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

How to refer unique dataset where last qualifier is unknown


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

New User


Joined: 29 Jul 2008
Posts: 3
Location: Bangalore

PostPosted: Mon Mar 30, 2009 6:12 pm
Reply with quote

eg: dataset ABC.XYZ.T<n> is unique dataset where n is some number and there is no dataset having qualifiers starting with ABC.XYZ. How can it be referred in JCL?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Mar 30, 2009 6:56 pm
Reply with quote

Nehanisha Pandey wrote:
dataset ABC.XYZ.T<n> is unique dataset where n is some number . . .
"hard code" that number in JCL . . .
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 Mar 30, 2009 9:55 pm
Reply with quote

Hello and welcome to the forum,

Quote:
eg: dataset ABC.XYZ.T<n> is unique dataset where n is some number and there is no dataset having qualifiers starting with ABC.XYZ. How can it be referred in JCL?
Other than Anuj's suggestion "hard code" the number, i have no idea what is gong on with this topic. . . icon_confused.gif

What good are "the numbers" if there are no datasets starting with ABC.XYZ?

A more clear descriptoin of what exists and what is needed may generate more usable replies. . .

Maybe i am completely missing something. . .
Back to top
View user's profile Send private message
Nehanisha Pandey

New User


Joined: 29 Jul 2008
Posts: 3
Location: Bangalore

PostPosted: Tue Mar 31, 2009 10:13 am
Reply with quote

hi ppl,

thanks for your prompt replies, I'll explain with a clear example.

My requirement:
Let us assume I have following 5 datasets:
ABC.XYZ.D1.T123
ABC.XYZ.D2.T659
ABC.XYZ.D3.T280
ABC.XYZ.D4.T217
ABC.XYZ.D5.T479

where D* is the parm to be passed from JCL, so we have
ABC.XYZ.D*.T* as fixed format of the dataset available.
Also, the no. follwing T is random, which we don't know.
Depending on the parm passed the respective dataset should be referred in the JCL.And there is only 1 unique dataset for the parm passed.
eg: if the parm passed is D4 then ABC.XYZ.D4.T217 should be referred in the JCL.

Hard coding won't help because then everytime JCL has to be modified. I was looking for some generic method.

I hope i explained well, let me know if you need any further clarification.
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: Tue Mar 31, 2009 10:23 am
Reply with quote

Hello,

Quote:
Also, the no. follwing T is random, which we don't know.
Will this number also be specified by some parm?

Are these D*.T* datasets being read in the process or are they being created?

It may help if you post one step of complete jcl as it needs to exist for a successful execution.

Depending on what the real requirement becomes, using one or more symbolic parameters in a cataloged procedure may be part of a solution. Dynamically creating jcl and submitting this via the internal reader may also be part of a solution.

Once we have a more clear understanding, more suggestions will be posted.

An explanation of the input files and the output files for this process may provide helpful info. An explanation what business function is supported by this could be useful as well.
Back to top
View user's profile Send private message
Nehanisha Pandey

New User


Joined: 29 Jul 2008
Posts: 3
Location: Bangalore

PostPosted: Tue Mar 31, 2009 10:44 am
Reply with quote

hi,

1-the random no. is unknown, can't be passed as parm
2-dataset is available, i.e. we are not creating, it exists already.
3-In the following jcl, basically I am trying to copy from the TAPE dataset to another dataset(being created in JCL).
4-The business requirement being I want to browse the contents of the TAPE dataset created on a certain day(DATE parm is passed from JCL)

the jcl:

Code:
//STEP01  EXEC PGM=SORT                         
//SYSPRINT DD SYSOUT=*                         
//SORTIN   DD DISP=SHR,                         
//            DSN=TPOMCS.ONSITE.STARTSK.&DATE..*
//SORTOUT  DD DISP=(NEW,CATLG,DELETE),         
//            DSN=TPOMCS.ONSITE.STARTSK.TEMP,   
//            SPACE=(80,(100,200)),             
//            LRECL=80,RECFM=FB,               
//            AVGREC=U                         

Let me know if you need any further clarification!

Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
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: Wed Apr 01, 2009 2:13 am
Reply with quote

Hello,

Quote:
Let me know if you need any further clarification!
Yup - sure do. . .

Quote:
1-the random no. is unknown, can't be passed as parm
2-dataset is available, i.e. we are not creating, it exists already.
I do not recall ever seeing an input dataset being opened where the dataset was not known. . . You might generate a dsn for an output file, but if you are going to read it, you have to specify the dataset name.

If you want to copy a tape to dasd to look at the data, determine the dataset name (maybe by using tso/ispf 3.4) and copy to dasd. If the tape has a high volume of data, suggest you only copy data of interest - there may not be space available to copy the entire file and if it is quite large, you will not be able to view it. . .
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Wed Apr 01, 2009 5:23 am
Reply with quote

You will need to write a small program to do the work for you. The easiest way is to write a small Rexx routine to find the data set(s) and do the allocation(s) and call the progam that you would have called directly in the JCL. The other way is to write a different small program to generate the JCL for you. Either way, since there is some unknown external factor that is determining the names, you are going to have to program something to find and use the name.
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: Wed Apr 01, 2009 7:56 am
Reply with quote

Hello,

Rexx for tape. . .?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 01, 2009 8:12 am
Reply with quote

Really poor design, not knowing the input file name.

You'll have to write a program that runs against the file list to get the exact file name and copy the JCL (that you want to use the file with) to the internal reader. The file list can be generated by any of a variety of methods ... pick one, but know the format of the output so your program can be appropriately coded.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Apr 01, 2009 11:40 am
Reply with quote

Quote:
Really poor design, not knowing the input file name.

Not sure that there is enough space on the back of a fag packet to enter a fully qualified dataset name icon_cry.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 01, 2009 4:42 pm
Reply with quote

expat, a bar napkin has plenty of space ... if you write small enough. Reading the written material whilst sober, however, now that's a fish of a different color ...
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Apr 01, 2009 5:06 pm
Reply with quote

Robert Sample wrote:
expat, a bar napkin has plenty of space ... if you write small enough. Reading the written material whilst sober, however, now that's a fish of a different color ...

Aaaaaaaaaaah, and I always thought that the bar napkin was for user documentation and the fag packet was the full design docs.

So that's where I've been going wrong.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 01, 2009 5:14 pm
Reply with quote

and some non-smoker threw away the design-docs.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 01, 2009 5:19 pm
Reply with quote

expat, that explains so much 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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
Search our Forums:

Back to Top