--Ret:rieving an Existing Data Set
You can retrieve an existing data set located in unit record devices (card reader and paper tape reader), the input stream, magnetic tape, or
dirE:~ct access devices. Data sets on magnetic tape and direct access devices are retrieved in simi.lar ways depending on whether they were passed, cataloged or kept when you created them.
This chapter describes how to retrieve:
• unit record data sets (card reader and paper tape reader).
• Input stream data sets.
• passed data sets.
• cataloged data sets.
• Kept data sets.
Table 15 shows the parameters required to retrieve a data set.
fold out Table 15 while readi.ng this chapter.
Unit Record Devices
Please
You can retrieve an input data set on either a card reader or a paper tape reader. As shown in Table 15, only the UNIT parameter is required to indicate the device you want for the data set. The DSNAME and DISP parameters are not used, "because data sets on unit record devices are always temporary and cannot be retrieved by another DD statement in your job.,
']~his section is summarized in Table 67 of Appendix D.
Location of the Data Set
The location of th.e data set is given by t,he UNIT parameter.
UNI,]~: The format. of the UNIT parameter is:
r---,
I
{Unit addreSS}I
I
UNIT= device typeI
I
group nameI
L __________________________________________ , _____________________________ J
uni1:. address
is the actual machine address of the device. For example,
UNIT=OOD. You should not specify the address unless you are sure you want that specific device.
device type
corresponds to the model number of the I/O device. Coding a device type provides you with a certain degree of device independence in that your data set may be placed in any of a number of devices of the same type. For example, if you code
UNIT=1442
Unit Record Devices
your data set can be placed by the operator in any 1442 Card Reader in the system. The following device types can be specified:
Device Type 1442 2520 2540 2671
Description
1442 card Read Punch 2520 Card Read Punch
2540 Card Read Punch (Read feed) 2671 Paper Tape Reader
group name
is the name of a collection of devices, selected by your installation during system generation. For example, your
installation might select the name CARD for all card readers in the configuration. If you do not care which card reader is used for your data set, you would then code
UNIT=CARD
Your manager or supervisor should tell you which group names were generated for your installation.
Data Attributes
The DCB parameter allows you to specify attributes for your data set when your program is to be executed rather than when i t is compiled.
Any applicable attributes not specified in your program must be
specified with the DCB parameter. However, in most cases, your compilE~r
will provide a default value for an attribute if you do not specify i t in the program or in the DD statement. other attributes are always given a fixed value by the compiler and you do not have to specify thern at all. For example, you can select a buffering technique with the assembler, but all other IBM compilers select one for your use when i t is needed.
DCB: You can use the DCB parameter to directly specify the DCB
attributes of your data set or to copy those DCB attributes specified in a DD statement for another data set. The format of the DCB parameter for specifying the attributes is:
r---.,
I
DCB=(list of attributes)I
L ______________________________________________________________________ .J
The attributes in the list are coded in the form of keyword subparameters separated by commas; for example,
DCB= (BLKSIZE=300, LRECL=100)
158
1-3
Subparameter ALGOL Assembler CGBOLE
BFALN= i ! For D
3 American National Standard COBOL.
" ,
I--'
3 American National Standard COBOL.
.~
_
....The valid subparameters that can be used with each campiler far the card re'ader and paper tape reader are shawn in Tables 16 and 17,
re'spectively. Underscared items are thase default values selected if yau .omit the subparameter. Default values are nat shawn where the attribute can either be specified in yaur pragram, .or in the DD statement. If values far a given subparameter are nat shawn, i t is either specified in yaur saurce pragram .or given a fixed value by the cempiler. A glessary .of DCB subparameters is given in Appendix B. Cede .only thase parameters that apply ta yaur cempiler as shawn in Tables 16 and 17. The farmat .of the DCB parameter far capying the DCB parameter .of a previaus DD statement in yaur jab is:
r---.---,
I {*.ddname } I
I DCB=( *.stepname.ddname [,list .of attributes1> I
I *.stepname.pracstepname.ddname I
L _______________________________________ . _______________________________ J
Replace "ddname" with the name .of the DD statement whase DCB parameter yau want ta capy. Replace "stepname" with the name .of the EXEC
statement .of the step that cantains that DD statement. If the DD statement yeu want ta capy is cantained in the same jab step, .omit the stepname, i.e.,
DCB=*.ddname
The fQllaw;ing, example shows haw t.o cade ·the DCB parameter t.o capy the DCB parametex:: '.o'f 'a DD statement in a previa us step:
r-;;;;;;2-;~;~:::---·---1
I
.1/001 DD ••• ,DCB=(BLKSIZE=1600,LRECL=80) II .. I
\. I
I .. I
I /
/STEP4· EXEC .... ItI
I
//READ DD ... DCB=*.STEP2.DDl II I
I .. I
I • I
l ... __ .... ~ __ ~ ... ___ ~ ... _ .... ___ ,.. ... _ ... ____ ... ___ ._. ______________ ... __________ ... ___________ J
,Th.e following ,example shaws how ta code ,the DCB parameter .of a previaus DD statement
in
the same step:r-'---... ---·-... ---,
I ·
I ..
I ..
I
//STEPD EXEC •••I
//DDA DD .... ,DCB=RECFM=FI •
I ..
I •
I
//DDC DD .... ,OCB=*.DDA I ..I ..
1 ..
L._. ______ .-_;.;.;.. ... ...;. ... ___ .... _""""'"' __ ... _______________ ~. ____ .... ________ - _______ ... __________ _
If yau want ta capy the DCB parameter .of a DD statement cantained in a ca.talaged pracedure step, yau must give bath the name .of the jab step that invakes the procedure and the pracedure step name, i.e.,
DCB=*.stepname.pracstepname.ddname
Unit Reco:
Devices
The first part of the following example shows your input deck; the
second part shows a cataloged procedure called by the SIX EXEC statement in your deck.
r---,
I INPUT DECK I
~---~
I . I
I . I
I . I
I //SIX EXEC PROC=XYZ I
I ·
~I
I ·
~I
I . stepname I
I //COPY EXEC ••• ~ I
I //DDl DD ••. ,DCB=*.SIX.STEP4.PAPER I
I ~ ddname ~ I
I procstepname ~ I
~---/-~---~
I CATALOGED PROCEDURE
~
Ir-~----~~---l
I //STEP4 EXEC... I
I //PAPER~D ••• ,DCB=CODE=I I
I . I
I . I
I . I
L _________________________________________________________ • _____________ J
If you want to modify the DCB subparameters you are copying add the new subparameters to the reference. The subparameters you specify will override the corresponding copied subparameters. For example:
r---,
I • I
I . I
I . I
I //OUT EXEC.... I
I
//READl DD ••• ,DCB=CBLKSIZE=160,LRECL=80,OPTCD=C,MODE=E,RECFM=F)I
I //READ2 DD ••• ,DCB=C*.READ1,MODE=C,STACK=2) I
L ______________________________________________________________________ J
Special Processin~tiQ~
You can use the DUMMY parameter to bypass I/O operations on your data set.
DUMMY: The DUMMY parameter allows you to bypass I/O operations and data set disposition. When your processing program asks to read the dummy data set, the read request is recognized, but no data is transmitted.
This facility is particularly useful when you are debugging your program because i t saves you processing time. For example, you can suppress the reading of a data set until you are sure your program is going to
process i t correctly.
162
The DUMMY parameter is a positional parameter. That means that i t must be coded first in the operand field. For example:
/IINPUT DD DUMMY"UNIT=2671, DCB=CODE=I //R20DD DUMMy,UNIT=1442
If you wish, you can omit all other parameters required to define your data set except DCB. (If you were not going to write the DCB parameter you do not have to write it.) For example, the two DD statements shown above could be coded as follows:
//INPUT DDDUMMY,DCB=CODE=I //R20 DD DUMMY
When you are ready to perform I/O operations on your data set, simply omit the DUMMY parameter and code all parameters required to retrieve the data. set. For example,
//INPUT DD UNIT=:2671,DCB=CODE=I //R20 DD UNIT=1442
Input Stream
You can place your input data set in the input stream following the other JCL statements in the job step. If the EXEC statement for the job step requests a program, you can include the input data for that program in t:he input stream. If the EXEC statement requests a cataloged
procedure, you can include the data for each procedure step in the input
strE~am.
']~he data must be preceded by a DD statement and followed by a
delimited (/*) statement. As shown in Table 15, the DD statement must con't:ain an
*
or DATA in the operand field. The*
parameter means that data follows. The DATA parameter must be used if the data contains JCL stat.ements •~~his section is sununarized in Table 68 of Appendix D.
The following considerations apply to data in the input stream in PCP and in MFT and MVT.
Input stream Data in PCP:
1. The input strea.m must be on a card reader or magnetic tape.
2. You can include only one input stream data set for each job step or procedure step.
3. The DD* or DD DATA statement for the data set must be the last DD statement for the job step or procedure step.
4. Do not code any other parameter in the DD statement.
5. The data must consist of unblocked, aO-character records.
6. The characters in the records must be coded in BCD or EBCDIC.
7. The data must be followed by a delimiter (/*) statement.
Retrieving
Input Strearr
Input S"tream Data in MFT and MVT:
1. The input stream must be on a card reader, magnetic tape or direc1:
access device. (The device must be supported by QSAM.)
2. You can include more than one input stream data set for each job step or procedure step.
3. If the data set contains JCL statements you must precede i t with Cl
DD DATA statement and follow i t with a delimiter statement.
4. If the data set does not contain JCL statements, you can either precede i t with a DD* statement or follow i t with a /* statement, or both. If you omit the DD* statement the system provides one.
Although i t is not necessary, i t is good practice to both precede the data with a DD* statement and to follow i t with a /* statement~.
5. The characters in the records must be coded in BCD or EBCDIC.
6. You may code the DCB subparameters BLKSIZE and BUFNO in the DD statement. (See "Data Attributes.")
Location of the Data set
To indicate that the data set follows in the input stream, you must code the
*
or the DATA parameter.THE * PARAMETER: To specify that data follows in the input stream, code an asterisk (*) in the operand field. For example:
//SYSIN DD
*
The data must not contain JCL statements.
The following example shows a two step job named ELLEN. Each of the!
two steps in the job contains a data set in the input stream. The system can have PCP. MFT or MVT.
r---"
I
//ELLEN JOBI
J //STEP1 EXEC PGM=ONE
I
I • I
I • I
I • I
I
//INPUT DD* I
I
data recordsI
I
/*I
I
//STEP2 EXEC PGM=TWOI
I · I
I . I
t • I
I
//SYSIN DD* I
I
data recordsI
I
L _______ • ____________________________________________________ - __________ /* JI
164
Us;ing tbe:p~eJ;:ed,in9,'eJ$:~mple" ass'QIIle:a $y:$teflt~it:hM:FT: prMVT. You can include mO'r~'t~an O'nelnp,ut stream ,data set for ,each jeb step. FO'r example i f youn,ave 'twO' data, sets f.O'r STEP1, code:
r--' .... .,..---... ---.-: ---... ---.... ---... ---,
I
//ELLEN JOBI
I
//STBPl EXEC PGM;:;:ONEI
I • I
I .. I
I • t
I
//INPUT DD*
tI
data reqo,rdsI
I
/*I
I
//READ DP*I
1
.data . recordsI
I
/*I
I
//STEP2 EXEC PGM=TWOI
I .. I
I .. I
I ..
II
/ISY8INDD * I
I
data. recerdsI
I
/*I
L ____ ~_~ ____ ~~_~_~~ __ ~_~_~~---_~~_~~ __ ~._~ ______ ~~ ___ ~ _______ ~~ _____ J
In thefO',llow;inq :examplE!, your . EXEC statement requests the TOP cataloged procedure .. , TOP:,hast.hree pt:ocedur,e step$ named 'AA,' BE, and cc. Yeu are inoludtnganinput ,s;tream, data ,'set,for',e'acfiprooedure step. Yeu are alsoincluding,a 'DD stat.:ertlentnamed' wOru(f,or prO'cedurestep BB.. The syst,em ca,nhavePCP, MFT, O'r MVT.
r ... --' .... ~ ... --... ~~ ...
-"'""'-...t ... - ...
--~...
~-... """"' ...
-~... ---..., ....
~-....-,---~~-·...
~~.. __:----... - ... ,---... - .... - ... - ... :.-... ----,
I
//STEPY EXEC TOPI
I
/IAA .. INPUT DD*I
I
data recordsI
I
/*I
I
//BB.:WORK DD UN:rT~2311,VOLUME=PRI;VATE,SPACE={TRK,200)I
I
/ISB. IN' ~DD*I
I
data, recordsI
I
/*I
I
//CC.SYSINDD* I
I
,data recO'rdsI
I
/*I
L ... _""'"". __ ... ...:..~ ... ~..,._ ... ~ ... ~-... - ... _ ... _"""'"_ ... _ .. _~· .... _..._ ... - ... _..,..-_-... -~_~ ... _ ... ___ ... _ ... _____ J
UsiIlt9 thepreced,ing example, assume' a system with MFT or MVT. YOu can include more than one input stream data set fO'r each prO'cedure job step.
FO'r example, if yO'U want to' inolude two data sets ferM, three fer BB, and one fer CC, . code:
Retrieving
Input Stream
r---,
I
//STEPY EXEC TOPI
//AA.INPUTl DO*
I
data records , /*I
//AA.INPUT2 OD*
I
da·ta recordsI I I I
/*
//BB.WORK DO UNIT=2311,VOLUME=PRIVATE, SPACE= (TRK, (200»
//BB.INl DO
*
da·ta records
I
/*I
//BB.IN2 00*
I
data recordsI
/*I
//BB.IN3 00*
I
data recordsI
/*I
//CC.SYSIN OD*
I
data recordsI
/*L _______ • ______________________________________________________________ _
Note: :E'or information on how to modify cataloged procedures, refer to
"Part III: Cataloged and In-stream Procedures."
DATA: To specify that data follows in the input stream, code DATA in the operand field. For example:
//SYSIN DD DATA
The data can contain any JCL statements except the delimiter (/*) statement, because the delimiter statement marks the end of the input data set.
For example, the following DD statement indicates that the data records that follow contain JCL statements.
//IN DD DATA data records
In the following example an EXEC statement requests a cataloged
procedure named ROSE. ROSE has two steps named PINK and TEA. You are including an input stream data set that has JCL statements for PINK and an input stream data set without JCL statements for TEA. You are also including a DO statement named BLANK for procedure step PINK. The
syste~ can have PCP, MFT, or MVT.
r---,
I
//STEPZ EXEC PROC=ROSEI
I
//PINK.BLANK 00 UNIT=2400,LABEL=(,BLP)I
I
//PINK.IN DD DATAI
I
d.ata recordsI
I
/*I
I
//TEA.INTAKE DD* I
I
data recordsI
I
/*I
L _______________________________________________________________________ J
Using the preceding example, assume a system with MFT or MVT. You can include more than one input stream data set for each procedure job step.
166
-For example, if you want to incl
u~de :act~taset without :JCL statements for PINI< and a data set with JCL statements for TEA, code:
r--·---,
I //STEPZ EXEC PROC=ROSE I
I //PINl<.BLANK DD UNIT=#:2400,LABEL==(,BLP) I
I /.IPINK.INDD DATA I
I data records I
I
/*I
I /.IPINK.IN2 DD * I
I data records I
I
/*I
I /.ITEA.IN'rAK.E DD * I
I data records I
I
/*I
I /.ITEA.GULP DD DATA 1
I data records I
I
/*I
L ___________________________ . ___________________________________________ J