Please explain with syntax and an example, the Inrec fields
and Outrec build in sort.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
what is the difference between JES3 and JES2?
Is Default for MSGCLASS = (1,1) ?
I have Job A and Job B. I want to trigger Job B from Job A. Please advise.
if my GDG limit has been kept as 50 and if am trying to put 60 records.what would happen. will there be any abend for this scenario
FOR a GDG, the book by 'SABA ZAMEER' says 'We can NOT ALTER the LIMIT parameter after it is defined'. (p-211). But many persons have written that it can be changed, which one is true ?
What is the function of the dd avgrec keyword in sms datasets?
How to print the Output to SPOOL using MSGCLASS and SYSOUT ?
List the different components of jcl statement?
Please give me the coding for converting VB to FB and FB to VB
what is symbolic parameters in jcl, what is a temparary data set ? where do u use ?
How to execute step2,step5,step7 of a proc of 10 steps? You are not allowed to change in JCL.
When The Define Jcl Is Not Available, How Can You Get Information About A Vsam File's Organisation ?