|
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
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.