×

Good News Everybody!

The new search engine is LIVE!

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




Hi Michael,

instead of defining INZ for the LIKEDS() definintion you should use
inz(*LikeDS).
D Year            DS                  Qualified Dim(2) Inz
D  Location                           LikeDS(Variables) DIM(4) Inz(*LikeDS)

Mit freundlichen Gru?en / Best regards

Birgitta

"Shoot for the moon, even if you miss, you'll land among the stars."
(Les Brown)

-----Ursprungliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von
Michael_Schutte@xxxxxxxxxxxx
Gesendet: Montag, 7. August 2006 20:18
An: rpg400-l@xxxxxxxxxxxx
Betreff: Multi-dimensional array initialization help.



I need an extra set of eyes please...

I have this datastructure set up so that I may use multi-dimensional
arrays, however, I can't get the program to work. Keep getting blanks in
the datastructure instead of zeros.

D LY              C                   1
D TY              C                   2
D Unit            C                   1
D Area            C                   2
D Regn            C                   3
D Comp            C                   4

D Year            DS                  Qualified Dim(2) Inz
D  Location                           LikeDS(Variables) DIM(4) Inz
D Variables       DS                  Qualified Inz
D  Terms                              Like(HTOTOT) Inz
D  ServiceA                           Like(HTOSVA) Inz
D  ServiceB                           Like(HTOSVB) Inz
D  ServiceC                           Like(HTOSVC) Inz
D  ServiceD                           Like(HTOSVD) Inz
D  ServiceE                           Like(HTOSVE) Inz
D  ServiceH                           Like(HTOSVH) Inz
D  FTTerms                            Like(HTOFT)  Inz
D  PBTerms                            Like(HTOPB)  Inz
D  PTTerms                            Like(HTOPT)  Inz
D  Active                             Like(HTOACT) Inz
D  FTActive                           Like(HTOAFT) Inz
D  PBActive                           Like(HTOAPB) Inz
D  PTActive                           Like(HTOAPT) Inz
D  TOP                           4  1              Inz
D  TOPB                          4  1              Inz
D  FTTOP                         4  1              Inz
D  PBTOP                         4  1              Inz
D  PTTOP                         4  1              Inz
D  UMAMT                        17  2              Inz

D CUPHTO        E DS                  Inz

The program compiles just fine however; when I get to the point of
populating the array, I get a data-decimal error.

/Free
  Year(TY).Location(Unit) = *Zeros;
  Year(LY).Location(Unit) = *Zeros;
  For Period.Period = RangeBeg.Period To RangeEnd.Period;
      If Period.Mnth > 12;
         Period.Mnth = 1;
         Period.Year += 1;
      EndIf;
      HTOUNT = %SubSt(%EditC(Location:'X'):3:4) + ' ';
      Chain (Company:HTOUNT:Period.Period) CULHTO;
      If not %Found(CULHTO);
         Reset CUPHTO;
      EndIf;

      Year(TY).Location(Unit).Terms += HTOTOT;  // Errors Here
      ...
/End-Free

When it gets to this point, I get the error.  Trying to Add HTOTOT to
blanks.  Can you see what I'm missing?  I thought on the very first line, I
set everything to *Zeros.  NOTE: that I also tried changing that to *ALL'0'

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

Follow-Ups:
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.