View previous topic :: View next topic
|
Author |
Message |
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Hi All,
Could any one please help me on the below issue,
File - 1
*******
Key = 1 to 5 characters
FB, LRECL=10
Code: |
11111ppppp
AAAAALLLLL
BBBBBOOOOO
ZZZZZ99999
|
File - 2
*******
FB, LRECL=10
Key = 1 to 5 characters
Code: |
KKKKKppppp
BBBBB11111
ZZZZZSSSSS
|
The output should be of LRECL=15 and FB. It should look like below,
Code: |
BBBBBOOOOO11111
ZZZZZ99999SSSSS
|
Condition:
If the key matches, then the oputput file should be of lrecl of 15 and the value should be 1 to 10 bytes from file 1 and 6 to 10 bytes of file 2 should be append to 11 to 15 of output file.
Thanks in advance. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Why not try joinkeys and reformat?
Numerous examples in forum |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Niki,
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD *
----+----1----+----2----+----3----+
11111PPPPP
AAAAALLLLL
BBBBBOOOOO
ZZZZZ99999
//INB DD *
KKKKKPPPPP
BBBBB11111
ZZZZZSSSSS
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(1,5,A)
JOINKEYS F2=INB,FIELDS=(1,5,A)
REFORMAT FIELDS=(F1:1,10,F2:6,5)
//* |
|
|
Back to top |
|
|
|