Test mode can be activated/deactivated by specifying *TEST or *EXECUTE in the MODE operand of the MODIFY-SDF-OPTIONS command. When the test mode has been activated, the subsequent commands are subjected to a syntax check by SDF, but not executed. In addition you can define in the lower-ranking operand CHECK-PRIVILEGES whether the privileges of the task are to be taken into account when the syntax is checked. The only commands executed are MODIFY-SDF-OPTIONS and SHOW-SDF-OPTIONS, which are used to change the SDF settings during testing or to deactivate the test mode, and to obtain information on the current settings.
Note
The chargeable subsystem SDF-P offers debuggers suitable for S procedures (see the “SDF-P” manual [5]). The test mode described here is supported for S procedures subject to the following restrictions:
Inputs are always analyzed by SDF-P first. Statements cannot be tested. SDF-P control flow commands are executed. This may lead to errors since commands setting or declaring S variables, for instance, are not executed in test mode.
Job variables, S variables and procedure parameters are substituted prior to syntax analysis.
In procedure/batch mode, input lines without a leading “/” are regarded as data records and ignored. A data record or a sequence of data records is enclosed between messages CMD0091 and CMD0092, which are used to highlight input records that have not been analyzed.
Specification of a program name in the DEFAULT-PROGRAM-NAME operand of the MODIFY-SDF-OPTIONS command causes the syntax analysis to include statements to a program with an SDF interface. This works only in procedure/batch mode if test mode has been activated.
Input lines with leading “//” are then interpreted as program statements and likewise subjected to a syntax check. This syntax check is performed in accordance with the statements defined for the specified program name in the syntax file (not in accordance with the file name used in the START-PROGRAM command).
If statements of several programs are to be evaluated, the DEFAULT-PROGRAM-NAME setting has to be changed accordingly in front of each statement block.
DEFAULT-PROGRAM-NAME=*NONE can be used to restrict syntax analysis to commands again.
Procedure interruption with the
Upon termination of a procedure in test mode, message CMD0093 informs the user that test mode is still active.
Example:
Contents of procedure file “PROC.SELECT”:
/BEG-PROC LOG=*ALL - / ,PAR=*YES( - / PROC-PAR=(&MODE=*EXEC,/ &TESTPROGRAM=PERCON,/ &OUTFILE, &ELEM)/ ,ESC-CHAR=C'&' - / ) /ASS-SYSDTA TO=*SYSCMD /MOD-SDF-OPT MODE=&MODE - / ,DEFAULT-PROG-NAME=&TESTPROGRAM - / ,LOG=*INPUT-FORM /SHOW-SDF-OPT INF=*USER /SHOW-FILE-ATTR F-NAME=&(JV.INFILE) /START-PERCON //SHOW-SDF-OPT //ASS-INPUT-F FILE=*DISK-F(NAME=&(JV.INFILE)) //ASS-OUT-F FILE=*DISK-F(NAME=&OUTFILE) //SEL-INPUT-REC COND= ((20,4)=NUMERIC AND (25,5)=ALPHA) //START-CONV //END /SHOW-FILE-ATTR F-NAME=&OUTFILE /MOD-JOB-SW ON=(1) /START-PROG FROM-FILE=$LMS LIB FILE=USER.LIB,USAGE=BOTH TOCX * ADDX &OUTFILE>&ELEM END /SET-JOB-STEP /MOD-JOB-SW OFF=(1) /MODIFY-SDF-OPT MODE=*EXEC - / ,DEFAULT-PROG-NAME=*NONE /END-PROC
The procedure PROC.SELECT uses the PERCON utility routine to select data records which satisfy certain criteria (one field may only contain digits, another one must not contain any digits) from the file TEST (= value of the job variable JV.INFILE) and writes these records to a file whose name is specified via procedure parameter &OUTFILE. The result file is then incorporated in the USER.LIB library by means of the LMS utility routine. The name of the library member is queried via procedure parameter &ELEM (the members already existing are displayed beforehand).
Tracer listing:
|
(1) | The PROC.SELECT procedure is called with procedure parameter MODE=*TEST. |
(2) | System file SYSDTA is assigned system file SYSCMD as input source, i.e. data records are read from the procedure file, too. |
(3) | The SDF settings are changed: MODE=*TEST causes the test mode to be activated. Testing is to include statements with leading “//”. All input is logged as entered. |
(4) | SHOW-SDF-OPTIONS is executed, i.e. the current SDF settings are displayed. |
(5) | The value of job variable JV.INFILE (“TEST”) has been substituted for &(JV.INFILE). |
(6) | Statements with leading “//” are syntax-checked but not executed (note that SHOW-SDF-OPTIONS is a statement here). |
(7) | Job variable replacement has taken place (as for item 5). |
(8) | Procedure parameter OUTFILE was omitted when the procedure was called and is therefore requested via prompting. |
(9) | The value “TEST4” is set for &OUTFILE. |
(10) | The subsequent statements to the LMS routine are ignored because they are not preceded by “//”.In accordance with the declaration, statements with leading “//” are syntax-checked only on the basis of the statements defined for PERCON in the syntax file. If other programs with an SDF interface are used, the declaration must be altered beforehand. |
(11) | The last data record to be ignored is sensed. The next input line starts with “/” or “//”. |
(12) | MODIFY-SDF-OPTIONS is executed, which in this case means deactivation of test mode. |