× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



+1 on explaining the use of "null" - testing a column for null is not an EQUAL test, it is an IS test - in SQL WHERE clause you would say something like COLUMN IS NULL - meaning that there is no specified value in that column. That column in that row cannot be used for comparisons or counts or whatever.


___How can a numeric field value be blanks?___


It is, as Buck said, unfortunate usage - NULL or NUL get all kinds of ways of using them - x'00' is used for terminating strings in C/C++, here's a quote about that -

In computer programming, a*null*-*terminated*string is a character string stored as an array containing the characters and*terminated*with a*null*character ( '\0' , called *NUL*in ASCII).

Note that x'00' is called a null character'

One question here, then - what does the OP mean by the term here - there's an isblank function in Excel, and also an isnull function - the latter means there's no value assigned, so it is different.

SQL on the IBM i uses a hyphen to indicate a column is null in that row - but that could not be used in a numeric DSPF field, unless, maybe, with some kind of EDTCDE or EDTWRD

On 2/22/2017 8:30 AM, Buck Calabro wrote:
On 2/21/2017 4:17 PM, Bob Cagle wrote:
Is there a way to display a null value on a display file?
No, for several reasons.
1) There is no such thing as a null value. [1] There's a null
attribute, and it's not mere pedantry to draw the distinction.
2) Display and printer files do not have any facility to handle NULL
database fields.

I have a user requesting that a 2-digit numeric field show either blanks or zero as well as 1 - 99, emulating Excel-like behavior.

The only solution I can think of is to convert it to a character field and validate for numeric or blank. Suggestions?
That's about the only way to get around RPG and DDS being strongly
typed. If you go this route, I suggest you make some utility
sub-procedures to do the typical DDS chores of validity checking,
editing, etc. Your RPG will have to get used to new and formerly
impossible errors like 'not a number'.

I have an off the wall question. Why does the end user want Excel-like
functionality from a 5250 display? If the answer is that Excel provides
a better UI(!) then perhaps you should consider integrating Excel into
the RPG application rather than trying to warp the 5250 interface to a
place it was never intended to go.

[1] Many people have unfortunately decided to call x'00' 'null'. It is
not at all the same thing as a database NULL.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.