Example 1: Describing a PROCESS command syntax
This example expands upon Example 1: Describing a PROCESS command syntax. This example shows how the parse macro instructions could be used within a command processor to describe the syntax of a PROCESS command to the parse service routine. A sample command processor that includes the parse macros used in this example is shown in z/OS TSO/E Programming Guide.
The sample PROCESS command we are describing to the parse service routine has the following format:
PROCESS dsname [ ACTION ]
[ NOACTION ]
Figure 1 shows the sequence of parse macro instructions that describe the syntax of this PROCESS 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 PROCESS 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 PRDSECT.
PCLDEFS IKJPARM DSECT=PRDSECT
DSNPCE IKJPOSIT DSNAME, X
PROMPT='THE NAME OF THE DATA SET YOU WANT TO PROCESS. X
ENTER ''?'' FOR HELP', X
HELP=('A DATA SET NAME WHICH HAS A FIRST-LEVEL QUALIFIER X
OTHER THAN ''SYS1''.'), X
VALIDCK=POSITCHK
ACTPCE IKJKEYWD DEFAULT='NOACTION'
IKJNAME 'ACTION'
IKJNAME 'NOACTION'
IKJENDP
Figure 2 shows the IKJPARMD DSECT created by the expansion of the parse macro instructions.
PRDSECT DSECT
DS 2A
DSNPCE DS 6A
ACTPCE DS H
process myid.data noation
the parse service routine would
prompt the terminal user with: INVALID KEYWORD, NOATION
REENTER THIS OPERAND -
NOACTION
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 PRDSECT DSECT.
Figure 3 shows the PDL returned by the parse service routine. The symbolic addresses within the PRDSECT 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.
