GET_PROCESS_LINE

Script Function: Retrieves the current line content of a data sequence.

Syntax

GET_PROCESS_LINE (Data sequence reference [, [Column] [, [STR_SUBSTITUTE_VAR] [, Row ] ] ])

Syntax

Description/Format

Data sequence reference

The reference to a data sequence that should be processed.
Format: script variable

Column

Access to a column of the data sequence's line.

  • The data sequence in which the lines are divided in columns.
    Format: A number without quotations, script literal or script variable
    Allowed values: "1" to "22" or column name
  • The data sequence of a VARA object
    For more information, see PREP_PROCESS_VAR and PREP_PROCESS_VAR_XML.
    Format: A number without quotations or script variable
    Allowed values: "1", "2" to n
    "1" = Key or result column. Value column of FILELIST VARA objects.
    "2" - "6" = Value columns of static VARA objects.
    "2" to n = Number of the value columns of VARA objects.
  • Note: Dynamic VARA objects (SQL, SQLI and Multi) can include any number of columns which depends on the relevant data source.

    Note: Static VARA objects only include 6 value columns ("1" to "6"). "1" returns the value of the key, "2" through "6" return the 5 value columns. So "6" returns value of column 5.

    Note: FILELIST VARA objects generally have only one column that can be addressed using "1".

  • The data sequence of a comment
    For more information, see PREP_PROCESS_COMMENTS.
    Format: Number without quotations or script variable
    Allowed values: "1", "2" and "3"
    "1" = Timestamp
    "2" = User name
    "3" = Comment text
  • The data sequence of a PromptSet object
    For more information, see PREP_PROCESS_PROMPTSET.
    Format: A number without quotations, AE name, script literal or script variable
    Note: If you do not specify a particular column, GET_PROCESS_LINE returns all information about an element, separated by the characters §§§.
    Allowed values:
    "1" or "VARIABLE_NAME" = The name of the PromptSet variable of the PromptSet element (without a leading &).
    "2" or "CUSTOM_FIELD" = The content of a user-defined field.
    "3" or "DEFAULT" = The default value of the PromptSet element.
    "4" or "TYPE" = The type of the PromptSet element (such as "text" or "integer")
    "5" or "DATA_REFERENCE" = The name of the reference object (a variable or a calendar)
    "6" or "DATA_REFERENCE_KEY" = The keyword of the reference Calendar object (if available).

STR_SUBSTITUTE_VAR
STR_SUB_VAR

The lines of the data sequence are also searched for script variables that should be replaced with their values.

Note: Note that you must set a comma if you use this parameter is used but do not specify a Column.

Example

:SET &VALUE# = GET_PROCESS_LINE(&HND#, ,STR_SUB_VAR)

Line Line of the data sequence that should be accessed.
Format: A number without quotations, script literal or script variable

The script function GET_PROCESS_LINE reads a line or columns of a data sequence. For an overview of script elements for creating and working with data sequences, see Script Elements for Data Sequences.

Use the GET_PROCESS_LINE script function within a process loop. For more information on loops for line-by-line processing of a data sequence, see :PROCESS... :TERM_PROCESS... :ENDPROCESS.

Warning! GET_PROCESS_LINE has to be in a PROCESS loop formed by script statements.

The individual lines of a data sequence can also be subdivided in columns. You can specify this setting by using the parameters COL=LENGTH or COL=DELIMITER when you generate the data sequence. Particular columns can be accessed with their numbers (1 - first column) or with the column name if it has been specified.

The whole line is returned if the column is not specified or if you use "0". The line is truncated after 255 characters.

If the values of a VARA object are retrieved, the current line includes the Key (static VARA object) or the result column (dynamic VARA object) plus the corresponding values. The value "1" for Column reads the Key/Result, the values "2" to "6" (static VARA object) reads the relevant value column. The result column corresponds to the first value column if no Result format is defined in the VARA object (SQL, SQLI, MULTI).
The number of value columns that is used in dynamic VARA objects (SQL, SQLI or MULTI) is not limited and depends on the settings that have been made in the VARA objects and the data type.The comment columns can also be read individually.

Note: If the column number is not specified when a VARA object is accessed, the system returns the value of all columns (Key / Result included) separated by "§§§" characters.

SAP monitors can specifically be accessed. The SAP Agent separates the individual lines that are supplied by SAP monitor in fixed columns. It saves column names and column sizes in the first line of the file that should be processed by the Automation Engine. The following columns can be accessed by using GET_PROCESS_LINE:

You can also use the parameter STR_SUBSTITUTE_VAR or its short form STR_SUB_VAR. Script variables are then searched within the line and replaced with their values. This function is very useful in combination with PREP_PROCESS_FILE. For example, you can prepare a text file that contains script variables in alterable positions in order to facilitate processing. No matter from where the data sequence is retrieved (file, report, VARA object), the values can be set by using script (see example 5 below).

Furthermore access to a specific line of the data sequence is possible. Enter the number of the line at the corresponding script function parameter. The first line is number 1. You can retrieve line numbers from data sequences with the GET_PROCESS_INFO script function. For more information, see GET_PROCESS_INFO.

Note: By default, GET_PROCESS_LINE truncates blanks that are used at the end of the line that should be read. This behavior can be deactivated with the GET_PROCESS_LINE_RTRIM setting in UC_SYSTEM_SETTINGS. For more information, see GET_PROCESS_LINE_RTRIM.

Examples

Example 1 retrieves the directories of a drive and writes them to the activation report within the loop using :PRINT.

:SET &HND# = PREP_PROCESS("PC01","WINCMD","*DIR*","CMD=DIR C:")
:
PROCESS &HND#
:   
SET &LINE# = GET_PROCESS_LINE(&HND#)
:  
 PRINT &LINE#
:
ENDPROCESS

Example 2 retrieves the values of a VARA object and writes them to the activation report within the process loop using :PRINT.

:SET &HND#=PREP_PROCESS_VAR(UC_CLIENT_SETTINGS)
:
PROCESS &HND#
:   
SET &RET1# = GET_PROCESS_LINE(&HND#,1)
:   
SET &RET2# = GET_PROCESS_LINE(&HND#,2)
:   
PRINT "&RET1# &RET2#"
:
ENDPROCESS

Example 3 reads all the Automic Web Interface's log file lines which provide information about the database. Column size and column names are specified and the relevant information is output in the activation report. Spaces (column 2 and 4) are ignored.

:SET &HND# = PREP_PROCESS_FILE(WIN21, "F:\AUTOMIC\DIALOG\TEMP\UCDJ_LOGG_01.TXT","*DB-INFO*","COL=LENGTH","LENGTH_TAB='8=DATUM,1,6=ZEIT,7,200=TEXT'")
:
PROCESS &HND#
:   
SET &COL1# = GET_PROCESS_LINE(&HND#,1)
:   
SET &COL2# = GET_PROCESS_LINE(&HND#,3)
:   
SET &COL3# = GET_PROCESS_LINE(&HND#,"TEXT")
:  
 PRINT "&COL1# &COL2# &COL3#"
:
ENDPROCESS

Example 4 reads the SAP monitor "MON1" from the monitor set "AE". The individual columns of the monitor data should be accessed. The lines of the data sequence are output in the activation report.

:SET &HND# = PREP_PROCESS("T01","R3MONITOR","*","MONSET=AE","MONNAM=MON1","COL=FILE","UC_USER_ID=AE","UC_SAPCLIENT=001")
:
PROCESS &HND#
:   
SET &PATH# = GET_PROCESS_LINE(&HND#,"PATH")
:   
SET &NAME# = GET_PROCESS_LINE(&HND#,"NAME"")
:   
SET &VALUE# = GET_PROCESS_LINE(&HND#,"VALUE"")
:   
SET &STATUS# = GET_PROCESS_LINE(&HND#,"STATUS")
:   
SET &DATE# = GET_PROCESS_LINE(&HND#,"DATE")
:   
SET &TIME# = GET_PROCESS_LINE(&HND#,"TIME")
:   
PRINT "&PATH# &NAME# &VALUE# &STATUS# &DATE# &TIME#"
:
ENDPROCESS

Definition of the column sizes and names in the file (first line) that is provided by the SAP Agent.

COL=LENGTH,LENGTH_TAB='74=PATH,25=NAME,5=VALUE,2=STATUS,9=DATE,7=TIME'

Example 5 reads the lines of a text file and replaces the included script variables with their values. The modified lines are then written to the activation report.

:SET &NAME# = SYS_ACT_ME_NAME()
:
SET &DATE# = SYS_DATE_PHYSICAL("MM/DD/YYYY")
:
SET &TIME# = SYS_TIME_PHYSICAL("HH:MM")
:
SET &JPNAME# = SYS_ACT_PARENT_NAME()

:
SET &HND# = PREP_PROCESS_FILE ("WIN01","C:\AUTOMIC\REPORT.TXT")
:
PROCESS &HND#
:  
SET &RET# = GET_PROCESS_LINE (&HND#,,STR_SUB_VAR)
:  
PRINT &RET#
:
ENDPROCESS

Abstract of the ready-made text file REPORT.TXT:

&date#/&time#

Report for &NAME#:

Activated by workflow: &JPNAME#

See also:

seealso

Script Elements for Data Sequences