Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

build file of dups using driver file & transaction file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Wed Dec 19, 2012 10:53 pm    Post subject: build file of dups using driver file & transaction file
Reply with quote

(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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Wed Dec 19, 2012 11:28 pm    Post subject: Reply to: build file of dups using driver file & transac
Reply with quote

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Wed Dec 19, 2012 11:49 pm    Post subject:
Reply with quote

"ALLDUPS" -- what a maroon. icon_redface.gif

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Wed Dec 19, 2012 11:54 pm    Post subject:
Reply with quote

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? icon_sad.gif

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Dec 20, 2012 12:03 am    Post subject:
Reply with quote

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Thu Dec 20, 2012 12:08 am    Post subject:
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Dec 20, 2012 12:37 am    Post subject: Reply to: build file of dups using driver file & transac
Reply with quote

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Thu Dec 20, 2012 1:26 am    Post subject:
Reply with quote

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. icon_lol.gif

I really appreciate your help!
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Dec 20, 2012 11:01 pm    Post subject:
Reply with quote

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. icon_lol.gif

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Thu Dec 20, 2012 11:13 pm    Post subject:
Reply with quote

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! icon_biggrin.gif
Back to top
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Fri Dec 21, 2012 10:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Dec 21, 2012 10:47 pm    Post subject:
Reply with quote

You seem to be running a rather backlevel version of DFSORT. Is JOINKEYS available in it?
Back to top
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Fri Dec 21, 2012 10:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Fri Dec 21, 2012 10:59 pm    Post subject:
Reply with quote

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 ... icon_smile.gif
Back to top
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Fri Dec 21, 2012 11:01 pm    Post subject:
Reply with quote

Finally thought to check the ICE201I line: it's F. I was expecting H.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Dec 21, 2012 11:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Dec 21, 2012 11:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Fri Dec 21, 2012 11:20 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us