passing timestamp

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
vinsashi
Participant
Posts: 150
Joined: Mon Aug 20, 2007 4:52 am
Location: singapore

passing timestamp

Post by vinsashi »

Hi,
I have to pass timestamp as job parameter how pass this one for particular job.

Thanks
v..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You... define it as a parameter and "pass" it. Not really sure what your issue might be here, can you elaborate on what you've tried and what issues you've had? :?

Also let us know where / how you are running this job, that can affect the answer as to how exactly this is done.
-craig

"You can never have too many knives" -- Logan Nine Fingers
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Enclose timestamp within quotes when you are passing as a parameter to the job

Code: Select all

dsjob <DS_LOGIN> <DS_DOMAIN> <DS_SERVER> -run -param ts="2010-06-22 00:00:00"
You are the creator of your destiny - Swami Vivekananda
vinsashi
Participant
Posts: 150
Joined: Mon Aug 20, 2007 4:52 am
Location: singapore

Post by vinsashi »

i have one job. and i am using bizdate job parameter in job.that bizdate parameter should be like this 2010-12-01 05:05:03 like this. for bizdate i specified datatype is date at job parameters.at the time running its not taking these type of values 2010-12-01 05:05:03

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

Post by anbu »

Define the parameter bizdate as String
You are the creator of your destiny - Swami Vivekananda
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Post by thanush9sep »

I just run a sample job in that i gave job parameter as

Bizdate as Date datatype and value as 2010-10-10 if i type a wrong date it does not accept
Biztime as Time datatype and value as 05:05:05.

I used a row generator to generate 10 rows and passed these parameter to target date and time column respectively(transformer stage). Without any conversion function it works fine.

You just need to a concatenation to get Timestamp value but you have to use type conversion function.

The advantage of using this is that you don't have to check for valid date and valid time. If you pass it as string then you have to check whether it is valid date or not.

And I wounder why are you hardcoding the bizdate in the job parameter. You should be passing it from the sequence.
Regards
LakshmiNarayanan
Post Reply