|
Barbara, That worked great. I also made that external data structure BASED(@). Thanks for the help and information. Kurt Anderson Application Developer Highsmith Inc -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Barbara Morris Sent: Friday, May 26, 2006 4:04 PM To: rpg400-l@xxxxxxxxxxxx Subject: Re: Default numeric: zoned or packed 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) -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.