IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Issues with multiple OUFILES in the same PDS


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
HammerTime

New User


Joined: 26 Sep 2012
Posts: 14
Location: UK

PostPosted: Fri Feb 07, 2014 7:04 pm
Reply with quote

I seem to have come across some quirky behaviour with the way SORT writes to multiple outfiles in the same PDS, and I wondered if there was a way around this.

Here is an example of what i'm doing:

Code:

//STEP01   EXEC PGM=SORT                                       
//SYSPRINT DD SYSOUT=*                                         
//SYSOUT   DD SYSOUT=*     
//*                                   
//SORTIN   DD *                                                 
MY FAVOURITE TOOL IS A LLLLLL AND MY FAVOURITE NUMBER IS NNNNNN
//*
//SORTOF00 DD DSN=MY.PDS(FILE1),DISP=OLD                       
//SORTOF01 DD DSN=MY.PDS(FILE2),DISP=OLD                       
//SORTOF02 DD DSN=MY.PDS(FILE3),DISP=OLD                       
//*                                       
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(10,10))                   
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10))                   
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(10,10))                   
//*                                                             
//SYSIN    DD *                                                 
       SORT FIELDS=COPY                                         
       OUTFIL FILES=01,                                         
              FINDREP=(INOUT=(C'LLLLLL',C'HAMMER',             
                              C'NNNNNN',C'111111'))             
       OUTFIL FILES=02,                                         
              FINDREP=(INOUT=(C'LLLLLL',C'CHISEL',             
                              C'NNNNNN',C'222222'))             
       OUTFIL FILES=03,                                         
              FINDREP=(INOUT=(C'LLLLLL',C'DRILL ',             
                              C'NNNNNN',C'333333'))             


Now I was hoping to see the PDS members containing the following after the JCL had run:
Code:

MY.PDS(FILE1):   MY FAVOURITE TOOL IS A HAMMER AND MY FAVOURITE NUMBER IS 111111

MY.PDS(FILE2):   MY FAVOURITE TOOL IS A CHISEL AND MY FAVOURITE NUMBER IS 222222

MY.PDS(FILE3):   MY FAVOURITE TOOL IS A DRILL  AND MY FAVOURITE NUMBER IS 333333


What we are actually getting is the final FINDREP being applied to all specified OUTFIL files:
Code:

MY.PDS(FILE1):   MY FAVOURITE TOOL IS A DRILL  AND MY FAVOURITE NUMBER IS 333333

MY.PDS(FILE2):   MY FAVOURITE TOOL IS A DRILL  AND MY FAVOURITE NUMBER IS 333333

MY.PDS(FILE3):   MY FAVOURITE TOOL IS A DRILL  AND MY FAVOURITE NUMBER IS 333333


It works fine if the various OUTFIL FILES are in a different PDS, but never when it's the same PDS.

I'm guessing it has something to do with the way SORT handles multiple outputs in a single PDS, but wondered if there is something we can do to override that? A wider part of our solution relies on the outputs (100 of) to be in the same PDS.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Feb 07, 2014 7:46 pm
Reply with quote

Quote:
'm guessing it has something to do with the way SORT handles multiple outputs in a single PDS,


NOPE it has to do how control info is handled by PDS data management

at open time it will find the TTR where to start writing the records
so multiple open will return the same TTR

and the content will be the same ( clobbered ) for each member created
( the PDS directory at STOW will point to the same TTR for all of them )

only the close will write back the info on the new starting <address>

how the data is clobbered will just depend on the timing of the writes

You will have to write to temporary sequential files
and write the pds members serially.

unless Your organization is willing to migrate to PDSE
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Feb 07, 2014 7:50 pm
Reply with quote

No, it is not quirky, and it is not restricted to SORT.

What you are doing, multiple DD names writing at the same time, should not be attempted with a PDS. The open for each DDNAME will get a separate copy of the directory, and then with each close you will successively lose the data from the previous directory written by the previous close.

You could check if it is possible with a PDSE, or write one sequential file in a format to load data into multiple members of a PDS.

Edit: You beat me enrico. I've always assumed it was the directory getting mashed - I guess same results either way :-)
Back to top
View user's profile Send private message
HammerTime

New User


Joined: 26 Sep 2012
Posts: 14
Location: UK

PostPosted: Fri Feb 07, 2014 8:20 pm
Reply with quote

Unfortunately each PDS member is a reasonable sized JCL, so writing them all out to 1 DS and splitting them into multiple members isn't really practical.

Just given it a go with a PDSE and it worked! Thank you so much.

That is twice in 24 hours you have come to my rescue!
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Feb 07, 2014 9:58 pm
Reply with quote

Hammertime,

You can't use OUTFIL to write to three PDS members in parallel. You can do that with regular sequential data sets or with PDSE members, but NOT with PDS members.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Feb 10, 2014 10:11 pm
Reply with quote

Hello,

If you create a new temporary file for each of the new members and immediately copy them to the target PDS,l wyou will have no problems.

Suggest you back up the entire pds before starting and one by one copy the temporary files into their proper member names, deleting the temporary files to free the temporary space.
Back to top
View user's profile Send private message
HammerTime

New User


Joined: 26 Sep 2012
Posts: 14
Location: UK

PostPosted: Mon Apr 07, 2014 3:26 pm
Reply with quote

Forgot to add closure to this thread. I was indeed able to use PDSE (LIBRARY) and it worked a treat.

Thank you all.

Edit - just realised I had actually responded in Feb to say it had worked. Ah well, happier to sing praises twice than not at all! icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
Search our Forums:

Back to Top