Page 1 of 2

Execute Command Stage in Sequencer Job

Posted: Tue Jul 06, 2010 12:04 pm
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.

Posted: Tue Jul 06, 2010 12:29 pm
by anbu
Above error message means that job was already running when the Sequence tried to run it.

Posted: Tue Jul 06, 2010 12:34 pm
by jpnrd
Yes, you are right. I am sorry for posting that warning. The problem is job is getting aborted.

Posted: Tue Jul 06, 2010 12:44 pm
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.

Posted: Tue Jul 06, 2010 12:49 pm
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)

Posted: Tue Jul 06, 2010 12:53 pm
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.

Posted: Tue Jul 06, 2010 12:57 pm
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?

Posted: Tue Jul 06, 2010 12:59 pm
by anbu
This is probably due to an invalid timestamp format. What is your timestamp format?

Posted: Tue Jul 06, 2010 1:01 pm
by jpnrd
2010-05-26 03:34:44.450

Posted: Tue Jul 06, 2010 1:04 pm
by chulett
It is *a* correct approach, yes. However, it seems your second job doesn't like the timestamp format you've passed in.

Posted: Tue Jul 06, 2010 1:10 pm
by jpnrd
But when I hardCode the same timestamp Value in Sql Sever Stage Its working fine why is that happening?

Posted: Tue Jul 06, 2010 1:16 pm
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)

Posted: Tue Jul 06, 2010 1:27 pm
by jpnrd
I tried Printf Still the same problem exists. Any other suggestions Please

Posted: Tue Jul 06, 2010 1:42 pm
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?

Posted: Tue Jul 06, 2010 1:51 pm
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)"