×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Ah...Thanks Bob (and Lois).  My thinking was backwards and was looking at
the redefine in terms of offset.  I was thinking of specifying the packed
length, not unpacked.  Thanks guys.

Buzz Fenner
mailto:bfenner@jonesborocwl.org



-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On
Behalf Of Bob Cozzi (RPGIV)
Sent: Monday, February 11, 2002 11:01 AM
To: rpg400-l@midrange.com
Subject: RE: Compiler error on packed field redefine

The From-To columns indicate the start and end locations in the database
record where the field is located. No the length of the fields. A quick
calculation of your packed field to me, indicates that:

 16 to 19 P 0
 16 through 19 = 4
 4 * 2 = 8
 8 - 1 = 7

Hence you field is 7 packed, so on a length-notation D spec you need to
code it as   7P 0
Unless the field is the rare "even packed" field, in which case it would
be 6P 0 look at the DDS source for the file and make the D spec look the
same.

Bob Cozzi
cozzi@rpgiv.com
Visit the on-line  Midrange  Developer  forum at: http://www.rpgiv.com


> -----Original Message-----
> From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]
On
> Behalf Of Buzz Fenner
> Sent: Monday, February 11, 2002 10:31 AM
> To: RPG Discussion
> Subject: Compiler error on packed field redefine
>
> 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?
>
> Buzz Fenner
> mailto:bfenner@jonesborocwl.org
>
>
>
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.


_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
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 thread ...

Replies:

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

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