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



Don Wereschuk wrote:
< How is the code inside the procedure supposed to know how long the field
< is that you are passing?

Again I'm not passing actual data since I haven't read the file yet.

Oh, now I think I get what you're trying to do. Maybe you want something more like this:

P FillArrayAll B
D FillArrayAll PI
D FieldToCheck *
D lenFieldToCheck...
D 5P 0 const
D CheckValue 50A
D ArrayValue 50A
D*
DCheckField S 65535A based(FieldToCheck)
D
D

/FREE
COUNT = 1;
read input filerec;
dow %subst(CheckField : 1 : lenFieldToCheck) < CheckValue;
read input filerec;
enddo;
dow not %eof(input) and
%subst(CheckField : 1 : lenFieldToCheck) = CheckValue and
COUNT < 9999;
WrkSupp(COUNT) = ArrayValue;
COUNT += 1;
read input filerec;
enddo;
/END-FREE
P FillArrayAll E

and you would call it like this:
fillArrayAll(%addr(filerec.PLCD) : %size(filerec.PLCD) : 'thisRecordNeedsAction' : 'I want this is my array');

As an aside, you seem to be using a global variable (WrkSupp) inside your subprocedure. This is not a very good practice, and can lead to some really frustrating bugs.

HTH,
Adam

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.