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
 

 

Issues with multiple OUFILES in the same PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Issues with multiple OUFILES in the same PDS
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Fri Feb 07, 2014 7:46 pm    Post subject: Reply to: Issues with multiple OUFILES in the same PDS
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Feb 07, 2014 7:50 pm    Post subject: Reply to: Issues with multiple OUFILES in the same PDS
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Feb 10, 2014 10:11 pm    Post subject:
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    Post subject:
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    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 ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts Faccing issues while creating a GDG V... sravindra_s JCL & VSAM 5 Thu Jun 23, 2016 11:26 am


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