|
View previous topic :: View next topic
|
| Author |
Message |
Iratxe
New User
Joined: 21 Feb 2006 Posts: 24
|
|
|
|
Hi,
I've got a little problem, I hope you can help me.
I?ve got a file like this:
FILE A:
1111 aa 10 ooooooooooo qq IN
1111 aa 20 ddddddddddd
1111 aa 30 eeeeeeeeeee
2222 aa 10 ooooooooooo qq IL
2222 aa 20 ddddddddddd
2222 aa 30 eeeeeeeeeee
3333 aa 10 ooooooooooo qq IN
3333 aa 20 ddddddddddd
4444 aa 10 ooooooooooo qq IL
4444 aa 20 ddddddddddd
4444 aa 30 eeeeeeeeeee
Now, I only want those records that have IN at the end, so, I've done the following selection:
OUTFIL INCLUDE=(94,2,CH,EQ,C'IN'),FNAMES=OUT01
OUTFIL INCLUDE=(94,2,CH,NE,C'IN'),FNAMES=OUT02
And I've obtained this in out01:
1111 aa 10 ooooooooooo qq IN
3333 aa 10 ooooooooooo qq IN
The following step, and this is my problem,is how to take out from file A the records that have the same field in the first positions.
I've tried to do the following:
1) Join the two files, and try to select the dups, but it doesn?t work, or I?m doing it bad.
//OUT03 DD DSN=SIC.DESA.WRK.HYSYG010.IN,DISP=OLD
// DD DSN=SIC.DESA.WRK.HYSYG010.NIN,DISP=OLD
.
.
.
SELECT FROM(OUT03) TO(OUT04) ON(1,6,PD) ALLDUPS
SELECT FROM(OUT03) TO(OUT05) ON(1,6,PD) NODUPS
I ?don?t know if I?ve explained, if not tell me and I?ll try to do it better
Thanks,
Iratxe |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I'm guessing you want the following for output:
OUT3
1111 aa 10 ooooooooooo qq IN
1111 aa 20 ddddddddddd
1111 aa 30 eeeeeeeeeee
3333 aa 10 ooooooooooo qq IN
3333 aa 20 ddddddddddd
OUT4
2222 aa 10 ooooooooooo qq IL
2222 aa 20 ddddddddddd
2222 aa 30 eeeeeeeeeee
4444 aa 10 ooooooooooo qq IL
4444 aa 20 ddddddddddd
4444 aa 30 eeeeeeeeeee
Is that correct? If so, then you need to use the SPLICE operator of DFSORT/ICETOOL rather than the SELECT operator. Tell me the RECFM and LRECL of each input file and I'll show you how to get what you want.
If that's not what you want for OUT3 and OUT4, then show what you do want. |
|
| Back to top |
|
 |
Iratxe
New User
Joined: 21 Feb 2006 Posts: 24
|
|
|
|
Yes it?s.
The LRECL is 281, and the RECFM is 33000. The first filed, what I've wrote as "1111", in the real file is a (1,6,PD), the field "aa" is a (7,2,CH), and the fiels "IN" is a (94,2,CH).
I'd like to know more about SPLICE, where can I get more information?
Thanks very much,
Iratxe |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Iratxe,
You can find complete information on the SPLICE operator of DFSORT's ICETOOL in "z/OS DFSORT Application Programming Guide" which you can access, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links
Here's a direct link to the information:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/6.13?DT=20050222160456
You can use a DFSORT/ICETOOL job like the one below to do what you asked for. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's KEEPBASE function. Only DFSORT has this function, so if you don't have DFSORT, you won't be able to use it. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:
Use [URL] BBCode for External Links
| Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/281)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD DSN=... output file1 (FB/281)
//OUT2 DD DSN=... output file2 (FB/281)
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT1) ON(1,6,PD) KEEPBASE -
WITHALL WITH(1,281) USING(CTL2)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,281,282:94,2)
/*
//CTL2CNTL DD *
OUTFIL FNAMES=OUT1,INCLUDE=(282,2,CH,EQ,C'IN'),
OUTREC=(1,281)
OUTFIL FNAMES=OUT2,SAVE,
OUTREC=(1,281)
/*
|
|
|
| Back to top |
|
 |
Iratxe
New User
Joined: 21 Feb 2006 Posts: 24
|
|
|
|
Thanks very much, it works ok.
Iratxe |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|