Page 1 of 1

APT_CONFIG_FILE error while using dsjob

Posted: Mon Jul 02, 2007 4:40 am
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`

APT_CONFIG_FILE error while using dsjob

Posted: Mon Jul 02, 2007 6:39 am
by ashwin141
Try specifying the Config File Parameter before your DS run command.

Posted: Mon Jul 02, 2007 7:25 am
by DSguru2B
Pass the entire param argument within quotes. Eg:

Code: Select all

dsjob -run -param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' $PROJPM $Jobname

Posted: Mon Jul 02, 2007 7:31 am
by kd813
specifying the parameter within single quotes is not working

Posted: Mon Jul 02, 2007 7:32 am
by kd813
dsjob -run -param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' $PROJPM $Jobname
is giving error

Posted: Mon Jul 02, 2007 7:32 am
by kd813
dsjob -run -param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' $PROJPM $Jobname
is not working

Posted: Mon Jul 02, 2007 7:47 am
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.

Posted: Mon Jul 02, 2007 8:02 am
by kd813
dsjob -run -param '$APT_CONFIG_FILE=${APT_CONFIG_FILE}' $PROJPM $Jobname
is not working

Posted: Mon Jul 02, 2007 8:07 am
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}' 

Posted: Mon Jul 02, 2007 11:11 pm
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
}

Posted: Tue Jul 03, 2007 7:29 am
by ray.wurlod
Verify the efficacy of your f_get_PX_ConfigFile command.

Posted: Tue Jul 03, 2007 7:30 am
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.