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


Example 2: Describing an EDIT command syntax

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

This example expands upon Example 2: Describing an EDIT command syntax. This example shows how the parse macro instructions could be used within a Command Processor to describe the syntax of an EDIT command to the Parse Service Routine.

The sample EDIT command we are describing to the parse service routine has the following format:

  EDIT       dsname
             [ PLI [([number  [number]]   [CHAR60 )]]]
             [     [ [  2     [  72  ]]   [CHAR48  ]]]
             [ FORT                                  ]
             [ ASM                                   ]
             [ TEXT                                  ]
             [ DATA                                  ]

             [ SCAN  ]
             [ NOSCAN]

             [ NUM  ]
             [ NONUM]

             [ BLOCK(number)  ]
             [ BLKSIZE(number)]

              LINE(number)

Figure 1 shows the sequence of parse macro instructions that describe the syntax of this EDIT 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 EDIT 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 defaults to IKJPARMD.

Note: Only the macros IKJIDENT, IKJKEYWD, and IKJPOSIT return a label in the DSECT.
Figure 1. Example 2 - using parse macros to describe command operand syntax
PARMTAB  IKJPARM
DSNAME   IKJPOSIT   DSNAME,PROMPT='DATA SET NAME'
TYPE     IKJKEYWD
         IKJNAME    'PL1',SUBFLD=PL1FLD
         IKJNAME    'FORT'
         IKJNAME    'ASM'
         IKJNAME    'TEXT'
         IKJNAME    'DATA'
SCAN     IKJKEYWD   DEFAULT='NOSCAN'
         IKJNAME    'SCAN'
         IKJNAME    'NOSCAN'
NUM      IKJKEYWD   DEFAULT='NUM'
         IKJNAME    'NUM'
         IKJNAME    'NONUM'
BLOCK    IKJKEYWD
         IKJNAME    'BLOCK',SUBFLD=BLOCKSUB,ALIAS='BLKSIZE'
LINE     IKJKEYWD
         IKJNAME    'LINE',SUBFLD=LINESIZE
PL1FLD   IKJSUBF
PL1COL1  IKJIDENT   'NUMBER',FIRST=NUMERIC,OTHER=NUMERIC,DEFAULT='2'
PL1COL2  IKJIDENT   'NUMBER',FIRST=NUMERIC,OTHER=NUMERIC,DEFAULT='72'
PL1TYPE  IKJKEYWD   DEFAULT='CHAR60'
         IKJNAME    'CHAR60'
         IKJNAME    'CHAR48'
BLOCKSUB IKJSUBF
BLKNUM   IKJIDENT   'NUMBER',FIRST=NUMERIC,OTHER=NUMERIC,              X
               PROMPT='BLOCKSIZE',MAXLNTH=8
LINESIZE IKJSUBF
LINNUM   IKJIDENT   'NUMBER',FIRST=NUMERIC,OTHER=NUMERIC,              X
               PROMPT='LINESIZE'
         IKJENDP

Figure 2 shows the IKJPARMD 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 2 - The IKJPARMD DSECT created by parse
IKJPARMD DSECT
         DS    2A
DSNAME   DS    6A
TYPE     DS    H
SCAN     DS    H
NUM      DS    H
BLOCK    DS    H
BLKSIZE  DS    0H
LINE     DS    H
PL1COL1  DS    2A
PL1COL2  DS    2A
PL1TYPE  DS    H
BLKNUM   DS    2A
LINNUM   DS    2A
If a terminal user entered the EDIT command described in this example in the form:
edit sysfile/x pl1(3) nonum block
the Parse Service Routine would prompt for the blocksize as follows:
ENTER BLOCKSIZE
The user at the terminal might respond with:
160

The Parse Service Routine would then complete the scan of the command parameters, build a parameter descriptor list (PDL), place the address of the PDL into the fullword pointed to by PPLANS, and return to the calling program.

The calling routine uses the address of the PDL as a base address for the IKJPARMD DSECT.

Figure 3 shows the PDL returned by the Parse Service Routine. The symbolic addresses within the IKJPARMD DSECT are shown to the left of the PDL at the points within the PDL to which they apply, and the meanings of the fields within the PDL are explained to the right of the PDL.

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

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014