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
 

 

How to Get the PS File name
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nemaji

New User


Joined: 29 May 2007
Posts: 22
Location: Pune

PostPosted: Mon Jan 11, 2010 9:34 pm    Post subject: How to Get the PS File name
Reply with quote

Hi..

Can you please suggest that how can we get the PS file name which has generated in the previous steps, in the same job? I want to write that in a work file so that can use it in my application program.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Jan 11, 2010 9:52 pm    Post subject:
Reply with quote

Please explain exactly what you want to do. Along with the requirement to do it in this fashion.

Dataset names are specified in the JCL and remain constant through the job execution lifecycle. Unless you are dynamically generating a dataset name from within a program, which IMHO is pretty bad practice, then the sucessor programs within the same job will need to dynamically allocate the file using the name generated originally.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Jan 11, 2010 10:29 pm    Post subject:
Reply with quote

You can refer back to dataset(s) in previous step(s) by DDNAME.

O.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Jan 11, 2010 10:37 pm    Post subject:
Reply with quote

10 to 1 Anthony is generating a PS file with a date as part of one of the DSN nodes.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Tue Jan 12, 2010 3:29 am    Post subject:
Reply with quote

If your program needs to find the actual dsname allocated to a ddname, search the web for programs that search the TIOT and JFCB control blocks, and of course, have someone at your site do a review of them with you to insure they suit your needs, are correct, and that you are legally allowed to use them for your particular pursuits. As ofer71 mentioned, the step looking for the dsname will need a referback dd to point to the ddname in the step that does the original allocation.
Back to top
View user's profile Send private message
nemaji

New User


Joined: 29 May 2007
Posts: 22
Location: Pune

PostPosted: Tue Jan 12, 2010 10:26 am    Post subject: Reply to: How to Get the PS File name
Reply with quote

Requirement goek like this, i have to make use of the NAME of the PS file generated say in third step. Now, in the fifth i have my application program which is getting called and it will take the PS file NAME also as an Input and based on that it will create few out put files (By suffixing some name at the last qualifier).

So, now, its important to paas the name of the PS file (Third Step) to my application program. Now, here i have to use Appliaction code to achieve this as there are few other task what my code is performing aprt from this.

Now, after generating an PS flat file in step-3, can we store it's NAME in an Work file so that i can read it in my program ?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jan 12, 2010 11:24 am    Post subject:
Reply with quote

You can use LISTALC from within REXX , parse the output and get dataset name.

O.
Back to top
View user's profile Send private message
nemaji

New User


Joined: 29 May 2007
Posts: 22
Location: Pune

PostPosted: Tue Jan 12, 2010 12:04 pm    Post subject: Reply to: How to Get the PS File name
Reply with quote

Ihave never worked on REXX. yes, i have tried iN "TSO LISTALC" in ISPF and ot gives you all the datsets currently allocated.
But, in my case when i will have a new datset allocated in third step, can i write an JCL step to execute "TSO LISTALC" command. even if i do that, i will be getting the list of all the datasets allocated currently, but i require only the one which has generated in the third step...

So, to do this, i will have to store the output of the "TSO LISTALC" in a work file do an SORT out of it, to find the dataset what i am looking for ? am i correct ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jan 12, 2010 12:32 pm    Post subject:
Reply with quote

how is the DSN being 'generated' in the third step?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jan 12, 2010 12:40 pm    Post subject:
Reply with quote

As asked previously, how is the dataset name being generated by the program.

Unless you answer the questions we ask with the information we ask for, rather than what you deem we should be allowed to know, there isn't a lot we can do to help you.

Why not just do
Code:

//STEP03   EXEC PGM=Whatever
//DDNAME   DD DSN=Blah blah blah,DISP=(,CATLG,DELETE),
//           ...... etc etc

//STEP05   EXEC PGM=Whatever2
//DDNAME   DD DSN=Blah blah blah,DISP=SHR
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jan 12, 2010 12:43 pm    Post subject:
Reply with quote

or if the DSN is being magically generated in the third step,
use the same brew of mushrooms to generate the DSN in the 5th step.
Back to top
View user's profile Send private message
nemaji

New User


Joined: 29 May 2007
Posts: 22
Location: Pune

PostPosted: Tue Jan 12, 2010 12:44 pm    Post subject: Reply to: How to Get the PS File name
Reply with quote

Step 1 is the Extract step, Step 2 is the filter step, then three is the SORT step where we gets an PS flat file with all the attributes (like DCB, DSN, DISP) coded in the JCl itself.

And i require the name of this PS flat file to pas on to my application code.
Back to top
View user's profile Send private message
nemaji

New User


Joined: 29 May 2007
Posts: 22
Location: Pune

PostPosted: Tue Jan 12, 2010 12:49 pm    Post subject: Reply to: How to Get the PS File name
Reply with quote

I do not want to make use of the DSN name generated in the Third step to create an new DSN for the next step. i only need to store (or pass) that NAME so that i can apply few logical operations on that in my code.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jan 12, 2010 12:53 pm    Post subject:
Reply with quote

Anyone here have a map of this thread .................... I'm totally lost icon_cry.gif

If, and only if, my interpretations are correct, you can specify any DSN you want for the SORTOUT DD name and then use it later in your job/application without having to do anything clever (aka stupid) anywhere at all.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 12, 2010 12:56 pm    Post subject:
Reply with quote

To summarize all solutions provided :

1. create dataset
2. use IRXJCL with the created dataset allocated
execute LISTALC
get the datasetname
write it to a workfile
3. use the contents of the work file as input

Now was that too difficult?
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Tue Jan 12, 2010 1:13 pm    Post subject: Reply to: How to Get the PS File name
Reply with quote

A much better solution is what ofer71 said near the beginning. Use a ddname with referback and don't worry about the data set name at all. If your data set is a &&TEMP dataset, you might not be able to allocate it dynamically anyway. Just use a ddname and read from that.

(btw, LISTALC is a TSO command, you need IKJEFTxx, not IRXJCL. From IRXJCL you could use BPXWDYN but that is way beyond this discussion)
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 12, 2010 1:21 pm    Post subject: Re: Reply to: How to Get the PS File name
Reply with quote

MBabu wrote:

(btw, LISTALC is a TSO command, you need IKJEFTxx, not IRXJCL. From IRXJCL you could use BPXWDYN but that is way beyond this discussion)


You are right of course.

I understood that the TS "needs" the dataset name to trigger some processing. So refering back doesnt solve that problem.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jan 12, 2010 1:25 pm    Post subject:
Reply with quote

PeterHolland,

experience has shown that just purely providing 'what the TS wants',
is often
  • very poor programming standards
  • illogical
  • illegal - as in audit
  • a question based on lack of experience
  • not really conducive to furthering professionalism
.
The fact that step 3 is a sort step and will have the DSN HARDCODED in the DD statement,
the question arises: Why does the DSN need to be contained in a file?
when we ever receive the answer to that question, a good technical answer will probably be provided.

since your step 1
Quote:
1. create dataset
is a sort step, how do you suppose your step 2
Quote:
2. use IRXJCL with the created dataset allocated execute LISTALC get the datasetname write it to a workfile
would be accomplished?
As your step 3
Quote:
3. use the contents of the work file as input
implies usage of dynamic file allocation and the technical level of the TS implies little knowledge to implement such a process,
which by the way is something systems programmers do, not application programmers - again audit, ease of maintaining of code, etc...

Anthony is not being 'water boarded'. He is only being asked, 'Why does the DSN need to be contained in a file?'.
We have received no answer.
What you have suggested is unnecessarily difficult based on the scarce amount of 'real' information received.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 12, 2010 1:42 pm    Post subject:
Reply with quote

Hello Dick,

are you accusing me of the following ? :

Quote:


experience has shown that just purely providing 'what the TS wants',
is often
very poor programming standards
illogical
illegal - as in audit
a question based on lack of experience
not really conducive to furthering professionalism
.


I never mentioned SORT in my first step, it would be the 3rd step where
the dataset is created.
The TS needs the dataset name of that dataset to trigger processing
in his 5th step, so getting that dataset name could be accomplished by
rexx or clist (suggested in previous comments in this topic).
Dynamic allocation has nothing to do with that.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jan 12, 2010 2:07 pm    Post subject:
Reply with quote

Peter,

I can not see where the OP has said that the dataset triggers anything, merely that he wants to use it in a later step of the same job.

The step creating the dataset is a sort step and as DBZ and I have already stated that the dataset name should be hardcoded.

Even if the OP uses the code below without a dataset name
Code:
//SORTOUT  DD SPACE=(unit,(p,s),RLSE), etc etc

he can still use a referback in a later step without even knowing the system generated dataset name. Maybe if we knew why the dataset name was of such prime importance we could possibly help out here.

Once again, we ask for pertinent information from the poster and all we get back is the mushroom syndrome.
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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