Focal Point
Clearing All

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

November 19, 2007, 11:09 AM
IBForum
Clearing All
I'm calling a fex multiple times w/in one session using the EX operator in WebFOCUS 7.6.1, and the fields that store market value sums are doubling each time EX calls a new report. Is there a way in WebFOCUS to clear all variables, internal tables, etc. between EX calls? We just upgraded to version 7.6.1 and this report ran fine under 5.2.3. I've tried putting a FILEDEF CLEAR and explicitly added CLEAR to my DEFINEs, but that didn't work. Thanks in advance for your time.


WF 8.1.05, Windows Server 2012 R2
November 19, 2007, 11:58 AM
Francis Mariani
What do you mean by "the fields that store market value sums are doubling each time EX calls a new report"?

Are these fields in a report or are they Dialogue Manager variables?

Are you using APPEND in your FILEDEF's?


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
November 19, 2007, 06:04 PM
IBForum
Francis,
Thanks for the reply. I wanted to do some more investigation before getting back to you. I just meant that if I have a fex that contains the following 3 lines of code...

EX REPORT.FEX
EX REPORT.FEX
EX REPORT.FEX

...the real database field, in this case ending market value (EMV), is doubled in the second output and tripled in the third. We are using an append in the FILEDEF. However, it looks like we may have an issue with our use of the &TOD variable to create unique files for each run of REPORT.FEX. Previously, the value of &TOD was unique each time EX REPORT.FEX was called. It looks like in version 7.6.1 this now remains static for each subsequent EX REPORT.FEX. I'm going to look for some documentation on &TOD to see if this has changed behavior. I'm also going to hard code the name of the output files defined in our FILEDEF and see if that fixes the problem.


WF 8.1.05, Windows Server 2012 R2
November 19, 2007, 06:42 PM
Francis Mariani
According to the 5.3.2 documentation, "&TOD - Returns the current time. When you enter FOCUS, this variable is updated to the current system time only when you execute a MODIFY, SCAN, or FSCAN command. To obtain the exact time during any process, use the HHMMSS subroutine", so the behaviour hasn't changed.

Try using the HHMMSS function instead:

-SET &TIME1 = EDIT(HHMMSS('A8'),'99$99$99');



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
November 20, 2007, 08:53 AM
GamP
When you use append, then it seems logical to me that values get doubled or tripled.
But, since you also mention creating the files with unique names, I think that this already crossed your mind.
Assigning a name using the time-method (using Francis' method) of course only works if you're quite sure that 1 cylce through report.fex takes absolutely more than 1 second. Otherwise you might consider to have the controling fex assign numbers, such as:
EX REPORT SEQUENCE=1
EX REPORT SEQUENCE=2
EX REPORT SEQUENCE=3
and then use the sequence number to make the holds unique.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 20, 2007, 10:46 AM
IBForum
Thanks for the help/info Francis and GamP. Once I hard-coded unique file names the problem indeed went away. What is really weird is that we had this report working consistently in 5.2.3 and more often than not in version 7.1.1. In version 7.1.1, things would sporadically double up, but I thought that was because two reports were running faster than one second. By the way, this was another person's design. I would probably not have chosen to base the filename on the &TOD variable. If nothing else comes to mind, I was thinking of concatenating the HH:MM:SS and a random number together to come up with a unique filename.


WF 8.1.05, Windows Server 2012 R2
November 21, 2007, 11:04 AM
ira
Whenever you get a result doubling - always use a different name and see if the results change..
also
-SET &TIME = HHMMSS ('A8');
-TYPE &TIME will show you current time. &tod shows oyu the time you entered into the focus/webfocus session... whereas hhmmss is running clock time when invoked.

Ira. wf 5.3.6 prod aix 533, test 7.6.1 windows


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0