z/OS TSO/E Programming Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 4: Describing a LIST command syntax

z/OS TSO/E Programming Services
SA32-0973-00

This example expands upon Example 4: Describing a LIST command syntax. This example shows how the parse macro instructions could be used to describe the syntax of a sample LIST command that has the following syntax:

LIST         symbol PRINT(symbol)

Figure 1 shows the sequence of parse macro instructions that describe this sample LIST command to the Parse Service Routine. The parse macro instructions used in this example build the parameter control list (PCL) describing the syntax of the LIST command operands. The macro instructions also create the DSECT that you use to map the parameter descriptor list returned by the parse service routine. In this example, the name of the DSECT is PARSELST.

Note: Only the macros IKJIDENT, IKJKEYWD, and IKJPOSIT return a label in the DSECT.
Figure 1. Example 4 - Using Parse Macros to Describe Command Operand Syntax
EXAM3    IKJPARM    DSECT=PARSELST
VARPCE   IKJTERM    'SYMBOL',UPPERCASE,PROMPT='SYMBOL',TYPE=VAR,       X
               VALIDCK=CHECK,SBSCRPT=SUBPCE
SUBPCE   IKJTERM    'SUBSCRIPT',SBSCRPT,TYPE=CNST,PROMPT='SUBSCRIPT'
KEYPCE   IKJKEYWD
NAMEPCE  IKJNAME    'PRINT',SUBFLD=PRINTSUB
PRINTSUB IKJSUBF
         IKJTERM    'SYMBOL-2',UPPERCASE,PROMPT='SYMBOL-2',TYPE=VAR
IKJENDP

Figure 2 shows the PARSELST DSECT created by the expansion of the parse macro instructions.

Note: Only the macros IKJIDENT, IKJKEYWD, and IKJPOSIT return a label in the DSECT.
Figure 2. Example 4 - The PARSELST DSECT
PARSELST DSECT
         DS    2A
         DS    5A
         DS    15A
KEYPCE   DS    H
         DS    11A
In this example, if the terminal user entered the LIST command incorrectly as:
list a of 1 in 3(1) print(d)
the Parse Service Routine would prompt the terminal user with:
INVALID SYMBOL, a...1 in 3(1)
REENTER
The user might respond with:
a of b in 3(1)
The Parse Service Routine would then prompt with:
INVALID SYMBOL, a...3(1)
REENTER
The user might respond with:
a of b in c(1)
This sequence resulted in the syntactically correct command of:
list a of b in c(1) print(d)

The Parse Service Routine would then build a parameter descriptor list (PDL) and place the address of the PDL into the fullword pointed to by PPLANS.

The Parse Service Routine then returns to the caller and the caller uses the address of the PDL as a base address for the PARSELST DSECT.

Figure 3 shows the PDL returned by the Parse Service Routine. The symbolic addresses of the PARSELST DSECT are shown to the left of the PDL at the points within the PDL to which they apply. A description of the fields within the PDL is shown on the right.

Note: Only the macros IKJIDENT, IKJKEYWD, and IKJPOSIT return a label in the DSECT.
Figure 3. Example 4 - The PARSELST DSECT and the PDL

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014