GET_PROCESS_LINE

Use the GET_PROCESS_LINE script function to read a line or columns of a data sequence. You must use this script function in a process loop.

Notes

Syntax

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

Parameters

  • GET_PROCESS_LINE
    Retrieves the current line content of a data sequence

  • Data sequence reference
    Defines the data sequence that should be processed
    Format: script variable

  • Column
    (Optional) Accesses a column of the data sequence line, either

    • a data sequence whose lines are subdivided into columns. You access particular columns with their numbers.
      Format: Number without quotations, script literal, or script variable
      Allowed values: 1-22 where 1 is the first column, or if defined, the column name.
      Note: To subdivide the individual lines of a data sequence, you use the parameters COL=LENGTH or COL=DELIMITER when you generate the data sequence.

    • the data sequence of a VARA object. For details, see PREP_PROCESS_VAR and PREP_PROCESS_VAR_XML
      Format: Number without quotations, or script variable
      Allowed values:

      • 1
        Retrieves the key or result column; value column of FILELIST VARA objects
        The current line includes the key of static VARA objects, or the result column of dynamic VARA objects and the corresponding values. The result column corresponds to the first value column if no result format is defined in the VARA object (SQL, SQLI, MULTI).
      • 2-6
        Retrieves the relevant value columns of static VARA objects
      • 2-n
        Number of the value columns of VARA objects

      Retrieving the values of VARA objects:

      • Dynamic VARA objects (SQL, SQLI, and Multi)
        They can include any number of columns depending on the relevant data source, such as the settings of the VARA object and the data type.
      • Static VARA objects only include six value columns:
        • 1
          Returns the value of the key
        • 2 -6
          Returns the five value columns
        • 6
          Returns the value of column number five.
      • FILELIST VARA objects generally have only one column that you can address by using 1.
    • Note: If the column number is not defined when a VARA object is accessed, the system returns the value of all columns (Key / Result included) separated by "ยงยงยง" characters.

    • the data sequence of a comment. For details, see PREP_PROCESS_COMMENTS
      Format: Number without quotations, or script variable
      Allowed values:

      • 1
        Timestamp
      • 2
        User name
      • 3
        Comment text
    • the data sequence of a PromptSet object. For details, see PREP_PROCESS_PROMPTSET
      Format: Number without quotations, AE name, script literal or script variable
      Allowed values:

      • 1 or VARIABLE_NAME
        Name of the PromptSet variable of the PromptSet element without a leading ampersand (&) character
      • 2 or CUSTOM_FIELD
        Content of a user-defined field
      • 3 or DEFAULT
        Default value of the PromptSet element
      • 4 or TYPE
        Type of the PromptSet element such as "text" or "integer".
      • 5 or DATA_REFERENCE
        Name of the reference object, such as a variable or a calendar
      • 6 or DATA_REFERENCE_KEY
        Keyword of the reference Calendar object if available

  • STR_SUBSTITUTE_VAR or STR_SUB_VAR
    (Optional) Within the line content of the data sequence, you can search for script variables that should be replaced with their values.
    Note:
    You must set a comma if you use this parameter, but do not specify the Column parameter. For example:

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

  • Line
    (Optional) Defines the line of the data sequence that you want to access. The first line is number 1. You can retrieve line numbers of data sequences with the GET_PROCESS_INFO script function. For details, see GET_PROCESS_INFO.
    Format: A number without quotations, script literal or script variable
    Notes
    • By default, GET_PROCESS_LINE truncates blanks used at the end of the line to be read. You can deactivate this behavior with the GET_PROCESS_LINE_RTRIM setting in the UC_SYSTEM_SETTINGS variable. For more information, see GET_PROCESS_LINE_RTRIM.
    • The whole line is returned if you do not define the Column parameter or if you use "0". The line is truncated after 255 characters.

SAP Monitors

SAP monitors can specifically be accessed. The SAP Agent separates the individual lines supplied by the 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:

  • CONTEXT - Name of the monitored context
  • PATH - Path specification of a value
  • NAME - Name of the value
  • VALUE - Current value
  • STATUS - Status: 1 = green, 2 = yellow, 3 = red
  • DATE - Date of the verification
  • TIME - Time of the verification

Examples

The following example retrieves the directories of a drive and writes them to the activation report within the loop by using :PRINT:

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

This example retrieves the values of a VARA object and writes them to the activation report within the process loop by 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

This example reads all the log file lines of the Automic Web Interface that provide information about the database. Column size and column names are specified, and the relevant information is output in the activation report. Spaces in columns 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=DATE,1,6=TIME,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

This example 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'

This example 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 prepared REPORT.TXT text file:

&date#/&time#

Report for &NAME#:

Activated by workflow: &JPNAME#

Depending on your settings, the report file may look similar to the following example:

2022-11-23 15:59:56 - U00020408 "11/23/2022/15:59"

2022-11-23 15:59:56 - U00020408 ""

2022-11-23 15:59:56 - U00020408 "Report for JOBS.CREATE_TEST_FILE:"

2022-11-23 15:59:56 - U00020408 ""

2022-11-23 15:59:56 - U00020408 "Activated by workflow: "

See also: