View previous topic :: View next topic
|
Author |
Message |
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
(My shop is not up-to-date on PTFs so I can't use the "tricks" PDF for what I'm trying to do. I say that because this is the ICE201I message:
"ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1")
I need to build a file using a driver file and a transaction file, consisting of any and all records on the tranx file whose key match one found on the driver file.
Here is the latest thing I've tried as a test job:
Code: |
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SAVEDD DD SYSOUT=*
//IN DD *
11111111111111111111AAAAA
33333333333333333333AAAAA
55555555555555555555AAAAA
// DD *
11111111111111111111BBBBB
11111111111111111111BBBBB
22222222222222222222BBBBB
22222222222222222222BBBBB
33333333333333333333BBBBB
33333333333333333333BBBBB
44444444444444444444BBBBB
44444444444444444444BBBBB
55555555555555555555BBBBB
55555555555555555555BBBBB
66666666666666666666BBBBB
66666666666666666666BBBBB
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,20,CH) ALLDUP
// |
I expected to get all the odd-numbered records from the second file in the concatenation, but instead I got this:
Code: |
11111111111111111111AAAAA
22222222222222222222BBBBB
33333333333333333333AAAAA
44444444444444444444BBBBB
55555555555555555555AAAAA
66666666666666666666BBBBB |
Can you offer any suggestions?
Code'd |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
With your code I get this. I had to change ALLDUP to ALLDUPS.
Code: |
11111111111111111111AAAAA
11111111111111111111BBBBB
11111111111111111111BBBBB
22222222222222222222BBBBB
22222222222222222222BBBBB
33333333333333333333AAAAA
33333333333333333333BBBBB
33333333333333333333BBBBB
44444444444444444444BBBBB
44444444444444444444BBBBB
55555555555555555555AAAAA
55555555555555555555BBBBB
55555555555555555555BBBBB
66666666666666666666BBBBB
66666666666666666666BBBBB |
|
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
"ALLDUPS" -- what a maroon.
How can I filter out the records from the driver so I get just the records from the second file, like this:
Code: |
11111111111111111111BBBBB
11111111111111111111BBBBB
33333333333333333333BBBBB
33333333333333333333BBBBB
55555555555555555555BBBBB
55555555555555555555BBBBB |
(Thanks for the formatting reminder!) |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
Oh, dear. I didn't quite see everything in your post. I think the business client's breathing down my neck distracted me. Why do they always want everything yesterday?
I tried ALLDUPS and got everything from both files:
Code: |
11111111111111111111AAAAA
11111111111111111111BBBBB
11111111111111111111BBBBB
22222222222222222222BBBBB
22222222222222222222BBBBB
33333333333333333333AAAAA
33333333333333333333BBBBB
33333333333333333333BBBBB
44444444444444444444BBBBB
44444444444444444444BBBBB
55555555555555555555AAAAA
55555555555555555555BBBBB
55555555555555555555BBBBB
66666666666666666666BBBBB
66666666666666666666BBBBB |
What I need for my anxious pacing user is just the matches from the second file, like this:
Code: |
11111111111111111111BBBBB
11111111111111111111BBBBB
33333333333333333333BBBBB
33333333333333333333BBBBB
55555555555555555555BBBBB
55555555555555555555BBBBB |
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Jenifer Lewis,
For starters you are running a version of DFSORT that is out of service. With your level of DFSORT you would need splice to get the desired results.
What is the LRECL and RECFM of both files? Can the driver file also have duplicates? |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
The "real" files (I'm just showing test data) both have the same LRECL (60) and RECFM (FB).
The driver file does not have duplicates. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Jenifer Lewis,
Use the following DFSORT/ICETOOL JCL which will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=Your FB 60 lrecl unique driver file
//IN2 DD DISP=SHR,DSN=Your FB 60 duplicate transaction file
//T1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(X,Y),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,20,CH) WITHALL -
KEEPNODUPS WITH(1,60) USING(CTL3)
//*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,BUILD=(1,20,61:C'Y')
//*
//CTL2CNTL DD *
OUTFIL FNAMES=T1,OVERLAY=(61:X)
//*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,BUILD=(1,60),INCLUDE=(61,1,CH,EQ,C'Y')
//* |
|
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
That worked like a champ -- I assigned OUT to the file in which I wanted the results and bingo: there they were!
One funny thing happened: the first record in the OUT file was just the first twenty bytes of a driver record w/o a match in the tranx file.
But I have what I need for now, and I'm very grateful. Thank you!
This is not the first time this user has made this particular request -- the other times someone else (who has since left the team) satisfied the request using Access. We plan to create a permanent solution (Access would not be useful as it's too hands-on) and this JCL will be part of it.
On a not unrelated note, I'm happy to report our systems programmer informed me he will upgrade our SORT/ICETOOL utilities to reflect the latest PTFs. So maybe the solution will look like a little different -- y'know, something actually "in service." What an amazing development.
I really appreciate your help! |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Jenifer Lewis wrote: |
One funny thing happened: the first record in the OUT file was just the first twenty bytes of a driver record w/o a match in the tranx file. |
I am sorry about that. It's an easy fix. Just remove the KEEPNODUPS parm on your SPLICE statement and you wont have the unmatched records from the driver file.
i.e
Code: |
SPLICE FROM(T1) TO(OUT) ON(1,20,CH) WITHALL -
WITH(1,60) USING(CTL3) |
Jenifer Lewis wrote: |
On a not unrelated note, I'm happy to report our systems programmer informed me he will upgrade our SORT/ICETOOL utilities to reflect the latest PTFs. So maybe the solution will look like a little different -- y'know, something actually "in service." What an amazing development.
I really appreciate your help! |
That's Great. If you had the latest PTF, this is how simple the job would be
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD DISP=SHR,DSN=Your FB 60 duplicate transaction file
//INB DD DISP=SHR,DSN=Your FB 60 lrecl unique driver file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(1,20,A)
JOINKEYS F2=INB,FIELDS=(1,20,A)
REFORMAT FIELDS=(F1:1,60)
//* |
|
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
Yup -- that's exactly how my JCL looked when I learned we were really out of date PTF-wise.
My systems programmer just dropped by to say he has applied all the PTFs and would like me to run some tests before he moves them to PROD. Very exciting! |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
Hmmm. I just ran a test and got RC=16. Seems to be looking for a SORTIN statement?
My JCL:
Code: |
//JS01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//DRIVER DD *
11111111111111111111AAAAA
33333333333333333333AAAAA
55555555555555555555AAAAA
//TRANX DD *
11111111111111111111BBBBB
11111111111111111111BBBBB
22222222222222222222BBBBB
22222222222222222222BBBBB
33333333333333333333BBBBB
33333333333333333333BBBBB
44444444444444444444BBBBB
44444444444444444444BBBBB
55555555555555555555BBBBB
55555555555555555555BBBBB
66666666666666666666BBBBB
66666666666666666666BBBBB
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS FILES=DRIVER,FIELDS=(1,20,A)
JOINKEYS FILES=TRANX,FIELDS=(1,20,A)
REFORMAT FIELDS=(F1:1,60)
/*
// |
Result:
Code: |
BROWSE - SYSOUT JS01 - Page 1 Line 1 Cols 1-80
COMMAND ===> SCROLL ===> CURSOR
******************************** Top of Data ***********************************
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 11:32 ON FRI DEC
OPTION COPY
JOINKEYS FILES=DRIVER,FIELDS=(1,20,A)
$
ICE005A 0 STATEMENT DEFINER ERROR
JOINKEYS FILES=TRANX,FIELDS=(1,20,A)
$
ICE005A 0 STATEMENT DEFINER ERROR
REFORMAT FIELDS=(F1:1,60)
$
ICE005A 0 STATEMENT DEFINER ERROR
ICE056A 0 SORTIN NOT DEFINED
ICE751I 0 C5-K90013 C6-K90013 C7-K90000 C8-K90013 E7-K24705
ICE052I 3 END OF DFSORT
******************************* Bottom of Data ******************************** |
According to the on-line manual:
Code: |
//S1 EXEC PGM=SORT
|//SYSOUT DD SYSOUT=*
|//SORTJNF1 DD DSN=INPUT1,DISP=SHR
|//SORTJNF2 DD DSN=INPUT2,DISP=SHR
|//SORTOUT DD SYSOUT=*
|//SYSIN DD *
|* Control statements for JOINKEYS application
| JOINKEYS FILE=F1,FIELDS=(15,2,A,7,4,A)
| JOINKEYS FILE=F2,FIELDS=(21,2,A,23,4,A)
| REFORMAT FIELDS=(F2:1,70,F1:1,60)
|* Control statements for main task (joined records)
| SORT FIELDS=COPY
|/* |
I changed "OPTION COPY" to "SORT FIELDS=COPY" and got the exact same error.
What am I missing??? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
You seem to be running a rather backlevel version of DFSORT. Is JOINKEYS available in it? |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
Supposed to be -- the systems programmer installed all the backlogged PTFs in a test m/f environment and I'm testing there. |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
I added a SORTIN card so now the SORTIN error is gone, but I'm stil getting the other errors:
Code: |
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5
SORT FIELDS=COPY
JOINKEYS FILES=DRIVER,FIELDS=(1,20,A)
$
ICE005A 0 STATEMENT DEFINER ERROR
JOINKEYS FILES=TRANX,FIELDS=(1,20,A)
$
ICE005A 0 STATEMENT DEFINER ERROR
REFORMAT FIELDS=(F1:1,60)
$
ICE005A 0 STATEMENT DEFINER ERROR
ICE751I 0 C5-K90013 C6-K90013 C7-K90000 C8-K90013 E7-K24705
ICE052I 3 END OF DFSORT |
Makes me wonder about the PTFs the guy swore he'd installed ... |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
Finally thought to check the ICE201I line: it's F. I was expecting H. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Jenifer Lewis wrote: |
Supposed to be -- the systems programmer installed all the backlogged PTFs in a test m/f environment and I'm testing there. |
Perhaps I misinterpreted the "Results" code block in your post of 1100 21 Dec 2012 UTC-6 as showing that you are running DFSORT V1.5? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Jenifer Lewis wrote: |
Finally thought to check the ICE201I line: it's F. I was expecting H. |
Jennifer Lewis,
Your shop is running Z/OS DFSORT V1R5 which is out of service and the max you could get upto is PTF G. G will get you November, 2009 DFSORT functions (JOINKEYS, TOJUL, TOGREG, WEEKDAY, etc) and all of the earlier functions. This function level corresponds to z/OS DFSORT V1R5 PTF UK51706 and z/OS DFSORT V1R10 PTF UK51707.
PTF H is built on DFSORT V1R10 and z/OS DFSORT V1R12. You will have to upgrade your z/OS in order to get to H. |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
Well, there it is. I thought we had upgraded recently, but I must have been confused given all the other upgrades (e.g. DB2, Endevor) that have been going on around here.
I'm told they're talking about 1Q 2013. At least I have the work-around (above).
Thanks for all your help! |
|
Back to top |
|
|
|