|
Well that plus the ability to actually do <snip> If RPG had full NULL support, you could simply have: > > fdate = someDate; > > If someDate was NULL, then fdate would be null. </snip> Then we'd be rockin' Thanks, Tommy Holden -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Wilt, Charles Sent: Friday, January 27, 2006 3:05 PM To: RPG programming on the AS400 / iSeries Subject: **SPAM** RE: %Trim dilemma Bob, It looks like RPG is getting closer. I didn't realize that you could have an externally defined DS in RPG with null capable fields. "Null-capable fields in externally-described data structures If the file used for an externally described data structure has null-capable fields defined, the matching RPG subfields are defined to be null-capable. Similarly, if a record format has null-capable fields, a data structure defined with LIKEREC will have null-capable subfields." Looks like something new with v5r3. I think this capability will take care of most of my concerns, I'll have to play with this some. But all that is left is an ALWNUL keyword for the d-specs to take care of standalone variables and non-externally defined DS's. Charles Wilt -- iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Wilt, Charles > Sent: Friday, January 27, 2006 3:53 PM > To: RPG programming on the AS400 / iSeries > Subject: RE: %Trim dilemma > > Bob, > > Asking what's a "NULL variable" is a good question. The only answer I > can come up with is, it depends! <grin> > > I don't know how oracle stores strings. But for example, > CREATE TABLE CMWTEST (F1 VARCHAR (10 ) NOT NULL) > > INSERT INTO cmwtest VALUES('') > > Fails in Oracle, ORA-01400: cannot insert NULL into <...> > > Whereas it works fine in DB2. > > > As far as RPG and "full NULL support", what I mean is given this code: > > If not %nullind(someDate); > //do something with some date > Endif; > > Will work if somedate is a field in a table, but it won't work if > somedate is an RPG internal field. > > So when using RPG with files that support NULL, you have to > do something > like > > If someDateValid; > %nullind(fdate) = *OFF; > fdate = someDate; > Else; > %nullind(fdate) = *ON; > Endif; > > If RPG had full NULL support, you could simply have: > > fdate = someDate; > > If someDate was NULL, then fdate would be null. > > > > Charles Wilt > -- > iSeries Systems Administrator / Developer > Mitsubishi Electric Automotive America > ph: 513-573-4343 > fax: 513-398-1121 > >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com 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.