//STEP020 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=PKAR.CP000000.PHUK.NDM.GRTV1.ILU.BK,DISP=SHR
//IN2 DD DSN=PKAR.CP000000.PHUK.NDM.GRTV1.ILH.BK,DISP=SHR
//T1 DD DSN=&&T1,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(5,5))
//T2 DD DSN=&&T2,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(5,5))
//CON DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
// DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
//OUT1 DD DUMMY
//OUT2 DD DSN=TANGM.VAU.EXCEPTN,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,15),
// SPACE=(TRK,(100,20),RLSE),
// DCB=(LRECL=22,RECFM=FB,BLKSIZE=0)
//TOOLIN DD *
* IN1->T1: GET ONE RECORD WITH EACH KEY.
* ADD '11' ID IN 17-18.
SELECT FROM(IN1) TO(T1) ON(23,16,CH) FIRST USING(CTL1)
* IN2->T2: GET ONE RECORD WITH EACH KEY.
* ADD '22' ID IN 17-18.
SELECT FROM(IN2) TO(T2) ON(38,16,CH) FIRST USING(CTL2)
* T1/T2->OUT1/OUT2: SPLICE RECORDS WITH MATCHING KEYS.
* GET 1-16 FROM BASE RECORD AND 17 FROM OVERLAY RECORD.
* RESULTING ID IS '12' FOR RECORDS WE WANT IN OUT1 AND
* '11' FOR RECORDS WE WANT IN OUT2.
SPLICE FROM(CON) TO(OUT1) ON(1,16,CH) WITH(23,1) -
KEEPNODUPS USING(CTL3)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,OUTREC=(1,22,23:C'11')
//CTL2CNTL DD *
OUTFIL FNAMES=T2,OUTREC=(1,22,23:C'22')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT2,INCLUDE=(23,2,CH,EQ,C'12'),
OUTREC=(1,22)
OUTFIL FNAMES=OUT1,INCLUDE=(23,2,CH,EQ,C'11'),
OUTREC=(1,22)
/*
Here Infile1 and Infile2 is hvng length 22 and having key-field on (1,16)
now the common records bet'n these 2 files will be present in OUT2 file.
Now my question is can I do the same for 3 files ?
i.e. I want to have a output file which will contain common key field (1,16) only. And output file will contain only key field(1.16)
Please note all the 3 input files are FB and having LRECL = 22 and are having key field on same position.
Hi,
Use the o/p file and the 3 rd file with the same logic so that you can get your desired o/p.You can go for another step of the same or you can code few more control cards to achive your final results.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Now my question is can I do the same for 3 files ?
i.e. I want to have a output file which will contain common key field (1,16) only. And output file will contain only key field(1.16)
It's not clear to me exactly what you want to do (or what you mean by "file balancing"), so please explain it, and please show a good example of the records in each of the three input files and what you expect for output.
File balancing means i want to compare 3 input files on key field and create an output file which will contain common key field among 3 files.
Structure of file1
454638342000556600020060101
454638342000576400020060101
454638342000588900020060101
454638342000598800020060101
454638342000619200020060101
Structure of file2
454638342000556600120060101
454638342000576400220070101
454638342000588900020080101
454638342000598800020090101
454638342000619200020100101
Structure of file3
454638342000556600120110101
454638342000576400020120101
454638342000588900620130101
454638342000598800020140101
454638342000619200020150101
Please note that (1,19) is a key field in all the three files.
Now I want o/p file as:
4546383420005988000
4546383420006192000
I can achieve this in two steps using ICETOOL, but can I do this in only a single step ?
I tried to do it in 1 step but am not successful in doing so..