I have a numeric loop. Loop end value is based on the number value in the .txt file
I have a execute command stage to read the value from the .txt file.
Execute command stage is having line this - cat test.txt
e.g. if this file is having the number 10, loop should be executed for 10 times.
in the loop, I am using the expresion - Convert(getCountValue.$CommandOutput,@FM,1)
but I am getting error saying not numeric value.
Would appreciate your suggestions.
Numeric Loop Value
Moderators: chulett, rschirm, roy
Your Convert() syntax is wrong, looks more like Field() syntax.
Assuming you want to strip any field marks from the output.
Code: Select all
Convert(@FM,"",getCountValue.$CommandOutput)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Sounds like you're doing this directly in the Loop Definition "To:" field and, while this can work in a Trigger expression, you cannot do it directly in the Loop Definition. You'd either need to send this in as a job parameter to the Sequence job and use the job parameter in the Start Loop stage or use a Routine Activity rather than the Execute Command stage.
Do basically the same thing in a routine using DSExecute: cat the file and then convert() to strip the field marks before passing back the count as the Answer. Then you can reference that in the Start Loop:
Do basically the same thing in a routine using DSExecute: cat the file and then convert() to strip the field marks before passing back the count as the Answer. Then you can reference that in the Start Loop:
Code: Select all
#RoutineActivityStageName.$ReturnValue#
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: Numeric Loop Value
You can check this one.Ahimsa wrote:I have a numeric loop. Loop end value is based on the number value in the .txt file
I have a execute command stage to read the value from the .txt file.
Execute command stage is having line this - cat test.txt
e.g. if this file is having the number 10, loop should be executed for 10 times.
in the loop, I am using the expresion - Convert(getCountValue.$CommandOutput,@FM,1)
but I am getting error saying not numeric value.
Would appreciate your suggestions.
1) Execute Command (cat file name); In the triggersUse this
Trim(Convert(@FM : @VM : @SM : @TM : @IM : Char(10) : Char(13) : Char(9), ' ', StageName.$CommandOutput))<>''
2) In the start loop you can always use 1 from and StageName.$CommandOutput is for To.
Thanks
Ram