Mark,

I believe you're referring to how SQL indicates the null attribute of a
column/field. For the C functions it would be an array of characters.

Bruce

On Thu, Jan 17, 2019 at 8:26 AM mlazarus <mlazarus@xxxxxxxxxxxx> wrote:

Frank,

Shouldn't the null map contain integers instead of booleans?

-mark

On 1/17/2019 2:02 AM, Frank Kolmann wrote:
Ok thanks Barbara, I will try again.
Just to be specific.

What I am doing is writing a "Generic" file update program that can
update any file.
I am using the C Ropen/Rwrite etc functions and it is mostly working
except when I try to ADD a new record.
The ADD fails where I get a error
Cause . . . . . : A data mapping error occurred on field ACTIV in
record
number 0, record format TESTR, member number 1, in member TESTPFN file
TESTPFN in library KOLMANN, because of error code 20.

20 -- A field that is not null capable could not be set to null.

Every field in the file has ALWNULL keyword.

I set up a specific NULL byte map
// Set NULL byte MAP
KOLMANN_TESTPFN_TESTR_nmap_t = *all'0';
KOLMANN_TESTPFN_TESTR_nkmap_t = *all'0';

xn.in_null_map = %addr(KOLMANN_TESTPFN_TESTR_nmap_t);
xn.null_key_map = %addr(KOLMANN_TESTPFN_TESTR_nkmap_t);
xn.out_null_map = %addr(KOLMANN_TESTPFN_TESTR_nmap_t);
XN.NULL_MAP_LEN = numfld;
XN.nullkymaplen = numkey;
record = data;
fb_p = Rwrite(in_p : buf_p : RCDL );
ErrMsg = %str(strerror(errno));
UPDDONE = @TRUE;
ENDIF;

This is a portion of the NULL MAP DS.
*
D KOLMANN_TESTPFN_TESTR_nmap_t...
D DS qualified align
D ACTIV N
D NULL1 N
D CMPNO N
D NULL2 N
D PLTNO N
D PRDNO N
D OPBAL N
== snip ==


Regards
Frank

On 17/01/2019 3:55 AM, Barbara Morris wrote:
On 2019-01-16 11:27 AM, Charles Wilt wrote:
Think you missed the point of Barbara's message...

As I read it, she's suggesting you split the code into two modules...
- One with ALWNUL(*USRCTL) that handles the PF I/O
- One with ALWNULL(*NO) that handles the UDDS display file I/O


No, I don't think he needs two modules. Even if there's a UDDS
display file that wouldn't use null values in the ALWNULL(*USRCTL)
module, the PF I/O can would still handle null values ok.


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com




This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2019 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].