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     [RESOLVED] &LINE Keeps returning 0

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[RESOLVED] &LINE Keeps returning 0
 Login/Join
 
Member
posted
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)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Member
posted Hide Post
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)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Gold member
posted Hide Post
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
 
Posts: 78 | Registered: November 08, 2010Report This Post
Virtuoso
posted Hide Post
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,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Member
posted Hide Post
Crymsyn, I am still getting 0 after removing
-SET &LINES=&LINES

njsden i already commented out the
ON TABLE HOLD AS &TABLE_NAME

and i am still getting 0


0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1
-*SET &LINES=&LINES;
-TYPE 'LINES' 0
'LINES' 0
-IF ' 0' EQ '1' THEN GOTO NODATA;


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Virtuoso
posted Hide Post
Do you mind posting your complete piece of code enclosed in
[code] tags?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Hi,
Could you run the following:
quote:

-* 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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
<JG>
posted
&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
 
Report This Post
Member
posted Hide Post
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)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Gold member
posted Hide Post
&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
 
Posts: 63 | Registered: January 12, 2011Report This Post
Member
posted Hide Post
Resolved


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Virtuoso
posted Hide Post
How?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Oh never mind, I just read your comment from before.

To flag it as resolved, please edit your original post and change it's title prefixing it with [RESOLVED]. That'll do it Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 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     [RESOLVED] &LINE Keeps returning 0

Copyright © 1996-2020 Information Builders