Focal Point
[SOLVED] Repeat loop throwing error

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

November 03, 2008, 06:16 AM
Narayana
[SOLVED] Repeat loop throwing error
Hi All,

I have a hold file which holds 3898 (value varies) records.
I need to use these records as input to another set of queries; so i have taken a REPEAT loop and sending the input records to the queries in the REPEAT loop. But it is throwing me the following error.
"REPORTING SERVER MESSAGES EXCEEDED IBIF_MAX_MESSAGES, REPORT RETRIEVAL ABORTED.
PLEASE CONTACT YOUR WEBFOCUS ADMINISTRATOR."

But the same loop is executing when i run the REPEAT loop for around 3000 records instead of giving the total recordcount from the hold file.

Please find below the code for your reference.

Thanks in Advance,


TABLE FILE DEPTLIST
PRINT
DEPT_I
CLASS_I
ITEM_I
DC_I
RETL_A
ON TABLE HOLD AS DEPTLIS1
END

-SET &LINECNT = &RECORDS;
FILEDEF SQLOUT13 DISK SQLOUT13.ftm (APPEND
-RUN
FILEDEF SQLOUT14 DISK SQLOUT14.ftm (APPEND
-RUN

-REPEAT REP1 FOR &CNT FROM 1 TO &LINECNT
-READ DEPTLIS1 NOCLOSE &DEPT_I.I6. &CLASS_I.I6. &ITEM_I.I6.

ENGINE DB2 SET DEFAULT_CONNECTION DB21
SQL DB2 PREPARE SQLOUT FOR
 SELECT B.DEPT_I DEPT_I, A.DIV_N DIV_N FROM DB2PROD.LGL_DIV A, DB2PROD.LGL_DEPT B
 WHERE B.DEPT_I=&DEPT_I AND B.GROC_DEPT_F='N' AND B.DIV_I=A.DIV_I
END

TABLE FILE SQLOUT
PRINT
DEPT_I
DIV_N
ON TABLE HOLD AS SQLOUT13
END

-SET &OUTCNT1 = &RECORDS;
-IF &OUTCNT1 = 1 THEN GOTO A ELSE GOTO B;
-A
ENGINE DB2 SET DEFAULT_CONNECTION DB21
SQL DB2 PREPARE SQLOUT FOR
 SELECT  MIN(A.RETL_A) MIN_RETL_A, MAX(A.RETL_A) MAX_RETL_A, ROUND(AVG(A.RETL_A),2) AVG_RETL_A, COUNT(*) CNTR1
 FROM DB2PROD.ITEM_STORE A, DB2PROD.LOC_RELT_SRVC_STGY B WHERE A.DEPT_I = &DEPT_I
 AND A.CLASS_I = &CLASS_I AND A.ITEM_I = &ITEM_I AND A.ITEM_STAT_C = 'A'
 AND B.RELT_TYPE_I = 'REGN' AND B.SRVC_STGY_I = '02'
 AND ((CURRENT DATE BETWEEN SRVC_STGY_EFF_D AND SRVC_STGY_EXP_D) OR
 (SRVC_STGY_EFF_D > CURRENT DATE AND SRVC_STGY_EXP_D > CURRENT DATE ))
 AND (SRVC_STGY_EXP_D > CURRENT DATE) AND B.RELT_LOC_I = 3894 AND B.LOC_I = A.STORE_I
END

TABLE FILE SQLOUT
PRINT
MIN_RETL_A
MAX_RETL_A
AVG_RETL_A
CNTR1
ON TABLE HOLD AS SQLOUT14
END

-GOTO REP
-B
-REP
-REP1

TABLE FILE SQLOUT13
PRINT
*
END

TABLE FILE SQLOUT14
PRINT
*
END

This message has been edited. Last edited by: Kerry,


Prod: WebFOCUS v7.1.4 OS: Windows Outputs: Excel, HTML, Pdf
November 03, 2008, 07:46 AM
Waz
The simple solution here is to turn ECHO OFF.

Your procedure is producing too many lines of code output, according to the variable IBIF_max_messages


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!

November 04, 2008, 03:06 AM
Narayana
The code does not have any ECHO statements or any TYPE statements.


Prod: WebFOCUS v7.1.4 OS: Windows Outputs: Excel, HTML, Pdf
November 04, 2008, 03:23 AM
Tony A
Read the manual / help files for the MSG environmental setting and see if that helps you out.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
November 04, 2008, 04:19 AM
Tony A
Narayana,

One other thing as it would help others performing a search on this sort of error, please change the title of this topic to something to do with "Max messages exceeded" so that it fits with the actual problem and not a symptom.

You can do this by editing your first post.

Thank you

T
November 04, 2008, 04:59 AM
GamP
There is no echo in your code, but it may very well be the process you're running does produce output lines of some kind. Since you're doing a whole lot of tables from a relational source, it may be that the output statistics from the table(s) are causing the message overload. You could try either increase the message limit or start the procedure with the statement SET MESSAGE=OFF.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 04, 2008, 02:34 PM
Michael Meagher
I had a similar problem that was solved by using SET MESSAGE=OFF.
November 04, 2008, 03:49 PM
j.gross
You issue two SQL select requests per row in DEPTLIST. For ~3000 entries, that's ~6000 separate requests.

Could you accomplish retrieval of the required data for a single set of DEPT/CLASS/ITEM values with a select on a join of the four DB2 tables
(DB2PROD.LGL_DIV, DB2PROD.LGL_DEPT, DB2PROD.ITEM_STORE, DB2PROD.LOC_RELT_SRVC_STGY)?

If so, you should be able to bundle the requests, using
SELECT . . .
WHERE . . .
AND(
(A.DEPT_I = ... AND A.CLASS_I = ... AND A.ITEM_I = ...)
OR (A.DEPT_I = ... AND A.CLASS_I = ... AND A.ITEM_I = ...)
. .
OR (A.DEPT_I = ... AND A.CLASS_I = ... AND A.ITEM_I = ...)
)
(
. . .
to cover multiple DEPT/CLASS/ITEM values in a single shot. You can generate and imbed the code for the DEPT/CLASS/ITEM selection using Define + Table + SAVE + -INCLUDE.

If selecting all the cases at once will exceed limits on the length of the query, you can still run a series of requests covering, say, 100 rows of values at a shot.


- Jack Gross
WF through 8.1.05
November 05, 2008, 06:01 AM
Frans
Simple solution; change max lines in your webfocus administration console/configuration/general then look for IBIF_max_messages and set it to 0.

Besides that, I think you should optimize your datarequest. Now you'll start 3000 agents, this doesn't seem like a efficient datarequest.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
November 05, 2008, 04:06 PM
Waz
Changing IBIF_max_messages to 0 can be dangerous. If the report code output is massive is could kill your browser, if in deferred mode it could fill the disk, we had job try to do that, all format errors from an APPEND.

I think setting ECHO and MESSAGE to off is the best starting point.

If this still happens, run the job deferred, and have a look at the deferred output file with the extension RSP, assuming you cannot retrieve the output.


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!

November 07, 2008, 12:47 AM
Piipster
Maybe start by looking at the edaprint.log to determine what the messages are. Then you can make a change appropriate to the messages.


ttfn, kp


Access to most releases from R52x, on multiple platforms.