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
I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?
What is use of restart and how to use it?
Which dd parameters are required?
What is the difference between the positional and keyword parameters? Give examples.
What dd statement is used to supply the name of a dataset?
which utility is used a dummy utility?
What happens if both JOBLIB & STEPLIB is specified ?
How do you access an uncatalogued dataset in a jcl?
what is a jcl?
I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.
What do you understand by the term job time – out and how can you overcome that?
How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?
Matching Logic in Jcl not in cobol.Could any one please answer this question
define cond parameter in jcl?
Explain about LMQUERY�give a dialog information about a data set