View previous topic :: View next topic
|
Author |
Message |
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Input file:
Code: |
format:wed2341236...&^ABC
Accountno:123456789
format:wed2241236...&^ABC
Accountno:123456735
format:wed2345236...&^ABC
Accountno:1234676457 |
Output file:
Code: |
wed2341236...&^ABC123456789
wed2241236...&^ABC123456735
wed2345236...&^ABC1234676457 |
I am thinking of sepearing the input file into two files and adding seq number to every record of bothe the file
File1:
Code: |
wed2341236...&^ABC001 |
File2:
Based on join on last 3 positions I will pick the account number from second file and append to the first file record.
I am sure there could be some other way to do this, could you please guide on this. |
|
Back to top |
|
|
Naish
New User
Joined: 07 Dec 2006 Posts: 82 Location: UK
|
|
|
|
You can use 'format' and 'Accountno'. Use WHEN=GROUP and PUSH the records. Finally you can OMIT what you don't want. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Possibly you can use RESIZE. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
That's Naish's line. Nic :-)
If your records are in groups of three, you can use that on the GROUP which Naish has suggested. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Use the following DFSORT JCL
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+----6-
FORMAT:WED2341236...&^ABC
ACCOUNTNO:123456789
FORMAT:WED2241236...&^ABC
ACCOUNTNO:123456735
FORMAT:WED2345236...&^ABC
ACCOUNTNO:1234676457
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,6,CH,EQ,C'FORMAT'),
PUSH=(81:8,18),RECORDS=2)
OUTFIL INCLUDE=(1,7,CH,EQ,C'ACCOUNTNO'),BUILD=(81,18,11,10)
|
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Thanks All. |
|
Back to top |
|
|
|