Page 1 of 1

how to add timestamp to a file name ?

PostPosted: Wed Sep 28, 2011 11:14 am
by richagoyal
Hi,

I have a file name , i want to suffix the file name with time stamp ! i prefer to do through sort/icetool !

Can anyone help me in this ?
eg :
file name : as.dbx.bd
time stamp : 2011-09-28-01.32.04.623397
new file name should be as.dbx.bd.2011-09-28-01.32.04.623397

Re: how to add timestamp to a file name ?

PostPosted: Wed Sep 28, 2011 11:44 am
by BillyBoyo
First, look at the rules for forming dataset names (on common mainframe operating systems...). Your desired name breaks several. Is the "file" under a different operating system?

Second, why do you want this (or what you could get with valid names) on your dataset name? We might have suggestions if we know the purpose.

Third, how were you thinking you might be able to do it in sort/icetool?

Re: how to add timestamp to a file name ?

PostPosted: Wed Sep 28, 2011 12:54 pm
by richagoyal
Hi,
i have a file that is generating every week the file is not containing any date value so by looking the file we cant make out this is which run file.
Requirement is the file name should have timestamp added to it as suffix.

please let me know how we cant do it !

Re: how to add timestamp to a file name ?

PostPosted: Wed Sep 28, 2011 1:19 pm
by richagoyal
yes the file is in different operating system , I am getting the file to mainframe and then I need to change the file name

Re: how to add timestamp to a file name ?

PostPosted: Wed Sep 28, 2011 5:29 pm
by steve-myers
How is the data getting to the MVS system? If you are using FTP it is very easy to create a valid MVS dataset name.

Re: how to add timestamp to a file name ?

PostPosted: Wed Sep 28, 2011 6:41 pm
by BillyBoyo
Your intended name is not valid for the mainframe.

Once you come up with a valid one, you can think about how to generate it. What is the source of your proposed timestamp? If it is weekly, do you need much beyond the actual date for recognitions, and then a look at the catalog when you need to know exactly? Nice if it was a business date, otherwise you end up in a pickle on a re-run.