delete a unix file from datastage sequence.
Moderators: chulett, rschirm, roy
delete a unix file from datastage sequence.
hi,
how to delete a unix file from datastage job.
datastage job should find test.txt file in unix server if it is exists then i should delete that file...! i want to use this process in a datastage sequencer.
how to delete a unix file from datastage job.
datastage job should find test.txt file in unix server if it is exists then i should delete that file...! i want to use this process in a datastage sequencer.
Last edited by Veni on Sun Jan 01, 2006 3:19 am, edited 1 time in total.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use an Execute Command activity with rm as the command. The command arguments field can contain options (for example -fr) and a job parameter reference to the parameter containing the name of the file to be deleted.
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: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There are two fields on the Command tab in an Execute Command activity.
In the first (Command) you put simply the rm command itself.
In the other (Parameters) you put anything else that needs to appear on the rm command line. This can include references to job parameters, for example -rf #path#/#filename#
The command that is executed in the operating system is rm -rf path/filename where path and filename are resolved job parameter values.
In the first (Command) you put simply the rm command itself.
In the other (Parameters) you put anything else that needs to appear on the rm command line. This can include references to job parameters, for example -rf #path#/#filename#
The command that is executed in the operating system is rm -rf path/filename where path and filename are resolved job parameter values.
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.
Thanks Every one. this work fine. i need to find file is found or not how do check? if it is found then i have to go for process otherwise i need to abort the sequence ?ray.wurlod wrote:There are two fields on the Command tab in an Execute Command activity.
In the first (Command) you put simply the rm command itself.
In the other (Parameters) you put anything else that needs to appear on the rm command line. This can include references to job parameters, for example -rf #path#/#filename#
The command that is executed in the operating system is rm -rf path/filename where path and filename are resolved job parameter values.
can any one suggest how to solve this.
First suggestion would be to find someone where you work who can help you with simple UNIX commands like this.
Second suggestion would be to start a new post as this one has been solved and we're moving off on to another topic entirely.
![Wink :wink:](./images/smilies/icon_wink.gif)
Second suggestion would be to start a new post as this one has been solved and we're moving off on to another topic entirely.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers