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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts How can we have the varying lenth of ... Gunapala CN DFSORT/ICETOOL 6 Fri Oct 14, 2016 7:31 pm


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