IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Merging multiple records onto single record based on key


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Fri Aug 09, 2013 8:30 pm
Reply with quote

Hi Dick,

Thanks for the motivation.
From a record with 10 byte, whenever first 6 byte matches (can be 3 or 4 records), I would like to merge the 8th column data, 9th column data and 10th column data onto a single record.

Code:
Input is

ABCDEF X 
ABCDEF   Y
ABCDEF     Z
MNOPQR   Y
MNOPQR
UVWXYA

Output is
ABCDEF XYZ
MNOPQR  Y 
UVWXYZ


Thanks
Vinu
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Aug 09, 2013 9:47 pm
Reply with quote

Hello,

Quote:
Thanks for the motivation.
You're most welcome icon_smile.gif

To do what you want, use your key (1-6) and in the INREC use IFTHEN, WHEN INIT, and PUSH the "x,y,z" values. Then in the OUTFIL, BUILD your re-formatted output records.

There should be examples here in the forum.
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Mon Aug 12, 2013 6:05 pm
Reply with quote

Thanks Dick for the guidance. I will try that.

Thanks
Vinu
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Sort SMF records? SYNCSORT 6
No new posts To Discard record with 0 entry if Dup... SYNCSORT 7
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts Identify and write records containing... SYNCSORT 11
No new posts Filter records where condition is in ... SYNCSORT 6
Search our Forums:


Back to Top