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



Brian,

Is FldQty declared as an alpha field?

Tim



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Brian Piotrowski
Sent: Friday, March 18, 2005 10:23 AM
To: RPG programming on the AS400 / iSeries
Subject: Conversion Error Help


Hi All,

 

I'm having a bit of a problem with a data evaluation / conversion, and I'm
wondering if you veterans can help (Yes, I am still fairly new to RPG)? 

 

In my code, I have this statement:

 

/FREE

  CHAIN KEYPB SSM05A11;                

  IF %FOUND(SSM05A11);                 

    FLDQTY = %SUBST(FLD5:2:%LEN(FLD5));          

    GTBOXQTY = (%INT(FLDQTY) > PNBQTY);

  ENDIF;                               

/END-FREE                              

 

KEYPB is a key that contains a part number

FLD5 is a 9A field

PNBQTY is a 6S field for box quantity

 

When my program runs, the user enters a value into FLD5 (in this case, the
user enters Q901).  The program then takes the part number and checks the
database for it.  If the part number is found, it will then compare the box
quantity of the record (PNBQTY) to the value entered by the user (in this
case, 901, since the FLDQTY statement is taking from value 2 to the end of
the string).

 

Or so it should... when I run the program, as soon as it gets to the FLDQTY
= %SUBST line, it gives me a "Type Compatibility Error Occurred".
In debug mode, if I do an eval on FLD5, I get 'Q901     ' (note the
trailing spaces).


Even when I try a %TRIM(FLD5), I get the compatibility error.

 

Can someone tell me where I am going wrong?

 

Thanks!


Brian.

 

 

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Brian Piotrowski

ISD Specialist

Simcoe Parts Service, Inc.

6795 Industrial Parkway

Alliston, ON, L9R1W1

bpiotrowski@xxxxxxxxxxxxxxx

ph: 705-435-7814 x343

fx: 705-435-6746

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 

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