Execute Unix commands in datastage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 86
- Joined: Mon Nov 27, 2006 3:42 am
- Location: Wilmington
Execute Unix commands in datastage
Hi All,
How to execute unix commands in Datasatge.
path/ Touch File.txt
path/ rm File.txt
Is this commands will work from datastage?
How to execute unix commands in Datasatge.
path/ Touch File.txt
path/ rm File.txt
Is this commands will work from datastage?
Re: Execute Unix commands in datastage
where you want to execute these commands, i mean before/afte job subroutine or in basic code.
-
- Participant
- Posts: 86
- Joined: Mon Nov 27, 2006 3:42 am
- Location: Wilmington
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 86
- Joined: Mon Nov 27, 2006 3:42 am
- Location: Wilmington
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not true.Magesh_bala wrote:In Execute command we cant execute the shell script commands, We can call only the shell scripts files.
If you can prove that your assertion is true I would be interested in seeing the proof.
I execute individual commands through Execute Command activity quite frequently.
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.
-
- Participant
- Posts: 86
- Joined: Mon Nov 27, 2006 3:42 am
- Location: Wilmington
Hi Ray, Thanks for your reply. Whe we execute the command
touch opt/Ascential/Data/Samplefile.txt --> It works
But when we use the Parameter
touch #path#samplefile.txt --> Its not working in Execute command stage
Can you please suggest how to use the parameter in execute command stage.
Thanks and Regards
N.Magesh
touch opt/Ascential/Data/Samplefile.txt --> It works
But when we use the Parameter
touch #path#samplefile.txt --> Its not working in Execute command stage
Can you please suggest how to use the parameter in execute command stage.
Thanks and Regards
N.Magesh
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Where is the parameter coming from?
You can not use parameters in the Command field in the Execute Command stage. You can only use them in the Parameters field.
Therefore the solution that you require for this particular problem (assuming that there exists a job sequence parameter called "path" and that its value includes a terminating pathname delimiter character ("/" on UNIX)) is as follows:
Command: touch
Parameters: #path#samplefile.txt
You can not use parameters in the Command field in the Execute Command stage. You can only use them in the Parameters field.
Therefore the solution that you require for this particular problem (assuming that there exists a job sequence parameter called "path" and that its value includes a terminating pathname delimiter character ("/" on UNIX)) is as follows:
Command: touch
Parameters: #path#samplefile.txt
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.
-
- Participant
- Posts: 86
- Joined: Mon Nov 27, 2006 3:42 am
- Location: Wilmington
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I did. A very complete solution.
Please purchase a premium memberhip that will allow you to read it, or have your employer purchase it.
Premium membership is one of the ways that the hosting and bandwidth costs of DSXchange are defrayed. By taking premium membership you are not only getting the benefits thereof but you are also helping to keep DSXchange alive. At less than 30c (Rs12) per day it is not expensive.
Please purchase a premium memberhip that will allow you to read it, or have your employer purchase it.
Premium membership is one of the ways that the hosting and bandwidth costs of DSXchange are defrayed. By taking premium membership you are not only getting the benefits thereof but you are also helping to keep DSXchange alive. At less than 30c (Rs12) per day it is not expensive.
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.
-
- Premium Member
- Posts: 291
- Joined: Wed Sep 26, 2007 11:23 am
- Location: Madrid, Spain
What if the command 'touch' requires the complete path to be executed?ray.wurlod wrote:Where is the parameter coming from?
You can not use parameters in the Command field in the Execute Command stage. You can only use them in the Parameters field.
Therefore the solution that you require for this particular problem (assuming that there exists a job sequence parameter called "path" and that its value includes a terminating pathname delimiter character ("/" on UNIX)) is as follows:
Command: touch
Parameters: #path#samplefile.txt
For example, /pathforcommands/touch
How can I tell Datastege the path where the command is in order to be executed?
Thanks a lot