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] To get the SNO from CAR FILE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] To get the SNO from CAR FILE
 Login/Join
 
<msam>
posted
 
-SET &ECHO=ALL;
-*SET NODATA=0;
DEFINE FILE CAR
COUNTR/I11= IF COUNTRY EQ 'ENGLAND' THEN 1 ELSE 0;
CARS/I11= IF CAR EQ 'TOYOTA' THEN 1 ELSE 0;
STS/I11= IF SEATS EQ 2000 THEN 1 ELSE 0;
SLS/I11= IF SALES EQ 100000 THEN 1 ELSE 0;

ACL/I11= IF ACCEL EQ 777 THEN 1 ELSE 0;
DEALER_COST/D20.2= IF DEALER_COST GT 1000 THEN 1 ELSE 0;
RETAIL_COST/D20.2= IF RETAIL_COST GT 2000 THEN 1 ELSE 0;

SNO/I11 = IF COUNTR GE 1 THEN 1 ELSE
          IF CARS GE 1 THEN 2 ELSE
          IF STS GE 1 THEN 3 ELSE
          IF SLS GE 1 THEN 4 ELSE
          IF ACL GE 1 THEN 5 ;

END
TABLE FILE CAR
PRINT
-*COUNTR
DEALER_COST
RETAIL_COST
BY SNO
END
 

I was in need of the SNO irrespective whether the value is true or false. In the above code I get the SNO only when the value is 1 .Please provide me any suggestions as how I can get the SNO in sequence whether the value is 1 or 0.

Regards,
MSAM

This message has been edited. Last edited by: Kerry,
 
Report This Post
<JG>
posted
quote:
SNO/I11 = IF COUNTR GE 1 THEN 1 ELSE
IF CARS GE 1 THEN 2 ELSE
IF STS GE 1 THEN 3 ELSE
IF SLS GE 1 THEN 4 ELSE
IF ACL GE 1 THEN 5 ;


Incomplete logic

SNO/I11 = IF COUNTR GE 1 THEN 1 ELSE
          IF CARS GE 1 THEN 2 ELSE
          IF STS GE 1 THEN 3 ELSE
          IF SLS GE 1 THEN 4 ELSE
          IF ACL GE 1 THEN 5 ELSE 0;  
 
Report This Post
Master
posted Hide Post
Are you looking for LIST or something like row number, then here it is
TABLE FILE CAR
PRINT 
COMPUTE SNO/I11=SNO+1;
COUNTRY
CAR
BY COUNTRY NOPRINT
BY CAR NOPRINT
END

TABLE FILE CAR
LIST
COUNTRY
CAR
BY COUNTRY NOPRINT
BY CAR NOPRINT
END
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
<msam>
posted
DEFINE FILE CAR
COUNTR/I11= IF COUNTRY EQ 'ENGLAND' THEN 1 ELSE 0;
CARS/I11= IF CAR EQ 'TOYOTA' THEN 1 ELSE 0;
STS/I11= IF SEATS EQ 222 THEN 1 ELSE 0;
SLS/I11= IF SALES EQ 0 THEN 1 ELSE 0;

ACL/I11= IF ACCEL EQ 777 THEN 1 ELSE 0;

DEALER_CO/I11= IF DEALER_COST GT 1000 THEN 1 ELSE 0;
RET_CO/I11= IF RETAIL_COST GT 1000 THEN 1 ELSE 0;

SNO/I11= IF COUNTR GE 1 THEN 1 ELSE
          IF CARS GE 1 THEN 2 ELSE
          IF STS GE 1 THEN 3 ELSE
          IF SLS GE 1 THEN 4 ELSE
          IF ACL GE 1 THEN 5 ELSE 5 ;
-*		  IF DEALER_CO GE 1 THEN 6 ELSE 
-*		  IF RET_CO GE 1 THEN 7 ELSE 7;  


END
-*
TABLE FILE CAR
SUM
COUNTR
CARS
STS
SLS
ACL
DEALER_CO
RET_CO
BY SNO
-*ON TABLE HOLD AS HOLD1
END
-EXIT   


The SNO value gets skipped when the value of the DEFINE field is 0.. Please suggest an idea..

Regards,
MSAM
 
Report This Post
Expert
posted Hide Post
quote:
when the value of the DEFINE field is 0

The value of which define field ?

Can you post your output and what you are expecting?


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
quote:
WebFOCUS 7.11


Wow, you have v7.11 Confused


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
<msam>
posted
it's 7.6.11 Good One
 
Report This Post
<msam>
posted
Waz,
What actually I'm trying to do is to generate a SNO based on the DEFINE fields so that I can use it as a FOR Field by joining to another table that has a SNO.
But as per my above code the DEFINE fields generate the SNO only when the value is 1 and it stops at the DEFINE which ever has the value 0.
I need to get the SNO for the above DEFINE fields irrespective whether the value returned is 1 or 0.Can we do that as per my logic or I'm I going in the wrong direction..

Regards,
MSAM
 
Report This Post
Expert
posted Hide Post
If you are not getting a zero, then your not getting a zero.

But....

If you use some of the techniques specified in this forum, then you can force the existance of the zero.

e.g.
DEFINE FILE CAR
COUNTR/I11= IF COUNTRY EQ 'ENGLAND' THEN 1 ELSE 0;
CARS/I11= IF CAR EQ 'TOYOTA' THEN 1 ELSE 0;
STS/I11= IF SEATS EQ 222 THEN 1 ELSE 0;
SLS/I11= IF SALES EQ 0 THEN 1 ELSE 0;

ACL/I11= IF ACCEL EQ 777 THEN 1 ELSE 0;

DEALER_CO/I11= IF DEALER_COST GT 1000 THEN 1 ELSE 0;
RET_CO/I11= IF RETAIL_COST GT 1000 THEN 1 ELSE 0;

SNO/I11= IF COUNTR GE 1 THEN 1 ELSE
          IF CARS GE 1 THEN 2 ELSE
          IF STS GE 1 THEN 3 ELSE
          IF SLS GE 1 THEN 4 ELSE
          IF ACL GE 1 THEN 5 ELSE 5 ;
-*		  IF DEALER_CO GE 1 THEN 6 ELSE 
-*		  IF RET_CO GE 1 THEN 7 ELSE 7;  


END
-*
TABLE FILE CAR
SUM
COUNTR
CARS
STS
SLS
ACL
DEALER_CO
RET_CO
BY SNO ROWS 0 OVER 1 OVER 2 OVER 3 OVER 4 OVER 5
-*ON TABLE HOLD AS HOLD1
END
-EXIT


Just note that SNO after a HOLD does not exist, you will have to reference it by E01.


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
<JG>
posted
quote:
SNO/I11= IF COUNTR GE 1 THEN 1 ELSE
IF CARS GE 1 THEN 2 ELSE
IF STS GE 1 THEN 3 ELSE
IF SLS GE 1 THEN 4 ELSE
IF ACL GE 1 THEN 5 ELSE 5 ;

Read your own code.

SNO can never have a value of 0 based on your define.
 
Report This Post
<msam>
posted
THANLK WAZ.. I REALLY APPRECIATE YOUR HELP.. Good One
 
Report 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] To get the SNO from CAR FILE

Copyright © 1996-2020 Information Builders