Page 2 of 3

Posted: Tue Mar 06, 2007 8:53 am
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.

Posted: Tue Mar 06, 2007 8:59 am
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?

Posted: Tue Mar 06, 2007 9:04 am
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

Posted: Tue Mar 06, 2007 9:06 am
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 ???

Posted: Tue Mar 06, 2007 9:15 am
by narasimha
A couple of things:

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

Posted: Tue Mar 06, 2007 9:19 am
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? :?

Posted: Tue Mar 06, 2007 10:08 am
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.

Posted: Tue Mar 06, 2007 10:49 am
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

Posted: Tue Mar 06, 2007 10:54 am
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

Posted: Tue Mar 06, 2007 10:57 am
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'.

Posted: Tue Mar 06, 2007 5:22 pm
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.

Posted: Wed Mar 07, 2007 1:06 pm
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.

Posted: Wed Mar 07, 2007 1:19 pm
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

Posted: Wed Mar 07, 2007 5:53 pm
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.

Posted: Wed Mar 07, 2007 8:30 pm
by DSguru2B
As Craig mentioned, maybe a bug :?