View previous topic :: View next topic
Author
Message
bijoybabu83 New User Joined: 15 Jan 2007Posts: 36 Location: Kerala
I have two files, Both 133 Bytes. I need to compate these two files.
1. Compate the two files FILE1 and FILE2 based on key on (9,45) of both files.
2. If a mathching key is found, then need to move a) 1 TO 88 of FILE1 to output file and then move 89,10 of FILE2 to output file.
Can anyone help me in writing an ice tool for this.
Back to top
dbzTHEdinosauer Global Moderator Joined: 20 Oct 2006Posts: 6966 Location: porcelain throne
Quote:
Can anyone help me in writing an ice tool for this.
could take a while. No one has ever asked for a solution to this problem.
Back to top
dejunzhu Active User Joined: 08 May 2008Posts: 390 Location: China
SPLICE function of ICETOOL can achieve the expecting result.
You can refer to DFSort manual for the usage of SPLICE.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
bbb,
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Back to top
bijoybabu83 New User Joined: 15 Jan 2007Posts: 36 Location: Kerala
Thank you Dejhunzu and Frank Yeagar for your help.
I created an ICETOOL for this myself. It is working perfectly now.
Please see the code :-
Code:
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPUT1 DD DISP=SHR,DSN=IHC$017.CBF.EXTRACT.FIL99
//INPUT2 DD DISP=SHR,DSN=IHC$017.CBF.EXTRACT.FIL98
//T1 DD DSN=&&EXT100,
// DISP=(,PASS),
// UNIT=SYSDA,
// SPACE=(133,(13,1),RLSE)
//T2 DD DSN=&&EXT200,
// DISP=(,PASS),
// UNIT=SYSDA,
// SPACE=(133,(13,1),RLSE)
//CONCT1 DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
// DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
//OUTPUT1 DD DSN=IHC$017.CBF.EXTRACT.FIL100,
// DISP=(,CATLG,DELETE),
// UNIT=SYSALLDA,
// SPACE=(CYL,(50,100),RLSE)
//TOOLIN DD *
COPY FROM(INPUT1) TO(T1) USING(CTL1)
COPY FROM(INPUT2) TO(T2) USING(CTL2)
SPLICE FROM(CONCT1) WITHALL -
ON(9,45,CH) -
ON(9,45,CH) -
WITH(64,10) -
TO(OUTPUT1)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1:1,8,9:9,45,54:79,10,70X)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(8X,9:9,45,10X,64:79,10,60X)
/*
This jcl is perfectly working for me.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
You should NOT use that type of concatenation with referback as it can run afoul of a system restriction that can cause records to be lost. Instead, it's better to use a one MOD temp data set like this:
Code:
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPUT1 DD DISP=SHR,DSN=IHC$017.CBF.EXTRACT.FIL99
//INPUT2 DD DISP=SHR,DSN=IHC$017.CBF.EXTRACT.FIL98
//T1 DD DSN=&&EXT100,
// DISP=(MOD,PASS),
// UNIT=SYSDA,
// SPACE=(133,(13,1),RLSE)
//OUTPUT1 DD DSN=IHC$017.CBF.EXTRACT.FIL100,
// DISP=(,CATLG,DELETE),
// UNIT=SYSALLDA,
// SPACE=(CYL,(50,100),RLSE)
//TOOLIN DD *
COPY FROM(INPUT1) TO(T1) USING(CTL1)
COPY FROM(INPUT2) TO(T1) USING(CTL2)
SPLICE FROM(T1) WITHALL -
ON(9,45,CH) -
ON(9,45,CH) -
WITH(64,10) -
TO(OUTPUT1)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1:1,8,9:9,45,54:79,10,70X)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(8X,9:9,45,10X,64:79,10,60X)
/*
For more on the system restriction, see the second bullet at this link:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA40/1.8.3.1?SHELF=&DT=20090527161936&CASE=
Back to top
bijoybabu83 New User Joined: 15 Jan 2007Posts: 36 Location: Kerala
Thank you so much franked. That worked.
Back to top
Please enable JavaScript!