View previous topic :: View next topic
|
Author |
Message |
ant1271
New User
Joined: 19 Apr 2007 Posts: 9 Location: Richmond
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
|
ant1271
New User
Joined: 19 Apr 2007 Posts: 9 Location: Richmond
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
|
|