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



Alan: I'm not passing the value in the data file field. I'm passing a pointer to the address of the variable that contains the data. The variable gets updated in the called procedure by reading the records in the data file. On one call I use Field1 from the file which is 1A but on another call I want to use Field2 which could be 10A. I set the length of the variable to 50A which should cover the maximum length of any fields I'm interested in. The problem is that using the Based(pointer) and the field is only 1A the system tries to put 50 chars into a 1 char size field. The VARYING is not adjusting the length to correspond to the actual Field length which is what the help says should happen. If I have to manually pass the length to adjust the variable in the called procedure How do I do this while still using the pointer which works the way I want?

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

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: Monday, January 21, 2008 2:46 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Passing Parameters

Hi Don
if I'm reading the following web page correct (which, knowing me - I'm not)

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/books/c092508602.htm

you should be using the max size that you want for VARYING therefore why
don't you use 65535


Alan Shore

NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx
"If you're going through Hell, keep going" - Winston Churchill


rpg400-l-bounces@xxxxxxxxxxxx wrote on 01/21/2008 01:52:08 PM:

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.
--
This is the RPG programming on the AS400 / iSeries (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.

--
This is the RPG programming on the AS400 / iSeries (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 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.