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



Buzz wrote:
>I have the following definition in a data structure; I'm grouping it with
>two other fields for some search criteria:
>
>0021.00 F*
>0022.00 Dl1_mtr_attribs   ds             6
>0023.00 D l1_mtrtyp                        1a
>0024.00 D l1_mtrnbr                        4p 0
>0025.00 D l1_mtrid                          1a
>0026.00 D*
>
>The subfields are also come from an input file (snippet from compiler
>listing):
>
>SEU==>
>0001.67     79=I                             A    1    1  L1_MTRTYP
>0001.68     80=I                             A    2    2  L1_MTRID
>0001.69     81=I                             P    3    5 3L1_WMSIZE
>0001.70     82=I                             P    6    9 0L1_TRFNBR
>0001.71     83=I                             P   10   15 0L1_MTRLOC
>0001.72     84=I                             P   16   19 0L1_MTRNBR
>
>The compiler flags the l1_mtrnbr field in the ds as not matching the
>definition from the I-spec:
>
>30 1 The length of the input field does not match the definition of the
>field; specification is ignored.
>
>I can't see anything wrong.  Am I missing something?
>
>BTW, if I don't indicate the ds length as 6, the compiler shows it as
A(5).
>What's up with this?

That's all interrelated.  As I'm sure you know, a 4 digit packed
decimal numeric field occupies 3 bytes of storage.  Thus, the
data structure shows up as 5 bytes long if you don't explicitly
declare a length for it.  Your input field occupies 4 bytes
(from position 16 to 19).  Without an explicit definition, the
input field would be defined as a 7 digit packed decimal field.

So that's the mismatch - the input field is a 7 digit packed
decimal field , but the field is defined in the data structure as
a 4 digit packed decimal numeric field.

Cheers!  Hans

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com



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