Doubt with ExecCommand Activity in sequence
Moderators: chulett, rschirm, roy
Doubt with ExecCommand Activity in sequence
Hi,
I want to remove file in AIX . Iam using a ExecCommand Activity in Sequencer in that ExecCommand tab and in command area I gave command as /DataStage/751A/Ascential/rm *.blp . But it is not taking so I gave in command space rm *.blp and in parameter space I gave a path /DataStage/751A/Ascential. Whil this activity take the parameter and execute the command
Please correct me if Iam wrong .
Thanks,
SomaRaju
I want to remove file in AIX . Iam using a ExecCommand Activity in Sequencer in that ExecCommand tab and in command area I gave command as /DataStage/751A/Ascential/rm *.blp . But it is not taking so I gave in command space rm *.blp and in parameter space I gave a path /DataStage/751A/Ascential. Whil this activity take the parameter and execute the command
Please correct me if Iam wrong .
Thanks,
SomaRaju
somaraju
Re: Doubt with ExecCommand Activity in sequence
That didn't work because it's not a valid UNIX command. What would happen if you typed "/DataStage/751A/Ascential/rm *.blp" from the command line? Unless you have copied the 'rm' command such that it lives in that Ascential directory, you're going to get an error.somu_june wrote:I gave command as /DataStage/751A/Ascential/rm *.blp
I'm suprised the other way worked at all. All it does it put the two parts together with a space between them and try to execute the command. That should mean you ended up with:
Code: Select all
rm *.blp /DataStage/751A/Ascential
I would think to be sure you know where exactly you are deleting these files from, you specifically change to the directory in question first. So, put this all in the Command box or split it up, doesn't really matter:
Code: Select all
cd /DataStage/751A/Ascential; rm *.blp
Or what Koolnitz just posted is another way. Probably safer, actually.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
use && in place of ; in Craig's code. This way the second command will only be executed if the first one is successful
Code: Select all
cd /DataStage/751A/Ascential && rm *.blp
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Code: Select all
In Command: rm
In Parameters: /DataStage/751A/Ascential/*.blp
The plus point with the above logic is you can even use job parameter if you want to change the directory runtime.
In Command: rm
In Parameters: #prmDirName#/*.blp
>> prmDirName is a job parameter
>> prmDirName can be set to /DataStage/751A/Ascential
Nitin Jain | India
If everything seems to be going well, you have obviously overlooked something.
If everything seems to be going well, you have obviously overlooked something.
As long as your version of DataStage actually supports using job parameters in the Parameters field.
There is a well know and often mentioned bug in some of the early 7.x versions where job parameters are translated in the log but are actually sent raw (untranslated) to the command itself. Seems to no longer be an issue in 7.5.x but be aware of the possibility of it in earlier versions.
There is a well know and often mentioned bug in some of the early 7.x versions where job parameters are translated in the log but are actually sent raw (untranslated) to the command itself. Seems to no longer be an issue in 7.5.x but be aware of the possibility of it in earlier versions.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
As I noted.
It's also good to note that it seems to be a platform specific issue, not a version specific one. Some platforms on the troublesome versions worked and some didn't. Best to check carefully beyond what it shows in the log as it always looks good there.
It's also good to note that it seems to be a platform specific issue, not a version specific one. Some platforms on the troublesome versions worked and some didn't. Best to check carefully beyond what it shows in the log as it always looks good there.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers