|
Sorry About that Last Post!
I took your code and ran it, it seemed to work fine.
I ran the code as
totali(i2).qta+=totali(i3).qta;
with out data and with data...
It appeared to be okay..
here is my code...
dtotali ds dim(10) qualified inz
d dest 45
d qta 5p 0 dim(20)
d val 5p 0 dim(20)
d con 10i 0 dim(20)
D i S 10i 0
/Free
for i = 1 to 10;
totali(1).qta(i) = 2;
endfor;
for i = 1 to 10;
totali(2).qta(i) = 2;
endfor;
totali(3).qta += totali(2).qta;
*inlr = *on;
/End-Free
>>> George.Amaya@xxxxxxxxxxxxx 09/16/03 8:40 AM >>>
When you initialize a data structure, it initializes all fields to
blanks... the last field is causing the problem.
>>> facchinetti@xxxxxxxxx 09/16/03 7:16 AM >>>
Just want to know if I'm misunderstanding the coding/usage
of DS with indexes, otherwise I'll call IBM support.
My DS is:
dtotali ds dim(10) qualified inz
d dest 45
d qta dim(20) like(w1qta01)
d val dim(20) like(w1imp01)
d con 10i 0 dim(20)
if I code (sum each element in totali(2).qta to
totali(1).qta):
totali(i2).qta+=totali(i3).qta;
I got an MCH1202 (decimal data....) but the dump clealry
states the data in totali().qta are ok.
in fact if I code:
totali(i2).qta(01)+=totali(i3).qta(01);
totali(i2).qta(02)+=totali(i3).qta(02);
totali(i2).qta(03)+=totali(i3).qta(03);
....
no errors and the result is correct.
Any comments?
Marco
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.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.
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.