× 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.



Why is a date field not being populated by the Fetch?
*
We are using SQL to retrieve records into a data structure and then
build a subfile.
The pgm bombs at an Eval-Corr statement.
*
The error message is RNQ0112, Date, Time or Timestamp value is not
valid .
The date field causing the error has a Null value.  It is valid... a
valid Null.

What value would you expect SQL to set? The very nature of NULL implies
that the variable should not be set. The indicator field will be set
instead, so that the program can intelligently not attempt to process the
null-data field. The fault is not in SQL's return value; it is in the
program that attempted to process data that was not (and should not have
been) returned. Here's the proper approach:

If nullFlags(fieldNbr) = *Zero ;
// Deal with the date here
Else ;
// No date was returned
EndIF ;

While I'm here and since you've shared, it would be to your advantage while
maintaining this program to eliminate all references to *IN indicators. The
need for numbered indicators passed many years ago.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
Sign seen in a Rome laundry: "Ladies, leave your clothes here and spend
the afternoon having a good time."


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.