getting execute command stage output
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 41
- Joined: Sun Mar 09, 2008 8:12 pm
getting execute command stage output
Hi,
I have execute command activity stage from which I am getting accountnumbers. How to pass all the accounts in to a user variable using user variable activity.
I tried using Field(Execute_Command_83.$CommandOutput,@FM,1) in the expression of user variable activity.
But it is only giving first account only. How to get all the account numbers which are result of execute command activity stage.
I have execute command activity stage from which I am getting accountnumbers. How to pass all the accounts in to a user variable using user variable activity.
I tried using Field(Execute_Command_83.$CommandOutput,@FM,1) in the expression of user variable activity.
But it is only giving first account only. How to get all the account numbers which are result of execute command activity stage.
k.v.sreedhar
First you'd have to explain for us how you want them retrieved from the command output. Do you want to bring them out all at once? In some sort of delimited list? One at a time because you are looping? It would be helpful to know how the list is being generated and what you plan on doing with it so we can steer you in the right direction.
Not a lot of information to go on at the moment, I'm afraid.
Not a lot of information to go on at the moment, I'm afraid.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 41
- Joined: Sun Mar 09, 2008 8:12 pm
I've been wondering... perhaps we don't understand what "all at once" means. You use Field() to get them one at a time, using that with a proper 4th argument would be the same as simply taking $CommandOutput as a string. I'm guessing that's not really what you want.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 41
- Joined: Sun Mar 09, 2008 8:12 pm
Hi,
Business give me a query to get the accountnumbers. the query will be dynamic. I am extracting the query into a file using a parllel job. That file contains the accountnumbers.
I am using execute command stage to extract those accountnumbers from file. I need to pass these accountnumbers to a parameter value in sequence job to run the subsequent jobs.
which function I need to use to get all these accountnumbers in a uservariable activity stage.
please help me.
Business give me a query to get the accountnumbers. the query will be dynamic. I am extracting the query into a file using a parllel job. That file contains the accountnumbers.
I am using execute command stage to extract those accountnumbers from file. I need to pass these accountnumbers to a parameter value in sequence job to run the subsequent jobs.
which function I need to use to get all these accountnumbers in a uservariable activity stage.
please help me.
k.v.sreedhar
Still not enough information.
What format are they listed in your file? What format do you need them in the parameter? You are making us guess, which is never good. Here's mine!
You have them in a file like this:
111111
222222
333333
And you need them in the parameter like this:
111111,222222,333333
Am I close? If so you don't need Field(), you need to Convert() all @FM to commas. If not, specifics please.
What format are they listed in your file? What format do you need them in the parameter? You are making us guess, which is never good. Here's mine!
You have them in a file like this:
111111
222222
333333
And you need them in the parameter like this:
111111,222222,333333
Am I close? If so you don't need Field(), you need to Convert() all @FM to commas. If not, specifics please.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 41
- Joined: Sun Mar 09, 2008 8:12 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Craig's syntax is correct. I usually do that in a user variable, which means that I have a delimited list to pass to the StartLoop activity.
Note that the final line terminator will mean that you have an empty line at the end. You may like to adjust for this either in the command itself (for example pipe through grep -v to remove lines that begin with CRLF) or in the user variable activity (for example using Left() function).
Note that the final line terminator will mean that you have an empty line at the end. You may like to adjust for this either in the command itself (for example pipe through grep -v to remove lines that begin with CRLF) or in the user variable activity (for example using Left() function).
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.
Hi bobbysridhar,
The below command in execute command activity can give you the output.
Then you can pass the command output to the start loop activity(space as delimiter) and to the job
Command-
Please correct me if I am wrong.
The below command in execute command activity can give you the output.
Then you can pass the command output to the start loop activity(space as delimiter) and to the job
Command-
Code: Select all
cat filename|xargs| tr -d '\n'
-
- Participant
- Posts: 24
- Joined: Wed Apr 16, 2014 11:11 am
- Location: United States
Re: getting execute command stage output
Thanks for your help. Figured it out and it works as I was hoping/expecting.
Thanks again
Thanks again