View previous topic :: View next topic
|
Author |
Message |
gragha
New User
Joined: 25 Jul 2006 Posts: 23
|
|
|
|
I have 2 Input files:
Input 1
AAAAAAAAAAAAA
Input 2
BBBBBBBBBBBBB
CCCCCCCCCCC
DDDDDDDDDDD
I need the Output to be:
BBBBBBBBBBBBB
AAAAAAAAAAAAA
CCCCCCCCCCC
DDDDDDDDDDD
Can anyone tell me how to accomplish this. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Can anyone tell me how to accomplish this. |
Not until you tell us the rules for what you're trying to do which are not obvious from your example. Are you trying to insert the first record from input file 1 after the first record from input file 2, or is it something more complicated than that based on the "keys" of the records, or something else?
Can input file1 only have one record?
You need to give a complete description and example of what you're trying to do and the possible variations. Then somebody can help you.
Also, give the RECFM and LRECL of the input files and the starting position, length and format of all relevant fields. |
|
Back to top |
|
|
gragha
New User
Joined: 25 Jul 2006 Posts: 23
|
|
|
|
Hi,
Thanks. Both files are FB, 4000 in length.
File 1 will always have 1 record. And we always need to insert file 1's record as the 2nd record in file 2. There are no conditions |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/4000)
//IN2 DD DSN=... input file2 (FB/4000)
//SORTOUT DD DSN=... output file (FB/4000)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(4001,8,A),SORTED,NOSEQCK
JOINKEYS F2=IN2,FIELDS=(4001,8,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1,F2,ONLY
OPTION COPY
OUTFIL VTOF,BUILD=(5,4000)
/*
//JNF1CNTL DD *
INREC OVERLAY=(4001:C'00000002')
/*
//JNF2CNTL DD *
INREC OVERLAY=(4001:SEQNUM,8,ZD,INCR=2)
/*
|
|
|
Back to top |
|
|
|