Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RPG IV and Null Database Fields

71 views
Skip to first unread message

Steve Moxon

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
I am having difficulty updating a null value field using an ILE RPG program
and wonder if anyone can offer any suggestions.

We have a database table with a number of null capable fields - see
definition below:

CREATE TABLE JM_LIMS_INTERFACE (
OBJECT_ID INTEGER ,
OBJECT_TYPE VARCHAR (10) ,
INTERFACE_NAME VARCHAR (10) ,
POSTING_STATUS VARCHAR (1) ,
POSTING_DATE TIMESTAMP ,
POSTING_ERROR VARCHAR (40) ) ;

I have an ILE RPG prog which reads a record from the table with no
problems - field posting_status is set to null. Testing this using the if
%NULLIND(fieldname) function works ok and confirms the field is null !!
However any attempts to update this field while it contains the null value
results in a data mapping error which suggests that the field will not
accept null values ('field that is not null capable cannot be set to null'
error generated) - the basic logic is :

EVAL %NULLIND(POSTI00001) = *OFF
EVAL POSTI00001 = 'P'
UPDATE rformat

POSTI00001 is the field name for the alias name POSTING_STATUS

My control specification includes the ALWNULL(*USRCTL) keyword.

I have not used ILE RPG much, but need it to work with this table on the
400 - have I missed the plot somewhere ??? We're running V4R2 on our AS400.


Regards,

Steve Moxon

Charles R. Pence

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
Steve Moxon wrote:
> <<SNIP>>
> POSTING_STATUS VARCHAR (1) ,
> <<SNIP>>

> However any attempts to update this field while it contains the null
> value results in a data mapping error which suggests that the field will
> not accept null values ('field that is not null capable cannot be set to
> null' error generated) - the basic logic is :
>
> EVAL %NULLIND(POSTI00001) = *OFF
> EVAL POSTI00001 = 'P'
> UPDATE rformat
>
> POSTI00001 is the field name for the alias name POSTING_STATUS
>
> My control specification includes the ALWNULL(*USRCTL) keyword.
>
> I have not used ILE RPG much, but need it to work with this table on
> the 400 - have I missed the plot somewhere ??? We're running V4R2 on our
> AS400.

Mabye SF53747 <see cover letter> on C9180420 or its later PTF SF60897.

Regards, Chuck
All comments provided "as is" with no warranties of any kind whatsoever.

Barbara Morris

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
Steve, this is exactly the scenario for APAR SA78270 (setting the
null-indicator for a varying-length field). Try one of these PTFs:
V4R2M0 SF53747
V4R4M0 SF54594
V4R4M0 SF54170 tgtrls(*prv)

Barbara Morris

Steve Moxon wrote:
>
> I am having difficulty updating a null value field using an ILE RPG program
> and wonder if anyone can offer any suggestions.

> ...
> CREATE TABLE JM_LIMS_INTERFACE (
> ...
> POSTING_STATUS VARCHAR (1) ,
> ...


> However any attempts to update this field while it contains the null value
> results in a data mapping error which suggests that the field will not
> accept null values ('field that is not null capable cannot be set to null'

> ...

Steve Moxon

unread,
Feb 10, 2000, 3:00:00 AM2/10/00
to
Barbara & Chuck,

Thank you both for the responses. APAR SA78270 is an exact match for
my problem - I'll install the PTF ASAP.

Steve Moxon

Barbara Morris wrote in message <38A1CCD5...@ca.ibm.com>...

0 new messages