Focal Point
[SOLVED] Error Handling

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

June 24, 2015, 06:24 PM
prodrigu
[SOLVED] Error Handling
Is there any new documentation or tips/tricks on Error Handling? I searched but didnt see anything new.

I know how to display the error when it occurs but I also want to display the line number or let me know the TABLE FILE or HOLD FILE the error occured in.

Is this possible?

Thanks,
prodrigu

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


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
June 24, 2015, 07:36 PM
Waz
As far as I know, you can't get the line number.

I would suggest a workaround of setting a string at each error test detailing what is needed, e.g. line number and master or a description of what was being done at that step.


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!

June 24, 2015, 07:55 PM
prodrigu
Waz,

I already have a -INLCUDE file to check for errors and no records return but I wanted to see if I can what line (which you said not possible) and display the current hold file the error occurred. I have this INCLUDE file after each HOLD file.

Do you have an example of error handling you can show me maybe you worked on before?

Right now we dont have error handling and I am trying to implement it since we are moving 3/4 of our reports to go against Netezza DB.

Thanks,
prodrigu


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
June 24, 2015, 11:45 PM
Waz
I'm going to have to dig it out, I don't have it with me.


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!

June 26, 2015, 05:05 AM
Ian Dalton
You could put in something at the end of your fex like:
-SET &PROG = XXXXXXXX;
-RUN
EX &PROG
-RUN
-IF &FOCERRNUM NE 0 THEN GOTO EX_ERROR ;
-RUN

-COMPMSG

-TYPE ==================================================================
-TYPE &PROG : COMPLETED SUCCESSFULLY
-TYPE ==================================================================
-GOTO CONT_XX

-EX_ERROR
-TYPE *******************************************************************
-TYPE &PROG - A PROBLEM HAS OCCURRED
-TYPE FOCERRNUM = &FOCERRNUM RETCODE = &RETCODE
-TYPE *******************************************************************
DOS ECHO &PROG > ERROR.DAT
-CONT_XX
-EXIT


_______________________
*** WebFOCUS 8.1.05M ***
June 26, 2015, 05:40 AM
Ian Dalton
To capture the error line and message in a file try:-

FILEDEF EMGFILE DISK EMGFILE.DAT
-RUN
SET EMGSRV=FILE
TABLE FILE CAR
PRINC CAR
END
-RUN


_______________________
*** WebFOCUS 8.1.05M ***
June 29, 2015, 11:53 AM
prodrigu
Thanks Ian!!!

Waz, did you have a chance to dig it out or no. If not dont worry about it.

Thanks,
prodrigu


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
June 29, 2015, 03:09 PM
eric.woerle
Ian,

quote:
SET EMGSRV=FILE

Is that a maintain command? I don't see any documentation on EMGSRV.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
June 29, 2015, 03:34 PM
Francis Mariani
The documentation for EMGSRV is in "WebFOCUS New Features 8.0.08" (80snf.pdf).

quote:

Capturing Event Routing for Specific FOCUS Error Conditions

You can now use the EMGSRV profile command to capture event routing for specific FOCUS
error conditions. The EDAPRINT/ON value enables you to use existing server event routing
facilities to create custom filters that trigger email alerts and/or procedure execution for enduser
events that would not normally be routed to the edaprint log.


Hmmm... The "FILE" option is not documented there.


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
June 29, 2015, 03:44 PM
prodrigu
Thanks Francis with the info...

I was wondering why it didnt work for me. I am currently using WF 7.7.03 and ive been pushing to upgrade to 8.0.

Thanks,
prodrigu


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
June 29, 2015, 06:24 PM
Waz
Hi Prodrigu,


This is what we did in my last job.

This is in a common fex
-SET &_VALID_ERROR_NUMBERS = '0, 3218, 32456, 36220' ;


END

-RUN

-IF NOT &FOCERRNUM IN (&_VALID_ERROR_NUMBERS.EVAL) THEN GOTO RPT_FERR ;

.
.
.
.


-GOTO RPT_OK

-*******************************************************************************
-RPT_ER1

-SET &RPT_MSG ='Error Message 1';
-GOTO RPT_END
-*******************************************************************************
-RPT_ER2

-SET &RPT_MSG = 'Error Message 2' ;
-GOTO RPT_END
-*******************************************************************************
-RPT_ER3

-SET &RPT_MSG = 'Error - ' | &ERR_MSG ;
-GOTO RPT_END
-*******************************************************************************
-RPT_FERR

-SET &RPT_MSG = 'Error - Focus Error Number '
-             | &FOCERRNUM | ' Encountered' ;
-GOTO RPT_END
-*******************************************************************************
-RPT_ZERO_RECS

-INCLUDE ZERO_REC_HANDLER

-IF &FOCERRNUM GT 0 THEN GOTO RPT_FERR ;

-*******************************************************************************
-RPT_OK

-SET &RPT_MSG = 'Report Successful' ;

-RPT_END

-INCLUDE MESSAGE HANDLER




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!

June 30, 2015, 05:22 AM
Ian Dalton
Hi Prodrigu,
I used SET EMGSRV=FILE in 7.7.03 and it works fine - don't know about version 8 though.
Regards,
Ian


_______________________
*** WebFOCUS 8.1.05M ***
June 30, 2015, 11:32 AM
prodrigu
Thanks Ian!!!!

I got it to work with the below code. All I needed to do it SET TEMPERASE=OFF.

  
SET TEMPERASE=OFF

-SET &TEMPPATH=TEMPPATH(80,'A80');
-TYPE &TEMPPATH

FILEDEF EMGFILE DISK EMGFILE.DAT
-RUN
SET EMGSRV=FILE
TABLE FILE CAR
PRINC CAR
END
-RUN



Thanks,
prodrigu


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
July 01, 2015, 04:16 AM
Ian Dalton
Hi Prodrigu,
Instead of setting TEMPERASE=OFF, just FILEDEF the output file to a specific loaction.
ie. FILEDEF EMGFILE DISK C:\ibi\apps\data\EMGFILE.DAT
Regards,
Ian


_______________________
*** WebFOCUS 8.1.05M ***