Stage Level Config File & Conditional Schema

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
binay
Premium Member
Premium Member
Posts: 25
Joined: Wed Aug 15, 2007 11:15 pm
Location: USA

Stage Level Config File & Conditional Schema

Post by binay »

Hello,

I've the following two questions on which I was trying to do some research (including searching in this forum) without much success:

1. There is an option to set Configuration File in every stage. For example, I might want to use a different configuration file in a Join Stage and use a different one in a Copy Stage. DataStage gives us that flexibility, however, for some reason, it is not enabled in my project. I'm not sure whether I've to set some environmental variable in DataStage Administrator to enable that....Can someone please help me out in this?

2. Can we write conditional statements in the Schema File? For example, I want to write a simple "If Else" statement on the basis of a certain field and I want to process the records accordingly. I know this is not a good process to do and would have a huge impact on performance if the number of records are high, however I just want to now whether we've this option in DataStage. If yes, can someone please re-direct me to the correct documentation?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

1. No. APT_CONFIG_FILE is job-wide.
2. No. You could use multiple schema files and parameterize the schema file name property.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
binay
Premium Member
Premium Member
Posts: 25
Joined: Wed Aug 15, 2007 11:15 pm
Location: USA

Post by binay »

For #1: If we go to any stage and click on Stage Tab, followed by Advanced tab, we can find a drop down box for configuration file. That drop down box is disabled in my project. Is there a way I can enable that drop down box? Do I've to do reset something in DataStage Administrator?

For #2: Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

1. Nothing of which I'm aware. Does context-sensitive help provide any clue?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
antonyraj.deva
Premium Member
Premium Member
Posts: 138
Joined: Wed Jul 16, 2008 9:51 pm
Location: Kolkata

Re: Stage Level Config File & Conditional Schema

Post by antonyraj.deva »

binay wrote:1. There is an option to set Configuration File in every stage. For example, I might want to use a different configuration file in a Join Stage and use a different one in a Copy Stage. DataStage gives us that flexibility, however, for some reason, it is not enabled in my project. I'm not sure whether I've to set some environmental variable in DataStage Administrator to enable that....Can someone please help me out in this?
In the stage level only node map constraint can be specified thus fixing the number of nodes to be used for that particular job.

APT_CONFIG can be set at server level globally for all projects or a specific configuration can be set at the project level.

As Ray pointed out, the APT_CONFIG is same for all stages in a job & also project level.

Thanks,
Tony
natehoy
Premium Member
Premium Member
Posts: 5
Joined: Wed Jul 18, 2012 8:14 am

Specifying config file at the JOB level

Post by natehoy »

Pardon me, I'm a rank wet-behind-the-ears newbie at DataStage, but I discovered the following that might be useful for this discussion. In DataStage 8.7, you can specify environment variables at the job level.

1. Make sure you are not currently editing your job.
2. Right-click on the job and click "Properties"
3. Select the "Parameters" tab.
4. Click "Add Environment Variable"
5. Scroll down and select "$APT_CONFIG_FILE". This should return you to the Job Properties screen with your environment variable on the list.
6. Double-click on the "Default Value" and change it to the Config file you want for that job.

Now whenever you go into any of the steps for that job, you should see your chosen config file.

Hope this helps...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

This is not new. You can only load environment variables as job parameters if those environment variables are defined at project level.

There may be one exception to this, if the special token $ENV is used as the default value. In this case, you are instructing DataStage to seek the value of the environment variable from the operating system shell in which the job is running.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply