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;
This is a portion of the NULL MAP DS.
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 ==
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.