I have two files each contains 10 records. I would like to
copy both files into one output file but in alternate
sequence. for e.g. first record from file1 then record 2
from file2.....

Answers were Sorted based on User's Feedback



I have two files each contains 10 records. I would like to copy both files into one output file bu..

Answer / mallikharjuna

it will be processed in 3steps
if the data is AAA
AAA
BBB
CCC

FILE2
DDD
EEE
FFF
LIKE 10 RECS

step1:
srt fields=copy
outrec fields=(1:1,3,4:seqnum,4,ZD,START=1,INCR=2 )

STEP:2

step2:
srt fields=copy
outrec fields=(1:1,3,4:seqnum,4,ZD,START=2,INCR=2 )


STEP=3 SORT FIELDS = COPY
OUTREC FIELDS =(1:1,3)

Is This Answer Correct ?    9 Yes 0 No

I have two files each contains 10 records. I would like to copy both files into one output file bu..

Answer / muttaiah

Mallikarjuna,

If you give sort=copy in step3. the format of o/p file is
rec1 - File1
rec2 - File1
Rec1 - File2
rec2 - File2

change the sort as:
sort fields=(4,4,ZD,A)
outrec fields=(1:1,3)
rec1 - File1
Rec1 - File2
rec2 - File1
rec2 - File2

Is This Answer Correct ?    6 Yes 0 No

I have two files each contains 10 records. I would like to copy both files into one output file bu..

Answer / aks

Use df sort utility and use infile and outfile for writing
the record into output file.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More JCL Interview Questions

Explain the function of //cntl statement?

0 Answers  


Explain the function of a dd statement?

0 Answers  


How To get the last record in VSAM file in cluster? and How can u get the ksds file records into ur cobol program ? Pls tell me about these two questions.

1 Answers   Cap Gemini,


What is the use of DSNDB07 ?

1 Answers  


I have two input SORTIN files and We need to create one SORTOUT file which contains data of both input files. What is the SortCard for this?. Suppose the length of the both files are different, then How we do it? Please reply ASAP

4 Answers   CSC,






How to send different PARM values based on the any condition to the program in a JCL? For example :- If the time is before 12:00 pm, I want to send "A" to some program and if it past 12:00 pm , I want to send "B" as a PARM value to that program. How to do it thur JCL only?

0 Answers   UHG,


what is the difference between return code and maxcc?

2 Answers   iGate,


What is job control language?

0 Answers  


I have a job which is a long-running one. Processes millions of records. Due to some run-time problem (not a problem due to the job/data) the job abends.What needs to be done to make the job complete successfully.

4 Answers   TCS,


how to code instream data in procedure?

3 Answers  


What is the function of a dd statement?

0 Answers  


How to delete AIX ? i) IEBGENER ii) IDCAMS iii) PURGE iv) All of the above

3 Answers   HSBC,


Categories