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


Example 3: Describing an AT command syntax

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

This example shows how the parse macro instructions could be used to describe the syntax of a sample AT command that has the following syntax:

          [stmt               ]
 AT       [(stmt-1,stmt-2,...)] (cmd chain) COUNT(integer)
          [stmt-3:stmt-4      ]
Figure 1 shows the sequence of parse macro instructions that describe this sample AT command to the Parse Service Routine. The parse macro instructions used in this example perform the following functions:
  • The IKJPARM macro instruction indicates the beginning of the parameter control list and creates the PARSEAT DSECT that you use to map the parameter descriptor list returned by the Parse Service Routine.
  • The IKJTERM macro instruction indicates that the terminal user can enter the statement number as a single value or as a list or range of values.
  • The IKJPOSIT macro instruction indicates that the user must enter the subcommand-chain as a parenthesized string.
  • The IKJKEYWD and IKJNAME macro instructions indicate the name of the keyword operand COUNT.
  • The IKJSUBF macro instruction indicates the beginning of a subfield description for the keyword operand. Within this subfield, an IKJIDENT macro instruction describes the positional operand.
  • The IKJENDP macro instruction indicates the end of the parameter control list.
Figure 1. Example 3 - using parse macros to describe command operand syntax
EXAM2    IKJPARM    DSECT=PARSEAT
STMTPCE  IKJTERM    'STATEMENT NUMBER',UPPERCASE,LIST,RANGE,TYPE=STMT, X
               VALIDCK=CHKSTMT
POSITPCE IKJPOSIT   PSTRING,HELP='CHAIN OF COMMANDS',VALIDCK=CHKCMD
KEYPCE   IKJKEYWD
NAMEPCE  IKJNAME    'COUNT',SUBFLD=COUNTSUB
COUNTSUB IKJSUBF
IDENTPCE IKJIDENT   'COUNT',FIRST=NUMERIC,OTHER=NUMERIC,               X
               VALIDCK=CHKCOUNT
         IKJENDP

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014