![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS/ACCESS Interface to IMS-DL/I: Reference |
| Basic CHKP Call |
The basic CHKP call can be issued in batch DL/I regions as well as in online DL/I regions. This call establishes a program synchronization point.(footnote 1) (Synchronization points are described in General Considerations for Sharing Resources.)
data _null_;
retain chkpnum 0;
infile acctsam dli call=func pcb=pcbindex
status=st;
file acctsam dli;
func = 'CHKP';
pcbindex = 1;
chkpnum = chkpnum +1;
put @1 'SAS'
@4 chkpnum z5.;
if st = ' ' then
return;
file log;
put _all_;
abort;
run;
The PCB= variable, PCBINDEX, has a value of 1. This indicates that the first eligible PCB is used for the CHKP call. A CHKP call requires the I/O PCB that is the first PCB in the PSB (see I/O PCBs).
The CHKP call is successful if
_ERROR_=0 and the STATUS= variable (ST) is blank. Otherwise, the STATUS= variable contains a status code that indicates the cause of the failure. In particular, an
XD status code in an IMS/ESA BMP region indicates that the IMS/ESA control region is being shut down.
You cannot read from the output buffer in a DATA step, but you can access the message segments that are placed in the output buffer. You format a GU call that uses the I/O PCB. When the DL/I INPUT statement executes, the SAS/ACCESS interface remembers that the output buffer contains data from a previous CHKP call. Instead of issuing the GU call, the SAS/ACCESS interface moves the segment from the output buffer to the input buffer, where it can be read. Therefore, in a BMP transaction-processing program, the first call issued after a CHKP call must be a GU that references the I/O PCB.(footnote 2)
Consider the previous example in Basic CHKP Call, which shows SAS statements that issue a CHKP call. If you issue the CHKP call in a BMP transaction-processing program, additional statements are needed. This example issues one CHKP call and optionally moves a message segment to the input buffer.
options imsbpin=trancode;
data _null_;
retain chkpnum 0;
infile acctsam dli call=func pcb=pcbindex
status=st;
file acctsam dli;
func = 'CHKP';
pcbindex = 1;
chkpnum = chkpnum +1;
put @1 'SAS'
@4 chkpnum z5.;
if st = ' ' then
do;
func = 'GU ';
input @;
if st ¬= ' ' then
if st= 'QC' then
do;
_error_ = 0;
stop;
end;
else
link abendit;
end;
else
if st = 'QC' then
do;
_error_ = 0;
stop;
end;
else
link abendit;
stop;
abendit:
file log;
put _all_;
abort;
run;
options imsbpin=*;
| I/O PCBs |
| TP PCBs |
Just as information from DB PCBs is available to the SAS program through the STATUS= and PCBF= variables after a DL/I call, so is information from the I/O and TP PCBs.(footnote 3) The format of the data in the PCBF= variable differs, however, according to the PCB type.
If a DL/I call uses the I/O PCB, the PCBF= variable data are formatted as shown in Format of I/O PCB Feedback Data.
If a DL/I call uses a TP PCB, the data in the PCBF= variable are formatted as shown in Format of TP PCB Feedback Data.
If a DL/I call uses a TP PCB, the data in the PCBF= variable are formatted as shown in Format of TP PCB Feedback Data.
| OS/390 DL/I System Calls |
Summary of Non-Database Access Calls summarizes the functions and region types for non-database access calls that are supported by the IMS-DL/I DATA step interface.
A LOG call inserts user log records in the DL/I log with the I/O PCB (see I/O PCBs). To insert a log record, you must specify
In an IMS-DL/I DATA step program, the LOG call is issued with the DL/I PUT statement. The PUT statement must format the log record
being inserted. The following statements from a sample program insert a log record with a code of
'A0'x in the IMS log. The example can be run using the SAS system options IMSREGTP=DLI or IMSREGTP=BMP:
data _null_;
infile acctsam dli call=func pcb=pcbindex
status=st;
file acctsam dli;
func = 'LOG ';
pcbindex = 1;
ll = 23;
zz = '0000'x;
logcode = 'A0'x;
logsegm = 'Text of Log Record';
put @1 ll pib2.
@3 zz
@5 logcode
@6 logsegm;
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
stop;
run;
put @1 ll pib4.
@5 zz
@7 logcode
@8 logsegm;
The value of the LL variable does not change.
In an online access region, the ROLL call has two purposes:
data _null_;
infile acctsam dli call=func pcb=pcbindex
status=st;
file acctsam dli;
func = 'ROLL';
pcbindex = 1;
put;
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
stop;
run;
A ROLB call is used in a batch DL/I region to back out any DL/I database updates that have been made since the last program synchronization point. ROLB differs from the ROLL call because it does not cause an 0778 abend. The ROLB call requires use of the I/O PCB (see I/O PCBs).
The ROLB call can be issued in batch DL/I regions if
Otherwise, the ROLB call can be issued only from an IMS/ESA BMP region, as described in IMS/ESA Message Queue Access.
options imsdlbko=y;
data _null_;
infile acctsam dli call=func pcb=pcbindex
status=st;
file acctsam dli;
func = 'ROLB';
pcbindex = 1;
put;
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
stop;
run;
| IMS/ESA BMP System Calls |
data _null_;
infile tranpsb dli call=func pcb=pcbindex
status=st;
file tranpsb dli;
func = 'DEQ ';
pcbindex = 1;
put @1 'A';
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
stop;
run;
options imsbpin=trancode;
data _null_;
infile acctsam dli call=func pcb=pcbindex
status=st;
file acctsam dli;
func = 'ROLB';
pcbindex = 1;
put;
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
stop;
run;
/* put a message in the queue */
data _null_;
infile tranpsb dli call=func pcb=pcbindex
status=st;
file tranpsb dli;
func = 'ISRT';
pcbindex = 2;
ll = 33;
zz = '0000'x;
msgsegm = 'trancode Message for Example # 2.';
put @1 ll pib2.
@3 zz
@5 msgsegm;
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
stop;
run;
data _null_;
infile acctsam dli call=func pcb=pcbindex
status=st;
pcbindex = 1;
file acctsam dli;
func = 'ROLB';
put @1 'SAVEIO';
if st ¬= ' ' then
if st = 'QC' then
_error_ = 0;
else
link abendit;
func = 'GU ';
input @;
if st = ' ' then
_error_ = 0;
else
link abendit;
stop;
abendit:
file log;
put _all_;
abort;
run;
data _null_;
infile acctsam dli call=func pcb=pcbindex
status=st;
file acctsam dli;
func = 'ROLB';
pcbindex = 1;
put @1 'SAVEIO';
if st ¬= ' ' and
st ¬= 'QC' then
link abendit;
return;
abendit:
file log;
put _all_;
abort;
run;
options imsbpin=*;
The message segment has been successfully moved if _ERROR_=0 after the INPUT statement executes.
If the PUT statement above is changed to
PUT;, the message segment would not be returned by the ROLB call.
A SAS program that executes in a BMP region can insert commands to IMS/ESA with the CMD call if
The CMD call is issued by a PUT statement and uses the I/O PCB.
For example, the following sequence of SAS statements issues the
'/START DB ACCTDBD. ' command. This example is run using the SAS system options IMSREGTP=BMP and IMSBPIN=trancode :
options imsbpin=trancode;
data _null_;
infile tranpsb dli call=func pcb=pcbindex
status=st;
file tranpsb dli;
func = 'CMD ';
pcbindex = 1;
ll = 23;
zz = '0000'x;
put @1 ll pib2.
@3 zz
@5 '/START DB ACCTDBD. ';
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
run;
options imsbpin=*;
If a CC status code is returned, the command returned a response message to the output buffer and the IMS-DL/I DATA step interface saved the response. To retrieve the response, the next call must be a GU that uses the I/O PCB, as is done after CHKP and ROLB calls in the IMS-DL/I DATA step interface. If subsequent response segments are queued, a CC status code is returned as a result of the GU call. The program can issue GCMD calls (see GCMD Call) to retrieve the subsequent response segments.
put @1 ll pib4.
@5 zz
@7 '/START DB D1MK0001.';
However, the value of the LL variable does not change.
data _null_;
infile tranpsb dli call=func pcb=pcbindex
status=st;
func = 'GU ';
pcbindex = 1;
input @;
if st = 'CC' then
do;
func = 'GCMD';
input @;
if st = ' ' or
st = 'QD' then
do;
_error_ = 0;
stop;
end;
else
link abendit;
end;
else
if st = 'QC' then
do;
_error_ = 0;
stop;
end;
else
link abendit;
return;
abendit:
file log;
put _all_;
abort;
run;
options imsbpin=*;
| IMS/ESA Message Queue Access |
To retrieve message segments for transaction processing, an IMS-DL/I DATA step interface program
To retrieve the first segment of any message, use a GU call. To retrieve subsequent segments of the same transaction message, issue a GN call. You can use the same sequence of SAS statements that issued a GU call for the first segment of a message, but the value of FUNC must be changed to GN. (For more information on GU and GN calls, see Summary of Non-Database Access Calls in OS/390 DL/I System Calls.)
options imsbpin=trancode;
data _null_;
infile acctsam dli call=func pcb=pcbindex
status=st;
func = 'GU ';
pcbindex = 1;
input @;
if st = ' ' then
do;
func = 'GN ';
do while (st = ' ');
input @;
if st ¬= ' ' then
if st = 'QD' then
do;
_error_ = 0;
stop;
end;
else
link abendit;
end;
end;
else
if st = 'QC' then
do;
_error_ = 0;
stop;
end;
else
link abendit;
stop;
abendit:
file log;
put _all_;
abort;
run;
options imsbpin=*;
The format of a retrieved message segment in the SAS input buffer differs depending on the language that generated the PSB. If an Assembler PSB is used, the message segment is formatted as shown in Assembler PSB Input Buffer Message Segment Format.
If a PL/I PSB is used, the message segment is formatted as shown in PL/I PSB Input Buffer Message Segment Format.
options imsbpin=trancode;
data _null_;
infile tranpsb dli call=func pcb=pcbindex
status=st;
file tranpsb dli;
func = 'ISRT';
pcbindex = 2;
ll = 35;
zz = '0000'x;
msgsegm = 'trancode Text of Message Segment';
put @1 ll pib2.
@3 zz
@5 msgsegm;
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
stop;
run;
data _null_;
infile acctsam dli call=func pcb=pcbindex
status=st;
func='GU ';
pcbindex= 1;
input @;
if st ¬= ' ' then
if st = 'QC' then
do;
_error_ = 0;
stop;
end;
else
do;
file log;
put _all_;
abort;
end;
stop;
run;
options imsbpin=*;
put @1 ll pib4.
@5 zz
@7 msgsegm;
The value of the LL variable does not change.
SSA1='#MODNAME=DFSMO4';
This causes the message to be formatted with the MOD DFSMO4. The
SSA1=' '; statement should follow the first DL/I PUT so that the MOD is not re-specified on ISRT calls for subsequent message segments.
For example, consider the following SAS statements:
data _null_;
infile tranpsb dli call=func pcb=pcbindex
status=st;
file tranpsb dli;
func = 'PURG';
pcbindex = 2;
ll = 27;
zz = '0000'x;
msgsegm = 'Text of Message';
put @1 ll pib2.
@3 zz
@5 msgsegm;
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
stop;
run;
If you want to change the MOD, use an SSA variable, as described in ISRT Calls to Message Queues.
PUT;
CHNG Call to TP PCBs shows an example of this sequence of calls. Remember
that you must use a modifiable TP PCB in order to change destination between calls.
data _null_;
infile tranpsb dli call=func pcb=pcbindex
status=st;
file tranpsb dli;
func = 'CHNG';
pcbindex = 3;
put @1 'destname';
if st ¬= ' ' then
do;
file log;
put _all_;
abort;
end;
stop;
run;
data _null_;
infile tranpsb dli call=func pcb=pcbindex
status=st;
file tranpsb dli;
func = 'PURG';
pcbindex = 3;
put;
if st = ' ' then
do;
func = 'CHNG';
put @1 '<destname>';
if st = ' ' then
do;
func = 'ISRT';
ll = 27;
zz = '0000'x;
msgsegm = 'Text of Message Segment';
put @1 ll pib2.
@3 zz
@5 msgsegm;
if st = ' ' then
stop;
else
link abendit;
end;
else
link abendit;
end;
else
link abendit;
return;
abendit:
file log;
put _all_;
abort;
run;
FOOTNOTE 2:
This is not the call sequence that would be used if programming in PL/I, COBOL, or Assembler, but it is consistent with the actions taken by DL/I after a
CHKP call.
FOOTNOTE 3:
IMS/ESA: Application Programming: EXEC DLI Commands for CICS and IMS, an IBM publication, describes the PCB mask data.
FOOTNOTE 4:
Although a message queue call does not use an SSA, it is provided as a way to specify the MOD.
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.