How to pass variable $APT_CONFIG_FILE from script
Moderators: chulett, rschirm, roy
How to pass variable $APT_CONFIG_FILE from script
Hi all
I am using shell script S1 to call the datastage sequence. I am writing all job parameters in a parameter file and script is using this parameter file.
In my main script i am calling a small shell scripts to launch the datastage sequence and providing input that parameter file.
in small script i am using the below command to run ds sequence
JobStatus=`dsjob -run -warn 9999 $ParmList -jobstatus $ProjName $JobName`
$ParmList ----> this input parameter file (contians all job parameter mentioaned in the sequence like, dbserver,dbuser,dbpwd,inputDir,OutputDir etc.).
Now i want to add $APT_CONFIG_FILE in sequence job parameters.
and want to pass the value from the parameter file.
i think beacause of $sign, i am not able to pass the config file.
Please let me know if some have already faced this issue.
Regards,
I am using shell script S1 to call the datastage sequence. I am writing all job parameters in a parameter file and script is using this parameter file.
In my main script i am calling a small shell scripts to launch the datastage sequence and providing input that parameter file.
in small script i am using the below command to run ds sequence
JobStatus=`dsjob -run -warn 9999 $ParmList -jobstatus $ProjName $JobName`
$ParmList ----> this input parameter file (contians all job parameter mentioaned in the sequence like, dbserver,dbuser,dbpwd,inputDir,OutputDir etc.).
Now i want to add $APT_CONFIG_FILE in sequence job parameters.
and want to pass the value from the parameter file.
i think beacause of $sign, i am not able to pass the config file.
Please let me know if some have already faced this issue.
Regards,
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
hi
in my parameter file i am writing the parameter name it self like,
$APT_CONFIG_FILE=/opt/Ascential/DataStage/Configurations/2Node.apt
InputDir=/home/source/
InputFileName=emp.dat
OutputDir=/home/target/
OutputFileName=emp.out
RejectDir=/home/reject/
RejectFileName=emp.rej
then i am passing it to script.
but it is not taking the configuration file because of $ sign, i have tried some escape sequece,but not able to resolve this issue.
in my parameter file i am writing the parameter name it self like,
$APT_CONFIG_FILE=/opt/Ascential/DataStage/Configurations/2Node.apt
InputDir=/home/source/
InputFileName=emp.dat
OutputDir=/home/target/
OutputFileName=emp.out
RejectDir=/home/reject/
RejectFileName=emp.rej
then i am passing it to script.
but it is not taking the configuration file because of $ sign, i have tried some escape sequece,but not able to resolve this issue.
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
Thanks for your help.
I cann't change this command written in the script,
i need to provide the list if parameter to the below script as $ParmList.
JobStatus=`dsjob -run -warn 9999 $ParmList -jobstatus $ProjName $JobName
if i follow the coding logic given by you , i need to write the all parameter name followed by the paramter file name
Regards,
I cann't change this command written in the script,
i need to provide the list if parameter to the below script as $ParmList.
JobStatus=`dsjob -run -warn 9999 $ParmList -jobstatus $ProjName $JobName
if i follow the coding logic given by you , i need to write the all parameter name followed by the paramter file name
Regards,
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
Looking at your original list of parameters, I think they should look like this :
'$APT_CONFIG_FILE'=/opt/Ascential/DataStage/Configurations/2Node.apt
'InputDir'=/home/source/
'InputFileName'=emp.dat
'OutputDir'=/home/target/
'OutputFileName'=emp.out
'RejectDir'=/home/reject/
'RejectFileName'=emp.rej
This is assuming the literals to the left of each equality is the parameter name of the job/sequence you are running ?
Hope this helps.
'$APT_CONFIG_FILE'=/opt/Ascential/DataStage/Configurations/2Node.apt
'InputDir'=/home/source/
'InputFileName'=emp.dat
'OutputDir'=/home/target/
'OutputFileName'=emp.out
'RejectDir'=/home/reject/
'RejectFileName'=emp.rej
This is assuming the literals to the left of each equality is the parameter name of the job/sequence you are running ?
Hope this helps.
Re: How to pass variable $APT_CONFIG_FILE from script
No, it's because each parameter name/value pair must be prefixed by "-param", each and every one. You need iterate thru the file and concatenate a string together so that you end up with:singhald wrote:i think beacause of $sign, i am not able to pass the config file.
Code: Select all
-param InputDir=/home/source/ -param OutputDir=/home/target/
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 4
- Joined: Fri Aug 01, 2008 12:54 pm
Passing $APT_CONFIG_FILE for invoking a Datastage Sequence
I have the same issue as above and which I wanted to check if anyone has implemented it earlier for a Datastage Sequence; I know this works when invoking a Datastage job but wanted to know if it works for a Sequence;
Here's what I wanted to do.
1) The Datastage Stage "Sequence" is being invoked from Command script; and this sequence inturn is invoking multiple Datastage Jobs; The reason to call the jobs thorugh the sequence is to simplify the calling procedure of the jobs by minimising the passing of the parameters which could be easliy set up in the Sequence.
2) However there is one parameter I still want to control at the Sequence level; i.e that is APT_CONFIG_FILE, setting up different config files for different sequences depending on the volume of data I need to churn for each sequence flow.
Here's how I tried to implement it;
I used to echo command to see the output of the command I am using and also used the actaul command call in the next line and here's the error I am getting; Can anyone of you help in how to resolve this issue;
------------------
# Run Job Sequence script; this is being called from a wrapper script
echo dsjob -run -wait -warn 1000000 -jobstatus -param "\$APT_CONFIG_FILE=$APT_CONFIG_FILE" $PROJECT $SEQUENCE
dsjob -run -wait -warn 1000000 -jobstatus -param "\$APT_CONFIG_FILE=$APT_CONFIG_FILE" $PROJECT $SEQUENCE
---------------------
the output of the above command
dsjob -run -wait -warn 1000000 -jobstatus -param $APT_CONFIG_FILE=/home/app/is/opt/IBM/InformationServer/Server/Configurations/config2node.apt Project_name Sequence_1
Error -3 getting information for parameter '$APT_CONFIG_FILE'
Status code = -3 DSJE_BADPARAM
-----------------------
Your help is greatly appreciated.
Here's what I wanted to do.
1) The Datastage Stage "Sequence" is being invoked from Command script; and this sequence inturn is invoking multiple Datastage Jobs; The reason to call the jobs thorugh the sequence is to simplify the calling procedure of the jobs by minimising the passing of the parameters which could be easliy set up in the Sequence.
2) However there is one parameter I still want to control at the Sequence level; i.e that is APT_CONFIG_FILE, setting up different config files for different sequences depending on the volume of data I need to churn for each sequence flow.
Here's how I tried to implement it;
I used to echo command to see the output of the command I am using and also used the actaul command call in the next line and here's the error I am getting; Can anyone of you help in how to resolve this issue;
------------------
# Run Job Sequence script; this is being called from a wrapper script
echo dsjob -run -wait -warn 1000000 -jobstatus -param "\$APT_CONFIG_FILE=$APT_CONFIG_FILE" $PROJECT $SEQUENCE
dsjob -run -wait -warn 1000000 -jobstatus -param "\$APT_CONFIG_FILE=$APT_CONFIG_FILE" $PROJECT $SEQUENCE
---------------------
the output of the above command
dsjob -run -wait -warn 1000000 -jobstatus -param $APT_CONFIG_FILE=/home/app/is/opt/IBM/InformationServer/Server/Configurations/config2node.apt Project_name Sequence_1
Error -3 getting information for parameter '$APT_CONFIG_FILE'
Status code = -3 DSJE_BADPARAM
-----------------------
Your help is greatly appreciated.
-
- Participant
- Posts: 4
- Joined: Fri Aug 01, 2008 12:54 pm
Hi Mike,
I am not sure if I understood you; infact I am protecting the env variable by having a backslash in the referecne to the $APT_CONFIG_FILE; however I have also tried the option which you had suggested; here is the modifed code and the results for the same
--- Code; the first call is just an echo where in the second call, I am calling the script by protecting the $APT_CONFIG_FILE using a single quote and also tried by using a \ in my previous call; I had also hardcoded the APT_CONFIG_FILE path to test this
# Run Job Sequence
echo dsjob -run -wait -warn 1000000 -jobstatus -param '$APT_CONFIG_FILE=/home/app/is/opt/IBM/InformationServer/Server/Configurations/config2node.apt' $PROJECT $SEQUENCE
dsjob -run -wait -warn 1000000 -jobstatus -param '$APT_CONFIG_FILE=/home/app/is/opt/IBM/InformationServer/Server/Configurations/config2node.apt' $PROJECT $SEQUENCE
-------the first output is an echo command and the second is the actual call in the results down blow (without the echo which is producing the error)
dsjob -run -wait -warn 1000000 -jobstatus -param $APT_CONFIG_FILE=/home/app/is/opt/IBM/InformationServer/Server/Configurations/config2node.apt DS_EDW js_omni_af_src_load
Error -3 getting information for parameter '$APT_CONFIG_FILE'
Status code = -3 DSJE_BADPARAM
So in your opinion; when this param is being passed to dsjob do you mean to say it is trying to expand it; sorry wasn't able to grasp your answer; so could you expand it.
Thanks for your answer though;
I am not sure if I understood you; infact I am protecting the env variable by having a backslash in the referecne to the $APT_CONFIG_FILE; however I have also tried the option which you had suggested; here is the modifed code and the results for the same
--- Code; the first call is just an echo where in the second call, I am calling the script by protecting the $APT_CONFIG_FILE using a single quote and also tried by using a \ in my previous call; I had also hardcoded the APT_CONFIG_FILE path to test this
# Run Job Sequence
echo dsjob -run -wait -warn 1000000 -jobstatus -param '$APT_CONFIG_FILE=/home/app/is/opt/IBM/InformationServer/Server/Configurations/config2node.apt' $PROJECT $SEQUENCE
dsjob -run -wait -warn 1000000 -jobstatus -param '$APT_CONFIG_FILE=/home/app/is/opt/IBM/InformationServer/Server/Configurations/config2node.apt' $PROJECT $SEQUENCE
-------the first output is an echo command and the second is the actual call in the results down blow (without the echo which is producing the error)
dsjob -run -wait -warn 1000000 -jobstatus -param $APT_CONFIG_FILE=/home/app/is/opt/IBM/InformationServer/Server/Configurations/config2node.apt DS_EDW js_omni_af_src_load
Error -3 getting information for parameter '$APT_CONFIG_FILE'
Status code = -3 DSJE_BADPARAM
So in your opinion; when this param is being passed to dsjob do you mean to say it is trying to expand it; sorry wasn't able to grasp your answer; so could you expand it.
Thanks for your answer though;
You need this:
Mike
Code: Select all
dsjob -run -wait -warn 1000000 -jobstatus -param '$APT_CONFIG_FILE'=/home/app/is/opt/IBM/InformationServer/Server/Configurations/config2node.apt Project_name Sequence_1