Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Merge: column x is equal to that of column a my output

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Kijo

New User


Joined: 22 Mar 2007
Posts: 9
Location: Philippines

PostPosted: Wed Aug 29, 2007 9:43 pm    Post subject: Merge: column x is equal to that of column a my output
Reply with quote

i have 2 flat files... the first contains columns a, b and c with 3 records, the other columns x and y with 5 records.

if the value of column x is equal to that of column a my output should be columns a, b, c and y with the same number of records as file 1...

file 1:

a123 b123 c123
a456 b456 c456
a789 b789 c789

file 2:

x123 y000
x222 y111
x456 y000
x789 y000
x888 y111

output:

a123 b123 c123 y000
a456 b456 c456 y000
a789 b789 c789 y000

any suggestions?

thank you very much!
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Wed Aug 29, 2007 11:36 pm    Post subject:
Reply with quote

Hello,

What should happen if there are duplicate "keys" in either of the files?
Back to top
View user's profile Send private message
Kijo

New User


Joined: 22 Mar 2007
Posts: 9
Location: Philippines

PostPosted: Thu Aug 30, 2007 9:07 am    Post subject:
Reply with quote

Hi,

there's no need to worry about dupes it will be taken care of by a previous job.
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Thu Aug 30, 2007 10:47 am    Post subject:
Reply with quote

Code:
// EXEC PGM=ICETOOL           
//DFSMSG DD SYSOUT=*           
//TOOLMSG DD SYSOUT=*         
//FILE1 DD *                   
123 123 123                   
456 456 456                   
789 789 789                   
/*                             
//FILE2 DD *                   
123 000                       
222 111                       
456 000                       
789 000                       
888 111                       
/*                             
//T DD DSN=&&T,DISP=(MOD,PASS)
//OUT DD SYSOUT=*             
//TOOLIN DD *                 
 COPY FROM(FILE1) TO(T)                         
 COPY FROM(FILE2) TO(T) USING(CTL1)             
 SPLICE FROM(T) TO(OUT) ON(1,3,CH) WITH(13,3)   
/*                                               
//CTL1CNTL DD *                                 
 INREC OVERLAY=(13:5,3)                         
/*                                               
//

Output:
Code:
123 123 123 000
456 456 456 000
789 789 789 000
Back to top
View user's profile Send private message
Kijo

New User


Joined: 22 Mar 2007
Posts: 9
Location: Philippines

PostPosted: Thu Aug 30, 2007 10:56 am    Post subject:
Reply with quote

thank you very much but is it also possible to do this with syncsort?
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Thu Aug 30, 2007 11:07 am    Post subject:
Reply with quote

Kijo,
Quote:
but is it also possible to do this with syncsort?

yes, it is possible in syncsort also.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us