Problem with execute_command activity

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

DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Try giving the parameters in the 'Parameter' box. See what happens. For a routine, you just need a few lines to run DSExecute() to run your command at the OS. Read about DSExecute() in DataStage help.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

sshettar wrote:well in the execute_command stage , in exeCommand tab under command i have given this command
mv #Path#/#OldFile# #Path#/#NewFile#

and in the parameter i have not given anything .
:? What happened to your assurances that you'd put the parameter portion of this command into the Parameter area? What happens when you do that - anything different happen?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Post by sshettar »

Well i'm not able to find the DSExecute function in the routine actuvity stage.

all i can see in DS is DSSendMail, DsSendMailTester,DSJobReport,DSRoutineChecker

Well i can see ExeSH, i tried using this function but doesnt seem to work

i have passes the argument as Command
where in , in the job parameter i have defined Command to be the entire statement ie mv ascential/dastage/70/d02/test.txt ascential/datastge/70/d02/test.arc

in the log it says

WaitForFileTest..JobControl (ExecSH): Executed command: mv /ascential/datastage/70/d02/test.txt /ascential/datastage/70/d02/test.arc
*** No output from command ***

help needed please

Thanks in advance
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

DSExecute() is a Basic command and not a routine. You have to encapsulate it in a routine. Do a search on it to find examples.

When you put the entire path of the two files, does the file get renamed?

How in the world can you be on 7.0 px engine and sitting on windows ???
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

A couple of things:

- Please confirm your OS
- Try your move command on the command prompt and check if it works first.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

sshettar wrote:WaitForFileTest..JobControl (ExecSH): Executed command: mv /ascential/datastage/70/d02/test.txt /ascential/datastage/70/d02/test.arc
*** No output from command ***
That all looks fine. What makes you think it didn't work? There is no 'output from command' when it works properly - it just renames the file. You only get output when it fails. Did you check your actual file? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you've checked and the file still isn't renamed, then you are a victim of the bug I mentioned earlier. It's hard to track down because everything gets translated properly in the log but the actual command run still has the '#'s in it.

You'll need to pursue the Routine Activity route. Or upgrade.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

Well the Routine Activity is working fine now .
But now i want to come up with a little more flexible job . as in i want to parameterize the command so that i can run the same job in order to execute the same task for different files
ie i am using routine activity stage and using ExeSH
this pops up one argument which i al already told u i have given the value as Command
and in the job parameter i have given the entire command as defualt value of command parameter
ie mv ascential/datastage/70/d02/test.txt ascential/datastage/70/d02/test.arc.

now i want to make this path and the old file n new file name as parameter so that i can use this same job sequence for different files.

help needed please

Thanks
Shalini
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Post by sshettar »

Well the Routine Activity is working fine now .
But now i want to come up with a little more flexible job . as in i want to parameterize the command so that i can run the same job in order to execute the same task for different files
ie i am using routine activity stage and using ExeSH
this pops up one argument which i al already told u i have given the value as Command
and in the job parameter i have given the entire command as defualt value of command parameter
ie mv ascential/datastage/70/d02/test.txt ascential/datastage/70/d02/test.arc.

now i want to make this path and the old file n new file name as parameter so that i can use this same job sequence for different files.

help needed please

Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You both dont have to post the same post twice.
Anywho, build a routine. Pass your parameters as arguments. This way it can be used for any number of files. And how are you running a routine in ExecSH. Or you mean your just running the mv command in after job subroutine 'ExecSH'.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If the issue is the parameter, are you sure you are assigning the prarameter correctly? Hope you know that its case sensitive. Use click option to assign parameter.
If you are all sure about that, to check the value, try "echo #parameter#" and check for output in log.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Put just mv in the Command field of the Execute Command activity.

Put the remainder of the mv command in the Parameters field of the Execute Command activity.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sudharma
Participant
Posts: 55
Joined: Wed Jan 24, 2007 10:28 am

Post by sudharma »

shettar,

i had a similar situation. i had to remeove the files from a sepcific path and i using rm -rf #$jpjobParameter#. ( i was passing this #$jpjobparameter# in the paramter , which is beneath the command )

this scenario did not work for me


then , i tired to the entire thing rm -rf /apps/..../......./ in the command itself and it worked.

hope u can try this or else you can execute a script here so that you can move your files from the old path to the new path

thanks
sudharma
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Yeah, you can try to test if it works with hard codes stuff, but for daily run, you need to figure out why parameter value is not getting passes correctly.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

As Craig mentioned, maybe a bug :?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply