cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with exec() command in 4.1

Former Member
0 Kudos

I am having issues with exec() in DS 4.1 The same script works fine in 3.2. Below is the script I am using -

$L_ETL_EXEC_FILE = 'JOB_XXX_ABC';

$L_ETL_FILENAME = GET_ENV ('LINK_DIR') || '\LOG\[$L_ETL_EXEC_FILE]' ;

print($L_ETL_FILENAME);

$L_RETURN_VARCHAR2 = EXEC ('[$L_ETL_FILENAME]', '', 8);

print('JOB_XXX_ABC Execution result: [$L_RETURN_VARCHAR2]');

Basically, this script kicks off another job. But when I run the job with the above script to kick off the other job, its giving error 50307/50616.

In the above EXEC statement, if I use '8', there's no error but this job is not kicking off the other job as it is supposed to. But if I use '1' in the above EXEC statement, its failing with error 50307/50616.

Function <exec> failed to launch program <E:\Program Files (x86)\SAP BusinessObjects\DataServices\LOG\JOB_XXX_ABC>, due to error <50616

Is this a privilege issue? In 3.2, this is all working fine.

In 4.1, we are having this issue. We are migrating the jobs from 3.2 to 4.1

Can someone please help?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member106536
Active Participant
0 Kudos

If there are spaces in your path, it will teach each subsequent 'word' as an additional argument unless quoted.

I would store that base path as a substitution variable.  Then if that path changes, you wont have to update it all over the place ... just in the subst var. 

Former Member
0 Kudos

Hi Joshua,

This is the code I am using -

$L_ETL_EXEC_FILE = 'JOB_TEST';

$L_ETL_FILENAME = GET_ENV ('DS_COMMON_DIR') || '\LOG\[$L_ETL_EXEC_FILE]' ;

print($L_ETL_FILENAME);

$L_RETURN_VARCHAR2 = EXEC ('[$L_ETL_FILENAME]', '', 1);

print('JOB_LOAD_BHI_REFERENCE_CODE_SET Execution result: [$L_RETURN_VARCHAR2]');

And, the error says it can't find the full path when I run the job with an error 50616 -

C:\ProgramData\SAP BusinessObjects\Data Services\LOG\Job_Name


If I were to use this path as substitution variable, would it help?

Former Member
0 Kudos

Just to check, are you not calling AL_RWLauncher anywhere?

Arun

Former Member
0 Kudos

Did you mean AL_RWJobLauncher.exe? No, I am not calling that anywhere. I was using the same code in 3.2 successfully.

former_member106536
Active Participant
0 Kudos

Try putting double quotes around the path.  If you use a subst var, it will take care of that for you.

you'll only make this mistake so many times before you start calling yourself names for forgetting to quote the path.  /bonk

may be something else, but this is an easy one to test.

Former Member
0 Kudos

Hi Joshua,


Did you mean double quotes around the following? I will be using a variable instead but is this where you wanted the double quotes?


$L_ETL_FILENAME = GET_ENV ('DS_COMMON_DIR') || ''\LOG\[$L_ETL_EXEC_FILE]'' ;


_____________________________________________________________________________________


$L_ETL_EXEC_FILE = 'JOB_TEST';

$L_ETL_FILENAME = GET_ENV ('DS_COMMON_DIR') || '\LOG\[$L_ETL_EXEC_FILE]' ;

print($L_ETL_FILENAME);

$L_RETURN_VARCHAR2 = EXEC ('[$L_ETL_FILENAME]', '', 1);

print('JOB_LOAD_BHI_REFERENCE_CODE_SET Execution result: [$L_RETURN_VARCHAR2]');

former_member106536
Active Participant
0 Kudos

you would need to wrap double quotes around the entire path:

$L_ETL_FILENAME = '"' || GET_ENV ('DS_COMMON_DIR') || '\LOG\[$L_ETL_EXEC_FILE]"' ;


if you do a directory listing of just the path... print(exec('cmd','dir "' || GET_ENV ('DS_COMMON_DIR') || '\*.*"',8));   ... it should tell you if thats the problem.


I know that I had issues when they changed the install directory, because they decided to add blanks in the path (for whatever reason) and when you print the stdout its not entirely clear if theres a blank in there as it spans multiple lines in the log.  I dont have direct access to the job server so its faster for me to do a dir *.guess than it is to get an answer out of the admin.  ;(



Former Member
0 Kudos

Sure. I will try this option. Thanks for your time, Joshua. Will keep you posted.

Former Member
0 Kudos

You are trying to call a .bat file correct? If thats the case why you need to write a custom script like this?

You could have inserted an exec() in a script after the dataflow.

exec('cmd.exe','E:\Program Files (x86)\SAP BusinessObjects\DataServices\LOG\JOB_XXX_ABC.bat',8);

Arun

Former Member
0 Kudos

No, this script kicks off another job. Basically, a set of scripts are included in a master job which in turn executes several other jobs. So, the idea is to run one job which will trigger all other jobs.

Former Member
0 Kudos

Hi,

Is it a same server (4.1) or new installation? If it is same server regenerate the batch file once again and include the file extension as well in the code.

Regards,

Chenna.