MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Changing DSN dynamically

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
ptf
Beginner


Joined: 03 Jun 2004
Posts: 10
Topics: 5

PostPosted: Thu Dec 09, 2004 12:23 pm    Post subject: Changing DSN dynamically Reply with quote

Is their a way I can change a dataset name within my jcl on the fly? My dilemma is that I have a job where one of the steps runs a Cobol program and creates an output file. I want the output file's dsn to have the particular clients id appended to the dsn. I see there are posts where current date is appended to a dsn, but I would like to pull the client id out of a file, and append it to my dsn. Any ideas?
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Dec 09, 2004 1:46 pm    Post subject: Reply with quote

The fundamental process is still the same.

A few easy ideas come to mind:

1. Execute TSO in a step and use the RENAME command to rename the dataset with the client ID appended.

2. Execute the IDCAMS program and use the ALTER command. Or, if you wish to keep the original dataset and just make a copy, use the REPRO command.

3. Do all of this directly from the COBOL program using dynamic allocation rountines (BPXWDYN, for example).

4. Execute a TSO/E REXX EXEC or CLIST and rename or copy as you see fit.
Back to top
View user's profile Send private message
ptf
Beginner


Joined: 03 Jun 2004
Posts: 10
Topics: 5

PostPosted: Mon Dec 13, 2004 11:24 am    Post subject: Reply with quote

ok, so if I was to use IDCAMS, how would I pull the client id out of the file, and append it to the dsn?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Dec 13, 2004 11:45 am    Post subject: Reply with quote

Quote:

My dilemma is that I have a job where one of the steps runs a Cobol program and creates an output file. I want the output file's dsn to have the particular clients id appended to the dsn.

ptf,

Generate the rename cards for IDCAMS in the cobol program itself. After the completion of your cobol pgm, run the rename step using the control cards created in the cobol pgm

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group