Barbara, Rob, Denis, Buck

Thank you Barbara -

I'm copying this to the RPG400 list for final archival reference and answer
to all our questions.

So, the answer is:   Redefine your input file as an external data
structure, or simply list the offending array elements in a data structure,
and all our dreams will come true!  (re: using pointers and based() for
array redefines)

Thanks to all,


Subject: Re: How to Define input fields into Array
Date: Fri, 11 Jan 2002 11:53:09 -0500

>Date: Thu, 10 Jan 2002 16:56:54 -0500
>     f                                     INFDS(HIYA)
>     d MyArray         s                   like(ary1) dim(3)
>     d                                     based(pMyArray)
>     d pMyArray        s               *   inz(%addr(ary1))

Rob, as Rod guessed, you can't count on ARY1, ARY2 and ARY3 being
contiguous.  To ensure they are contiguous, define an externally-described
data structure:

     d               e ds                  extname(ARRAYFILE)

>From: "Richard B Baird" <>
>Date: Fri, 11 Jan 2002 08:23:02 -0500
> ...
>the technique I was told about involved having the fields described ONLY
>an external data structure 'D' spec.  I assume that the %addr technique
>still works if the data is actually described by the "I"nput specs
>generated by an input file?

Richard, you need a data structure for sure, whether or not you have
I specs or O specs.  (Either an externally-described DS, or a pgm-described
one that just lists the fields without the types.)

Just remember that I and O specs are really descriptions of move operations
between the I/O buffer and the fields.  They're also be used for
if there isn't an explicit definition, but the definition isn't identical
the I spec.  For example, if you have a zoned (5,2) on an I spec, the
will define a packed (5,2) for you.

Barbara Morris

This thread ...

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