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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I have mainpgm(abc) this is the only cobol pgm(non-db2).And this pgm calling subpgm name "acd" this also only cobol(non- Db)and this pgm calling some other subpgm this pgm has cobol-db2 pgm. 1) IF you calling static mode how to run and how to compile? 2) IF you calling dynamic mode how to run and how to compile? plz suggestion me.

1954


How can a jobs execution priority be modified?

799


what is the use of IEBGENER utility?

662


Explain how can a jobs execution priority be modified?

742


Why block size is multiple of lrecl in jcl?

915






What is jcl in mainframe?

690


How do you access an uncatalogued dataset in a jcl?

729


Explain the purpose of dd dummy statement?

671


When The Define Jcl Is Not Available, How Can You Get Information About A Vsam File's Organisation ?

748


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

840


What is jcl in mainframe, and how many types of jcl statements are there for a job?

631


The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?

947


How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length ----TRY

861


what is the difference between JES3 and JES2?

683


I have a job called careerride and some steps in it as step1,step2. But I want to execute step2 before step1 ? How do I do that?

834