Please explain with syntax and an example, the Inrec fields
and Outrec build in sort.

Answers were Sorted based on User's Feedback



Please explain with syntax and an example, the Inrec fields and Outrec build in sort...

Answer / sviakumar

Inrec is one type of sorting which selects first and then
sorting.but in case of OUtrec is entirly reverse of Inrec
(i.e., first sorting and then select )

Is This Answer Correct ?    23 Yes 3 No

Please explain with syntax and an example, the Inrec fields and Outrec build in sort...

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

Please explain with syntax and an example, the Inrec fields and Outrec build in sort...

Answer / cd

In most cases INREC and OUTREC statements can be used
interchangeably..

The difference between them is more of a performance issue
than anything else.

For Example:

INPUT
------

Name Regn. No. School ADDRESS
____ _________ _______ __________________________

DINA 1657565511 SSV sadadadadadadadadadadadada
EALA 1264546461 SADADADA ddwaedsagfdsdsadadagfdsdsw
ARUN 1214231211 DADARDCA kjhdsakjhgkjdagtsagdsakjhd
SUDA 1212121211 DRADS kiyeakjhsdakjgdajgshaskgsa
RINI 1275655345 AFAASFAF kadhlkjdabgsagkjashksaoksa


Assume, you want to have the sorted names of the people from
this file in the output.

What Inrec would do:

//SYSIN DD *
SORT FIELDS=(1,4,CH,A)
INREC FIELDS=(1,4)
/*


Step 1.

Name
____
DINA
EALA
ARUN
SUDA
RINI

Step 2.

Name
____
ARUN
DINA
EALA
RINI
SUDA


If outrec was used, the steps 1 and 2 would be reversed.


thanks

Is This Answer Correct ?    4 Yes 2 No

Please explain with syntax and an example, the Inrec fields and Outrec build in sort...

Answer / cd

step 1:

Name Regn. No. School ADDRESS
____ _________ _______ __________________________

ARUN 1214231211 DADARDCA kjhdsakjhgkjdagtsagdsakjhd
DINA 1657565511 SSV sadadadadadadadadadadadada
EALA 1264546461 SADADADA ddwaedsagfdsdsadadagfdsdsw
RINI 1275655345 AFAASFAF kadhlkjdabgsagkjashksaoksa
SUDA 1212121211 DRADS kiyeakjhsdakjgdajgshaskgsa

Step 2.

Name
____
ARUN
DINA
EALA
RINI
SUDA


hth

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More JCL Interview Questions

can we maintain 2 generations with different Lengths in Same GDG ?

3 Answers   RBS,


What is a GDG? How is it referenced? How is it defined? What is a MODELDSCB?

3 Answers  


can we copy a file from fixed block to variable block and vice versa ....asap

1 Answers  


How different is the JCL executing a COBOL program? 1) if the program is using VB file as input. 2) if the program is using FB file as input.

1 Answers   HSBC,


Explain about LMOPEN -

1 Answers  






Suppose there are 2 Input files Infile-1 and Infile-2. Both the Files contain Employee Records. You need to compare both the files and Write the Common Records in third file named Outfile. How can we do this using File-Aid?

0 Answers   CGI, Verizon,


when can a job time-out occur? How to overcome that?

0 Answers   IBM,


Is condition checking possible in jcl? If yes, how?

0 Answers  


Can you delete the GDG base without deleting GDG generations ?

7 Answers   Cap Gemini,


Hi, Say I have 10 flat files and I want to copy all these 10 flat files to a GDG versions flat files (I have GDG base: FDWS01.TEST.RESTORE) in one shot. Can we do that in one shot using a JCL. May be by using IEBGENER. It's a bit urgent. So anyone's fast rely would be appreciated.. Thanks in advance.. 10 flat files ----------------------------------- FDWS01.SUB.RESTORE1 FDWS01.SUB.RESTORE2 FDWS01.SUB.RESTORE3 ; ; FDWS01.SUB.RESTORE10 TO GDG versions ----------------------- FDWS01.TEST.RESTORE.G0001V00 FDWS01.TEST.RESTORE.G0002V00 FDWS01.TEST.RESTORE.G0003V00 ; ; FDWS01.TEST.RESTORE.G0010V00

4 Answers  


i have a jcl in which 4 & 5 step creates a new generation. 4th step output is as input for the 6th step & 5th step output is used as input in the 7th step. How they are refered as in the 6th & 7th steps? If the job abends in 6th step then how the 5th step output is refered in 7th step?

1 Answers   IBM,


What is a Dummy Utility and what it does ?

3 Answers  


Categories