Supported RPG Features

The ALWNULL keyword on CTL-OPT (or H-spec) controls how SQL NULL values in database columns are handled by native file I/O (CHAIN, READ, WRITE, UPDATE).

Value Behaviour
*NO (default) Reading a record containing a NULL raises the data-mapping I/O error, %STATUS 01299
*INPUTONLY / *YES NULLs read silently as type defaults (blanks / zero); writes always store values
*USRCTL %NULLIND(field) is maintained on read and honored on WRITE/UPDATE (an on indicator stores SQL NULL)
CTL-OPT ALWNULL(*USRCTL);

See the Disk File I/O chapter for the full read/write semantics and an example.