Getting values of User defined environment variables in UNIX

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
Madhavan VM
Participant
Posts: 33
Joined: Sat Jul 02, 2005 2:27 am
Location: Bangalore

Getting values of User defined environment variables in UNIX

Post by Madhavan VM »

Hello All,

My requirement is:

To get the value of User defined environment variable for a project in the UNIX box.

For e.g.:
1. I have defined a variable Log_Dir having value /user/spool/myproject/logdir in the administrator.
2. I am using this variable in the job and have given the value in job as $PROJDEF.
3. I want to run the job from UNIX using dsjob command. I want to use the value "/user/spool/myproject/logdir" in my batch run script.

I could see that if we use the command below it will give me "$PROJDEF":

dsjob -paraminfo project_name job_name parameter_name

Is there a way I can get the actual value (/user/spool/myproject/logdir) stored in administrator?

Your help is appreciated.

Thanks and Regards,
Ajith GK
warm regards,
Ajith GK
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you want the project default value when the job runs, don't mention the parameter name when you run the job from UNIX. Let it take the default.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you want to replace the default when running the job, use the -param option.
dsjob -run -param Log_Dir=/user/spool/myproject/logdir projname jobname

To recover the value that was used, whether it was substituted for $PROJDEF or in the run request, you need to look at the job log. The "job started" entry shows the parameter values that were actually used for the run.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Madhavan VM
Participant
Posts: 33
Joined: Sat Jul 02, 2005 2:27 am
Location: Bangalore

Post by Madhavan VM »

Hello All,

Thank you for all the replies.

I think my requirement was not mentioned/understood clearly. Let me restate it.

1. I have defined a variable Log_Dir having value /user/spool/myproject/logdir in the administrator.
2. I am creating a script which is different from the one used to run the job from UNIX.

Say, the script is:

SCRIPT_NAME=`basename $0`
JobName=$1

LOG_DIR= :?:
Here I want to assign the value that is there in the administrator.

In short, I want to obtain the actual value defined in the administrator using a combination of Orchestrate and UNIX commands.

Hence, the reason I mentioned that "dsjob -paraminfo project_name job_name parameter_name" will give me the value "$PROJDEF". What I want is "user/spool/myproject/logdir" assigned to the LOG_DIR variable in the UNIX script.

Let me know if you could help me in the same.
warm regards,
Ajith GK
maheshsada
Participant
Posts: 69
Joined: Tue Jan 18, 2005 12:15 am

Post by maheshsada »

to read the value defined in administrator - you have to go to your project in unix and there will be a file - DSParams. If you read the file for your parameter name you can get the value defined in administrator
Madhavan VM
Participant
Posts: 33
Joined: Sat Jul 02, 2005 2:27 am
Location: Bangalore

Post by Madhavan VM »

Thank you Mahesh! That did the trick.

Thanks everyone who responded to the question. :)
warm regards,
Ajith GK
Post Reply