|
Hello,
thanks to Javier Mora for reminding me about this topic. :-)
Thanks to Mark's answer from last October, I found some more breadcrumbs
to follow.
https://archive.midrange.com/c400-l/202410/msg00001.html
The PDF mentioned by Mark says:
When you read from a database file, the corresponding byte in the null
field map is indicated with a character '1' if the field is considered
null. This is specified in the null field map pointed to by the in_null_map
pointer.
I changed my CGI program to decide upon said character:
if (docs_data_nullfld.SUBTITLE == '0') {
do things if field is not NULL …
Unfortunately, this never matches, and hence the "field is not NULL" code
is never branched to.
Debugging. When I do a
printf("0x%0X\n", docs_data_nullfld.SUBTITLE);
Im getting a 0x1 when the field is NULL, and 0x2 when it's not. Neither in
ASCII nor in EBCDIC, numerals are encoded in character positions 0x1 or 0x2.
This leaves me greatly confused.
When I do a
if (docs_data_nullfld.SUBTITLE != '1') {
do things if field is not NULL …
branches to the correct code. Duh! So I basically got it to work.
I understand that the documentation mentions just the NULL case associated
with an '1', but not that a field not being NULL is actually '0'. My bad.
If someone can shed some light upon the seemingly bogus values being
output by my "hex" printf, I'm most interested!
Thanks!
:wq! PoC
--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L)
mailing list
To post a message email: C400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/c400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.