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
 

 

Want to merge of two flat files like INNER join

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

New User


Joined: 22 Jun 2007
Posts: 42
Location: Chennai

PostPosted: Mon Jan 07, 2008 4:58 pm    Post subject: Want to merge of two flat files like INNER join
Reply with quote

First input file:
920061200000 6011abc120002941
919405490001 6011abc100005032
919405490001 6011abc100006832
919405490001 6011abc100010826

Second input file:
6011abc100005032 ¬B¬¬ NT
6011abc100006832 ¬B¬¬ NT
6011abc100010826 ¬B¬¬ NT
6011abc100014141 ¬B¬¬ NT

The 16 digit key is present in 14th position of both input file, I want the out put file as:

Output file:

919405490001 6011abc100005032 ¬B¬¬ NT
919405490001 6011abc100006832 ¬B¬¬ NT
919405490001 6011abc100010826 ¬B¬¬ NT


I am not getting the last characters after key fields from second inputs...

I am using this coding in ICETOOL:

//TOOLIN DD * * (KSVARS05)
COPY FROM(IN1) TO(TMP1) USING(CPY1)
COPY FROM(IN2) TO(TMP1) USING(CPY2)
SPLICE FROM(TMP1) TO(OUT) ON(13,16,CH) WITH(49,1) USING(CPY3)
/*
//CPY1CNTL DD * * (KSVARS06)
INREC BUILD=(1:1,28,49:C'11',30X)
/*
//CPY2CNTL DD * * (KSVARS07)
INREC BUILD=(13:13,26,49:C'22',30X)
/*
//CPY3CNTL DD * * (KSVARS08)
OUTFIL FNAMES=OUT,INCLUDE=(49,2,CH,EQ,C'21')
/*

Please help me out of this problem..
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Jan 07, 2008 5:55 pm    Post subject:
Reply with quote

Code:
//STEP001  EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                       
920061200000 6011ABC120002941                                         
919405490001 6011ABC100005032                                         
919405490001 6011ABC100006832                                         
919405490001 6011ABC100010826                                         
/*                                                                     
//IN2      DD *                                                       
             6011ABC100005032 ¬B¬¬ NT                                 
             6011ABC100006832 ¬B¬¬ NT                                 
             6011ABC100010826 ¬B¬¬ NT                                 
             6011ABC100014141 ¬B¬¬ NT                                 
/*                                                                     
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//BOTH     DD SYSOUT=*                                                 
//TOOLIN DD *                                                         
COPY FROM(IN1) TO(TMP1) USING(CPY1)                                   
COPY FROM(IN2) TO(TMP1) USING(CPY2)                                   
SPLICE FROM(TMP1) TO(BOTH) ON(13,16,CH) WITH(28,10) WITH(50,1) -       
                    USING(CPY3)                               
/*                                                           
//CPY1CNTL DD *                                               
 INREC BUILD=(1:1,28,49:C'11',30X)                           
/*                                                           
//CPY2CNTL DD *                                               
 INREC BUILD=(13:13,26,49:C'22',30X)                         
/*                                                           
//CPY3CNTL DD *                                               
 OUTFIL FNAMES=BOTH,INCLUDE=(49,2,CH,EQ,C'12'),OVERLAY=(49:2X)
/*                                                           
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Jan 07, 2008 6:02 pm    Post subject:
Reply with quote

If both the files are of same attributes then
Code:
//IN1      DD  DSN=file-1                                                             
//         DD  DSN=file-2
//BOTH     DD SYSOUT=*                                                 
//TOOLIN DD *                                                         
SPLICE FROM(IN1) TO(BOTH) ON(13,16,CH) WITH(28,10)                   
/*                                                                     
Back to top
View user's profile Send private message
ayansau

New User


Joined: 22 Jun 2007
Posts: 42
Location: Chennai

PostPosted: Tue Jan 08, 2008 10:05 am    Post subject:
Reply with quote

Thanks a lot KRISPREM, Its working icon_lol.gif
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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


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