PREP_PROCESS_REPORT
Script Function: It uses filter criteria in order to retrieve the report lines of executable objects and provides the result for further processing in the form of an internal list (data sequence).
Syntax
PREP_PROCESS_REPORT ([Object type] ,[RUNID] ,[Report type] [,Filter] [,"COL=Definition1] [,Definition2]")
Syntax |
Description/Format |
---|---|
Object type |
The short form of the object type that belongs to the executable objects. You can also edit the client in which this script function is used. The short form is CLT in this case. Format: AE name, script literal or script variable This is an optional parameter because the object type can be clearly assigned through its RunID (compatible to version 2.6xx). |
RunID |
The RunID of the task whose report should be processed. You can activate the Generate at runtime option in the Attributes tab if you want to analyze the report of a different task. Client reports do not require a RunID in order to be specified. |
Report type |
The abbreviation for the report type. |
Filter |
The definition of a filter condition for the content of a line (case-insensitive). For the filter definition, you can use the wildcard characters "*" and "?". "*" serves as a placeholder for any number of characters (even none) and "?" represents exactly one character. You can also use these wildcard characters repeatedly. Format: script literal or script variable |
Definition1 |
This parameter determines whether the lines of the data sequence will be subdivided into columns. Allowed values: NONE(default value), LENGTH, DELIMITER NONE = No subdivision |
Definition2 |
This parameter determines the column sizes and names (optional), or the delimiter. Allowed values: LENGTH_TAB and DELIMITER
|
Return Code |
---|
Reference to the data sequence of the report |
Comments
This script function provides the report contents of executable objects for further processing with AE Script. The report is read from the AE database and prepared as data sequence.
If you access a task's report by using this script function, the parameters RunID and Repor Type can be omitted because the script function itself retrieves the RunID. Note that you must set the comma that belongs to the parameter. By default, the job report (REP) is used for jobs and the activation report (ACT) for other tasks.
The job report of the task itself can be analyzed in the Post Process tab. Depending on the result, the definitive end of the job can be specified using the script statement :MODIFY_STATE.
The script function waits if a task is accessed that has already ended but whose report is still incomplete.
By default, this script function reads the entire line of the report. Structured access is also possible provided that the line is subdivided into columns. The following rules apply:
- maximal 22 columns with a total size of 2048 bytes
- column size maximal 255 characters and
- column name maximal 32 characters
GET_PROCESS_LINE can be used to access particular columns.
The report is saved in the same language in which the Automation Engine logging is made.
The return code of this script function is a data sequence reference. It is given to the script statements :PROCESS and :ENDPROCESS as start parameters. In combination with the script function GET_PROCESS_LINE, each individual line of the data sequence and its columns can now be processed.
No error occurs if the data sequence does not contain the required content. The processing of the data sequence that is defined between :PROCESS and :ENDPROCESS does just not take place.
No new value can be assigned to the script variable containing the data sequence reference. The data sequence must be discarded with the script statement CLOSE_PROCESS first and then the variable can be re-used.
The script statement causes all the script's open transactions to be written to the AE database.
Examples
The first example searches for all lines of a job report in which the drive C: appears. All lines are output in the activation protocol.
:SET &HND# = PREP_PROCESS_REPORT("JOBS",, "REP", "*C:\*")
:PROCESS &HND#
: SET &RET# = GET_PROCESS_LINE(&HND#)
: PRINT &RET#
:ENDPROCESS
The second example is based on a job which requested file names for processing from the user. The file names are stored in the activation report. The file names can be read if a quotation is used as a delimiter. They are output in the activation protocol.
:SET &RUNNR# = GET_UC_OBJECT_NR("MM.DAY")
:SET &HND# = PREP_PROCESS_REPORT(, &RUNNR#,
"ACT",,"COL=DELIMITER",
"DELIMITER=*'*")
:PROCESS &HND#
: SET &RET# = GET_PROCESS_LINE(&HND#,1)
: PRINT &RET#
:ENDPROCESS
In the third example, a job's report is analyzed in its Post Process tab. This allows you to find out whether an error occurred while a file was copied under Windows. You can easily call the script function by using the Filter parameter. The preceding commas stand for the object type, the RunID and the report type JJR1 of the task itself.
:SET &HND# = PREP_PROCESS_REPORT(,,,"*file not found*")
:PROCESS &HND#
: SEND_MSG BU,BU,"Error occurred
while copying."
: MODIFY_STATE RETCODE=50
:ENDPROCESS
See also:
Script Element | Description |
---|---|
Discards an unnecessary data sequence. |
|
Loop for line by line processing of a data sequence - a sequential file or a command result, for example |
|
This is used to retrieve content from the current line of a data sequence. |
Script Elements - Data Sequences
Sample Collection
Setting End Status depending on Report Content
Calling an MBean
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function