IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Use splice operator for two files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ant1271

New User


Joined: 19 Apr 2007
Posts: 9
Location: Richmond

PostPosted: Mon Mar 17, 2008 3:54 pm
Reply with quote

Hi, i would want to use splice operator for two files.
file 1 has loan numbers with record length of 10 bites
file 2 has a record key of 98 bites which also contains the loan number.

file 1
0000001
0000002
0000003

file 2
abcdefgh.........0000001xyz....
(the length of the record is 98 bites as told earlier)
.
.
.

I want to check if there are any ocurance of loan numbers(File 1) in File 2. If the loan number is present, i would want to get rid of that particular record, matching the loan number.

regards
Anant
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Mar 17, 2008 6:01 pm
Reply with quote

ant1271
How should the o/p look like? Should the o/p have the format of FIle-1 or File-2? OR else something diff then File-1 and FIle-2?
Back to top
View user's profile Send private message
ant1271

New User


Joined: 19 Apr 2007
Posts: 9
Location: Richmond

PostPosted: Mon Mar 17, 2008 6:08 pm
Reply with quote

The output will be same as file 2. If file 2 has 1 million records and file 1 has 10,000, then the file 2 should have lesser 10,000 records.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Mar 17, 2008 8:42 pm
Reply with quote

What is the RECFM and LRECL of the input files?

What is the starting position of the loan number in input file2?

Can input file2 have duplicate loan numbers within it (e.g. two 0000001 records?).

Is there some reason you have to use SPLICE? SELECT would probably be a better choice if file2 does NOT have duplicate loan numbers within it.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Mar 17, 2008 8:53 pm
Reply with quote

Code:
//STEP001  EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*     
//DFSMSG   DD SYSOUT=*     
//IN1      DD *           
0000001                   
0000002                   
0000003                   
/*                         
//IN2      DD *           
ASDAD..0000001             
AASDF..0000002             
AASDF..0000003             
SDFAD..0000004             
ASDFG..0000005             
/*
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
 COPY FROM(IN2)  TO(TMP1) USING(CP01)                                 
 COPY FROM(IN1)  TO(TMP1) USING(CP02)                                 
 SPLICE FROM(TMP1) TO(OUT) ON(8,7,CH) WITH(82,1) -                   
                            USING(CP03) KEEPNODUPS                   
/*                                                                   
//CP01CNTL DD   *                                                     
  OUTREC OVERLAY=(81:C'11')                                           
/*                                                                   
//CP02CNTL DD   *                                                     
  OUTREC OVERLAY=(8:1,7,81:C'22')                                     
/*                                                                   
//CP03CNTL DD   *                                                     
  OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,NE,C'12'),BUILD=(1,80)           
/*                                                                   


OUT contains
Code:
SDFAD..0000004
ASDFG..0000005


Hope this is what you wanted!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Mar 17, 2008 9:02 pm
Reply with quote

As I said, SELECT would be a better choice for that particular example, but I'll wait for Anant's answers to my questions before commenting further.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Mar 18, 2008 6:27 pm
Reply with quote

Ohh i hadnt seen this quote from you Frank....
Quote:
Is there some reason you have to use SPLICE? SELECT would probably be a better choice if file2 does NOT have duplicate loan numbers within it.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top