Steps for executing BODS job from Unix Script

 

This will help you understand how to change the global parameters used in the job during execution of the job invoked via a Unix Script.

While you export the .SH for job execution, the default parameter values or last used parameter value will be attached within the .SH file. Whenever you execute that .SH file, the job starts with the same parameters all the time. You may need to modify the .SH file all the time, whenever you need to make changes in the user parameter (Global parameter) values. Go through the simple steps involved in resolving this issue effectivelty with minor modifications and a simple unix script to pass new user defined values and execution of the BODS job.

Log in to Data Service Management Console

Go to Administrator-> Batch (Choose Repository)

                         /wp-content/uploads/2013/09/pic1_272007.jpg

  Click on Batch Job Configuration tab to choose  the job which needs to be invoked through Unix

                         /wp-content/uploads/2013/09/pic2_272008.jpg

  Click on Export Execution Command Option against the job

                         /wp-content/uploads/2013/09/pic3_272013.jpg

Click on Export.

Two Files then will get generated and placed in the Unix Box. **

One .TXT file named as “Reponame.Txt” in /proj/sap/SBOP_INFO_PLAT_SVCS_40_LNX64/dataservices/conf

 

One .sh file named as “jobname.sh” in /proj/sap/SBOP_INFO_PLAT_SVCS_40_LNX64/dataservices/log

**Location will be changed according to the setup

/wp-content/uploads/2013/09/pic4_272015.jpg

1. For a job with no user entry parameters required, we can directly call the .sh file generated for job execution.

. ./Job_Name.sh

2. For a job which has parameters the script
will look like this

 

/proj/sap/SBOP_INFO_PLAT_SVCS_40_LNX64/dataservices/bin/AL_RWJobLauncher “/proj/sap/SBOP_INFO_PLAT_SVCS_40_LNX64/dataservices/log/DEV_JS_1/”
-w “inet:acas183.fmq.abcd.com:3500″ ” -PLocaleUTF8 -R\”REPO_NAME.txt\”  -G”1142378d_784a_45cd_94d7_4a8411a9441b”
-r1000 -T14 -LocaleGV -GV\”\$Character_123=MqreatwvssQ;\$Integer_One=Qdasgsssrdd;\”  -GV\”DMuMDEn;\”    -CtBatch -Cmacas183.fmq.abcd.com -CaAdministrator -Cjacas183.fmq.abcd.com -Cp3500 “

The highlighted items are parameters default values provided in the job. While executing the job , if the user wants to change this default values to the user defined entries, we have to make the following changes in the script.

/proj/sap/SBOP_INFO_PLAT_SVCS_40_LNX64/dataservices/bin/AL_RWJobLauncher /proj/sap/SBOP_INFO_PLAT_SVCS_40_LNX64/dataservices/log/DEV_JS_1/”

-w “inet:acas183.fmq.abcd.com:3500″ ” -PLocaleUTF8 -R\”REPO_NAME.txt\”  -G”1142378d_784a_45cd_94d7_4a8411a9441b”

-r1000 -T14 -LocaleGV -GV\”\$Character_123=$1;\$Integer_One=$2;\”  -GV\”DMuMDEn;\”    -CtBatch -Cmacas183.fmq.abcd.com -CaAdministrator -Cjacas183.fmq.abcd.com -Cp3500 “

Where $1 and $2 are the parameters passed by the user replacing the default values.

 

Thus the job should execute in the following way

 

. ./Job_Name.sh $1 $2

Areas of difficulty.

 

The user entries should feed to the script as encrypted data. For this encryption, the value should be encrypted using AL_Encrypt utility.

 

That means if user need to pass an integer value 10 for a parameter variable say $Integer_One in the job, then he cannot use $Integer_One=10; instead he has to pass “MQ” which is the result of the utility AL_Encrypt

Al_Encrypt 10;

Result : – MQ

I have created a Script that can resolve the issue to a very good extend.

Logic of the Custom Script

Name of the Script: Unix_JOB_CALL.sh

Pre-Requisite:- Keep a parameter file (Keep entries line by line in the parameter order under a name “Job_Parm_File”)

(As we have different scripts for different jobs, we can keep different param files as well. Whenever there is a change invalue needed, user can simply go and modify the value without changing the order of parameter)

Sample Script Code

rm -f Unix_Param_Temp_File;

touch Unix_Param_Temp_File;

chmod 777 Unix_Param_Temp_File;

cat Job_Parm_File | while read a

  do

     AL_Encrypt $a >> Unix_Param_Temp_File

  done

JOB_PARAMS=`tr ‘\n’ ‘ ‘<Unix_Param_Temp_File`

. ./Test_Unix.sh $JOB_PARAMS

rm Unix_Param_Temp_File;

Through this you can execute the job with user defined parameter values using unix.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply