APT_CONFIG_FILE error while using dsjob
Moderators: chulett, rschirm, roy
APT_CONFIG_FILE error while using dsjob
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`
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
Try specifying the Config File Parameter before your DS run command.
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.
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.
-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.
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.
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
}
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
}
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Try the following
Check weather the correct value gets echoed on the screen.
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
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.