View previous topic :: View next topic
Author
Message
Hari Kumar New User Joined: 28 Jul 2005Posts: 19
Hi,
I have two input files.
Input File F1
1111
2222
3333
5555
7777
8888
Input File F2
3333
4444
8888
9999
O/p file should contain only F2 records that are not in F1
Required O/P
4444
9999
Please provide sysin card for creating output file.
Regards,
Hari
-----------------------------------------------------------------------
"Why Repeat the old errors,if there are so many new errors to commit."
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hi There,
Code:
//STEP0100 EXEC PGM=ICETOOL
//*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
1111
2222
3333
5555
7777
8888
/*
//IN2 DD *
3333
4444
8888
9999
/*
//T1 DD DSN=&T1,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS)
//T2 DD DSN=&T2,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS)
//INT DD DSN=*.T1,DISP=(OLD,PASS),VOL=REF=*.T1
// DD DSN=*.T2,DISP=(OLD,PASS),VOL=REF=*.T2
//FILEB DD SYSOUT=*
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
SORT FROM(INT) USING(CTL3)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,OUTREC=(1,80,C'1')
/*
//CTL2CNTL DD *
OUTFIL FNAMES=T2,OUTREC=(1,80,C'2')
/*
//CTL3CNTL DD *
OPTION EQUALS
SORT FIELDS=(1,4,CH,A)
SUM FIELDS=(81,1,ZD)
OUTFIL FNAMES=OUT,INCLUDE=(81,1,ZD,EQ,3),OUTREC=(1,80)
OUTFIL FNAMES=FILEB,INCLUDE=(81,1,CH,EQ,C'2'),OUTREC=(1,80)
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Hari,
Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
1111
2222
3333
5555
7777
8888
/*
//IN2 DD *
3333
4444
8888
9999
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,4,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(81:C'1')
/*
//CTL2CNTL DD *
INREC OVERLAY=(81:C'2')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'2'),
BUILD=(1,80)
/*
Back to top
Please enable JavaScript!