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




Coworker pointed that out to me, but we got off on a tangent which led us
off into breaking arrays into multiple elements.  That part wasn't
applicable to this.

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


|-----------------------------+-------------------------------------------|
|   Mel Rothman               |                                           |
|   <mel@xxxxxxxxxxxxxx>      |                                           |
|   Sent by:                  |                                         To|
|   rpg400-l-bounces@midrange.|      rpg400-l@xxxxxxxxxxxx                |
|   com                       |                                         cc|
|                             |                                           |
|   07/21/2004 04:37 PM       |                                    Subject|
|                             |      Re: Array overlay.                   |
|         Please respond to   |                                           |
|      RPG programming on the |                                           |
|          AS400 / iSeries    |                                           |
|      <rpg400-l@xxxxxxxxxxxx>|                                           |
|                             |                                           |
|                             |                                           |
|-----------------------------+-------------------------------------------|






I forgot to mention that what I wrote is in addition to the problem pointed
out
by Hans Boldt and Scott Klement: MaxPty cannot overlay MaxPty1 because at
36
bytes it is larger than MaxPty1's 4 bytes.


Mel



Mel Rothman wrote:

> The problem has to do with how overlay works when the overlain field is
> an array.  From the RPG IV reference manual:
>
> If the subfield specified as the first parameter for the OVERLAY keyword
> is an array, the OVERLAY keyword applies to each element of the array.
> That is, the field being defined is defined as an array with the same
> number of elements. The first element of this array overlays the first
> element of the overlaid array, the second element of this array overlays
> the second element of the overlaid array, and so on.
>
> To avoid this problem, try something like this:
>
> D  MaxPtyA                      36
> D  MaxPty1                      10i 0 Overlay(MaxPtyA)
> D  MaxPty2                      10i 0 Overlay(MaxPtyA:*next)
> D  MaxPty3                      10i 0 Overlay(MaxPtyA:*next)
> D  MaxPty4                      10i 0 Overlay(MaxPtyA:*next)
> D  MaxPty5                      10i 0 Overlay(MaxPtyA:*next)
> D  MaxPty6                      10i 0 Overlay(MaxPtyA:*next)
> D  MaxPty7                      10i 0 Overlay(MaxPtyA:*next)
> D  MaxPty8                      10i 0 Overlay(MaxPtyA:*next)
> D  MaxPty9                      10i 0 Overlay(MaxPtyA:*next)
> D  MaxPty                       10i 0 dim(9) Overlay(MaxPtyA)
>
> In addition, make sure that pointer pSJQL0100 has storage allocated to
> it and that the elements of array MaxPtr contain numeric values.
>
>
> Mel Rothman
> Mel Rothman, Inc.
>
>
>
> rob@xxxxxxxxx wrote:
>
>>
>> Let me try repasting without some of the comments and see if that
>> inspires
>> anyone to respond
>>
>>  * SJQL0100 - QWDLSJBQ - List Subsystem Job Queue Entries
>> D pSJQL0100       s               *
>> D SJQL0100        DS                  Qualified based(pSJQL0100)
>> D  JobQueueName                 10a
>> D  JobQueueLib                  10a
>> D  SeqNbr                       10i 0
>> D  AllocInd                     10a
>> D*
>> D*
>> D  Reserved1                     2a
>> D  MaxAct                       10i 0
>> D*
>> D  MaxPty1                      10i 0
>> D  MaxPty2                      10i 0
>> D  MaxPty3                      10i 0
>> D  MaxPty4                      10i 0
>> D  MaxPty5                      10i 0
>> D  MaxPty6                      10i 0
>> D  MaxPty7                      10i 0
>> D  MaxPty8                      10i 0
>> D  MaxPty9                      10i 0
>> D  MaxPty                       10i 0 Overlay(MaxPty1) dim(9)
>>
>>                  For x = 1 to %elem(SJQL0100.MaxPty);
>>                    cmd += ' MAXPTY' + %char(x) + '(';
>>                    Select;
>>                    When SJQL0100.MaxPty(x)=-1;
>> RNF7503S Expression contains an operand that is not defined.
>>                      cmd += '*NOMAX';
>>                    Other;
>>                      cmd += %char(SJQL0100.MaxPty(x));
>> RNF7503S Expression contains an operand that is not defined.
>>                    EndSl;
>>                    cmd += ')';
>>                  EndFor;
>>
>> Rob Berendt
>> --
>> Group Dekko Services, LLC
>> Dept 01.073
>> PO Box 2000
>> Dock 108
>> 6928N 400E
>> Kendallville, IN 46755
>> http://www.dekko.com
>>
>>
>>
|-----------------------------+-------------------------------------------|
>>
>> |   rob@xxxxxxxxx
>> |                                           |
>> |   Sent by:
>> |                                           |
>> |
>> rpg400-l-bounces@midrange.|                                         To|
>> |   com                       |
>> rpg400-l@xxxxxxxxxxxx                |
>> |
>> |                                         cc|
>> |   07/21/2004 02:13 PM
>> |                                           |
>> |                             |
>> Subject|
>> |         Please respond to   |      Array
>> overlay.                       |
>> |      RPG programming on the
>> |                                           |
>> |          AS400 / iSeries
>> |                                           |
>> |
>> <rpg400-l@xxxxxxxxxxxx>|
>> |
>> |
>> |                                           |
>> |
>> |                                           |
>> |
>> |                                           |
>>
|-----------------------------+-------------------------------------------|
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> As some people may prefer field names over an array I defined a data
>> structure like the following:
>> D pSJQL0100       s               *
>> D SJQL0100        DS                  Qualified based(pSJQL0100)
>> D  JobQueueName
>> 10a                                        Job Queue Name
>>
>> D  JobQueueLib
>> 10a                                        Job
>> Queue Library
>>
>> D  SeqNbr                       10i
>> 0                                      Sequence number
>> D  AllocInd
>> 10a                                        Allocation Indicator
>>
>> D*
>> *NO=Not
>> aloc to sbs
>>
>>
>> D*
>> *YES=Alloc
>> to sbs
>>
>> D  Reserved1                     2a
>> D  MaxAct                       10i
>> 0                                      Maximum Active jobs
>>
>> D*
>> -1
>> = *NOMAX
>>
>> D  MaxPty1                      10i
>> 0                                      Max jobs, priority 1
>> D  MaxPty2                      10i
>> 0                                      Max jobs, priority 2
>> D  MaxPty3                      10i
>> 0                                      Max jobs, priority 3
>> D  MaxPty4                      10i
>> 0                                      Max jobs, priority 4
>> D  MaxPty5                      10i
>> 0                                      Max jobs, priority 5
>> D  MaxPty6                      10i
>> 0                                      Max jobs, priority 6
>> D  MaxPty7                      10i
>> 0                                      Max jobs, priority 7
>> D  MaxPty8                      10i
>> 0                                      Max jobs, priority 8
>> D  MaxPty9                      10i
>> 0                                      Max jobs, priority 9
>> D  MaxPty                       10i 0 Overlay(MaxPty1) dim(9)
>>
>> However, I am getting the following in the compile:
>> For x = 1 to %elem(SJQL0100.MaxPty);
>> cmd += ' MAXPTY' + %char(x) + '(';
>> Select;
>> When SJQL0100.MaxPty(x)=-1;
>> RNF7503S Expression contains an operand that is not defined.
>> cmd += '*NOMAX';
>> Other;
>> cmd += %char(SJQL0100.MaxPty(x));
>> RNF7503S Expression contains an operand that is not defined.
>> EndSl;
>> cmd += ')';
>> EndFor;
>>
>>
>> Rob Berendt
>> --
>> Group Dekko Services, LLC
>> Dept 01.073
>> PO Box 2000
>> Dock 108
>> 6928N 400E
>> Kendallville, IN 46755
>> http://www.dekko.com
>>
>>
>>
>>
>> --
>> 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.
>>
>>
>>
>> --
>> 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.
>>
>
>
> --
> 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.
>
>


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