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



Kurt Anderson wrote:
> 
> I've read a lot of articles and threads (here or in archives) that
> mention that if a number data type is left undefined, it will default to
> Packed.
> On our system, it defaults to Zoned.
> Is there a system setting involved here?
> 
> I recently created a data structure that had file-defined fields (so I
> only had the name of the field in the DS, no definition) and it
> converted all my Packed numbers to Zoned (which of course caused my
> calls to unprototyped programs to fail).
> 
> The solution I had was to explicitly define the numeric fields in the
> data structure (which I don't like doing b/c now if one of those field
> definitions changes, someone has to fix the data structure).  I
> considered using ExtFld, but, near as I can tell, that only works with a
> ExtName - and I don't want all the fields from that file in the data
> structure.
> 
 
Kurt, for maximum confusion, when the type of a numeric field is not
specified for a _subfield_ it defaults to zoned.  See the "Internal
Format" section of the "Data Types and Data Formats" in the ILE RPG
Reference.

I think the easiest way to solve the problem would be to define your
subfields LIKE subfields in an externally-described data structure that
you define just for the LIKE definitions.  Using the LIKE keyword, you
get the new field defined exactly the same as the like field.  (Beware
that this is not the case for *LIKE DEFINE.)

D myfile_types    e ds              qualified extname(whatever)
D myds              ds
D    something                      like(myfile_types.somefield)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.