Focal Point
[CLOSED] DOS command execution status

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7207004306

May 06, 2011, 07:05 PM
Bill Helzing
[CLOSED] DOS command execution status
I'm looking for advice on how to receive a completion status code from a non-WebFOCUS executable that is initiated with a DOS command from within a FOCEXEC.

If anyone has done this before, can you advise me on how it was accomplished.

Thanks for your time,
Bill Helzing IBI - Chicago

This message has been edited. Last edited by: Kerry,
May 06, 2011, 09:00 PM
Waz
I think this has been asked before, or something very similar.

What version of WebFOCUS are you on ?

Please update your signature.

Have you looked at the SYSTEM command.
SYSTEM command


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

May 08, 2011, 01:03 PM
<JG>
The real question I suspect is,

How do you return the completion code of third party programs executed using WebFOCUS OS level calls.

The answer is,

Directly you can't.

WebFOCUS does not know or care about the OS level program.

The OS level Program does not know or care about WebFOCUS.

All reasonable "batch" execution systems allow log writing.

The WebFOCUS SYSTEM function waits for completion of the CALL as opposed to ! DOS etc. which does not.

Write the log.

Map the log to WF.

Read the log.
May 09, 2011, 04:36 AM
Computix
Hi Bill,

what I do make some calls with -WINNT and retrieve the Exit-Code within WebFOCUS.

e.g.
 
-WINNT powershell -Command "exit ((get-content xyz.txt).length)"
-SET &COUNT = &EXITRC;

Regards Markus


WF 7.6.6 (MRE,BID, DevStudio, partly RC) on Windows 2003 /Apache/Tomcat
Output: HTML,Excel,PDF,PPT
Adapters: SQL Server, DB2, Oracle
May 09, 2011, 09:11 AM
dlogan
Depending on how complicated the output is, you can also just do a simple redirect.

e.g.
DOS dir > output.txt

Stores the output of the dir command into the output.txt.

You should then be able to read the output back in using FOCUS and parse it.


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP