ykishore
New User
Joined: 12 Aug 2005 Posts: 53 Location: USA
|
|
|
|
Hi All
Here is my requirement. I've two sequential files with different lengths.
File -1: Lrecl=350 Byte
File -2: Lrecl=23 Byte
I want to have 3 kinds of outout as below.
1)Only Matched cases
2)Only file-1 records
3)Only file-2 records.
Matching Criteria :
----------------------
File-1: 1-3 ,4,3, 7,8, 289,6( total : 23 Byte)
File-2: 1-23
Can you please let me know solution for this Using ICETOOL. |
|
pjnithin
Active User
Joined: 22 Dec 2005 Posts: 116
|
|
|
|
This will give you matching records from file1 and file2 in the same format as of file 1.
Since the key for file 1 is not mentioned properly, I am assuming it this way to make it a 23 byte key.
File-1: from pos-1,3byes ,from pos-4,3bytes, from pos-7,8bytes, from pos-289,9bytes( total : 23 Byte key)
File -2: the whole file of 23bytes is the key.
Code: |
//SORT1 EXEC PGM=ICETOOL
//SYSOUT DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//LIST99 DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=infile 2(of 23 bytes),DISP=SHR
//IN2 DD DSN=infile 1(of 350 bytes),DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=out file(of 350 bytes),DISP=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,23,CH) WITHALL -
WITH(1,350) WITH(352,1) USING(CTL3)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,OVERLAY=(351:C'11')
/*
//CTL2CNTL DD *
OUTFIL FNAMES=T1,OUTREC=(1:1,14,15:289,9,24:15,274,298:298,53,C'22')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,
OUTREC=(1:1,14,15:24,274,289:15,9,298:298,53),
INCLUDE=(351,2,CH,EQ,C'12')
/*
|
Why you need other 2 outputs, when the 2 input files itself have the same info.
Please let me know whether this is hel[ful to you. |
|