Focal Point
[CLOSED] Test if APP command was successful

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

November 20, 2013, 10:28 AM
TexasStingray
[CLOSED] Test if APP command was successful
Anyone know how to test to see if a call to an APP command like APP COPYFILE was successful?

This message has been edited. Last edited by: <Kathryn Henning>,




Scott

APP COPYFILE IBISDAMP FLOWDESC.XSD DEFAULT  TDEST FLOWDESC.XSD DEFAULT
-RUN

-TYPE &FOCERRNUM


This results in '36307' so I know that an error occurred... Perhaps testing &FOCERRNUM after a -RUN will suffice.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
You don't list your platform in your post but if you are running on a Windows box, you could check for the file existence after the copy with the DOS STATE command then poll the value of &RETCODE. &RETCODE = 0 on success and -1 otherwise.

I suppose that if the target file exists prior to the copy that you would need to delete it, then copy the new file, and then check if it exists in the target location.

APP DELETEF ...
APP COPYF ...
DOS STATE file
-IF &RETCODE EQ 0 THEN .... ELSE...;

Hope that helps,

Norb


prod:7.6.9, win2k3 mre, caster, bid, devstudio 7.6.9
Testing &FOCERRNUM does not always return an error. If the app folder is not there an error will be returned if the file is not there it does not seem to return an error. Want to get rid of all DOS commands that this can be a big security hole.




Scott