APT_CONFIG_FILE error while using dsjob

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
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

APT_CONFIG_FILE error while using dsjob

Post by kd813 »

I am passing the value for APT_CONFIG_FILE environment variable using a function,
If the functin is called in a differrent shell script fron the one in which the Datastage job is called then the job runs successfully but if the variable is set in the same script then the job is failed by giving the following error :

"main_program: ##$APT_CONFIG_FILE=$APT_CONFIG_FILE does not exist or is not a file or symbolic link to one.
##Fatal Error: Cannot continue without a configuration file."

In Unix the error shown is :
"Invalid arguments: dsjob -run
[-mode <NORMAL | RESET | VALIDATE>]
[-param <name>=<value>]
[-warn <n>]
[-rows <n>]
[-wait]
[-opmetadata <TRUE | FALSE>]
[-disableprjhandler]
[-disablejobhandler]
[-jobstatus]
[-userstatus]
[-local]
[-useid]
<project> <job|jobid>

Status code = -9999 DSJE_DSJOB_ERROR"

The dsjob command that i am using is :

" `$DSPATH/dsjob -server $SERV -user $DATASTAGE_ID -password $DATASTAGE_PWD -run -wait -param '$APT_CONFIG_FILE'=$APT_CONFIG_FILE $PROJPM $Jobname`
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

APT_CONFIG_FILE error while using dsjob

Post by ashwin141 »

Try specifying the Config File Parameter before your DS run command.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Pass the entire param argument within quotes. Eg:

Code: Select all

dsjob -run -param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' $PROJPM $Jobname
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

Post by kd813 »

specifying the parameter within single quotes is not working
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

Post by kd813 »

dsjob -run -param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' $PROJPM $Jobname
is giving error
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

Post by kd813 »

dsjob -run -param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' $PROJPM $Jobname
is not working
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ok. Tell us the following
-How are you getting $APT_CONFIG_FILE value in your script. Is this a variable in your shell script?
-Do you have $APT_CONFIG_FILE defined as a job parameter in your job that you are calling?

I have successfully passed environment variable values in a shell script this way. If it works for me, I dont see why it should not work for you.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

Post by kd813 »

dsjob -run -param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' $PROJPM $Jobname
is not working
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ok my bad. That was just a snippet to plug into your original command. Substitute the following in your original command

Code: Select all

-param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' 
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

Post by kd813 »

The problem is if I am calling the job in script A and passing the parameter APT_CONFIG_FILE to it from script B (where it is getting generated throught some funtion)then it is accepting the value of this parameter.

But if I am generating the value of APT_CONFIG_FILE (using the same function ) in the same script i.e script A thn it is not taking the value of the parameter and giving me error
Script A
{ . /script B
dsjob -server $SERV -user $DATASTAGE_ID -password $DATASTAGE_PWD -run -param '$APT_CONFIG_FILE'=${APT_CONFIG_FILE} $PROJPM $Jobname
}
Script B
{
APT_CONFIG_FILE=`f_get_PX_ConfigFile $KEY $INSTANCE_INFO1 $COMM_ID $COMM_PWD $INP_REC_CNT`
}
This is working

But below script is not working
Script A
{
APT_CONFIG_FILE=`f_get_PX_ConfigFile $KEY $INSTANCE_INFO1 $COMM_ID $COMM_PWD $INP_REC_CNT`
dsjob -server $SERV -user $DATASTAGE_ID -password $DATASTAGE_PWD -run -param '$APT_CONFIG_FILE'=${APT_CONFIG_FILE} $PROJPM $Jobname
}
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Verify the efficacy of your f_get_PX_ConfigFile command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Try the following

Code: Select all

export APT_CONFIG_FILE=`f_get_PX_ConfigFile $KEY $INSTANCE_INFO1 $COMM_ID $COMM_PWD $INP_REC_CNT` 
echo ${APT_CONFIG_FILE}
eval dsjob -server $SERV -user $DATASTAGE_ID -password $DATASTAGE_PWD -run -param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' $PROJPM $Jobname 
Check weather the correct value gets echoed on the screen.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply