Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to Delete a Dataset ending with Timestamp value?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 35
Location: Pune

PostPosted: Mon Jun 23, 2008 8:00 pm    Post subject: How to Delete a Dataset ending with Timestamp value?
Reply with quote

Hi,
My job creates Datasets which have Date fields attached to the filename
at its end. Eg:
Code:
ABC.DEF.DT080623

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
View user's profile Send private message
References
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1003
Location: Virginia, USA

PostPosted: Mon Jun 23, 2008 8:03 pm    Post subject:
Reply with quote

Sounds like a good reason to use a process date instead of current date.
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 35
Location: Pune

PostPosted: Mon Jun 23, 2008 8:13 pm    Post subject: Reply to: How to Delete a Dataset ending with Timestamp valu
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1641
Location: germany

PostPosted: Mon Jun 23, 2008 8:17 pm    Post subject:
Reply with quote

most sites have an application calendar, which is accessed by all jobs to determine the 'Processing date'.
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 35
Location: Pune

PostPosted: Mon Jun 23, 2008 8:26 pm    Post subject: Reply to: How to Delete a Dataset ending with Timestamp valu
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1641
Location: germany

PostPosted: Mon Jun 23, 2008 8:51 pm    Post subject:
Reply with quote

sounds as if you have a timely problem.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3560
Location: Brussels once more ...

PostPosted: Mon Jun 23, 2008 9:55 pm    Post subject:
Reply with quote

Surely a job for GDG man icon_eek.gif
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 35
Location: Pune

PostPosted: Tue Jun 24, 2008 6:05 pm    Post subject: Reply to: How to Delete a Dataset ending with Timestamp valu
Reply with quote

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
View user's profile Send private message
Robert Sample

Senior Member


Joined: 06 Jun 2008
Posts: 953
Location: Atlanta, GA

PostPosted: Tue Jun 24, 2008 7:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3560
Location: Brussels once more ...

PostPosted: Tue Jun 24, 2008 7:23 pm    Post subject:
Reply with quote

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 icon_evil.gif

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1