Focal Point
Include Procedure Not Working

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

October 10, 2007, 11:15 AM
KentO
Include Procedure Not Working
I am trying to include a .FEX procedure in another .FEX procedure. The included procedure is found but the code is ignored as if the procedure is skipped.

My calling procedure is LUSER.FEX:

DEFINE FILE LOGAGREE
CNTR/I4 = 1;
-INCLUDE PROJECT
END
TABLE FILE LOGAGREE
PRINT PROJNAME PROJWT PROJGIVE CNTR
BY PROJECT
IF MONTHS EQ &SELMO
END

My called procedure is PROJECT:

PROJECT/A7 = (LOGACCT|EDIT(SEQNO));

Is it possible to include a procedure in the define file section of a calling procedure?

Kent


Windows2003 Server, WebFOCUS 7.7.02 Developers Studio and MRE
October 10, 2007, 11:21 AM
Francis Mariani
Managed Reporting? Self Service? WebFOCUS Version?

Yes it is possible to include a procedure in a DEFINE. How do you know that the procedure is found? What is the error message you're getting?

I would put a -RUN after the END commands of the DEFINE and the TABLE.

If you're running the fex from within MRE, you may need -MRNOEDIT -INCLUDE PROJECT.


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
October 10, 2007, 11:23 AM
GinnyJakes
Kent,

Let's rule out the easiest situation first, pathing. Is the included focexec in the same directory that your source focexec is in or in the same application path?

If not, you might have to say this:

-INCLUDE DIRNAME/PROJECT

I would consider this to be a best practice anyway as it makes the include self-documenting.

If that is not the problem...

You didn't mention what release you are running but there was an issue with this way back when in 5.2.x. When you included the define, it required that it be complete. That means including the define and end statement.

Change project so that it looks like this:

DEFINE FILE LOGAGREE ADD
PROJECT/A7 = (LOGACCT|EDIT(SEQNO));
END

Then change your source program thusly:

DEFINE FILE LOGAGREE
CNTR/I4 = 1;
END
-INCLUDE DIRNAME/PROJECT
TABLE FILE LOGAGREE
PRINT PROJNAME PROJWT PROJGIVE CNTR
BY PROJECT
IF MONTHS EQ &SELMO
END

I hope that resolves your problems.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 10, 2007, 11:04 PM
Piipster
quote:
DEFINE FILE LOGAGREE
CNTR/I4 = 1;
-INCLUDE PROJECT
END



I don't see why this wouldn't work. Have you added this to the beginning of your code?

-DEFAULT &ECHO=ALL

This will show you how the code is being resolved.

What makes you say the code is found but ignored? Error messages?


ttfn, kp


Access to most releases from R52x, on multiple platforms.
October 11, 2007, 03:39 PM
KentO
Thanks for all the help. I have resolved the problem. Using "Echo" showed me what what was wrong.
Kent


Windows2003 Server, WebFOCUS 7.7.02 Developers Studio and MRE