Hi All,
I have to use the loop functionality based on the number of records in a File.
I used the ExecuteCommand activity with wc -l command.
In the start loop, the loop type is Numeric. Start is 1, Step is 1 and End is #Execute_Command_0.$CommandOutput#
I got the following error
LoopingSeq..JobControl (@StartLoop_Activity_3): Controller problem: Loop final value not numeric (13 /myfolder/filename.txt) - cannot execute
I used the UserVariable activity and gave the following derivation Field(Execute_Command_0.$CommandOutput," ",1). I mapped #UserVariables_Activity_13.New# to the Start loop end value and it worked perfect.
I want to find out how I can do this directly with the ExecuteCommand activity output without using UserVariable activity.
TIA
--Rich
Execute Command
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Don't forget that you have to strip the line terminator off.
Code: Select all
Trim(Convert(@FM,"",Execute_Command_0.$CommandOutput))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.