ECHO and EXEC Function

Hi Gurus

I am trying to invoke batch script below from BODS using EXEC function
My requirement is to open a file in the directory and read the first line and pass it back to the BODS function which called the bat file


$L_READ_RETURN_VALUE = PRINT(EXEC(‘D:\Projects\SAP_GIS_AUDIT\INBOUND\SDME\READ_LINE.BAT’,‘’,0));

When I am specifying echo off the output is echo off , When I am specifying echo on its printing the whole script

Can anybody help please ?


abhilash.joseph (BOB member since 2014-02-06)

It goes wrong with the second parameter for exec()

parameter 0 returns NULL except if an error occurs.

I think you need parameter 8, it will return the stdout and stderr.

Please consult the DS_42 reference guide at page 826 for more info. :slight_smile:


H. Westerhof :netherlands: (BOB member since 2010-03-26)

The first parameter that I use is usually “cmd.exe”.


eganjp :us: (BOB member since 2007-09-12)