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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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

This mailing list archive is Copyright 1997-2022 by 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.