Page 2 of 3

Posted: Thu Jul 13, 2006 7:47 am
by chulett
They work fine, you just need to know how to handle them. :wink:

Posted: Thu Jul 13, 2006 7:51 am
by DSguru2B
True. Very true.
Its just my personal rule of thumb, a space in a file name, a big no no.
Because once this file is built. If it needs to be accessed again in some other job, the sequential file wont read it then due to that pesky space. Or it can, am i missing something here ???

Posted: Thu Jul 13, 2006 8:00 am
by opdas
Hi,
I'm geting the following error at runtime when I use :

output__#DSJobStartDate#_#DSJobStartTime#.txt

Code: Select all

Sequential_File_2: When processing argument -fileWhen processing path: /home/dsetl01/my_prg/tmp/output_2006-07-13_19:23:44.txt is not a valid path name: Invalid hostname: /home/dsetl01/my_prg/tmp/output__2006-07-13_19
but works fine when use :

output__#DSJobStartDate#.txt

We are using AIX 5.3

Posted: Thu Jul 13, 2006 8:12 am
by chulett
DSguru2B wrote:Because once this file is built. If it needs to be accessed again in some other job, the sequential file wont read it then due to that pesky space. Or it can, am i missing something here ???
Yes. :wink:

The sequential stage can handle it just fine, it's the peoples that have the problem. Typically, you just need single quotes around the filename.

Posted: Thu Jul 13, 2006 8:14 am
by chulett
opdas wrote:We are using AIX 5.3
Looks to be specific to AIX. :? Can you check with your UNIX sysadmins and find out if the colon is not allowed in a pathname? Or at least what characters are not allowed?

You might also try creating the file by hand at the command line, see if possibly it's an issue with your version of DataStage...

Posted: Thu Jul 13, 2006 8:24 am
by DSguru2B
If nothing works out, then just simply create the file output.txt and run an After Job Subroutine and do this

Code: Select all

mv /home/dsetl01/my_prg/tmp/output.txt /home/dsetl01/my_prg/tmp/output`date +"%Y%m%d_%H%M%S"`.txt

Posted: Thu Jul 13, 2006 8:24 am
by opdas
well I can create a file at the same path using touch command.

Code: Select all

touch output_2006-07-13_19:28:50.txt

Posted: Thu Jul 13, 2006 8:28 am
by DSguru2B
Can you vi it or cat it.
And the problem is not even due to AIX. Over here i tested it both on Sun and AIX. No problems. Also i checked on wikepedia, the colon is not a forbidden character. So its definately something else.

Posted: Thu Jul 13, 2006 8:45 am
by chulett
opdas wrote:well I can create a file at the same path using touch command.

Code: Select all

touch output_2006-07-13_19:28:50.txt
Then to me it looks like it's coming down to an issue with the ancient version of DataStage you are running. Can you contact Ascential Support and verify?

Posted: Thu Jul 13, 2006 8:50 am
by DSguru2B
Upgrade. Simple as that.
Try the after job subroutine.

Posted: Thu Jul 13, 2006 8:51 am
by opdas
Hi
Can you pl check at the server if its creating a file name with current date-time when you use
output`date +"%Y%m%d_%H%M%S"`.txt
i.e it creates a file name as "output20060713_201435.txt"

or its just creating a file with name :

output`date +"%Y%m%d_%H%M%S"`.txt

Posted: Thu Jul 13, 2006 9:03 am
by DSguru2B
I did. I tested it out.
It creates the file "output20060713_201435.txt"

Posted: Thu Jul 13, 2006 11:32 am
by opdas
There is something seriously wrong .... i need to do an investigation. :roll:

Posted: Thu Jul 13, 2006 12:19 pm
by DSguru2B
Try checking with your unix admin.
Try running this command at the unix level, just copy past my code and see if the file gets created.

Code: Select all

touch output`date +"%Y%m%d_%H%M%S"`.txt 

file_timestamp

Posted: Tue Jul 25, 2006 12:17 am
by sravanthi
chulett wrote::!: There is no problem with either spaces or colons in UNIX pathnames. And using the DSJobStartTimestamp macro in a sequential filename works fine as I just built a quick test job to verify that fact for myself. It will also 'open in the sequential file stage' (aka View Data) just fine as well with the macro in the name.

So, bottom line, something else is wrong. Something in your file or in what you are doing or with your version of DataStage... who knows, but it ain't the macro per se.

:idea: Post some details for us so we no longer need to guess. What operating system? How exactly are you 'opening' the file? Paste the entire error here, don't hand type it, don't paraphrase it. Let's see what happens next.

ps. My test was done using 7.5.1A on H-PUX. Mr 'me too' Kumar_j - what version of DataStage are you running? :?
================================
Hi ,

I want to generate a file with timestamp in this format name_YYMMDDddmmss.xml.

For this prsently i'm using unix script.is there any way to generate from datastage itself.When i use name_#DSJobStartTimestamp#.it is generating as name_2006-07-25 01:09:24.xml.I need name_060725010924.xml.

is there any way for doing this.

thanks!