Creation of Sequential file with timestamp appended

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Creation of Sequential file with timestamp appended

Post by Sreenivasulu »

Hi All,

I want to create a sequential file whose name would be dynamic. For example i want to create a sequential file which would have the current system timestamp appended to the file. Anyone having any ideas on this

:)
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
use parameters in the file's path tab.
i.e. #DIR_PARAM#/file_name#TMSP_PARAM#.dat
or if you prefer get the parameter to hold the full path or file name
yes this means you need to have it in a paramter prior to running that job.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
raju_chvr
Premium Member
Premium Member
Posts: 165
Joined: Sat Sep 27, 2003 9:19 am
Location: USA

Post by raju_chvr »

<FILENAME>_#DSJobStartDate#

this should also workj if you are not creating the file twice on the same day ....
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

Post by jreddy »

There is a DSJobStartTimeStamp macro too available if you need to capture timestamp and still have no problem running it more than once a day.
raju_chvr
Premium Member
Premium Member
Posts: 165
Joined: Sat Sep 27, 2003 9:19 am
Location: USA

Post by raju_chvr »

I tried it in Windows environment. It aborted as it can't create a file with with ':' in it and the 'DSJobStartTimeStamp' comes back with a value which has ':' in it ..
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Post by ogmios »

raju_chvr wrote:I tried it in Windows environment. It aborted as it can't create a file with with ':' in it and the 'DSJobStartTimeStamp' comes back with a value which has ':' in it ..
Change the ':' to '_' with ereplace afterwards. Put the calculation of the date/time in a controlling job passing the value as a parameter.

Ogmios
Post Reply