× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ok Vern, take this example and tell me if this is "support".

A PF like this (I use dates for null because are the most common null
fields):

field1    10A
field2      L   ALWNULL
field3    30A
field4      L   ALWNULL

when I use it in RPGIV the only thing I have to do is declaring in the H
spec ALWNULL(*USRCTL) and the use the biff %nullind to get or set the null
status. That's it.

In sql/rpg I have to do something like:

define e ds:

d myfile        e ds                  extname(myfilepf)
d indnul          s              4b 0 dim(1000)

prepare an sql statement:

wstring = 'SELECT * FROM MYFILEPF WHERE .....';
 /end-free
C/exec sql
C+  PREPARE S1 FROM :WSTRING
C/end-exec
C/exec sql
C+  DECLARE CURS1 CURSOR FOR S1
C/end-exec
C/exec sql
C+  OPEN CURS1
C/end-exec
C/exec sql
C+  FETCH CURS1 INTO :MYFILE :INDNUL
C/end-exec

Now to test if the two fields are null you have to to write something like:

if indnul(2) <> 0;
  do something...
endif;
if indnul(4) <> 0;
  do something...
endif;

Now try to modify the PF as follow:

field1    10A
field1A   50A
field2      L   ALWNULL
field3    30A
field4      L   ALWNULL

The code is still working?

And before you suggest not use SELECT * remember that you have to build and
maintaine the list of fields in the select statement and in the receiving ds
to follow all your database modifications (removing and adding fields) and
not just re-compiling as with RPGIV.
Since we where talking about support this is what I mean for almost not
supported.

HTH
Marco

--- Vernon Hamberg <vhamberg@xxxxxxxxxxx> wrote:

> The NULL attribute of a column (field) is a bit flag stored in the record 
> ahead of the actual data. If you are working in C, you need to use a 
> NULL-indicator array. Same in RPG IV, and even in embedded SQL. The trick 
> is to have an array of 4B 0 (according to the manual) and append it to the
> 
> host variable array
> 
>   :hostarray:indarray
> 
> Then there is a value for each column that can be used to get or set the 
> NULL attribute. This seems like pretty full support for SQL/RPG, if by
> that 
> you mean embedded SQL.
> 
> Later
> Vern
> 
> At 02:41 AM 9/3/2005, you wrote:
> 
> >If you plan to use:
> >
> >SQL, the support is complete
> >RPGIV, partial support for previous release, good for V5R3
> >SQL/RPG, almost not supported.
> >
> >HTH
> >Marco
> >
> >P.S. RPGIV supports null only on database fileds.
> >
> >--- Chris Payne <CPayne@xxxxxxxxxxxxxxx> wrote:
> >
> > > Hello,
> > >
> > > What is your take on NULL's on the Iseries, do they have a place? If a
> > > user does not enter data into an optional numeric field, do you set
> the
> > > field to 0 or NULL? What are some of the drawbacks of using NULL's?
> > >
> > >
> > >
> > > Christopher M. Payne
> > >
> > > CPayne@xxxxxxxxxxxxxxx
> > >


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

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.