HI all,
For a specific reason I have some null field in a table, here's the table:
And the rpg-program:
The response is this:
When I put %NullInd(Field2) set to *on, it always remains *on, I expect then clear of the record.
Do I have to reset the %Nullindicator every time? This is an example, but my program have dozens of fields.
Many thanks.
For a specific reason I have some null field in a table, here's the table:
Code:
Create Table Testnull (Field1 Int, Field2 Varchar(100) Ccsid 280 Default Null) Rcdfmt Testnullr;
Code:
**FREE Ctl-Opt DftName(TESTNULL01) dftactgrp(*no) actgrp(*New) option(*nounref :*srcstmt :*nodebugio) datfmt(*iso) timfmt(*iso) DecEdit('0.') debug Text('Test for null field') alwnull(*usrctl); dcl-f Testnull Usage(*output); Dcl-s Idx Int(5); For Idx = 1 to 4; Clear TestNullR; Field1 = Idx; If %Rem(Idx :2) = 1; Field2 = 'Odd number'; Else; %NullInd(Field2) = *on; EndIf; Write TestNullR; EndFor; *inlr = *on;
When I put %NullInd(Field2) set to *on, it always remains *on, I expect then clear of the record.
Do I have to reset the %Nullindicator every time? This is an example, but my program have dozens of fields.
Many thanks.
Comment