delete dataset

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

vennam445
Participant
Posts: 20
Joined: Tue Oct 21, 2008 12:34 pm

delete dataset

Post by vennam445 »

Hi,
I should delete Dataset after creation.Is there a way to delete it from Datastage?
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Yes, from Tools-->Data Set Management.
vennam445
Participant
Posts: 20
Joined: Tue Oct 21, 2008 12:34 pm

Post 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.
vrishabhsagar
Participant
Posts: 33
Joined: Mon Nov 12, 2007 1:02 am
Location: Bangalore

Post 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.
Rishabh Sagar V
Bangalore
vennam445
Participant
Posts: 20
Joined: Tue Oct 21, 2008 12:34 pm

Post 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?
vrishabhsagar
Participant
Posts: 33
Joined: Mon Nov 12, 2007 1:02 am
Location: Bangalore

Post by vrishabhsagar »

$DSHOME usually be loaded into your environment. Are you using AIX? Try

Code: Select all

echo $DSHOME
Rishabh Sagar V
Bangalore
vennam445
Participant
Posts: 20
Joined: Tue Oct 21, 2008 12:34 pm

Post 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,
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Please read your manual as to what's a dataset. Either Rejects.txt or Result.txt is not a dataset.
mail2hfz
Premium Member
Premium Member
Posts: 92
Joined: Thu Nov 16, 2006 8:51 am

Post 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>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsedi
Participant
Posts: 220
Joined: Wed Jun 02, 2004 12:38 am

Post 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.
vennam445
Participant
Posts: 20
Joined: Tue Oct 21, 2008 12:34 pm

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

You need to enter the command as ./orchadmin.
vennam445
Participant
Posts: 20
Joined: Tue Oct 21, 2008 12:34 pm

Post by vennam445 »

I tried even ./orchadmin.It doesnt work:(
Post Reply