IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to Delete a Dataset ending with Timestamp value?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 34
Location: Pune

PostPosted: Mon Jun 23, 2008 8:00 pm
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
Craq Giegerich

Senior Member


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

PostPosted: Mon Jun 23, 2008 8:03 pm
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: 34
Location: Pune

PostPosted: Mon Jun 23, 2008 8:13 pm
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jun 23, 2008 8:17 pm
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: 34
Location: Pune

PostPosted: Mon Jun 23, 2008 8:26 pm
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jun 23, 2008 8:51 pm
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: 8797
Location: Welsh Wales

PostPosted: Mon Jun 23, 2008 9:55 pm
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: 34
Location: Pune

PostPosted: Tue Jun 24, 2008 6:05 pm
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

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Jun 24, 2008 7:06 pm
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: 8797
Location: Welsh Wales

PostPosted: Tue Jun 24, 2008 7:23 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top