View previous topic :: View next topic
|
Author |
Message |
Puspojit
New User
Joined: 10 Mar 2008 Posts: 34 Location: Pune
|
|
|
|
Hi,
My job creates Datasets which have Date fields attached to the filename
at its end. Eg:
I use the EZACFSM1 utility to achieve this.
But the problem would arise when the job extends to the early hour of next day of the and the Job is scheduled to be run daily.
For eg:,if the job runs on early hours of today morning and then re-runs on the same day at Night, my job would not execute because the dataset having same name is already present( Since the date hasnt changed).
In this case I would require to delete the dataset before creating it.
How do I do the same?
The piece of code I am using to add date field is
Code: |
//STEP1 EXEC PGM=EZACFSM1,COND=(4,LT)
//SYSOUT DD DSN=&&CNTL,DISP=(,PASS),
// UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
ALTER 'DATASET' -
NEWNAME('DATASET.DT&YR2&MON&DAY')
/*
//STEP2 EXEC PGM=IDCAMS,COND=(4,LE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=&&CNTL,DISP=(OLD,DELETE)
//*
|
Regards,
Puspojit |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Sounds like a good reason to use a process date instead of current date. |
|
Back to top |
|
|
Puspojit
New User
Joined: 10 Mar 2008 Posts: 34 Location: Pune
|
|
|
|
Hi Craq,
Do u mean scheduler date(The date set by job scheduler) as the process date? If yes, can we use the scheduler date over here ?
Pls explain, as I was of the opinion that this utility fetches system date only.......though I am not very sure about it as I havent seen any of such jobs in Production.....Also what date does this utility return if the
Job starts before midnight and ends after midnight?
Regards,
Puspojit |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
most sites have an application calendar, which is accessed by all jobs to determine the 'Processing date'. |
|
Back to top |
|
|
Puspojit
New User
Joined: 10 Mar 2008 Posts: 34 Location: Pune
|
|
|
|
Ok.....I got the Application calendar thing but how can I use it in the
utility as the date parameters are fixed. Pls let me know how can this be achieved through the utility itself ?
Regards....Puspojit |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
sounds as if you have a timely problem. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Surely a job for GDG man |
|
Back to top |
|
|
Puspojit
New User
Joined: 10 Mar 2008 Posts: 34 Location: Pune
|
|
|
|
I do understand that GDG would be the better option over here but is'nt
there any way to issue delete command for datasets having symbolic parameters (the date,ofcourse).
Since it has been decided that the dataset name should have a datefield attached to it, I have to go forward with this process.....the only hope I see is using the TIME part alongside the date to make the dataset
unique........But it would be my last option
Pls suggest a better way out.
Regards,
Puspojit |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
If your system has CA-7 installed, look at CARPROC -- it will allow date substitutions in JCL submitted through CA-7. If not, you may have to write a program to generate the JCL since there's no way I know of in pure JCL to access date fields. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
Since it has been decided that the dataset name should have a datefield attached to it, I have to go forward with this process..... |
Looks like another case of the technically uneducated making technical decisions on behalf of the poor sods that actually do the work
Have you considered using a static dataset throughout the job and only performing the rename at the end of the job, using maybe a REXX step to generate a date and time value which gets passed to an IDCAMS step. |
|
Back to top |
|
|
|