Page 1 of 1

Alternating recs from multiple input files to one output fil

Posted: Sat Mar 19, 2016 2:15 am
by ChykyMunky
I want to have multiple input files.
The input files should alternate being written to ONE output file.
So it should look something like this

Input File 1:
1
2
3

Input File 2:
A
B
C

Output File:
1
A
2
B
3
C

(In the past I have attached a sequence number to the input recs, sort on the sequence numbers, then write to the file. I'm looking for something different from that)

Posted: Sat Mar 19, 2016 1:15 pm
by William Collins
Use MERGE with SORTIN01 and SORTIN01. OPTION EQUALS, and use a generated sequence number for the fake key for the MERGE. Remember to drop the fake bit in OUTREC or OUTFIL.

Posted: Mon Mar 21, 2016 6:46 pm
by ChykyMunky
How do I get the sequence numbers on there?