BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Follow BOB on Twitter! 
Follow BOB on Twitter! (Opens a new window)  

General Notice: No events within the next 45 days.

Master/Child Job Passing Encrypted Global Variables


 
Search this topic... | Search DI: Designer and Job Design... | Search Box
Register or Login to Post    Forum Index -> Data Integrator -> DI: Designer and Job Design  Previous TopicPrint TopicNext Topic
Author Message
Nickster19
Forum Member
Forum Member



Joined: 10 Aug 2017

Posts: 3



PostPosted: Thu Aug 10, 2017 11:36 am 
Post subject: Master/Child Job Passing Encrypted Global Variables

We have been migrating a bunch of our repositories from 3.2 to 4.2 One repository has a master job that runs and calls a bunch of child jobs. The master job passes Global Variables to the child job. We have had issues when trying to get the child jobs to run with the passed global variables. I have viewed many different forums and tried every way I could find to encrypt the variables and pass them to the child job, but have not found any success. I have also tried passing -GI so the variables don't need to be encrypted, but no luck. Any help on this would be greatly appreciated. I have spent the past few weeks trying to figure this out. Below is the detailed example master/child job I am trying to execute with encrypted global variables.

Thanks for taking a look and offering any suggestions or help!


Master Job Script:
#Set Variables
$G_VAR1 = 'Test';

#Encrypt Variables
$G_VAR1_En = exec('AL_Encrypt ','\''||$G_VAR1||'\'');

#Encrypt Second Way
$G_NEWVAR = '\$G_NEW_VAR1';
$G_VAR1_2 = $G_NEWVAR||'='||$G_VAR1_En;

#EXECUTE CHILD JOB
print (exec('/DS/dataservices/log/Job_Child.sh',$G_VAR1_En,icon_cool.gif);
print (exec('/DS/dataservices/log/Job_Child.sh',$G_VAR1,icon_cool.gif);
print (exec('/DS/dataservices/log/Job_Child.sh',$G_VAR1_2,icon_cool.gif);


Shell Script (Job_Child.sh)
/DS/dataservices/bin/AL_RWJobLauncher "/DS/dataservices/log/JS_DEV_LOCAL_3502/" -w "inet:server.dev.domain.com:3502" -C "/DS/dataservices/log/Job_Child.txt"


Text File (Job_Child.txt)
-PLocaleUTF8 -R"ETL_NICK.txt" -G"cf4f0bb8_c3f1_4b9e_bd8c_65915f624c65" -t5 -T14 -LocaleGV -GV\"\$G_NEW_VAR1=$1;\" -CtBatch -Cserver.dev.domain.com -CaAdministrator -Cjserver.dev.domain.com -Cp3502

Child Job Script will print out the value of $G_NEW_VAR1

Thank you!
Back to top
jlynn73
Forum Associate
Forum Associate



Joined: 27 Oct 2009

Posts: 538
Location: DesMoines Iowa


flag
PostPosted: Fri Aug 11, 2017 8:05 am 
Post subject: Re: Master/Child Job Passing Encrypted Global Variables

$G_VAR1 = 'Test';
print( exec( 'cmd','al_encrypt.exe "[$G_VAR1]"',icon_cool.gif);

stdout=
0: VGVzdA


use brackets if you need to '[$concatenate] [$variables]'. Don't make it more complicated than it needs to be.
Back to top
Nickster19
Forum Member
Forum Member



Joined: 10 Aug 2017

Posts: 3



PostPosted: Fri Aug 11, 2017 10:15 am 
Post subject: Re: Master/Child Job Passing Encrypted Global Variables

jlynn73 - Thank you for your help. I can correctly encrypt the variable, however I can't figure out the syntax to pass the variable to the Job_Child.txt file for command line execution. From my research, I don't change anything on the Job_Child.sh script. Before our migration, we were simply passing the variable to the .sh script using -LocaleGV -GV\"\$G_NEW_VAR1=$1;\".

Passing the encrypted variable I receive the following error "The data <$1> is invalid. Use the AL_Encrypt utility to encode substitution variable and global variable data prior to adding them to the Data Services job command line."
Back to top
jlynn73
Forum Associate
Forum Associate



Joined: 27 Oct 2009

Posts: 538
Location: DesMoines Iowa


flag
PostPosted: Fri Aug 11, 2017 10:32 am 
Post subject: Re: Master/Child Job Passing Encrypted Global Variables

My guess is the script is not recognizing the parameter as its inside quotes. (escaping your parameter)

I definitely feel your pain. Working with these command line files is extremely tedious. I use Python to generate these from a master copy.

I believe theres an OS limitation to the number of parameters you can pass.

I take something like this:
-LocaleGV -GI -GV"$FileName=&&FileName;" -CtBatch
and feed a parameter file to a script, which then replaces the &&Parameters.

Which helps when you have a couple dozen parameters... crazy.gif
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Data Integrator -> DI: Designer and Job Design  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0104 seconds using 17 queries. (SQL 0.0028 Parse 0.0002 Other 0.0074)
CCBot/2.0 (http://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo