delete dataset
Moderators: chulett, rschirm, roy
delete dataset
Hi,
I should delete Dataset after creation.Is there a way to delete it from Datastage?
I should delete Dataset after creation.Is there a way to delete it from Datastage?
-
- Participant
- Posts: 33
- Joined: Mon Nov 12, 2007 1:02 am
- Location: Bangalore
If you want to delete it programatically use this command in a command stage in sequence / after job subroutine.vennam445 wrote: Hi,
I want to delete it after performing a test on the reject link.I should use a stage do delete the dataset.
Code: Select all
$DSHOME/bin/orchadmin rm <datasetname>
Rishabh Sagar V
Bangalore
Bangalore
If you want to delete it programatically use this command in a command stage in sequence / after job subroutine.
where $DSHOME is the home directory of your DataStage installation.[/quote]
Thanks for your reply.How can i find the DSHOME directory?
Code: Select all
$DSHOME/bin/orchadmin rm <datasetname>
Thanks for your reply.How can i find the DSHOME directory?
-
- Participant
- Posts: 33
- Joined: Mon Nov 12, 2007 1:02 am
- Location: Bangalore
$DSHOME usually be loaded into your environment. Are you using AIX? Try
Code: Select all
echo $DSHOME
Rishabh Sagar V
Bangalore
Bangalore
I wrote a shell script to delete dataset.
a=`cat Rejects.txt|wc -l`;
if [ $a -ne 0]
then `rm Result.txt';
exit 1;
fi;
When i execute this script from command line it works fine but not from the after job sub routine.After job subroutine ran without error but the file is not deleted.I am using execute command sequence for the after job sub routine.
Also I have one more issue.Once the file is deleted the job has to abort in the sequence.How can I do that.
Thanks,
a=`cat Rejects.txt|wc -l`;
if [ $a -ne 0]
then `rm Result.txt';
exit 1;
fi;
When i execute this script from command line it works fine but not from the after job sub routine.After job subroutine ran without error but the file is not deleted.I am using execute command sequence for the after job sub routine.
Also I have one more issue.Once the file is deleted the job has to abort in the sequence.How can I do that.
Thanks,
Try the suggested method, not with "rm" command to delete the datasets. The file you were able to delete is the descriptor file not the data file and you will be left with orphan data files.
If you want to delete it programatically use this command in a command stage in sequence / after job subroutine.
Code:
$DSHOME/bin/orchadmin rm <datasetname>
Full not relative paths when you do something like this, never mind the fact that (as noted) it is not the right thing to be doing.vennam445 wrote:When i execute this script from command line it works fine but not from the after job sub routine.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I tried to delete the .ds file by going to the path ~/IBM/InformationServer/PXEngine/bin which has the orchadmin file.I tried to execute the orchadmin command from here to delete the file
orchadmin delete filename.ds but I am geting the error orchadmin not found.But when I do the ls command i can see the orchadmin file.
orchadmin delete filename.ds but I am geting the error orchadmin not found.But when I do the ls command i can see the orchadmin file.
Not much command line experience, it seems. If you cd to the directory a command 'lives in' then preface it with 'dot slash' i.e. "./orchadmin delete filename.ds" - assuming that syntax is correct. Or fully pathing a command works from anywhere.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers