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

How many types of parameters are used in JCL and what are mandatory parameters of JOB statement.

13 Answers   IBM,


What does the one advantange of using IEBUPDTE?????

2 Answers  


what is a null indicator in db2?

5 Answers   Fiserv, IBM,


what happens in conversion stage in job processing?

0 Answers   IBM,


What does the TIME parameter signify ? What does TIME=1440 mean ?

6 Answers   Accenture, TCS,


how to run JCL thru COBOL.

1 Answers   Patni,


wht r different types of sorts ?

1 Answers   L&T,


What type of versions we r using in mainframe (jcl, cobol, db2, vsam, cics)?

1 Answers   Accenture,


I have a PDS and want to omit few rows of all members of a PDS. How to do it?

6 Answers   Accenture,


What is primary allocation for a dataset?

4 Answers  


Please give me the coding for converting VB to FB and FB to VB

3 Answers   HP,


How can the attributes of one sms dataset be copied to another dataset?

0 Answers  


Categories