Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How to flush data from a HOLD file used in a loop.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to flush data from a HOLD file used in a loop.
 Login/Join
 
Guru
posted
Hi All,
I am using a HOLD file (and reading from it using READ ) which is inside a loop. Every time loop comes back to starting point it inserts new data, but it seems HOLD file is not flushing the old data hence every time i get the old data.
I am using Oracle 8i on WinXP with WF713.
Thanks,
Shankar


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Guru
posted Hide Post
Hi,
Please let me know if there is any syntax which i can use.
I tried finding some previous discussions but to no avalil.
Frowner


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Master
posted Hide Post
are you using a -READ with NOCLOSE




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Guru
posted Hide Post
No, i am not using NOCLOSE with READ.
Simple READ like this:
-READ TEMP_CNT &CNT_IP.A5
-RUN

When the loop comes back here it doesnt overwrite previous value, instead everytime it reads the first value stored here.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Virtuoso
posted Hide Post
The -RUN is effectively closing the file TEMP_CNT. If you have your -READ in a loop, remove the -RUN, it is unnecessary.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
You most likely do not have a -RUN after the TABLE FILE... PRINT... ON TABLE HOLD... END statement. You need the -RUN before the -READ.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Hi Alan, Francis,
I've removed all the -RUN after -READ inside the loop.
I do have a -RUN after the TABLE FILE... PRINT... ON TABLE HOLD... END statement.
Still i am getting the same result i.e. the variable populated by -READ is always showing the same old value. However when I do a view source of the report, i am getting below warning:
(FOC441) WARNING. THE FILE EXISTS ALREADY. CREATE WILL WRITE OVER IT
It gives me warning but never overwrites it.
Is there any direct way to flush the -READ variable and the HOLD file through which -READ is reading value.
Please help!!!


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Expert
posted Hide Post
Hi Shankar,

Can you please post your complete code for us to take a look at? READ does not place data in ANY file.

Thank you in advance for sharing with all. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Expert
posted Hide Post
A working example:

-*-SET &ECHO=ALL;

-SET &C1 = 'ENGLAND';
-SET &C2 = 'FRANCE';
-SET &C3 = 'CANADA';
-SET &C4 = 'ITALY';

-REPEAT ENDREP1 FOR &COUNTER FROM 1 TO 4
TABLE FILE CAR
SUM CNT.CAR CAR
WHERE COUNTRY EQ '&C.&COUNTER'
ON TABLE HOLD AS H001 FORMAT ALPHA
END
-RUN

-READ H001 &CNT_CAR.I5. &CAR.A16.
-TYPE *******************************
-TYPE COUNTRY IS &C.&COUNTER / CAR COUNT IS &CNT_CAR / SAMPLE CAR IS &CAR
-TYPE *******************************

-ENDREP1


Are any of the TABLE files resulting in zero records? That is most likely the issue. As illustrated in the example above: no cars for Canada, but the car for France is being read.

This solves the issue:
-*-SET &ECHO=ALL;

-SET &C1 = 'ENGLAND';
-SET &C2 = 'FRANCE';
-SET &C3 = 'CANADA';
-SET &C4 = 'ITALY';

-REPEAT ENDREP1 FOR &COUNTER FROM 1 TO 4

-REP1
TABLE FILE CAR
SUM CNT.CAR CAR
WHERE COUNTRY EQ '&C.&COUNTER'
ON TABLE HOLD AS H001 FORMAT ALPHA
END
-RUN
-IF &LINES EQ 0 GOTO NODATA;

-READ H001 &CNT_CAR.I5. &CAR.A16.
-TYPE *******************************
-TYPE COUNTRY IS &C.&COUNTER / CAR COUNT IS &CNT_CAR / SAMPLE CAR IS &CAR
-TYPE *******************************
-GOTO ENDREP0

-NODATA
-SET &CNT_CAR = 0;
-SET &CAR = '';
-TYPE *******************************
-TYPE COUNTRY IS &C.&COUNTER / CAR COUNT IS &CNT_CAR / SAMPLE CAR IS &CAR
-TYPE *******************************

-ENDREP0

-ENDREP1


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Hi,
Here is my code:
-SET &STARTSVCOFF = 2;
-SET &ENDSVCOFF = 4;
-LOOPBEGSVC
-SET &SVC_TEMP = '''' || SUBSTR(&SERVICE.LENGTH, &SERVICE, &STARTSVCOFF, &ENDSVCOFF, 3, 'A3') || '''';
-TYPE SVC_TEMP = &SVC_TEMP
SQL SQLORA
INSERT INTO APL_CCAM9.TEMP_CCAM_BASE_ALLOC_DETAILS
(YEAR_NBR)
SELECT BALLOC.YEAR_NBR
FROM APL_CCAM.CCAM_BASE_ALLOCATION BALLOC
WHERE 1=1
&YEAR_COND
AND BALLOC.SERVICE_CD = &SVC_TEMP
;
END
-RUN
-SET &CNT_IP = '';

USE CLEAR
JOIN CLEAR *
SQL SQLORA
SELECT YEAR_NBR CNT
FROM APL_CCAM9.TEMP_CCAM_BASE_ALLOC_DETAILS
WHERE ROWNUM = 1
;
TABLE
FILE SQLOUT
PRINT *
ON TABLE HOLD AS INP1 FORMAT FOCUS
END
-RUN
-TYPE DATA IS STORED IN WEBFOCUS HOLD FILE

JOIN CLEAR *
TABLE FILE INP1
SUM CNT NOPRINT
ON TABLE HOLD AS TEMP_CNT FORMAT ALPHA
END
-RUN
-READ TEMP_CNT &CNT_IP.A5

-TYPE DATA IS STORED IN WEBFOCUS VARIABLES
-TYPE CNT_IP = &CNT_IP


-IF &CNT_IP EQ '' THEN GOTO NOMATCHFND ELSE GOTO MATCHFND;
-NOMATCHFND
-TYPE INSIDE NOMATCHFND


-SET &STARTSVCOFF = &STARTSVCOFF + 6;
-SET &ENDSVCOFF = &ENDSVCOFF + 6;

-IF &SERVICE.LENGTH LT &STARTSVCOFF THEN GOTO 'LOOPENDSVC' ELSE GOTO 'LOOPBEGSVC';

-LOOPENDSVC

Hope this helps you ppl to help me out...


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Expert
posted Hide Post
TABLE FILE INP1
SUM CNT NOPRINT
ON TABLE HOLD AS TEMP_CNT FORMAT ALPHA
END

Is it possible to have zero records resulting from this TABLE FILE? If so, use the technique I showed you in my last posting to this thread.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How to flush data from a HOLD file used in a loop.

Copyright © 1996-2020 Information Builders