Page 1 of 1

Problems with Job Parameters and Sequence Job

Posted: Mon Sep 12, 2005 4:23 am
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?

Posted: Mon Sep 12, 2005 4:43 am
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.

Posted: Mon Sep 12, 2005 7:56 am
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]

Posted: Mon Sep 12, 2005 3:41 pm
by ray.wurlod
Sometimes the line termination character is converted to a field mark (@FM, or Char(254)) as part of being captured.

Posted: Tue Sep 13, 2005 1:20 am
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.

Posted: Thu Oct 13, 2005 6:16 pm
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

Command Output

Posted: Wed Jan 18, 2006 2:41 pm
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!