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


Please Help Members By Posting Answers For Below Questions

Name a few IBM utility programs, and explain its function.

4440


//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 /*

913


What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?

1999


How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.

5062


What parameter of the job statement is used to limit the cpu time consumed by the job?

840






what disp parameter we mention for creation of temporary dataset so that we can use it in later steps?

658


what is DSN parameter and DISP parameter is used for?

678


what is DD statement is used in JCL?

683


How to run cobol program using jcl?

652


What is NOTCAT ?

740


How jcl is used for testing batch programs?

721


what is use of disp parameter in dd statement?

666


what operation is performed by job statement?

663


How can values be passed from the job stream to an executable program?

875


Explain dfsort utility?

675