Script Statements: They are used to define a loop for the line by line processing of a data sequenceAn internal listing of Console outputs or lines of Variable objects, etc. The lines of a data sequence can be accessed by using a PROCESS loop or the script element GET_PROCESS_LINE. The script elements PREP_PROCESS* generate data sequences. such as the content of a sequential file or the text result of a command.
:PROCESS Data sequence reference
[Statement]
:TERM_PROCESS
:ENDPROCESS
Syntax |
Description/Format |
---|---|
:PROCESS |
The beginning of the loop. |
Data sequence reference |
The reference to a data sequence that should be processed. |
Statements |
One or more statements that will be processed during every processing cycle: script statement |
:TERM_PROCESS |
A statement to exit the loop. |
:ENDPROCESS |
The end of the loop. |
:CLOSE_PROCESS |
Frees the handle after each :PROCESS - :ENDPROCESS loop. |
The scriptA particular Automation Engine object type. statements :PROCESS and :ENDPROCESS facilitate the line-by-line processing of data sequences. They are provided by the following script elements:
A new line is read in every cycle. This is repeated until the loop is either finished or explicitly terminated using the script statement :TERM_PROCESS.
You can use the script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… GET_PROCESS_LINE in order to retrieve the contents of a line.
An empty data sequence does not cause an error message. In this case, the processing of the data sequence that is defined between :PROCESS and :ENDPROCESS does not take place.
The following example retrieves the directories of a disk drive and writes the results to the activation reportA report provides more detailed information about a task's execution or a component. using the :PRINT statement. It includes a :TERM_PROCESS statement to exit the loop if the value of the USER variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. is TSOS.
:SET &HND# = PREP_PROCESS("PC01","WINCMD","*DIR*","CMD=DIR C:")
:PROCESS &HND#
: IF&USER# = "TSOS"
: TERM_PROCESS
: ENDIF
: PRINT &LINE#
:ENDPROCESS
:CLOSE_PROCESS &HND#
See also:
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
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |