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
 
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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

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