|
My instinct would be to do something like this:--
D DS
D SCDLP
D DLP 5p 2 dim(366)
D overlay(SCDLP)
I don't understand why MOVEA wouldn't work... but honestly, I haven't
used MOVEA in like 15 years, so I don't remember it very well.
My instinct would be to do something like this:
D DS
D SCDLP
D DLP 5p 2 dim(366)
D overlay(SCDLP)
(This assumes SCDLP is the field from the file.) To me, it's the most
obvious solution -- you can clearly see that DLP is an array that's
overlaying the SCDLP field.
If for some reason you can't put SCDLP in a data structure (because
it's
parameter, or you want it used in another DS, such as a LIKEREC or
EXTNAME) then I'd do something like this:
D dsDLP DS
D DLP 5p 2 dim(366) overlay(SCDLP)
And simply copy the SCDLP field to the DS.
eval dsDLP = scDLP;
You could also use pointers -- but it's probably best to avoid them.
Hope that helps.
On 6/2/2011 10:22 AM, THarteau@xxxxxxxxxxxxxxxxxx wrote:
Hi,defined
I have a file I have no control over. one of the fields is
as 1098 long, alpha. What is actually is, is an 366 element array ofconvert
packed 5.2 numbers. I thought MOVEA used to work when trying to
something like this, but it does not anymore. My program is in RPGLE.I
have tried different combinations of EVAL, MOVE, MOVEA, datastructures&
the %DEC bif. The closest I have gotten is to have packed blanks inmy
numeric field. Any ideas on how to get 366 numeric fields? Here ismy
code ( a bit cluttered because of the different things I have tried).path
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
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 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.