Loop final value not numeric

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
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Loop final value not numeric

Post by devidotcom »

Hi All,

Please find the error message I get when I use the numeric loop in the sequence.

Controller problem: Loop final value not numeric

I have the below stages
Command Execute -> Start Loop -> Job Activity -> End Loop

I execute the command wc -l <filename>|awk '{print $1}' in the command execute stage and want to read this count of lines in the Start loop thats when I get the error message.

I have tried
Trim(Convert(@FM," ",#Command_Execute.$CommandOutput#))

But this did not work and gives the below error.

Controller problem: Loop final value not numeric (Trim(Convert(@FM," ",3) - cannot execute

I have searched for the forum but that did not help me.
Please help.

Thanks
ersunnys
Participant
Posts: 29
Joined: Wed Sep 13, 2006 1:39 pm
Location: Singapore

Re: Loop final value not numeric

Post by ersunnys »

Hi,

Please trying after removing space after @FM as below

Trim(Convert(@FM,"",#Command_Execute.$CommandOutput#))
devidotcom wrote:Hi All,

Trim(Convert(@FM," ",#Command_Execute.$CommandOutput#))
Regards,
Sunny Sharma.
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Thank you for your reply.

I tried removing the space but that did not succeed.
Trim(Convert(@FM,"",#Fetch_NumTblNames.$CommandOutput#))

Got the below error message.
Controller problem: Loop final value not numeric (Trim(Convert(@FM,"",3) - cannot execute

Please help
Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why is the activity variable contained in sharp signs?

Build the expression with the expression editor. You should get something like

Code: Select all

Convert(@FM:" ", "", Fetch_NumTblNames.$CommandOutput) 
I believe that your reference to a non-existence stage variable is returning -3 (DSJE.BADPARAM) and it's that which is causing the 3 to appear.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
QuestExpert
Participant
Posts: 22
Joined: Tue Mar 13, 2007 10:10 am

Pass Number of lines (as Numeric) from file to Numeric Loop

Post by QuestExpert »

ray.wurlod wrote:Why is the activity variable contained in sharp signs?

Build the expression with the expression editor. You should get something like

Code: Select all

Convert(@FM:" ", "", Fetch_N ...[/quote]


Ray, Was right your Variable should not have surrounded by ##; 
Tanks to all of you for Posting and helping us out.
it work for me like below.

[b]Trim(Convert(@FM,"",Read_Number_of_Lines.$CommandOutput))[/b]
Quest Expert
Post Reply