how could i append "Date" to sequential file name
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 6
- Joined: Tue Jan 20, 2009 10:21 pm
how could i append "Date" to sequential file name
Hi,
My requirment is to gnerate csv files like "<date>.csv " from datastageV8 at the target stage. Every time i run the job i need to get the with the todays date as its file name.
I have to get a solution on how to do this entirely in datastage itself.
Thanks in advance
Jose
My requirment is to gnerate csv files like "<date>.csv " from datastageV8 at the target stage. Every time i run the job i need to get the with the todays date as its file name.
I have to get a solution on how to do this entirely in datastage itself.
Thanks in advance
Jose
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
But carries baggage of it's own which may be too heavy. Like, an After routine is already defined for the job or such a simple task as renaming a file seems overly complicated to do it in two places, one fairly hidden in the GUI.
I like using a DS Macro for this;
Everything has a downside and this one is that the file will be overwritten if you run the job more then once a day.
I like using a DS Macro for this;
Code: Select all
#DSJobStartDate#.csv
-
- Participant
- Posts: 36
- Joined: Thu Sep 01, 2005 5:44 am
- Location: Canada
That downside can also be taken care if another macro #DSJobStartTime# is added to the file name like #DSJobStartDate#_#DSJobStartTime#.csvthrobinson wrote:But carries baggage of it's own which may be too heavy. Like, an After routine is already defined for the job or such a simple task as renaming a file seems overly complicated to do it in two places, one fairly hidden in the GUI.
I like using a DS Macro for this;Everything has a downside and this one is that the file will be overwritten if you run the job more then once a day.Code: Select all
#DSJobStartDate#.csv
Thanks & Regards,
Rony
Rony
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
That doesn't work on UNIX 7.5.3, neither does #DSJobStartTimeStamp# for this reason;
Sequential_File_15: When processing argument -fileWhen processing path: /tmp/2009-02-18_07:55:25.csv is not a valid path name: Invalid hostname: /tmp/2009-02-18_07
Are you saying it works on 8.x or yours (rony_daniel)?
Sequential_File_15: When processing argument -fileWhen processing path: /tmp/2009-02-18_07:55:25.csv is not a valid path name: Invalid hostname: /tmp/2009-02-18_07
Are you saying it works on 8.x or yours (rony_daniel)?
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
Server - works
EE - Doesn't work because of the colon. A hardcoded test of a Sequential file name that contains a colon throws the same fatal warning;
and UNIX doesn't care either;
EE - Doesn't work because of the colon. A hardcoded test of a Sequential file name that contains a colon throws the same fatal warning;
Code: Select all
Sequential_File_15: When processing argument -fileWhen processing path: /tmp/todd:todd.csv is not a valid path name: Invalid hostname: /tmp/todd
Code: Select all
touch todd:todd.csv
-rw-rw-r-- 1 dstage 0 Feb 18 08:55 todd:todd.csv
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: