Page 1 of 2

delete dataset

Posted: Sat May 02, 2009 7:50 pm
by vennam445
Hi,
I should delete Dataset after creation.Is there a way to delete it from Datastage?

Posted: Sat May 02, 2009 8:22 pm
by lstsaur
Yes, from Tools-->Data Set Management.

Posted: Sat May 02, 2009 8:49 pm
by vennam445
lstsaur wrote:Yes, from Tools-->Data Set Management.
Hi,
I want to delete it after performing a test on the reject link.I should use a stage do delete the dataset.

Posted: Sat May 02, 2009 9:53 pm
by vrishabhsagar
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.
If you want to delete it programatically use this command in a command stage in sequence / after job subroutine.

Code: Select all

$DSHOME/bin/orchadmin rm <datasetname>
where $DSHOME is the home directory of your DataStage installation.

Posted: Sat May 02, 2009 10:01 pm
by vennam445
If you want to delete it programatically use this command in a command stage in sequence / after job subroutine.

Code: Select all

$DSHOME/bin/orchadmin rm <datasetname>
where $DSHOME is the home directory of your DataStage installation.[/quote]

Thanks for your reply.How can i find the DSHOME directory?

Posted: Sat May 02, 2009 10:39 pm
by vrishabhsagar
$DSHOME usually be loaded into your environment. Are you using AIX? Try

Code: Select all

echo $DSHOME

Posted: Sun May 03, 2009 2:11 pm
by vennam445
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,

Posted: Sun May 03, 2009 2:53 pm
by lstsaur
Please read your manual as to what's a dataset. Either Rejects.txt or Result.txt is not a dataset.

Posted: Sun May 03, 2009 2:56 pm
by mail2hfz
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>

Posted: Sun May 03, 2009 3:00 pm
by chulett
vennam445 wrote:When i execute this script from command line it works fine but not from the after job sub routine.
:!: 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.

Posted: Mon May 04, 2009 3:30 pm
by dsedi
try writing a routine by passing the arguments like the $APT_ORCHHOME directory plus the dataset to be deleted and use the Dsexecute command in the routine.

Posted: Mon May 04, 2009 4:00 pm
by vennam445
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.

Posted: Mon May 04, 2009 4:22 pm
by chulett
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.

Posted: Mon May 04, 2009 4:27 pm
by lstsaur
You need to enter the command as ./orchadmin.

Posted: Mon May 04, 2009 4:58 pm
by vennam445
I tried even ./orchadmin.It doesnt work:(