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     how to distinguish null from 0 in a var

Read-Only Read-Only Topic
Go
Search
Notify
Tools
how to distinguish null from 0 in a var
 Login/Join
 
Platinum Member
posted
does anyone know how to tell a variable whether it contains '0' or '' (null). WFC seems to think they are the same.


wf 7.6.11
unix aix
active reports, HTML, Excel, Text and PDF formats
 
Posts: 102 | Registered: April 20, 2004Report This Post
Member
posted Hide Post
Mike,

I don't know if you need to know the "value" or the existance of the variable. For existance, try the following:

-SET &ER = '&' ;
-*SET &VAR = 0;
-TYPE The variable &ER..VAR
-IF &VAR.EXISTS GOTO EXISTS ELSE DOESNT;
-DOESNT
-TYPE doesn't
-EXISTS
-TYPE exist

I tried testing the .LENGTH of &VAR with both '' and 0 (see below). 1 was returned for both values, so that's no good.

-SET &VAR = '';
-SET &LEN = &VAR.LENGTH;
-TYPE VAR length &LEN

Hope this helps.


WebFOCUS 53, 71, 76 - All Platforms
 
Posts: 15 | Location: Information Builders - Chicago | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
WF doesn't think they are the same unless you tell it it does. There is probable a MISSING=OFF in a master file somewhere that tells it to treat nulls as a blank or 0;


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
Virtuoso
posted Hide Post
There is a suffix function called ASIS().

Example from help files.
-SET &VAR1 = ' ';
-SET &VAR2 = 0;
-IF &VAR2 EQ ASIS(&VAR1) GOTO ONE;
-TYPE VAR1 &VAR1 EQ VAR2 &VAR2 NOT TRUE
-QUIT
-ONE
-TYPE VAR1 &VAR1 EQ VAR2 &VAR2 TRUE


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
If you are not talking about & variables, the word you are looking for is MISSING. For example, to set a value to null or for null to be a valid value, a field should have MISSING=ON, for example:
FIELD=ABC,,I4,A4,MISSING=ON,$

For a DEFINE (see the manual for complete syntax):
ABC/I4 MISSING ON=IF TEST IS TRUE THEN DEF*4 ELSE MISSING;

Then to test for null:
WHERE ABC IS MISSING

When the field is printed, it will contain the NODATA character string which is . by default.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Platinum Member
posted Hide Post
thank you all for the tips. I have to say the solution I am looking for is dhagen's because I was referring to the value of the var and there is no master file to speak of. Thanks!


wf 7.6.11
unix aix
active reports, HTML, Excel, Text and PDF formats
 
Posts: 102 | Registered: April 20, 2004Report This Post
Virtuoso
posted Hide Post
Glad you found what you were looking for.

For future reference, there is ALWAYS a Master File to speak of with WebFOCUS, and sometimes, that's where the problem exists or where it can be fixed. Don't overlook that in your troubleshooting.


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
Platinum Member
posted Hide Post
thank you, Darin. I will keep that in mind. In this case, however, I was talking about the value in a & variable. thanks.


wf 7.6.11
unix aix
active reports, HTML, Excel, Text and PDF formats
 
Posts: 102 | Registered: April 20, 2004Report 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     how to distinguish null from 0 in a var

Copyright © 1996-2020 Information Builders