PREP_PROCESS_FILENAME

Use the PREP_PROCESS_FILENAME script function to retrieve a list of files that are available in a specific directory. The script lets you filter for particular file names, and specify whether to include subdirectories and folders. On the host, the Agent retrieves the files. The script function returns a reference to a data sequence that you can use for further processing by assigning the return code to the :PROCESS script statement. Use the GET_PROCESS_LINE script function to access each line in the data sequence.

Important! Agents for applications (Oracle applications, PeopleSoft, and SAP) do not support PREP_PROCESS_FILENAME.

Notes:

Syntax

PREP_PROCESS_FILENAME (Host, File name, [Wildcards], [Subfolder], [Filter] [,"COL=Definition1[, Definition2]"] [,"UC_LOGIN=Login object"])

Parameters

Note: Include commas between the parameters even if you omit parameters. Do not place a comma after the last parameter that you specify.


Defining Columns

To split the data sequence lines into columns, specify the Column separation parameter as follows:

COL=Definition1[, Definition2]

Where

Return Codes

The script function retrieves a reference to a data sequence that contains a list of retrieved file names. The following return codes indicate errors:

Examples

The following example lists all HTML documents contained in the Web Help of the Automation Engine documentation. The use of wildcards is explicitly specified. The resulting list of files is printed in the activation report.

:SET &HND# = PREP_PROCESS_FILENAME("WIN01","c:\AUTOMIC\documentation\webhelp\german\uc*.htm","Y",,,,"UC_LOGIN=WIN_LOGIN")
:
PROCESS &HND#
:   
SET &LINE# = GET_PROCESS_LINE(&HND#)
:  
PRINT &LINE#
:
ENDPROCESS

The following example creates a list of all stylesheets that are supplied with the Automation Engine documentation. All subfolders of the documentation directory are included in the search. The result contains no drive specification, and is written to the activation report.

:SET &HND# = PREP_PROCESS_FILENAME("WIN01", "\AUTOMIC\documentation\uc*.css","Y","Y",)
:
PROCESS &HND#
:   
SET &LINE# = GET_PROCESS_LINE(&HND#)
:  
PRINT &LINE#
:
ENDPROCESS

The following example creates a list of all AE programs. The individual lines are split in columns, with the columns separated by backslashes. The script retrieves the fifth column in the data sequence, which contains the file name of the program, and writes the results in the activation report.

:SET &HND# = PREP_PROCESS_FILENAME("WIN01","c:\AUTOMIC\server\bin\*.exe",,,,"COL=DELIMITER,DELIMITER=*\*")
:
PROCESS &HND
:
SET &LINE# = GET_PROCESS_LINE(&HND#,5)
:
PRINT &LINE#
:
ENDPROCESS

The following example retrieves the same files, but this time, a filter excludes all files except those that contain the string "server" in the file name.

:SET &HND# = PREP_PROCESS_FILENAME("WIN01","c:\AUTOMIC\server\bin\*.exe",,,"*server*","COL=DELIMITER,DELIMITER=*\*")
:
PROCESS &HND#
:
SET &LINE# = GET_PROCESS_LINE(&HND#,5)
:
PRINT &LINE#
:
ENDPROCESS

See also:

seealso

Script Elements for Data Sequences