To delete datasets from DataStage Job

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

Post Reply
mehimadri
Premium Member
Premium Member
Posts: 25
Joined: Sat Jan 13, 2007 4:56 am
Location: United States

To delete datasets from DataStage Job

Post by mehimadri »

Hi Friends,

In our environment, we have multiple projects with their own configuration files. I need to delete datasets using orchadmin command in the execute command activity. The datastage admin has advised me to include the following statements:

(i) Source the dsenv file
(ii) Export APT_CONFIG_FILE = <the path to my project's config file>
(iii) provide the path to orchadmin command and the options to delete the dataset

I understand why we need to source the dsenv file, however I am not sure why we need to export the apt_config_file since this variable is already defined in the administrator.
Also the path to orchadmin is present in the PATH variable defined in the Administrator hence I cannot understand the reason for (iii) as well.


can you please let me know if you find the reasons why is he asing me to do (ii) and (iii)
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Usually these values aren't set if you login as a user and open a command window, but if you call this from DataStage then those setup steps for the environment are not required.
mehimadri
Premium Member
Premium Member
Posts: 25
Joined: Sat Jan 13, 2007 4:56 am
Location: United States

Post by mehimadri »

Without doing this it is causing a reply=127 (Command not found) error.

So, if I am calling orchadmin from DataStage (using Execute command activity stage) then explicitly setting APT_CONFIG_FILE is not needed. Since the command will be executed in UNIX how will the UNIX know which configuration file to use considering there are multiple projects running in the server, each having its own configuration file?
mehimadri
Premium Member
Premium Member
Posts: 25
Joined: Sat Jan 13, 2007 4:56 am
Location: United States

Post by mehimadri »

As per my belief:

When we run orchadmin through datastage:
(i) We do not need to source dsenv because datastage already does that
(ii) We do not need to export APT_CONFIG_FILE

However I would like to know the reasons behind these?
intelcom
Premium Member
Premium Member
Posts: 25
Joined: Thu Feb 28, 2008 2:05 am

Re: To delete datasets from DataStage Job

Post by intelcom »

Hi

when running from within a DS job you only need to run the

<path>/bin/Orchadmin rm datasetname

You don't need to do (i) and (ii) unless you are doing it from a script.
mehimadri
Premium Member
Premium Member
Posts: 25
Joined: Sat Jan 13, 2007 4:56 am
Location: United States

Post by mehimadri »

Thanks, I thought so. However what is the reason:

Does DataStage source dsenv file while starting a Job?

And

The server here is running multiple projects with different configuration files. When I run the orchadmin command, I believe DataStage opens a shell and runs the command. How is the configuration file set in this case?
Post Reply