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
 
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm

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