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] DST.COUNT into &variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] DST.COUNT into &variable
 Login/Join
 
Platinum Member
posted
Hi,
i think for you guys this is quiet easy. I want to make a distinct count on a table file. And i have only one column as result. I want to put this result into a &variable to use it for an output.

Regards

Christian

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


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
 
Posts: 156 | Location: Essen Germany | Registered: December 02, 2010Report This Post
Expert
posted Hide Post
Consider HOLDing your selection and using &LINES or &RECORDS.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
  
-SET &ECHO=ALL;
APP APPENDPATH IBISAMP
-RUN
TABLE FILE CAR
SUM
  CNT.DST.COUNTRY
ON TABLE SAVE
END
-RUN
-READ SAVE &CNTRY_CNT.I5.
-TYPE &CNTRY_CNT
-EXIT


Output:
  
ALPHANUMERIC RECORD NAMED  SAVE
 0 FIELDNAME                         ALIAS         FORMAT        LENGTH
 COUNTRY                           COUNTRY       I5              5
 COUNTRY                           COUNTRY       A10            10
 TOTAL                                                          15
 -READ SAVE &CNTRY_CNT.I5.
 -TYPE     5


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
quote:
-READ SAVE &CNTRY_CNT.I5.


One caveat: The length of the saved field may be 5 or 9, depending on SET COUNTWIDTH.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Doug:
Consider HOLDing your selection and using &LINES or &RECORDS.


More specifically, HOLD the list of distinct values, as in
 TABLE FILE CAR
 COUNT ENTRIES BY SEATS
 ON TABLE HOLD
 END

&LINES        =        3 <--
&RECORDS      =       18



If you just HOLD the count, &LINES will be one, while &RECORDS will be the number of records contributing to the result set, not the count of distinct values.

 TABLE FILE CAR
 WRITE CNT.DST.SEATS
 ON TABLE HOLD
 END

&LINES        =        1 <--
&RECORDS      =       18
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
Hi Tom,

looks great!! But i don't understand why webfocus knows that COUNTRY = CNTRY.
Strange!!

Regards

Christian


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
 
Posts: 156 | Location: Essen Germany | Registered: December 02, 2010Report This Post
Expert
posted Hide Post
I don't even know why COUNTRY = CNTRY? What do you mean?

The example is doing a -READ(Dialogue Manager) and setting the ampere &CNTRY_CNT and the ampere has the value of the DISTINCT COUNT...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Jack, Never used COUNTWIDTH = ON; seems a waste, really:

  
-SET &ECHO=ALL;
APP APPENDPATH IBISAMP
-RUN
TABLE FILE CAR
SUM
  CNT.DST.SEATS/I11
ON TABLE SAVE
END
-RUN

-READ SAVE &CNTRY_CNT.I11.
-TYPE &CNTRY_CNT
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
J,
quote:
More specifically, HOLD the list of distinct values
I was just giving direction rather then a definitive answer. There's lots of ways to skin this cat.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 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     [SOLVED] DST.COUNT into &variable

Copyright © 1996-2020 Information Builders