concatenating the target file with the system date

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
santhoshrao.kuttuva
Participant
Posts: 13
Joined: Tue May 12, 2009 6:22 am
Location: Chennai

concatenating the target file with the system date

Post by santhoshrao.kuttuva »

Hi all

i have a requirement as when my job gets run the target file which i specified should return with the current system date.

for eg., i have to get the target file name as " sample 20090405.txt"

Pleas eadvice ... Thanks in advance...
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago

Post by nagarjuna »

Hi ,

Parameterise the target file name and get the value for that parameter from transformer or from OS .
Nag
dinakaran_s
Participant
Posts: 22
Joined: Wed Jul 02, 2008 7:01 am
Location: London

Post by dinakaran_s »

Hi,

Use the Sequencer jobs to run the job and now you can use the below function to define as paramter for the job.

Ereplace(Oconv(@DATE,"D-YMD[4,2,2]"),'-','')

This function will return the system date without '-' (e.x. YYYYMMDD).

Let me know i foyu need anything more.
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

Try using a DS Macro. If the format is acceptable it would be somewhat simpler then the other suggestions.
sample#DSJobStartDate#.txt
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The other typical piece of advice is to write to a static filename and then rename it with the date/timestamp after job. A simple script/batch can do the trick.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply