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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 7 Thu Jun 29, 2017 1:41 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm


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