Execute Command Stage in Sequencer Job

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

Execute Command Stage in Sequencer Job

Post by jpnrd »

Hi,

I Unloaded the max of timestamp in to a text file using sequential stage. I need to pass this as job parameter to next job using sequencer job. For this I used Execute command stage and in the command line I tried 'Cat Textfilepath.txt'. In the next job activity I specified job parameter values as Execute Command Return Value. But the job is getting aborted every time.

the warning it is showing is

SequencerTest1..JobControl (@Job_Activity_3): Controller problem: Error calling DSRunJob(Px_Etl_Unld_Pc_PolicyPeriod_TodaysDate1), code=-2
[Job is not in the right state (compiled and not running)]

I tried using 'Field Textfilepath.txt' now the second job is getting aborted.

Am I doing it in correct way. If not please correct me. I am new to this sequence jobs so please help me.
Thanx
Jaya
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Above error message means that job was already running when the Sequence tried to run it.
You are the creator of your destiny - Swami Vivekananda
jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

Post by jpnrd »

Yes, you are right. I am sorry for posting that warning. The problem is job is getting aborted.
Thanx
Jaya
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'd have to post your abort message and be specific about which job is aborting if you wanted anyone to be able to help.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

Post by jpnrd »

The Second job to which I am passing timestamp is getting aborted. The abort message I am getting in sequence job is

SequencerTest1..JobControl (DSWaitForJob): Job Px_Etl_Unld_Pc_PolicyPeriod_TodaysDate1 has finished, status = 3 (Aborted)
Thanx
Jaya
jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

Post by jpnrd »

I went to the Job Log and Job log is saying this error messge

SQLServer_Enterprise_0,0: [IBM (DataDirect OEM)][ODBC SQL Server Driver][SQL Server]Conversion failed when converting datetime from character string.
Thanx
Jaya
jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

Post by jpnrd »

Yes, I just posted it above. I want to know is my approach to get the timestamp value to a variable correct or not?
Thanx
Jaya
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

This is probably due to an invalid timestamp format. What is your timestamp format?
You are the creator of your destiny - Swami Vivekananda
jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

Post by jpnrd »

2010-05-26 03:34:44.450
Thanx
Jaya
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It is *a* correct approach, yes. However, it seems your second job doesn't like the timestamp format you've passed in.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

Post by jpnrd »

But when I hardCode the same timestamp Value in Sql Sever Stage Its working fine why is that happening?
Thanx
Jaya
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

I think i faced same issue before. If you are using cat Textfilepath.txt, you will get a newline char along with timestamp.

Try this

Code: Select all

printf $(<Textfilepath.txt)
You are the creator of your destiny - Swami Vivekananda
jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

Post by jpnrd »

I tried Printf Still the same problem exists. Any other suggestions Please
Thanx
Jaya
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Check the director log and find what timestamp value is passed to the job?

What is the data type of timestamp parameter used in job Px_Etl_Unld_Pc_PolicyPeriod_TodaysDate1?
You are the creator of your destiny - Swami Vivekananda
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

I missed quotes in the above command. Without quotes you will get only date and not the timestamp part. Try with quotes as here

Code: Select all

printf "$(<Textfilepath.txt)"
You are the creator of your destiny - Swami Vivekananda
Post Reply