I have this code anytime i run it the &LINES keeps returning zero even though there is a record that is returned. Am i doing something wrong??
TABLE FILE &TABLE_NAME2 PRINT PART -*ON TABLE HOLD AS &TABLE_NAME2 END -RUN
-SET &LINES=&LINES; -TYPE '>>>>>>>>>>>>>>DODO ' &LINES -IF '&LINES.EVAL' EQ '1' THEN GOTO NODATA;This message has been edited. Last edited by: joyesiji,
WebFOCUS 7.6.9 Windows all output (Excel, HTML, PDF)
February 24, 2012, 04:41 PM
joyesiji
and when i even look at the debug code i see
-RUN 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 -SET &LINES= 0; -TYPE 'LINES' 0
so why is &LINES always 0
WebFOCUS 7.6.9 Windows all output (Excel, HTML, PDF)
February 24, 2012, 06:25 PM
Crymsyn
It is always zero because you are setting it to zero. It is a parameter that is automatically set and do not need to set it or define it. Try
TABLE FILE &TABLE_NAME2
PRINT PART
-*ON TABLE HOLD AS &TABLE_NAME2
END
-RUN
-TYPE '>>>>>>>>>>>>>>DODO ' &LINES
-IF &LINES EQ 1 THEN GOTO NODATA;
WF: 8201, OS: Windows, Output: HTML, PDF, Excel
February 24, 2012, 06:25 PM
njsden
quote:
TABLE FILE &TABLE_NAME2 PRINT PART ON TABLE HOLD AS &TABLE_NAME2 END -RUN
That would be a weird behaviour, however, I don't know if the fact that you are attempting to write to the same file you're reading from maybe causing WebFOCUS counters to go nuts ...
Can you try writing to a different HOLD file and then show both &LINES and &RECORDS to see what you get?
It would also be nice to know what your EMPTYREPORT setting is.This message has been edited. Last edited by: njsden,
-* File joyesiji01.fex TABLE FILE CAR PRINT COUNTRY ON TABLE HOLD END -RUN -TYPE &LINES
Do you get 5?
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
February 26, 2012, 01:19 PM
<JG>
&LINES is a reserved variable.
Play with it and it will do strange things.
-SET &whatever = &LINES;
-IF &LINES EQ/NE/GT/LT x GOTO ...
Is about all you can do with it.
Best practice is.
WF Request -RUN -SET &your_variable = &LINES;
Do what you need based on &your_variable
February 26, 2012, 02:03 PM
joyesiji
Thanks guy i was able to find out why it was not working , there was a sql query before the code and that sql code contained errors, even though webfocus ran the TABLE FILE correctly and returned one result the &LINES was always 0, once i fixed the sql code then &LINES returned 1, Can i use &RECORDS instead of &LINES
WebFOCUS 7.6.9 Windows all output (Excel, HTML, PDF)
February 27, 2012, 01:07 AM
SriAravind
&LINES - Use this when you want to find out how many records are there in the hold file or report.
&RECORDS - Use this when you want to find out the number of records read from the database.
WebFocus Version 7.7.05 Windows, HTML/PDF/EXL2K/AHTML
March 02, 2012, 04:19 PM
joyesiji
Resolved
WebFOCUS 7.6.9 Windows all output (Excel, HTML, PDF)