Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Match two recs of same file and append it to first rec

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1806
Location: NY,USA

PostPosted: Fri Jul 13, 2012 4:45 pm    Post subject: Match two recs of same file and append it to first rec
Reply with quote

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:

Code:
123456789001

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
View user's profile Send private message

Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Fri Jul 13, 2012 5:00 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1894
Location: UK

PostPosted: Fri Jul 13, 2012 8:11 pm    Post subject:
Reply with quote

Possibly you can use RESIZE.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Jul 13, 2012 8:16 pm    Post subject: Reply to: Match two recs of same file and append it to first
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jul 13, 2012 9:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1806
Location: NY,USA

PostPosted: Wed Jul 18, 2012 5:01 pm    Post subject:
Reply with quote

Thanks All.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us