Man Page Index
Halts execution of the program and returns control to the shell.
text is any text to be displayed on exit.
+ suppress a NEWLINE at exit or after text output.
The X command returns control directly to the shell.
F-OPEN 1 SALES
XCannot Open SALES file!
The X command stops execution of the program if the file SALES cannot be opened, and displays a suitable message.
The two shell commands associated with jCL which permit list handling are the PQ-SELECT and PQ-RESELECT commands. See the chapter on List Processing for more information on lists.
Executed from a jCL program, resets the pointer of a specified select register to the beginning of the list of record keys.
register-number is the number (1 TO 5) of the select register to be reset.
This command is executed from the primary output buffer to reset the pointer of a specified select register back to the beginning of the list.
Each time you use the "!" reference to retrieve a value from the list, the value is not destroyed. The pointer is simply advanced to the next parameter in the list. PQ-RESELECT resets the pointer back to the beginning of the list so that you can perform another pass.
You cannot execute PQ-RESELECT directly from the shell.
MV %1 !1
IF # %1 XNo records selected
10 MV %1 !1
IF # %1 XFinished
Executed from a jCL program, loads a list of keys into a select register.
register-number is the number of the select register (1 to 5) in which the keys are to be placed.
To use PQ-SELECT you must first construct a list by using one of the list processing commands such as SELECT, SSELECT, QSELECT, BSELECT, GET-LIST, FORM-LIST, SEARCH or ESEARCH. Put the PQ-SELECT command in the stack so that it will be processed as part of the external job stream when the required list is active.
Retrieve the list elements one at a time, using a "!n" direct or an indirect reference.
You cannot execute PQ-SELECT directly from the shell.
002 HSSELECT SALES
004 HPQ-SELECT 1
006 10 MV %1 !1
007 IF # %1 X Done
008 T %1
009 GO 10
This example selects all the records in the SALES file, loads the record-list into select register 1 and displays the keys one at a time.
The first line of a jCL program defines the program as one of two basic types, a PQ or a PQN style program.
Wherever possible, you should use the PQN style.
There are several differences between the two styles, as outlined in the following topics.
PQ-style programs usually use a blank as the delimiter between parameters in the buffers. PQN-style programs usually use a field mark.
PQN allows parameters to be null or contain blanks and more closely mirrors the native record structure.
PQ commands are still supported for compatibility but you should use the functionally superior PQN commands in new or revised jCL programs.
When pointers are moved, PQ commands will generally leave the pointer at the first character of a parameter. PQN commands will generally leave the pointer at a field mark.
Commands affected by this difference are A, B, BO, F, H, IH and IP.
Buffer referencing, file buffers and select registers are only available with PQN commands.
These commands are only used in PQN-style jCL programs:
F;, F-KLOSE, F-WRITE, L, MVD
F-CLEAR, F-OPEN, FB, MS,
F-DELETE, F-READ, IBH, MV,
F-FREE, F-UREAD, IBP, MVA,
These commands are functionally equivalent in both PQ and PQN-style programs:
( ), G, IF E, RSUB, U
, GO B, IFN, RTN, X
+, GO F, M, S,
-, GOSUB, P, STOFF,
C, IF, RI, STON,