× 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.



This is starting to drive me down the hall screaming.

And the archives had a promising solution with data structures but it
just doesn't work. V5R3

I have a file with a field (dividnum) defined as packed 5,0.

I have two programs that use the file. Program B has a display file with
the field in it via reffld(dividnum)

Program A has a data structure defined with a specified length and an
array in it defined as like(dividnum) that is passed to/from program B
using prototypes.

Program B has a data structure defined with with the same specified
length and an array in it defined as like(dividnum) that is pointer
based. Program B sets the pointer to the data structure as the address
of Program A's data structure that is passed to it. I have verified that
the pointer "magic" works just fine.

// Program A

D SelDs           ds           384  

D   sel                               like(dividnum) DIM(32) ASCEND


// Program B

D SelDs           ds           384    based(SelDsAdr)              

D   sel                               like(dividnum) DIM(32) ASCEND

D SelDsAdr        s               *                                


The problem is that the array in program A is zoned, as I would expect
it to be since it is in a data structure. Program B however defines the
array as being packed.

There has got to be a way to define fields by reference to reduce code
changes when lengths changes but either get consistent type (zoned,
packed...) or be able to force the type so that they can be passed as
parameters between programs.

Does everyone hard code field lengths for numeric parameter passing or
have I missed something?

Roger Vicker, CCP


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.