rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
I am trying to achieve the following functionality using ICETOOL. I have two input files.
File 1 :
RECL = 10, RECFM = FB
File 2 :
RECL = 5, RECFM =FB
I wanna filter all the records from File 1 which has the characters (6,2) as '01' and the characters (1,5) of file 1 do not match with all the records in file2.
I am trying to SPLICE option but not able to arrive at the desired results. Can anybody help me with this.
An example input/output is given below for reference
File 1:
1234523422
3243223411
5435201211
3252642643
2643601642
6457601452
2345432624
File 2:
22545
32654
15213
12345
54352
Output File:
2643601642
6457601452 |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Assuming that you don't have duplicate 1-5 values in file1, and you don't have duplicate 1-5 values in file2, you can use a DFSORT/ICETOOL SELECT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/10)
//IN2 DD DSN=... input file2 (FB/5)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/10)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,5,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INCLUDE COND=(6,2,CH,EQ,C'01')
/*
//CTL2CNTL DD *
INREC OVERLAY=(10:X)
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,OMIT=(10,1,CH,EQ,C' ')
/*
|
Alternatively, if you have the Nov, 2009 DFSORT PTF, you can use this DFSORT JOINKEYS job:
Code: |
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/10)
//IN2 DD DSN=... input file2 (FB/5)
//SORTOUT DD DSN=... output file (FB/10)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,5,A)
JOINKEYS F2=IN2,FIELDS=(1,5,A)
JOIN UNPAIRED,F1,ONLY
OPTION COPY
/*
//JNF1CNTL DD *
INCLUDE COND=(6,2,CH,EQ,C'01')
/*
|
|
|