Passing Timestamp as a parameter value

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
bensonian
Participant
Posts: 42
Joined: Tue Nov 22, 2005 2:12 pm

Passing Timestamp as a parameter value

Post by bensonian »

I am trying to pass a 'Timestamp' value from a unix file after removing new line charecter, using a EXECUTE COMMAND' activity and the 'Char(Command Output)' value, which is a timestamp, is being passed to the next job, which has it's parameter type being defined as String.

The job is aborting due to the following reason:

(@Job_Activity_13): Controller problem: Error calling DSSetParam(pEXTR_STRT_TS), code=-4
[ParamValue/Limitvalue is not appropriate]

Could anybody shed some light on it.

Thanks
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Passing Timestamp as a parameter value

Post by sud »

Give this a try, use this derivation in the sequence when passing the parameter to the job:

Code: Select all

Ereplace(Link.$CommandOutput,@FM,'')
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
bensonian
Participant
Posts: 42
Joined: Tue Nov 22, 2005 2:12 pm

Re: Passing Timestamp as a parameter value

Post by bensonian »

sud wrote:Give this a try, use this derivation in the sequence when passing the parameter to the job:

Code: Select all

Ereplace(Link.$CommandOutput,@FM,'')

Still its the same error
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Passing Timestamp as a parameter value

Post by sud »

Ok, please provide the following:

1> The contents of the file
2> The commands (exact) used in the execute command stage and while passing to the job
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
bensonian
Participant
Posts: 42
Joined: Tue Nov 22, 2005 2:12 pm

Re: Passing Timestamp as a parameter value

Post by bensonian »

sud wrote:Ok, please provide the following:

1> The contents of the file
2> The commands (exact) used in the execute command stage and while passing to the job

Contents of file:

"2008-07-24 00:00:01"

command:

cat -n <path name> <filename>

passing to the job: Ereplace(Execute_Command_0.$CommandOutput,@FM,' ')
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Passing Timestamp as a parameter value

Post by sud »

Do only a cat (the -n option will list with record numbers which you don't want). Use this:

Code: Select all

cat <path name>/<filename>


and in ereplace, make sure there is no space between the single quotes.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
bensonian
Participant
Posts: 42
Joined: Tue Nov 22, 2005 2:12 pm

Re: Passing Timestamp as a parameter value

Post by bensonian »

sud wrote:Do only a cat (the -n option will list with record numbers which you don't want). Use this:

Code: Select all

cat <path name>/<filename>


and in ereplace, make sure there is no space between the single quotes.
Appreciate your help sud. Its still the same thing, even after i changed it accordingly.

Controller problem: Error calling DSSetParam(pEXTR_STRT_TS), code=-4
[ParamValue/Limitvalue is not appropriate]
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

are you sure the output from the execute command is "2008-07-24 00:00:01" only and your execute command is not failing.
what is return value of the execute command??
the output from execute command will be a char, and can be passed to a string variable as trim(Execute_Command_0.$CommandOutput)
Last edited by keshav0307 on Fri Jul 25, 2008 11:46 am, edited 1 time in total.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Passing Timestamp as a parameter value

Post by sud »

Hmmm, I am running out of ideas, but let us do one thing.

a> In the sequence where you pass the parameter value to the job, just hardcode the timestamp value and run, if this works then surely the problem is on the sequence side and do point b. If this failed do c.

b> Check what is being sent to the job, there can be many ways of doing it, you can call the basic routine writetolog (something like that)

c> Then the problem is with the job parameter in the job, may be delete it and redefine it or something ... recompile the job (any such illogical thing you can think of ... sometimes jobs do get corrupted).
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
bensonian
Participant
Posts: 42
Joined: Tue Nov 22, 2005 2:12 pm

Re: Passing Timestamp as a parameter value

Post by bensonian »

sud wrote: c> Then the problem is with the job parameter in the job, may be delete it and redefine it or something ... recompile the job (any such illogical thing you can think of ... sometimes jobs do get corrupted).
Option C worked sud. Appreciate your help sud.
Post Reply