|
Hi All: I am having a problem with passing parameters to a procedure that I just can't seem to solve.
The following code is my procedure:
P FillArrayAll B
D FillArrayAll PI
D FieldToCheck *
D CheckValue 50A
D ArrayValue 50A
D*
DCheckField S 1A based(FieldToCheck) VARYING
D
D
D*************************************************************************
/FREE
COUNT = 1;
read input filerec;
dow CheckField < CheckValue;
read input filerec;
enddo;
dow not %eof(input) and
CheckField = CheckValue and
COUNT < 9999;
WrkSupp(COUNT) = ArrayValue;
COUNT += 1;
read input filerec;
enddo;
/END-FREE
P FillArrayAll E
CheckValue is pre-set.
CheckField is a value from a data file
If I define CheckField to be the same size as the field in the file I have no problems. My problem is that I want to pass different fields from the file at different times, each field
Having a different size. When I defined CheckField larger than the actual length of the field I get an error (Length of variable is out of range). All the help I've been able to find
Says that using VARYING should set the variable to the proper length but this is not working. Can anyone see what I'm doing wrong here. Thanks in advance for any help.
******************************************
Don Wereschuk
ISD - Programmer/Analyst
Simcoe Parts Service Inc.
Phone: 705-435-7814 Ex: 302
Fax: 705-435-6746
mailto:dwereschuk@xxxxxxxxxxxxxxx
******************************************
"Save the Cheerleader - Save the world" - Hiro Nakamura
________________________________
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
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.