Problems with Job Parameters and Sequence Job

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
RobJ
Charter Member
Charter Member
Posts: 19
Joined: Tue May 10, 2005 8:22 am
Location: Bracknell, England

Problems with Job Parameters and Sequence Job

Post by RobJ »

I'm having problems with passing a string parameter from a job sequence into a parallel job.

The value I want to pass is obtained from a file in the AIX file system, so I'm trying to use an Execute Command activity, whose output is the required parameter value.

So far so good, the Execute Command Activity works fine and the output is as expected (in fact, a string representation of a date: 12.09.2005)

The problem comes when I try to add a Job Activity and to populate the job parameter TESTDATE with the expression Execute_Command_1.$CommandOutput.

I get the error:

CallParamTest..JobControl (@Job_Activity_0): Controller problem: Error calling DSSetParam(TESTDATE), code=-4
[ParamValue/Limitvalue is not appropriate]


I do have a workaround, which is to replace the simple expression Execute_Command_1.$CommandOutput with the complex one OConv(IConv(Execute_Command_1.$CommandOutput,"D4.DMY[2,2,4]"),"D.DMY[2,2,4]")

But that shouldn't do anything except waste a few CPU cycles, should it? It's just taking my string input, converting it to an internal representation and then back to a string in the same format, isn't it? Plus, it wouldn't work if my string parameter didn't happen to be a date.

Any ideas?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Typically a command output has leading and trailing line terminator characters that you need to strip off.
Try using Trim() or Convert() function to remove all Char(10) characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RobJ
Charter Member
Charter Member
Posts: 19
Joined: Tue May 10, 2005 8:22 am
Location: Bracknell, England

Post by RobJ »

ray.wurlod wrote:Typically a command output has leading and trailing line terminator characters that you need to strip off.
Try using Trim() or Convert() function to remove all Char(10) characters.
Thanks Ray. Your suggestion was certainly on the right lines. Not sure what the character in question is (not Char(10) apparently), but it's at the end of the string, so I can strip it off using an expression like

Code: Select all

Execute_Command_1.$CommandOutput[1,len(Execute_Command_1.$CommandOutput)-1]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sometimes the line termination character is converted to a field mark (@FM, or Char(254)) as part of being captured.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RobJ
Charter Member
Charter Member
Posts: 19
Joined: Tue May 10, 2005 8:22 am
Location: Bracknell, England

Post by RobJ »

ray.wurlod wrote:Sometimes the line termination character is converted to a field mark (@FM, or Char(254)) as part of being captured.
Yup, that's it. Convert(@FM,"",Execute_Command1.$CommandOutput) gives mewhat I need. Thanks.
rhys.jones@target.com
Participant
Posts: 24
Joined: Mon Mar 14, 2005 6:42 pm
Location: Minneapolis, Minnesota

Post by rhys.jones@target.com »

RobJ wrote:
ray.wurlod wrote:Sometimes the line termination character is converted to a field mark (@FM, or Char(254)) as part of being captured.
Yup, that's it. Convert(@FM,"",Execute_Command1.$CommandOutput) gives mewhat I need. Thanks.
You guys ROCK!!! I had the exact same problem and your Convert fixed it. THANK YOU! :D
lshort
Premium Member
Premium Member
Posts: 139
Joined: Tue Oct 29, 2002 11:40 am
Location: Toronto

Command Output

Post by lshort »

ray.wurlod wrote:Sometimes the line termination character is converted to a field mark (@FM, or Char(254)) as part of being captured.

Thanks a million....you saved me hours. :-) Your the Man!
Lance Short
"infinite diversity in infinite combinations"
***
"The absence of evidence is not evidence of absence."
Post Reply