View previous topic :: View next topic
|
Author |
Message |
t1nt1n
New User
Joined: 08 Jul 2005 Posts: 31
|
|
|
|
I have a scenario say my job creates a dataset daily for processing. How can i concatenate the current date to the dataset name ? - this was asked ina interview |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
One of the easiest ways is to set a variable to the date value at the beginning of the job, and then use that variable when the dataset is created:
Code: |
//MYJOB JOB (...),CLASS=X,MSGCLASS=X
//*
// SET MMDDYY=070805
//*
...
//SYSUT2 DD DSN=HLQ1.HLQ2.D&MMDDYY,DISP=(,CATLG,DELETE),...
|
|
|
Back to top |
|
|
brain_s390
New User
Joined: 06 May 2005 Posts: 58 Location: Mumbai
|
|
|
|
Hi,
Here it will be hardcoded in the JCL and daily programmer will need to change the date.
//MYJOB JOB (...),CLASS=X,MSGCLASS=X
//*
// SET MMDDYY=070805
//*
...
//SYSUT2 DD DSN=HLQ1.HLQ2.D&MMDDYY,DISP=(,CATLG,DELETE),...
Instead of this we can do this thru COBOL pgm where it will move system date in the last qualifier of the dataset. |
|
Back to top |
|
|
t1nt1n
New User
Joined: 08 Jul 2005 Posts: 31
|
|
|
|
Thanks Superk & brain S390 |
|
Back to top |
|
|
|