View previous topic :: View next topic
|
Author |
Message |
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Hi,
Can someone help me in the following requirement
I have two sequential files of length 133. The file has only values in the first 11 positions all other are spaces
The files looks like
file1..
A0000008060
A0000009980
A0000018060
file2...
A0000008060
A0000009980
A0000018060
A0000019980
A0000108060
A0000109980
The requirement is to delete the records in file2 if they are present in file1.
Now my output should be
A0000019980
A0000108060
A0000109980
Can some one could help me out...
Thanks,
Dharani |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Use the SELECT operator and the NODUPS option of ICETOOL . |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
I tried the following code.
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,1,CH,2,10,ZD) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(133:C'1')
/*
//CTL2CNTL DD *
INREC OVERLAY=(133:C'2')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),
BUILD=(1,132,1X)
/*
It gave me a syntax error in
OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),
Can you pls tell me what is the error in this...
Thanks,
Dharani |
|
Back to top |
|
|
nuthan
Active User
Joined: 26 Sep 2005 Posts: 146 Location: Bangalore
|
|
|
|
Did you used OUT as your dd name? |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Yes Nuthan
IN1 & IN2 are DD names for input file1 and file2
OUT is the DD name for ouput file.
Thanks,
Dharani |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Instead of BUILD=(1,132,1X), try OUTREC=(1,132,1X). |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
no luck for me superk. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
nagarajan,
Use the below code
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=HLQ.ONE.ONX,DISP=SHR
//IN2 DD DSN=HLQ.TWO.TWX,DISP=SHR
//OUT DD DSN=HLQ.T1T2TE,DISP=(,CATLG,DELETE)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,11,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(133:C'1')
/*
//CTL2CNTL DD *
INREC OVERLAY=(133:C'2')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),
BUILD=(1,132)
/*
|
output:
Code: |
A0000019980
A0000108060
A0000109980
|
|
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
use the below control card for CTL3 to get an output with LRECL 133
Code: |
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),
BUILD=(1,132,133:X)
/*
|
|
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Thanks a lot Aaru.
It worked for my requirement
Thanks,
Dharani |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
You are welcome |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Hi Aaru,
Could you help me again with another one.
My requirement is the same to delete the records in file2 if they are present in file1. This should be done based on the emp-no.
First file has
A0000008060
A0000009980
A0000018060
Second one has
0000008060
0000009980
0000018060
0000019980
0000108060
0000109980
The emp-no is of 10 digits length. In first file it is from 2-11 positions
and in the second one it is from 1-10 positions.
Can this be done using icetool. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Nagarajan,
Use this sort card for your new requirement. Try and let me know if this works.
Code: |
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(2,10,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(133:C'1')
/*
//CTL2CNTL DD *
INREC OVERLAY=(2:1,10,132:X,133:C'2')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),
BUILD=(1:2,10,133:X)
/*
|
|
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Aaru, It worked fine for me.. Thanks again for your help |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Glad that i was able to help you |
|
Back to top |
|
|
|