Not sure I understand the problem. It is just

d aPackedDs...
d ds Qualified
d OneValue...
d 5p 2 Dim(366)

d x...
d s 10i 0
/Free

aPackedDs = InField;

For x = 1 To 366;
Monitor;
aField = aPackedDs.OneValue(x);
On-Error;
Leave;
EndMon;
EndFor;


I assume that the problem is that not all the fields are initialized to some
value and have blanks in them? I don't really like the monitor because it
will fill the logs with error messages but alternative is to just code a
function to check for numeric.



On Thu, Jun 2, 2011 at 9:22 AM, <THarteau@xxxxxxxxxxxxxxxxxx> wrote:

Hi,
I have a file I have no control over. one of the fields is defined
as 1098 long, alpha. What is actually is, is an 366 element array of
packed 5.2 numbers. I thought MOVEA used to work when trying to convert
something like this, but it does not anymore. My program is in RPGLE. I
have tried different combinations of EVAL, MOVE, MOVEA, data structures &
the %DEC bif. The closest I have gotten is to have packed blanks in my
numeric field. Any ideas on how to get 366 numeric fields? Here is my
code ( a bit cluttered because of the different things I have tried).

D DS
D DLPA 3
D DLPN 5P 2
D WkD S 3 DIM(366)
D DLP S 5P 2 DIM(366)

C IF SCDLP <> *blanks
C MOVEA SCDLP WkD
C EVAL X = 0
C*
C DOU X >= 366
C EVAL X = X + 1
C MOVE WkD(X) DLPA
C MOVE WkD(X) DLPN
C EVAL DLPA = WkD(X)
C IF DLPN <> 0
C EVAL DLP(X) = DLPN
C ENDIF
C ENDDO
C*
C ENDIF
<===================================================>

Terri Harteau
Felker Brothers Corporation
****************
"Do not follow where the path may lead. Go instead where there is no path
and leave a trail."
Ralph Waldo Emerson

****************



--
This is the RPG programming on the IBM i / System i (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.