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


  • Subject: problem with using D-specs in a procedure
  • From: bmorris@xxxxxxxxxx
  • Date: Wed, 1 Sep 1999 09:13:44 -0400




Joe, the compiler formerly failed to notice that the array DAY does not fit
within the subfield SUNDAY.  The rules for overlay say that the entire overlaid
field must fit.

This particular case might have actually worked, but there were some cases where
the compiler allowed programs to compile that caused data corruption in other
variables, so the compiler was PTF'd.

Starting in V4R2 you can say OVERLAY(data-structure-name) so change Day so it
has OVERLAY(Days).
For releases before that, try coding it this way:
     D Days            DS
     D  Sunday                       10A   Inz('Sunday')
     D  Monday                       10A   Inz('Monday')
     D  Tuesday                      10A   Inz('Tuesday')
     D  Wednesday                    10A   Inz('Wednesday')
     D  Thursday                     10A   Inz('Thursday')
     D  Friday                       10A   Inz('Friday')
     D  Saturday                     10A   Inz('Saturday')
     D Day             S             10A   Dim(7) Based(pDay)
     D pDay            S               *   Inz(%Addr(Days))

Barbara Morris

>Date: Tue, 31 Aug 1999 13:52:46 -0500
>From: "Joe Teff" <jteff19@idt.net>
>
>An associate was trying to use some code shown in
>Bob Cozzi's RPG IV book and it won't compile. I've looked
>at it and don't see the problem. What am I missing?
>
>Joe Teff
> ...
>
>     D Days            DS
>     D  Sunday                       10A   Inz('Sunday')
>     D  Monday                       10A   Inz('Monday')
>     D  Tuesday                      10A   Inz('Tuesday')
>     D  Wednesday                    10A   Inz('Wednesday')
>     D  Thursday                     10A   Inz('Thursday')
>     D  Friday                       10A   Inz('Friday')
>     D  Saturday                     10A   Inz('Saturday')
>     D  Day                          10A   Dim(7) Overlay(Sunday)
> ...
>          A d d i t i o n a l   D i a g n o s t i c   M e s s a g e s
> Msg id  Sv Number Seq     Message text
>*RNF7303 30    102 010200  Subfield DAY defined with keyword OVERLAY is =
>too big;
> ...


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.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.