Please explain with syntax and an example, the Inrec fields
and Outrec build in sort.
Answer Posted / sharath
INREC
-----
A typical use of INREC is listed below with example,
//STEPXXX EXEC SORTD
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=XXXXXXX.NAME.FILE,
// DISP=SHR
//SORTOUT DD DSN=XXXXXXX.NAME.COUNT,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(400,200),RLSE),
// UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=14,BLKSIZE=0)
//SYSIN DD *
INREC FIELDS=(1:1,10,11:C'0001')
SORT FIELDS=(1,10,CH,A)
SUM FIELDS=(11,4,ZD)
/*
Here suppose 1 to 10 is NAME field then you insert a number
from 11 to 14 for every name field. Finally your aim is to
count the number of records having same NAME.
OUTREC
------
Reverse basically. Syntax below
//STEPXX EXEC SORTD5
//SORTIN DD DSN=XXXXXXX.FILE1,
// DISP=SHR
//SORTOUT DD DSN=XXXXXXX.FILE2,
// (NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
// DCB=(LRECL=31,BLKSIZE=0,RECFM=FB)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,10,11:C'0001')
Here you insert 0001 for all values of output file at 11th
place.
Is This Answer Correct ? | 13 Yes | 5 No |
Post New Answer View All Answers
Step 1 RC 4 Step 2 Step 3 I want to know the COND parameter which can be coded in step 2 or 3. Step 2 should be executed based on Step 1 RC and Step 3 should not be executed based on step 1's RC
Is their any set of rules for dd? Explain.
Mainframes gets a text file that contains the name of the file. Now using JCL i want to locate that file name in the mainframe system and perform further processing. Please tell how to proceed
What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?
write a jcl to execute a job by 7:00 am on jan 20,1986?
How to pass data to a program that is coded in an exec statement?
We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?
Are there any set of rules for the names of the steps used in a job?
Can we call instream to catalog and catalog to instream?
what is DSN in JCL and what are the parameters to declare the DSN?
In job processing, what happens in conversion stage?
Explain how can an in-stream dataset be terminated?
How to override loadlib?
Explain the function of //cntl statement?
how do you access an uncataloged dataset in a jcl?