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.....

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If a (+1) generation dataset is created in the first step of a job, how can it be referenced in later steps of the same job for input?

1033


What is the difference between run mode and addressing mode?

857


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

1093


State the uses of syspring, sysin, sort fields, sum fields and dummy.

840


in a jcl, a large volume dataset is loaded to a table using bmcload in step1 and an image copy of the loaded table is taken using bmccopy in step2. Step2 abends because the image copy dataset cannot hold the volume of the table. How can this be rectified?

1001


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

950


how can a gdg base be created in a jcl. What is the difference between empty and scratch parameter while defining/altering gdg base?

1020


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

985


Hello Guys, I have 1+ Year Experience in MAINFRAME TESTING. After 1 Week I have an Interview With a Company on Mainframe Testing. Please Could You Guys Please Suggest me What Sections Should I prepare ?? ___Tell Me the Topic Or Appropriate Site & Links. ?? ---------------Thank You

2506


What do you understand by the term notcat 2 – gs?

975


have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records... run a loop from record one to 10 evaluate i/3 if comes even then skip else write to output file

1206


Which statement is used to identify the private libraries in job?

910


What statement marks the beginning of a job step; assigns a name to the step; identifies the program or catalogued or in-stream procedure to be executed in the step?

850


what is DSN in JCL and what are the parameters to declare the DSN?

965


What is the purpose of dd * statement in jcl?

1015