How to dynamically name a file

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
mchaves
Participant
Posts: 50
Joined: Mon Aug 08, 2005 9:59 pm
Location: Sydney
Contact:

How to dynamically name a file

Post by mchaves »

Hi there,

I need to export data into a file that has to have this sort of name "dailyextract_yyyymmdd". How can I do this using a job?

I know that's something to be informed in the filename in the sequential file stage but I am not sure what.

Cheers
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Use either a job parameter or a macro.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
mchaves
Participant
Posts: 50
Joined: Mon Aug 08, 2005 9:59 pm
Location: Sydney
Contact:

Post by mchaves »

Mate,

I would like to use a macro. Could you post an example using macro?


Cheers
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Use the Search facility, there's a lot of commentary on how to use one. For a date, check out macro DSJobStartTimestamp.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
mchaves
Participant
Posts: 50
Joined: Mon Aug 08, 2005 9:59 pm
Location: Sydney
Contact:

Post by mchaves »

Got it!!!

The file name in the sequential file stage should look like :

#Source_Dir#\DailyBadDebt-#DSJobStartDate#.csv
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Well done! And the work you expended in your research will benefit you by establishing the neuronal paths that help you to retain that knowledge.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply