View previous topic :: View next topic |
Author |
Message |
ptf Beginner
Joined: 03 Jun 2004 Posts: 10 Topics: 5
|
Posted: Thu Dec 09, 2004 12:23 pm Post subject: Changing DSN dynamically |
|
|
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 |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Thu Dec 09, 2004 1:46 pm Post subject: |
|
|
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 |
|
 |
ptf Beginner
Joined: 03 Jun 2004 Posts: 10 Topics: 5
|
Posted: Mon Dec 13, 2004 11:24 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Dec 13, 2004 11:45 am Post subject: |
|
|
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 |
|
 |
|
|