cancel
Showing results for 
Search instead for 
Did you mean: 

.bat execution in BODS script

Former Member
0 Kudos

Hi Folks,

I was trying to call a batch script from Data Services.

The goal was to execute the .bat script residing on BODS server D:/DSS/exec/file_move.bat

Here is the syntax that am using:-

exec( 'D:/DSS/exec/ds_file_move.bat' , $lv_source||' '||$lv_target||' '||$lv_fname, 8 )

I print the return code and it is - " 1: 'd 6? is not recogn "

I am not sure if we need to set on the BODS server and any pre-requisits to be handled before hand to invoke the batch scripts.

Any inputs on this will be really appreciated.

Thanks,

Amarri

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Ashwin,

If the job server is a windows machine, assume that it is because its a .bat file, I would start with a script

$foo = exec('cmd', 'echo ' || $lv_source || ' '|| $lv_target || ' ' || $lv_fname, 8);

print( 'the output |' || $foo );

Where $foo is a varchar(2048) or a length enough.

so you can verify the command line parameters pass thru as intended.

The string " 1: 'd 6? is not recogn "  is not long enough to hold the entire message.

maybe you could add "@echo on" to the bat file and see the context of the error?

Jim

Former Member
0 Kudos

Try

exec( 'D://DSS/exec//ds_file_move.bat' , $lv_source||' '||$lv_target||' '||$lv_fname, 8 )

Arun

former_member200473
Contributor
0 Kudos

Hi  Ashwin,

Have a look in to the below mentioned link:

http://scn.sap.com/message/13741603#13741603

it may help you.

Regards,

Shiva Sahu