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