MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » September 2012

RE: data queues and null indicators



fixed

Thanks, Alan. I'll give it a try.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Campin
Sent: Thursday, September 06, 2012 3:45 PM
To: Midrange Systems Technical Discussion
Subject: Re: data queues and null indicators

If you are using a qualified data structure with nested records to a define
a data structure when you write the data structure all the status of the
nulls goes with it I like the nested data structures because I can refer to
the fields by the name for both data and nulls.

d cTrue...
d c '1'
d cFalse...
d c '0'

d TD_DQ_Data...
d ds Qualified
d Template
d FieldOne...
d 1a
d FieldTwo...
d 10a

d TD_DQ_Nulls...
d ds Qualified
d Template
d FieldOne...
d n Inz(cFalse)
d FieldTwo...
d n Inz(cFalse)

d TD_DQ...
d ds Qualified
d Template
d Data...
d Likeds(TD_DQ_Data)
d Nulls...
d LikeDs(TD_DQ_Nulls)
d Inz(*LikeDs)
d NullArray...
d n Dim(2)
d Overlay(Nulls)

d DQData...
d ds LikeDs(TD_DQ)
/Free

Clear DQData;

DQData.Data.FieldOne = 'N';
DQData.Nulls.FieldOne = cFalse;
DQData.Nulls.FieldTwo = cTrue;

// Or
DQData.NullArray(2) = cTrue;

// You now write DQData to data queue.

// Receiver just does.

If DQData.Nulls.FieldTwo;
// Do something.
EndIf;


On Thu, Sep 6, 2012 at 2:14 PM, Thomas Garvey <tgarvey@xxxxxxxxxx> wrote:

Hi, Alan,

That's what I was thinking when I defined a table (with DDS) where the
fields were all null capable (ALWNULL). In the program(s) which load
the data structure and then insert that data structure into the data
queue, the null 'status' of each field is not 'propagated' to the
program which reads the data queue and uses the same externally
defined data structure to subdefine the data queue entry.

I like your method of qualified data structures to define and name the
null indicator array for the file's fields. I've been using includes
to define all the null indicator fields and the required array (which SQL
needs).
I'll try your technique in my next application where it's needed.

In any case, since I'm using the data queue, I'll have to figure out
some way to add a user defined array to the end of the queue entry to
convey programmatic null indicator equivalent values.

Thanks

Tom


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Campin
Sent: Thursday, September 06, 2012 2:39 PM
To: Midrange Systems Technical Discussion
Subject: Re: data queues and null indicators

You are correct. Nulls are only supported in RPG in external described
tables. You must define a array of indicators to hold true or false to
null.

i use qualified data structures to do this. See my document at
www.think400.dk/downloads.htm on RPG and Nulls.

On Thu, Sep 6, 2012 at 1:08 PM, Thomas Garvey <tgarvey@xxxxxxxxxx> wrote:

I've been using data queues to funnel data into several programs. I
am using the typical method (I suppose) of using data structures to
define the data values in the data queue entries. This particular
data structure is externally defined.

Now I have need to be able to determine if individual field values
in the data queue entry are null. That is, the data placed there by
the originating program(s) is properly setting the field's null
value using the %nullind function.

The externally defined data structure has the fields defined as null
capable, but I'm thinking that passing the null settings for each
field is beyond the capability of data queues, no matter how you
define the data contained in them.

Has anyone else been in this situation? Short of adding an array of
flags to the end of the data structure to contain the null
indicators for each field, anybody got any ideas?


TIA,


Thomas Garvey



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at http://archive.midrange.com/midrange-l.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.








Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact