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     [Solved] GET 0 IS COUNT IS 0

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] GET 0 IS COUNT IS 0
 Login/Join
 
Member
posted
I'm using a table file and I want to count the number of stores that match a certain criteria,
the following code works fine if there are at least 1 match, but if the count is 0 it will throw
an error saying there is a missing value for &STORE_COUNT when I expect it returns a 0,


TABLE FILE STORE_CATALOG
PRINT
CNT.STORE_ID AS STORE_COUNT;
WHERE STORE_ID EQ '&store_query'
ON TABLE SAVE AS STORE_COUNT FORMAT ALPHA
END
-RUN
-READ STORE_COUNT &STORE_COUNT.I5.

TYPE &STORE_COUNT

I really need it to return a 0 to set up a flag later on the program, any help will be appreciated.

This message has been edited. Last edited by: Kathleen Butler,


WebFocus 768
Windows, all output
 
Posts: 18 | Registered: June 20, 2011Report This Post
Expert
posted Hide Post
1) Initialize it upfront
-SET &STORE_COUNT = 0 ;
TABLE FILE STORE_CATALOG
PRINT
CNT.STORE_ID AS STORE_COUNT;
WHERE STORE_ID EQ '&store_query'
ON TABLE SAVE AS STORE_COUNT FORMAT ALPHA
END
-RUN
-READ STORE_COUNT &STORE_COUNT.I5.

TYPE &STORE_COUNT
or 2) TABLE FILE ...
...
END
-RUN
-SET &STORE_COUNT = &LINES ;




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
quote:
-SET &STORE_COUNT = &LINES ;

That did it! Thanks a lot Susannah !


WebFocus 768
Windows, all output
 
Posts: 18 | Registered: June 20, 2011Report This Post
Virtuoso
posted Hide Post
On a related note - if you were doing any sort of summation, you might need to use &RECORDS instead of &LINES. For a PRINT they would be the same, but for a SUM, &LINES would be the number of aggregated lines while &RECORDS would be the number of individual records in the answer set.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
Good One Good One
quote:
"Initialize it upfront" and "On a related note"
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
woulda been READ.... .A5 anyway, not .I5
sigh.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report 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     [Solved] GET 0 IS COUNT IS 0

Copyright © 1996-2020 Information Builders