Examples of DL/I call functions
The following examples show how to use the DL/I call functions.
Basic CHKP Call: Use a CALL FUNCTION statement to contain the CHKP function and a CALL DATA statement to contain the checkpoint ID.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L CHKP 10101400
L DATA TESTCKPT
Symbolic CHKP Call with Two Data Areas to Checkpoint: Use a CALL FUNCTION statement to contain the CHKP function, a CALL DATA statement to contain the checkpoint ID data, and two CALL DATA statements to contain the data that you want to checkpoint.
You also need to use an XRST call when you use the symbolic CHKP call. Prior usage of an XRST call is required when using the symbolic CHKP call, as the CHKP call keys on the XRST call for symbolic CHKP.
Recommendation: Issue an XRST call as the first call in the application program.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L XRST
L .
L .
L .
L CHKP
L DATA TSTCHKP2 X
L 8 DATA STRING2- X
L 16 DATA STRING2-STRING2-
U EIGHT BYTES OF DATA (STRING2-) IS CHECKPOINTED AND
U SIXTEEN BYTES OF DATA (STRING2-STRING2-) IS CHECKPOINTED ALSO
CHNG Call: Use a CALL FUNCTION statement to contain the CHNG function and a CALL DATA statement to contain the new logical terminal name.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L CHNG SET1
L OPT IAFP=A1M,PRTO=LLOPTION1,OPTION2,
L CONT OPTION4
L Z0023 DATA DESTNAME
LL is the hex value of the length of LLOPTION,.........OPTION4.
The following is an example of a CHNG statement using SETO ID SET2, OPTION statement, DATA statement with MODNAME, and FDBK statement.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L CHNG SET2
L OPT IAFP=A1M,TXTU=SET2
L Z0023 DATA DESTNAME
L Z0095 FDBK FEEDBACK AREA
CMD Call: Use a CALL FUNCTION statement to contain the CMD function and a CALL DATA statement to contain the Command data.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L CMD
L ZXXXX DATA COMMAND DATA
WHERE XXXX = THE LENGTH OF THE COMMAND DATA
DEQ Call: For full function, use a CALL FUNCTION statement to contain the DEQ function and a CALL DATA statement to contain the DEQ value (A,B,C,D,E,F,G,H,I or J).
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L DEQ
L DATA A
For Fast Path, use a CALL FUNCTION statement to contain the DEQ function.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L DEQ
DLET Call: Use a CALL FUNCTION statement to contain the DLET function. The data statement is optional. If there are intervening calls to other PCBs between the Get Hold call and the DLET call, you must use a data statement to refresh the I/O area with the segment to be deleted.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L DLET
FLD Call: Use a CALL FUNCTION statement to contain the FLD function and ROOTSSA, and a CALL DATA statement to contain the FSAs.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L FLD ROOTA (KEYA =ROOTA)
L DATA ??????? X
L DATA
GCMD Call: Use a CALL FUNCTION statement to contain the GCMD function; no CALL DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GCMD
GHN Call: Use a CALL FUNCTION statement to contain the GHN function; no CALL DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GHN 10103210
GHNP Call: Use a CALL FUNCTION statement to contain the GHNP function; no CALL DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GHNP 10103210
GHU Call with a Continued SSA: Use two CALL FUNCTION statements to contain the single SSA.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GHU SEGG (FILLRG = G131G131G131G131G131G131G131G131G131G*
CONT 131G131G131G131G131G131G131 )
GMSG Call: Use a CALL FUNCTION statement to contain the GMSG function. Use a CALL DATA statement to retrieve messages from AO exit routine.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GMSG TOKEN111 WAITAOI
L Z0132 DATA
L GMSG
L Z0132 DATA
GN Call: Use a CALL FUNCTION statement to contain the GN function; no CALL DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GN 10103210
GNP Call: Use a CALL FUNCTION statement to contain the GNP function; no CALL DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GNP 10103210
GU Call with a Single SSA and a Relational Operator: Use a CALL FUNCTION statement to contain the GU function; no CALL DATA statement is required. The qualified SSA begins in column 24 and is contained in parentheses.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GU SEGF (KEYF > F131*KEYF < F400)
GU Call with a Single SSA and a Relational Operator Extended Across Multiple Inputs with Boolean Operators: Use a CALL FUNCTION statement to contain the GU function and three additional continuation of CALL FUNCTION input to continue with Boolean operators. No CALL DATA statement is required. The qualified SSA begins in column 24 and is contained in parentheses. This type of SSA can continue over several statements.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GU SEGG (FILLRG > G131G131G131G131G131G131G131G131G131G*
CONT 131G131G131G131G131G131G131 &FILLRG < G400G400G4*
CONT 00G400G400G400G400G400G400G400G400G400G400G400G400G400 *
CONT )
GU Path Call: Use a CALL FUNCTION statement to contain the GU function and three additional continuation of CALL function input to continue with two additional SSAs. No CALL DATA statement is required. The call uses command codes in columns 24 and 25 to construct the path call. This type of call cannot be made with the column-specific SSA format.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L GU SEGA *D(KEYA = A200) *
SEGF *D(KEYF = F250) *
SEGG *D(KEYG = G251)
GUR Call: Use a CALL FUNCTION statement to contain the GUR function and a DATA statement to specify the maximum size of the output area for the returned XML document.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
O LCASE=C
S1111 1 1 1 1DFSCAT00 AIB
L U0001 GUR HEADER (RHDRSEQ EQDBD DBOHIDK5)
L Z9999 DATA
The following table shows the key lines and elements in the example of the GUR call:
Line in the example | Explanation |
---|---|
O LCASE=C | Specifies that DFSDDLT0 uses character representation and not hexademcimal representation for the XML output. Without character representation, you cannot read the returned XML document. |
S1111 1 1 1 1DFSCAT00 AIB | Specifies that DFSDDLT0 uses the AIB interface and the DB PCB name is DFSCAT00, which is the system-defined catalog. |
L U0001 GUR HEADER | Specifies that IMS is to issue one GUR call. The SSA contains the key field RHDRSEQ, which is used to find a DBD that is named DBOHIDK5. |
L Z9999 DATA | Specifies that DFSDDLT0 is to use the maximum data output area, which is 9999 bytes. |
If the GUR call returns an XML document that is too large to fit into the output area that is specified by the DATA statement, you must modify the GUR call so that it is repeated. You can repeat the GUR call in one of two ways:
- Set the repeat count on the GUR call (columns 5-8) to the number of times to repeat the call,
which is the recommended way. In the following example, U0002 specifies that IMS is
to issue two GUR
calls:
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L U0002 GUR HEADER (RHDRSEQ ==PSB BMP255 ) L Z9999 DATA
- Use multiple GUR calls:
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L U0001 GUR HEADER (RHDRSEQ ==PSB BMP255 ) L Z9999 DATA L U0001 GUR HEADER (RHDRSEQ ==PSB BMP255 ) L Z9999 DATA
Either method produces the same results.
ICAL Call: Use a CALL FUNCTION statement to contain the ICAL function. Use a CALL DATA statement to contain the message to pass from the IMS™ application to the program that is specified in the IMS OTMA descriptor.
The following example demonstrates how to send a synchronous callout request message to a destination named DESCRPTR with 45 bytes of request data and expect 100 bytes of response data to be returned in a timeout value of 500 (or 5 seconds).
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ICAL SENDRECV DESCRPTR 000500 00045 00100
L DATA HELLO OUT THERE. THIS IS A MESSAGE FROM IMS.
ICMD Call: Use a CALL FUNCTION statement to contain the ICMD function. Use a CALL DATA statement to contain the command.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ICMD
L Z0132 DATA /DIS ACTIVE
INIT Call: Use a CALL FUNCTION statement to contain the INIT call and a CALL DATA statement to contain the INIT function DBQUERY, STATUS GROUPA, or STATUS GROUPB.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L INIT 10103210
L Z0011 DATA DBQUERY
INQY Call: Use a CALL FUNCTION statement to contain the INQY call and either the DBQUERY or ENVIRON subfunction. The subfunctions are in the call input rather than the data input as in the INIT call.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L INQY ENVIRON 10103210
L V0256 DATA 10103211
L 10103212
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L INQY DBQUERY 10103210
L V0088 DATA 10103211
L 10103212
ISRT Call: Use two CALL FUNCTION statements to contain the multiple SSAs and a CALL DATA statement to contain the segment data.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ISRT STOCKSEG(NUMFIELD =20011) X10103210
ITEMSSEG 10103211
L V0018 DATA 3002222222222222 10103212
ISRT Containing Only One Fixed-Length Segment: Use a CALL FUNCTION statement to contain the ISRT function and segment name, and two CALL DATA statements to contain the fixed-length segment. When inserting only one fixed-length segment, leave columns 4 through 8 blank and put data in columns 16 through 71. To continue data, put a nonblank character in column 72, and the continued data in columns 16 through 71 of the next statement.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ISRT JOKESSEG 10103210
L DATA THEQUICKBLACKDOGJUMPEDONTOTHECRAZYFOXOOPSTHEQUICKBROWNFO*10103211
XJUMPEDOVERTHELAZYDOGSIR 10103212
ISRT Containing Only One Variable-Length Segment: Use a CALL FUNCTION statement to contain the ISRT function and segment name, and two CALL DATA statements to contain the variable-length segment. When only one segment of variable-length is being processed, you must enter a V in column 4, and columns 5 through 8 must contain the length of the segment data. The length in columns 5 through 8 is converted to binary and becomes the first two bytes of the segment data. To continue data, put a nonblank character in column 72, and the continued data in columns 16 through 71 of the next statement.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ISRT JOKESSEG 10103210
L V0080 DATA THEQUICKBLACKDOGJUMPEDONTOTHECRAZYFOXOOPSTHEQUICKBROWNFO*10103211
XJUMPEDOVERTHELAZYDOGSIR 10103212
ISRT Containing Multiple Variable-Length Segments: Use a CALL FUNCTION statement to contain the ISRT function and segment name, and four CALL DATA statements to contain the variable-length segments. For the first segment, you must enter a V in column 4 and the length of the segment data in columns 5 through 8. If the segment is longer than 56 bytes, put a nonblank character in column 72, and continue data on the next statement. The last statement to contain data for this segment must have a nonblank character in column 72.
The next DATA statement applies to the next variable-length segment and it must contain an M in column 4, the length of the new segment in columns 5 through 8, and data starting in column 16. Any number of variable-length segments can be concatenated in this manner. If column 72 is blank, the next statement must have the following:
- An L in column 1
- An M in column 4
- The length of the new segment in columns 5 through 8
- The keyword DATA in columns 10 through 13
- Data starting in column 16
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ISRT AAAAASEG 10103210
L V0080 DATA THEQUICKBLACKDOGJUMPEDONTOTHECRAZYFOXOOPSTHEQUICKBROWNFO*10103211
XJUMPEDOVERTHELAZYDOGSIR *10103212
M0107 DATA NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRYNOW*10103213
ISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY 10103214
ISRT Containing Multiple Segments in a PATH CALL: Use a CALL FUNCTION statement to contain the ISRT function and segment name, and seven CALL DATA statements to contain the multiple segments in the PATH CALL.
When DFSDDLT0 is inserting or replacing segments through path calls, you can use V and P in successive statements. The same rules apply for coding multiple variable-length segments, but fixed-length segments must have a P in column 4 of the DATA statement. This causes the length field in columns 5 through 8 to be used as the length of the segment, and causes the data to be concatenated in the I/O area without including the LL field.
Rules for continuing data in the same segment or starting a new segment in the next statement are the same as those applied to the variable-length segment.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ISRT LEV01SEG*D *10103210
LEV02SEG *10103211
LEV03SEG *10103212
LEV04SEG 10103213
L V0080 DATA THEQUICKBLACKDOGJUMPEDONTOTHECRAZYFOXOOPSTHEQUICKBROWNFO*10103214
XJUMPEDOVERTHELAZYDOGSIR *10103215
M0107 DATA NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRYNOW*10103216
ISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY *10103217
L P0039 DATA THEQUICKBROWNFOXJUMPEDOVERTHELAZYDOGSIR *10103218
L M0107 DATA NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRYNOW*10103219
ISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY 10103220
LOG Call Using an LLZZ Format: Use a CALL FUNCTION statement to contain the LOG function and a CALL DATA statement to contain the LLZZ format of data to be logged.
When you put a Z in column 4, the first word of the record is not coded in the DATA statement. The length specified in columns 5 through 8 must include the 4 bytes for the LLZZ field that is not in the DATA statement.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L LOG 10103210
L Z0016 DATA ASEGMENT ONE 10103211
The A in column 16 becomes the log record ID.
POS Call: Use a CALL FUNCTION statement to contain the POS function and SSA; CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L POS SEGA (KEYA =A300)
PURG Call with MODNAME and Data: Use a CALL FUNCTION statement to contain the PURG function and MOD name. Use the CALL DATA statement to contain the message data. If MOD name is provided, a DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L PURG MODNAME1
L DATA FIRST SEGMENT OF NEW MESSAGE
PURG Call with Data and no MODNAME: Use a CALL FUNCTION statement to contain the PURG function; a DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L PURG
L DATA FIRST SEGMENT OF NEW MESSAGE
PURG Call without MODNAME or Data: Use a CALL FUNCTION statement to contain the PURG function; CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L PURG
RCMD Call: Use a CALL FUNCTION statement to contain the RCMD function. Use a CALL DATA statement to retrieve second and subsequent command response segments resulting from an ICMD call.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L RCMD
L Z0132 DATA
REPL Call: Use a CALL FUNCTION statement to contain the REPL function. Use a CALL DATA statement to contain the replacement data.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L REPL
L V0028 DATA THIS IS THE REPLACEMENT DATA
RLSE Call: Use a CALL FUNCTION statement to contain the RLSE function.
|----+---1----+----2----+----3----+----4----+----5
L RLSE
ROLB Call Requesting Return of First Segment of Current Message: Use a CALL FUNCTION statement to contain the ROLB function. Use the CALL DATA statement to request first segment of current message.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ROLB
L DATA THIS WILL BE OVERLAID WITH FIRST SEGMENT OF MESSAGE
ROLB Call Not Requesting Return of First Segment of Current Message: Use a CALL FUNCTION statement to contain the ROLB function. The CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ROLB
ROLL Call: Use a CALL FUNCTION statement to contain the ROLL function. The CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ROLL
ROLS Call with a Token: Use a CALL FUNCTION statement to contain the ROLS function and token, and the CALL DATA statement to provide the data area that will be overlaid by the data from the SETS call.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ROLS TOKEN1
L Z0046 DATA THIS WILL BE OVERLAID WITH DATA FROM SETS
ROLS Call without a Token: Use a CALL FUNCTION statement to contain the ROLS function. The CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ROLS
ROLX Call: Use a CALL FUNCTION statement to contain the ROLX function. The CALL DATA statement is optional. The ROLX function is treated as a ROLS call with no token.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L ROLX
SETO Call: Use a CALL FUNCTION statement to contain the SETO function. The DATA statement is optional; however, if an OPTION statement is passed on the call, the DATA statement is required. Also, if a FEEDBACK statement is passed on the call, then both the DATA and OPTION statements are required. The following is an example of a SETO statement using the OPTION statement and SETO token of SET1.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L SETO SET1 5000
L OPT PRTO=11OPTION1,OPTION2,
L CONT OPTION3,
L CONT OPTION4
11 is the hex value of the length of 11OPTION,.........OPTION4.
The following is an example of a SETO statement using the OPTION statement and SETO token of SET1.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L SETO SET1 7000
L OPT PRTO=11OPTION1,OPTION2,OPTION3,OPTION4
11 is the hex value of the length of 11OPTION,.........OPTION4.
The following is an example of a SETO statement using the OPTION statement and SETO token of SET2 and FDBK statement.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L SETO SET2 5500
L OPT PRTO=11OPTION1,OPTION2,OPTION3,OPTION4
L Z0099 FDBK OPTION ERROR FEEDBACK AREA
11 is the hex value of the length of 11OPTION,.........OPTION4.
SETS Call with a Token: Use a CALL FUNCTION statement to contain the SETS function and token; use the CALL DATA statement to provide the data that is to be returned to ROLS call.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L SETS TOKEN1
L Z0033 DATA RETURN THIS DATA ON THE ROLS CALL
SETS Call without a Token: Use a CALL FUNCTION statement to contain the SETS function; CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L SETS
This topic contains Product-sensitive Programming Interface information.
SNAP Call: Use a CALL FUNCTION statement to contain the SNAP function and a CALL DATA statement to contain the SNAP data.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L SNAP 10103210
L V0022 DATA PRINTDD 22222222 10103212
This topic contains Product-sensitive Programming Interface information.
STAT Call: OSAM statistics require only one STAT call. STAT calls for VSAM statistics retrieve only one subpool at a time, starting with the smallest. See IMS Version 13 Application Programming for further information about the statistics returned by STAT.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L STAT DBASF
L STAT VBASS
L STAT VBASS
L STAT VBASS
L STAT VBASS
SYNC Call: Use a CALL FUNCTION statement to contain the SYNC function. The CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L SYNC
Initial XRST Call: Use a CALL FUNCTION statement to contain the XRST FUNCTION and a CALL DATA statement that contains a checkpoint ID of blanks to indicate that you are normally starting a program that uses symbolic checkpoints.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L XRST 10101400
L DATA
L CKPT
L DATA YOURID01
Basic XRST Call: Use a CALL FUNCTION statement to contain the XRST function and a CALL DATA statement to contain the checkpoint ID.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L XRST 10101400
L DATA TESTCKPT
Symbolic XRST Call: Use a CALL FUNCTION statement to contain the XRST function, a CALL DATA statement to contain the checkpoint ID data, and one or more CALL DATA statements where the data is to be returned.
The XRST call is used with the symbolic CHKP call.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----<
L XRST
L DATA TSTCHKP2 X
L 8 DATA OVERLAY2 X
L 16 DATA OVERLAY2OVERLAY2
U EIGHT BYTES OF DATA (OVERLAY2) SHOULD BE OVERLAID WITH CHECKPOINTED DATA
U SIXTEEN BYTES OF DATA (OVERLAY2OVERLAY2) IS OVERLAID ALSO