PREP_PROCESS_VAR_XML

Script Function: Use selection criteria in order to retrieve a list of XML Variable object values and provide the result for further processing in the form of an internal list (data sequence).

Syntax

PREP_PROCESS_VAR_XML(Variable, Key, Value)

Syntax

Description/Format

Variable

The name of the Variable object that should be processed.
Format: AE name, script literal or script variable  

Key

The filter for the Key column.
Format: script literal or script variable

In dynamic variables, the Key column corresponds to the first basic column (value column). The result column is build only after retrieving the variable values.

Value

The filter for the value.
Format: script literal or script variable
Format for Variable object XML: XPath (format: string)
You can use a maximum of 64 characters.
Default value: "*"

The wildcard characters "*" and "?" can be used. "*" stands for any character, "?" for exactly one.

The format for the Variable object XML has to be the same for both script functions.


Return code

Reference to the data sequence of the Variable object.

Comments

This script function read the values of an XML Variable object. You limit the values that should be read by using the parameters Key and Value. The input is case sensitive.

Value refers to the content of a value column. Column determines the number of the particular value column that should be searched. The first value column is automatically used if you do not define a column. Static variables include 5 value columns. The column number of dynamic variables is not limited and depends on the data source and the settings that are defined in the Variable object.

The script function PREP_PROCESS_VAR_XML may only be used with the Variable object XML, which provides only one value column.

The return code of this script function is a data sequence reference. It is passed on to the script statements :PROCESS and :ENDPROCESS as a start parameter. If you use it in combination with the script function GET_PROCESS_LINE, you can now access each of the Variable object's individual lines.

No error message is output if the Variable object does not include the searched values. The data sequence that is defined between :PROCESS and :ENDPROCESS is not processed in this case.

Names of VARA objects that include a variable must be specified in quotation marks. Otherwise, an error message is displayed.

No new value can be assigned to the script variable that includes the data sequence reference. The data sequence must be discarded by using the script statement CLOSE_PROCESS, and then the variable can be re-used.

Example

In this example, the value of the data sequence lines represented by the script variables &VALUE# and &GB# are read, which in turn read out the values "A/B" of the key called "KEY01" of the Variable object XML, called "VARA.XML":

:SET &HND# = PREP_PROCESS_VAR_XML(VARA.XML, "KEY01", "A/B")
:PROCESS &HND#
: SET &GB# = GET_PROCESS_LINE(&HND#,1)
: SET &VALUE# = GET_PROCESS_LINE(&HND#,2)
: PRINT "&GB# &VALUE#"
:ENDPROCESS

 

See also:

Script element Description

:CLOSE_PROCESS

Discards an unnecessary data sequence.

:PROCESS... :TERM_PROCESS... :ENDPROCESS

Loop for the line-by-line processing of a data sequence such as a sequential file or a command result.

GET_PROCESS_LINE

This is used to retrieve content from the current line of a data sequence.

PREP_PROCESS_VAR Use selection criteria in order to retrieve a list of Variable object values and provide the result for further processing in the form of an internal list (data sequence). 

Script Elements - Data Sequences

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function