Concatenating Timestamp With a Sequential file
Moderators: chulett, rschirm, roy
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 ???
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 ???
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Hi,
I'm geting the following error at runtime when I use :
output__#DSJobStartDate#_#DSJobStartTime#.txt
but works fine when use :
output__#DSJobStartDate#.txt
We are using AIX 5.3
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
output__#DSJobStartDate#.txt
We are using AIX 5.3
Yes.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 ???
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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?opdas wrote:We are using AIX 5.3
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...
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
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
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.
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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
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?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
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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
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
Om Prakash
"There are things that are known, and there are things that are unknown, and in between there are doors"
"There are things that are known, and there are things that are unknown, and in between there are doors"
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.
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
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
file_timestamp
================================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!
sravanthi