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



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

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





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.