Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

SET NODATA not working

SET NODATA not working

SET NODATA not working

How can I get the SET NODATA command to work for a "grouped by" report?  Here's a snippet of my code:

     CNT.counter AS 'COUNT'

To clarify, the DESCRIPTION field will display "N/A" if the table value is null, but the &GROUPBY isn't doing the same thing. It will just be a blank.  The &GROUPBY field is being used as the link to another report.  In HTML, the blank is fine - the link still works.  But the PDF DrillThrough version of the report doesn't display anything for the link so users cannot drillthrough on the null values.  Please excuse my ignorance as I am new to WebFOCUS and just about ready to throw in the towel.

RE: SET NODATA not working


I understand your issue and have encountered this issue myself.  I have yet been able to create a work around for it, but I think I have an understanding.

I am not fully positive, and I am sure someone will correct me if I am wrong, but from what I have gathered, the SET NODATA command does not work on variables.  I have created a report that if I used an &variable, the report displayed a blank, but if I set that &variable to a DEFINE variable, then it displayed my SET NODATA correctly.

RE: SET NODATA not working

SET NODATA should work on ANY fields, whether real, DEFINEd, or provided by a Dialogue Manager Variable (by the time the reporting server sees it, the variable has had it's value replaced, so it's no longer a variable). Anywhere the NODATA characters would appear (the default is a dot '.'), this replaces the dot.

The first quesion to ask is "is the &GROUPBY REALLY missing?". For example, if this is an SQL table, the value would have to be declared as 'missible' in the original table, which would provide, in the MFD, a MISSING=ON declaration, allowing the field to get the NODATA characters. If not missable, then a MISSING value becomes a blank.

In your case, if you remove the SET NODATA line, what value shows? Is it a '.', or a blank? In the dtaa description, is that field described with MISSING=ON?

RE: SET NODATA not working

The &GROUPBY variable is returning a space.  The ERP data being accessed is stored in a Progress database.  Is it possible that the fields are null when the records are created if no value is entered upon creation, but then through maintenance of the record, the null value is lost and replaced with a non-value (neither a space nor null)?

RE: SET NODATA not working

The fact that th &GROUPBY field displays as a SPACE, rather than the NODATA character can mean one of two things:

1. The value in the database is ACTUALLY a space (perhaps declared as not missable)

2. In the MFD, the MISSING attribute for that field is not specified, or specified as OFF

This is assuming we're dealing with a SINGLE table. If JOINs are in effect, then is it a one-to-one JOIN, or a one-to-many? In a one-to-one (UNIQUE) JOIN, if a record is NOT found, we make one up, with default values (again, this pre-supposes that MISSING=OFF in the MFD for that field)

RE: SET NODATA not working

We've queryied the database outside of WebFOCUS and have confirmed that the values in the tables are not null and not a space.  The MISSING attributes for all fields are set to ON (the default).  We are using multiple one-to-many joins (left-outer joins in most cases).

When the variable &GROUPBY is set to display the field value from the host table (ie: "CUS"), and if that value is empty - WebFOCUS is returning a space.  If we use a join to look up the code's description in another table (ie: "Customer"), if the value was empty in the host table, the NODATA works because it can't find the description record (there is no " " value in the description table).  I hope I explained myself well enough.

RE: SET NODATA not working

You say:

"if that value is empty - WebFOCUS is returning a space"

What do you mean by 'empty'? If the value is "not null and not a space", what is it?

RE: SET NODATA not working

It seems to be returning a hexidecimal zero, but NODATA doesn't see this a a true null value.  As I mentioned in the previous posting on Feb 27th, if a new record is created and no value is entered in a text field, NODATA sees it as a null.  However, once the record is updated, NODATA isn't seeing that field as a null anymore (eventhough the field still has no value entered).

RE: SET NODATA not working

But a hexidecimal ZERO isn't NULL, it's a non-printing character, which is why it displays as blank.

for starters, let's ensure that it is hexadecimal zero. Since the field is alpha, you can use the subroutine UFMT, which will display the value in HEX. If it TRULY is hex 0, then you can issue a DEFINE like the following, which makes a alpha field with hex 0 into a MISSING value:


field MISSING ON = IF UFMT(field,inlength,'Alength') eq '00000000...' THEN MISSING ELSE field;

Which says, if the value of the field is hex zeros, set it to MISSING, OTW leave it as is.

RE: SET NODATA not working

This link is to the ASCII chart.  It says that a hexidecimal 0 is null:  http://www.ascii.ws/images/ascii-chart.gif (unless, in database terms, it's something different).  We did a SQL query "length(fieldname)" and it returned a zero length.

Currently, we are doing a work-around similar to what you provided.  This really isn't an acceptable solution because it's a hardcoded-work-around that has to be done on each field that we're grouping by, plus it'll have to be done on each report that's generated.  What we were hoping for is some kind of command that can be run before the NODATA statement that will treat all "empty" fields the same as true null values.  I hope that makes sense.

RE: SET NODATA not working

You said it returns a HEX 0, but that the length of the field is also zero. A HEX zero doesn't have a zero length; it has a length of 1; one byte to hold the HEX 0.

Earlier on, you said:

"The MISSING attributes for all fields are set to ON (the default)."

The default for fields in a MFD is MISSING=OFF. Can you post the MFD entry for the field in question? To get a MISSING value, it must EXPLICITLY say MISSING=ON for that field in the MFD. It should look like:



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close