Batch file on the appserver environment.

LINUS

New Member
Hi All,

I am using openedge 10.1B and my appserver envi is on UNIX. I want to run a batch process or a XYZ.p file on the appserver. The main focus is the user can switch off his machine or log off from his client session, but the batch process should run on the appserver continuously.....

Please suggest.

Regards,
Linus.
 
Your requirement can't be implemented with the AppServer successfully. As soon as the client disappears the request on the agent is killed.

The only way to have a batch session running against the database that is independent of user interaction is to start a batch process using -b. But, you could start this batch session from an AppServer agent utilizing OS-COMMAND and starting a new mbpro session with it.

Regards, RealHeavyDude.
 
RealHeavyDude,

I am trying this.........

cProgName = "ob/testing1.p".
comm-str = STRING(DBNAME) + " -ld " + cdbname +
" -p " + cProgName + " &".
comm-str = comm-str + " -d " + SESSION:DATE-FORMAT + " ".
ASSIGN comm-str = " mbpro " + comm-str.
IF OPSYS = "UNIX" THEN
DO:
ASSIGN comm-str = comm-str + " >/dev/null 2>/dev/null".
UNIX VALUE(comm-str).
END.

But unable to get the result.... Am I doing wrong?

Thanks,
Linus
 
What are you meaning - you are unable to get the result?
What result do you expect?

I don't understand the ampersand in you command string ...

Try the following:
ASSIGN comm-str = SUBSTITUTE ( "mbpro -db &1 -ld &2 -p &3 -d &4 >/dev/null 2>/dev/null", DBNAME, LDBNAME, cProgName, SESSION:DATE-FORMAT ).

I am not a *nix guru - but have a look into the SILENT option to the OS-COMMAND and exec *nix command.


BTW, you should use OS-COMMAND, OS-COPY, OS-DELETE, etc. instead of UNIX since these port to all operating systems which are supported by Progress.
 
I don't understand the ampersand in you command string ...

Unix has ability to run any command as independent batch if & symbol is used in os-command. Even if parent process was killed it still be alive. But i think & should be last symbol in comm-str.
remove " &" from " -p " + cProgName + " &". line
and add
comm-str = comm-str + " &". /* at the end. */
OS-COMMAND silent value (comm-str).
 
Actually I want to run a testaa.p file as a batch process on appserver, which has the following code:

do i = 1 to 10:
disp "this is test message in batch process " + string(i).
pause 5.
end.

I added " &' in the last and run it with os-command.. But could not get this results in the log file.

Thanks,
Linus
 
You defined >/dev/null 2>/dev/null" which means all displays go to null device.

define stream teststream.
output stream teststream to log/batch.log append.
do i = 1 to 10:
message stream teststream STRING(TIME,"HH:MM:SS") " this is test message in batch process " + string(i).
pause 5.
end.
output stream teststream close.
 
Back
Top