Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 & VSAM
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    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

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
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: 34
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

Global Moderator


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

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: 34
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

Global Moderator


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

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: 8593
Location: Back in jolly old England

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: 34
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

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

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: 8593
Location: Back in jolly old England

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us