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



Looks like you have your old line sequence number in there. The value
'003000' is six positions long. Position six and I believe seven must be
blank.

003000    Qty = Out.QYer(1).QMon(2).QDay(15);


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Tim Kredlo
Sent: Thursday, February 03, 2005 3:04 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: Fully qualified data structures

Help!
I am at V5R2.
I am trying to build a qualified data structure of nested arrays and cannot
tell if I have the syntax correct.
In my attempts I built the following test program (TKTEST) and don't
understand the results I am getting.
Note that in both cases "Out.QYer(1).QMon(2).QDay(15)" are identical (no
typos).
The only difference is whether I am assigning a value to, or retrieving a
value from, the data structure.

This is the first time I have tried to nest arrays and may be going about it
'all wrong'.
But if I comment the line where I fill "Out.QYer(1).QMon(2).QDay(15)" from
QTY,
and leave the line where I fill QTY from "Out.QYer(1).QMon(2).QDay(15)",
the program compiles.

D Qty             S      8S  0  Inz 
* Quantities for 31 days

D QMon            Ds           Qualified    
D  QDay                           Like(Qty)   
D                                     Dim(31)      
D                                     Inz          
 * Quantities for 12 months                        
D QYer            Ds             Qualified    
D  QMon                           LikeDs(QMon) 
D                                     Dim(12)      
D                                     Inz(*LikeDs)
 * Quantities for 3 years                    
D Out             Ds              Qualified     
D  QYer                            LikeDs(QYer)  
D                                     Dim(3)        
D                                   Inz(*LikeDs)  
 *--------------------------------------------------

      // This the test 1           
 /Free 
                            
003000    Qty = Out.QYer(1).QMon(2).QDay(15);

003100    Out.QYer(1).QMon(2).QDay(15) = Qty;

======>      a       b

*RNF5008 20 a      003100  Factor 1 operand is not valid; defaults to
blanks.              
*RNF5507 30 b      003100  A semi-colon is not specified at the end of a
free-format       
                           specification.

 /End-Free 

Compile errors with line#s:
*RNF7030 30        003000  The name or indicator QDAY is not defined.

*RNF5064 20        003000  An array index is specified for name that is not
an array. 
*RNF7064 30        003000  The Factor 2 operand QYER of IN or OUT is not a
data area. 
Compile errors at listing end.
*RNF5008 20      1 Factor 1 operand is not valid; defaults to blanks.

*RNF5064 20      1 An array index is specified for name that is not an
array.
*RNF5507 30      1 A semi-colon is not specified at the end of a free-format

                   specification.

*RNF7030 30      1 The name or indicator is not defined.

*RNF7064 30      1 The Factor 2 operand of IN or OUT is not a data area.

 *--------------------------------------------------

      // This the test 2
/Free                                    
  Qty = Out.QYer(1).QMon(2).QDay(15);    
  // Out.QYer(1).QMon(2).QDay(15) = Qty; 

/End-Free

Program TKTEST placed in library EXPRDPGM. 00 highest severity. Created on
02/03/05 at 12:45:47. 

Thanks in advance for your help.

Tim Kredlo
Exterior Wood, Inc




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