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

Dynamic dataset allocation


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Fri Jun 08, 2007 12:34 pm
Reply with quote

Morning folks:

I am here with another situation for which I need you guys to put on your thinking cap to help me find a solution.

The story goes like this.

I have a file that would contain "N" number of datasets (sequential) based on a few conditions these files are to be allocated using a job. Since I don't know at any given point of time what the number "N" would be, I could not think of providing intelligence to the JCL to loop around and create them. (I dont know if this can be done at all. Should you know please do give me a heads up).

Since I have a JAVA module executing in an UNIX environment, I thought I would make that loop around and dynamically create the JCL steps corresponding to the "N" number of files by writing into a file(At the end of the loop this file would have "N" jobs in one file). And finally upon completion, the file with the job syntax would be transferred to MVS region where it would be submitted just once to create all the output files.

My problem:
Since "N" files is going to have differnt record formats, how is it possible to have them dynamically created? icon_cry.gif

I wonder if I wrote what I wanted and hope it is not obscure. icon_question.gif Please let me know if you think otherwise and please advise.

Thanks very much

Vik Rajagopalan
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Fri Jun 08, 2007 2:18 pm
Reply with quote

Quote:
Since I have a JAVA module executing in an UNIX environment, I thought I would make that loop around and dynamically create the JCL steps corresponding to the "N" number of files by writing into a file(At the end of the loop this file would have "N" jobs in one file). And finally upon completion, the file with the job syntax would be transferred to MVS region where it would be submitted just once to create all the output files.


The question is when you will get to know the record length and format. if you these by the time you create the jobs in Java , you can supply the attributes as well in the jobs.

I am sort of a layman, can you tell me what you mean by
Quote:
please do give me a heads up).
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: Fri Jun 08, 2007 2:19 pm
Reply with quote

Hello,

It may help if you describe more about what you want to do - rather than how you might solve it. Explaining about the different types of files and how they will be used on the target system would help.

If we understand what kind of precess you need to support, we may be able to offer suggestions on different ways to approach a solution.
Back to top
View user's profile Send private message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Fri Jun 08, 2007 4:58 pm
Reply with quote

Dick et al,

Sorry, I knew I had over communicated then.

This is what is going to happen in the current process. There is a Mainframe environment which is going to classify datasets in the DASD, based on a few rules and data layout, and would eventually write into layout file the names of the datasets that correspond to each data layout. Now lets say we take the categorized file which has "N" number of files, we need to create output datasets for the "N" number of files. The catch here being that the output names for the "N" files would be would be defined in an OMVS environment using JAVA front end.

Please suggest how we can proceed in making the JCL intelligent enough to figure this out.

Hope this helps.

Vik Rajagopalan
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: Fri Jun 08, 2007 6:12 pm
Reply with quote

Hello,
You might consider having the JCL created dynamically, not the allocation.

Many places have processes that deal with variables such as yours and instead of just creating a list of datasets, they create all of the jcl includeing dd statements that have all of the proper dataset names for the current run.

If you search around in these forums, you will find several topics on dynamic dataset allocation. Maybe one will fit your need.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Fri Jun 08, 2007 8:15 pm
Reply with quote

Do you need just to allocate N datasets?
Back to top
View user's profile Send private message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Sat Jun 09, 2007 8:28 am
Reply with quote

Oh yes, I need to allocate "N" number of datasets dynamically. The JCL should be able to know what "N" datasets are AND should be able to really know the attributes too when creating them. Is it possible??
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sat Jun 09, 2007 9:23 am
Reply with quote

Alright ...you can do this with 2 steps.

Here is sample, you can change as per your reqt.

Step 1: Using SORT COPY create below data with input file which has N dataset names.
Input: file with N dataset names
Code:
TEST.DSN.N1
TEST.DSN.N2
TEST.DSN.N3


Output: file with format as below control card for N dataset names
Code:
ALLOC DSNAME(TEST.DSN.N1) NEW RECFM(F) LRECL(10) SPACE(10,10)   
ALLOC DSNAME(TEST.DSN.N2) NEW RECFM(F) LRECL(10) SPACE(10,10)   
ALLOC DSNAME(TEST.DSN.N3) NEW RECFM(F) LRECL(10) SPACE(10,10)


Step 2:

Code:
 //TEST  EXEC  PGM=IKJEFT01,COND=(0,NE)                         
 //SYSTSPRT DD  SYSOUT=*                                       
 //SYSTSIN  DD output from step1     
Back to top
View user's profile Send private message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Sat Jun 09, 2007 12:28 pm
Reply with quote

Dev,

Thanks for the tip but the catch is that the dynamic allocation of the "N" number of files can have different data layouts. So I cannot go ahead with LRECL=10 always. You know what i mean.

Please let me know what you think of this situation.

Vikram
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sat Jun 09, 2007 12:30 pm
Reply with quote

Do you know the file pattern to relate the record length ?
Back to top
View user's profile Send private message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Sat Jun 09, 2007 12:55 pm
Reply with quote

Dev,

In any given point of time, there might a bunch of sequential files in a listing for which we have to create the output defined by the JAVA module. These files could be with varying record lengths as such.

I was thinking if it was possible to have both the input and output together in one file and use the LIKE parameter to dynamically define the datasets.

Would LIKE parameter work only when the storage is controlled by SMS or under all circumstances?

Please let me know

Vik Rajagopalan
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Jun 09, 2007 2:37 pm
Reply with quote

Are the filenames going to change ?

If not, you could set up all of the files as empty and populate them from other systems as and when required, and at the end of the batch cycle renull the files back to empty.
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: Sat Jun 09, 2007 8:26 pm
Reply with quote

Hello,

To repeat my earlier question - is there some reason that the enire set of jcl cannot be created and submitted for each "run"?

I suppose "we don't want to" is a reason, but it seems like all of the info is available then and would remove the need for the dynamic allocation. What was needed would be allocated and things not needed would not be referenced.

If there is something i don't understand, please advise.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sat Jun 09, 2007 10:20 pm
Reply with quote

Quote:
we have to create the output defined by the JAVA module. These files could be with varying record lengths as such


In Java module do you know all the mainframe output dataset names, attributes required? then you can create JCL in Java module and submit from Java module. The job will be executed in mainframe and there is no need to do edit or create JCL in Mainframe.
Back to top
View user's profile Send private message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Sun Jun 10, 2007 9:58 am
Reply with quote

Dick,

If there were "N" datasets to be created in the JCL, the user would end up having to make many changes and stuff like that. Problem is the users are not conversant with the Mainframe at all, the easiest route would be involve them and do very minimal activity. With that thought, I felt it would not be reasonable to have the user to keep changing the datasets in the JCL.

Now, the problem again with what you said would be if I the output datasets in the Mainframe for the "N" datasets were a standard all the time, in a sense that we create it just once and leave it there. In my case, the dataset names would be entered by the user in the online region which is JAVA and could be of any format.

Please let me know if I conveyed things right here.
Back to top
View user's profile Send private message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Sun Jun 10, 2007 10:01 am
Reply with quote

Dev,

That is what I am thinking about now.

Use the LIKE parameter when creating the output dataset name to pick the input dataset attributes and dynamically create datasets commands in JAVA and send the file to MVS using the TSO OGET command and retrieve the file in MVS region and make the user to just submit the job once to create the "N" datasets.

I don't know if this would work but I would give it a shot and would keep you posted on the development.

All,

Thanks so very much for the interest and help extended so far.Appreciate your help indeed.

Thanks much

Vik Rajagopalan
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sun Jun 10, 2007 10:02 am
Reply with quote

vikirum
Did you see my response?
Quote:
In Java module do you know all the mainframe output dataset names, attributes required? then you can create JCL in Java module and submit from Java module. The job will be executed in mainframe and there is no need to do edit or create JCL in Mainframe.
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: Sun Jun 10, 2007 9:03 pm
Reply with quote

Hello,

I believe you've explained your requirement - i also believe i've not been as clear as i might.

What i've been thinking of would have neither user interaction with jcl nor "dynamic dataset allocation" during the run.

Rather than submitting a job that needed to be changed (by the useer) or one that dynamically allocated files/dd statements, what i've done in cases like this if to have all of the jcl created by the remote process before the job is submitted. I've used both complete jcl or had the job execute a catalog PROC, but i used overrides in the submitted jcl to take care of any thing that was "dynamic". When the remote process submits the job, no further cusomization is required.

When i've had to deal with requirements like this, the remote process(es) had all of the info needed and built jcl accordingly.
Back to top
View user's profile Send private message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Mon Jun 11, 2007 11:44 am
Reply with quote

Dev:

I did see the response. If only I knew the output attributes for the "N" datasets before hand I would not even thinking of creating them straight away.

The only information we would have is the Output dataset names corresponding to Input dataset names. And we need to create the output datasets corresponding to the Input datasets.

Please let me know if I made some sense at all. I have been thinking about this for so long that there is a good chance that I may not be at my best when it comes to communicating this coherently. Please advise if there is a disconnect.

Vik Rajagopalan
Back to top
View user's profile Send private message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Mon Jun 11, 2007 11:51 am
Reply with quote

Dick,

Fantastic. What you said seems like an appropriate way for getting this done.

I will use the LIKE parameter and create the JCL in the remote site and see how it works.

Would keep you posted and thanks so much for your time and interest.

Have a good day

Vik Rajagopalan
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Mon Jun 11, 2007 11:51 am
Reply with quote

just a thought... When you do IEBGENER copy you dont have to give the DCB parameters for output file, by default it takes the DCB parameters of input file attribute.
All you need to is N copy steps.
Back to top
View user's profile Send private message
vikirum

New User


Joined: 26 Apr 2007
Posts: 30
Location: Chennai

PostPosted: Mon Jun 11, 2007 11:53 am
Reply with quote

Dev,

Oh that is even a nicer solution. Thanks so much for that. I would give that a shot to see how it works.

Thanks so much for your interest and I appreciate it very much

Have a good day

Vik Rajagopalan
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 Jun 11, 2007 6:02 pm
Reply with quote

You're welcome and good luck icon_smile.gif

We're here if there are "opportunities".

And yup, this
Quote:
I have been thinking about this for so long that there is a good chance that I may not be at my best when it comes to communicating this coherently
does sound familiar icon_smile.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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top