Thanks, that makes sense when I look at what I need to do, but unfortunately
I do not have the ability of mapinc as this will be a single program which
updates many different files all with different NULL capabilities. I will
not know until runtime what the nullflds will be like? I am wondering if I
can create a nullflds map over a file of say 8,000 null fields and simple
use it as a template for all null_maps? Probably easier if I could simple
access the in_null_map with a ptr and set the memory directly with 0xF0 or


Chris Hird
Shield Advanced Solutions Ltd
1(519) 940-1192
Please consider the environment before printing this email.

This message, including any attached documents, is intended for the
addressees only. It may contain information that is confidential, privileged
and/or exempt from disclosure. No rights to privilege or confidentiality
have been waived. Any unauthorized use or disclosure is prohibited. If you
have received this message in error, please reply to the sender by e-mail
and delete or destroy all copies of this message.
Avant d'imprimer ce courriel, pensez à l'environnement.

Ce message, incluant tous les documents joints, est à l'intention des
destinataires visés seulement. Il peut contenir des renseignements
confidentiels, protégés et/ou ne pouvant pas être divulgués. Aucune
renonciation n'est faite quant à sa nature confidentielle et privilégiée.
Par conséquent, toute diffusion ou utilisation non autorisée est strictement
interdite. Si vous avez reçu ce message par erreur, veuillez en aviser
immédiatement l'expéditeur par retour de courriel et en détruire toutes les
copies existantes.

-----Original Message-----
From: c400-l-bounces@xxxxxxxxxxxx [mailto:c400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Barbara Morris
Sent: Friday, September 14, 2012 3:37 PM
To: c400-l@xxxxxxxxxxxx
Subject: Re: [C400-L] _SET_NULL_MAP_FIELD() macro

On 9/14/2012 11:47 AM, Chris Hird wrote:
... The _SET_NULL_MAP_FIELD() macro takes 3 parameters, first the
_RFILE ptr, then a type...

Chris, for update, you need the _SET_UPDATE_NULL_MAP_FIELD macro. The one
you mentioned works with the output null map.

I think those macros are meant to be used with a typedef created by pragma
mapinc with the nullflds option. The _type would be the typedef name, and
the _field would the field name. It looks like the macros only support
clearing the whole null map with _CLEAR_UPDATE_NULL_MAP, and then setting
individual fields to '1' with _SET_UPDATE_NULL_MAP_FIELD.

Here's a test program I found in my library that updates file BMORRIS/JUNKF.
It looks like the field names in my junk file were all 10A, and the first
and third were defined ALWNULL. The program is blindly updating all the
fields, and setting the third field NULL3 to be null.

#pragma mapinc("nulls", "BMORRIS/JUNKF(REC)","nullflds")
#pragma mapinc("data", "BMORRIS/JUNKF(REC)","both")
#include "nulls"
#include "data"
BMORRIS_JUNKF_REC_both_t data;
_RFILE *rf;

rf = _Ropen("BMORRIS/JUNKF", "rr+ nullcap=Y");
_Rreadn (rf, &data, sizeof(data), __DFT);
memcpy(&data, "null1 notnull2 null3 notnull4 ", 40);
_Rupdate (rf, &data, sizeof(data));
_Rclose (rf);
This is the C programming iSeries / AS400 (C400-L) mailing list To post a
message email: C400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

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