Page 1 of 1

Environmental variable setting

Posted: Sat Jun 03, 2006 2:29 am
by fk4u
Hello There.
I want to automate my environmental variables.
we are going to build a warehouse so we will need daily batch directory for batch processing.
We need to create a directory path on daily bases like 2006-06-02 etc.
Actually our all datafiles will be placed on business date directory and all jobs will get the source files from that directory.
So how to set the value automatically so that the directory path will be automatically set to current business date.
DSParams file in projects directory shows all the values defined. But it is static. I need that the value of date should change on next business day.

Posted: Sat Jun 03, 2006 7:54 am
by chulett
Many ways to do this. What is your overall scheduling mechanism? For example, we use Control-M and it provides the current 'Business Day' as a job parameter. Or a job / script could query the system and set the environment variable accordingly first off.

Posted: Sat Jun 03, 2006 8:17 am
by fk4u
Thanks for the reply.
Actually our jobs will run at midnight. I can create a file which will have business date only. We will not use the system data as business date cause may be some time our batch will not run one day and we have to run it other day.so current date is not acceptable.
I need datatstage to read that file and get the specific business date.
There is other choice. My oracle table BUS_DATE will also contain the business date so we can get the date from that table.
So can you guide me how to proceed. How datastage will get date through either way.
Any method you thik is easy.

Posted: Sat Jun 03, 2006 8:42 am
by chulett
The 'current date' certainly could be acceptable the vast majority of the time as long as you have a mechanism to override it if you need to. That's how we handle it.

There are tons of posts on reading parameter values from a flat file. Also on reading values from a DB in a DS job and passing it out via USER STATUS. The approach could also depend again on your overall control mechanism and what you are using for job control, which you didn't specify.

Are you using Sequence jobs or some other form of job control? What coordinates things overall?

'Easiest' to me sounds like something to set your 'Business Date' environment variable, as you originally mentioned, and then source it from there in the jobs that need it.

Posted: Sat Jun 03, 2006 11:38 am
by DSguru2B
You need to set your variable in your process itself. Like say for instance, one job reads the business date and populates it in a file. That file could just be a single column single row format, with just the date in it. You can also populate it in the parameter file of the second job that needs the business date and let the job pick it up from there
Reference thispost to get an idea of how to dynamically set variables.
Regards,