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
Name a few IBM utility programs, and explain its function.
//S10 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //CON DD DSN=VAR.INPUT1,DISP=SHR // DD DSN=VAR.INPUT2,DISP=SHR //OUT DD DSN=VAR.OUTPUT,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,5)),UNIT=SYSDA //TOOLIN DD * * Splice the needed data from the two VB files together SPLICE FROM(CON) TO(OUT) ON(5,5,CH) WITHALL - WITH(12,5) WITH(22,20) VLENMAX /*
What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?
How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.
What parameter of the job statement is used to limit the cpu time consumed by the job?
what disp parameter we mention for creation of temporary dataset so that we can use it in later steps?
what is DSN parameter and DISP parameter is used for?
what is DD statement is used in JCL?
How to run cobol program using jcl?
What is NOTCAT ?
How jcl is used for testing batch programs?
what is use of disp parameter in dd statement?
what operation is performed by job statement?
How can values be passed from the job stream to an executable program?
Explain dfsort utility?