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

Dynamic Sortin DD cards


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hellosri

New User


Joined: 14 May 2007
Posts: 7
Location: CT, USA

PostPosted: Fri Sep 03, 2021 3:59 am
Reply with quote

Hello there,

I have a requirement where my first step REXX creates multiple files based on the number of entries passed in the sysin card and it creates that many number of files dynamically.


For example
Sysin card in REXX step :
F001
F004
F008

Three output files gets created with F001, F004 and F008 as qualifiers.

The above entries can be dynamic and can vary.

In the same job I need to merge all these files together in a sort step so that the merged files can be used as input in the same job later.

How can I dynamically use all of the inputs in SORTIN DD statement so that I can merge them?
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1231

PostPosted: Fri Sep 03, 2021 5:16 am
Reply with quote

Lesson #1:
Learn the difference between “files” in Windows, and “datasets” + “DDnames” in zOS.

What, and where do you plan to create? What may be the need to change the standard DDnames - not clear from your post. Also, hard to imagine the need to change your DSNames - why?
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 512
Location: Denmark

PostPosted: Fri Sep 03, 2021 12:28 pm
Reply with quote

You need to make the first step create a list of the datasets it creates, then this list can be used by the second step. The second step should also be a REXX pgm, which allocates the datasets and invokes SORT.
Another approach would be a second REXX step using the SDSF API to id the dynamically creates datasets, but that is somewhat more complicated.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 512
Location: Denmark

PostPosted: Fri Sep 03, 2021 12:47 pm
Reply with quote

Or perhaps simpler - write an 'outer' REXX which runs the original pgm, then does a TSO LISTALC ALL to id the dynamically created datasets and builds a list from that. Then you do not have to modify the original program.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 510
Location: London

PostPosted: Fri Sep 03, 2021 1:20 pm
Reply with quote

Generate a SORTIN DD card with all the datasets concatenated into a PDS member and use a JCL INCLUDE referring to that in the merge step JCL
Back to top
View user's profile Send private message
hellosri

New User


Joined: 14 May 2007
Posts: 7
Location: CT, USA

PostPosted: Fri Sep 03, 2021 3:17 pm
Reply with quote

Thank you everyone for your response. Kindly excuse not able to use proper English as English is not my primary language. I am going to try out the solution provided my Peter and will let you know. Thanks again very much.

Cheers
Sri
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1231

PostPosted: Sat Sep 04, 2021 3:45 am
Reply with quote

Pete Wilson wrote:
Generate a SORTIN DD card with all the datasets concatenated into a PDS member and use a JCL INCLUDE referring to that in the merge step JCL

JCL INCLUDE is resolved before any other “SORTIN DD card” is generated within the same job.

One can use a temporary dataset, or concatenation of several ones, as concatenated //SYSIN DD
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1231

PostPosted: Sat Sep 04, 2021 3:48 am
Reply with quote

Moderators have deleted my response, but it was the most important issue in this situation: an approach inherited from Windows does not work well in zOS, in 99.99% of all cases.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2815
Location: NYC,USA

PostPosted: Sat Sep 04, 2021 6:18 am
Reply with quote

Already two or more solutions have been provided to try out of which the first one from Willy , I have used in past and works which generates the SORTIN DD via REXX.
So let us be generous to wait for TS to try it and file vs dataset is not any more debatable, one can free to use any term.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
No new posts Dynamic condition checks COBOL Programming 5
No new posts AFRREBLK - Dynamic DSN IBM Tools 9
No new posts Group selective VB records - Trailer ... DFSORT/ICETOOL 16
No new posts Dynamic file read via JCL JCL & VSAM 3
Search our Forums:

Back to Top