Trying to Append time stamp to file name!!

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
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

Trying to Append time stamp to file name!!

Post by allavivek »

Hi All,

I was trying to generate file name as #filename#_#timestamp#.

I was generating timestamp in sequence using command as
date '+%y%m%d:%H:%M:%S'

while running sequence job is getting aborted and error is
When processing argument -fileWhen processing path: /home/xxxx/xxx/file_100908:14:58:00 .dat is not a valid path name

i tried removing ":" from timestamp but it was saying "controller problem code =-4 "
Then i tried passing timestamp using Erreplace(timestamp,@FM," ")
but still error is coming...

Any suggestions please...

Thank you
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Dont add space to the timestamp. Try this

Code: Select all

Erreplace(timestamp,@FM,"") 
You are the creator of your destiny - Swami Vivekananda
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

Post by allavivek »

anbu wrote:Dont add space to the timestamp. Try this

Code: Select all

Erreplace(timestamp,@FM,"") 
Hi anbu ,

Thaks for reply ..i did tried that option but still error persists..

Thnak you
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Can you post the pathname in this run?
You are the creator of your destiny - Swami Vivekananda
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

Post by allavivek »

anbu wrote:Can you post the filename in this run?
full file name is

#working_dir#/#param_DataFilename#_#Param_timestamp#.dat


param_timestamp is what iam trying to get from sequence..
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Can you post the value of filename from director?

Did you get the same error message after the erreplace change?
You are the creator of your destiny - Swami Vivekananda
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

Post by allavivek »

anbu wrote:Can you post the value of filename from director?

Did you get the same error message after the erreplace change?
yes anbu ,

But i tried changing the datatype of timestamp param to string in job parameters and it worked...

Do we should have a datatype of string for timestamp value??

I was unable to sort why does error came and why does error gone??

thank you..
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Timestamp data type is not available for the job parameter. You have to pass date and time separately or as a string
You are the creator of your destiny - Swami Vivekananda
Post Reply