|
A data structure is treated just like a character field in RPG IV. A VARYING field is easily copied to and from a fixed-length character field in RPG IV. No special handling required. I believe you problem is that you are trying to copy a varying length character field (one with VARYING specified) to a data structure. The 2-byte integer prefix is not copied in this context. Only the data. Therefore you either have to do it correctly, to do it this way: D myVarLen DS D Length 5I 0 D data 255A D MyData S 255A VARYING C eval data = myData C eval length = %len(myData) To go the other way around, you'd code this: C eval myData = Data C eval %len(myData) = Length // Assuming "LENGTH" has been set correctly. -Bob Cozzi www.RPGxTools.com RPG xTools - Enjoy programming again. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of THarteau@xxxxxxxxxxxxxxxxxx Sent: Monday, October 03, 2005 12:42 PM To: RPG programming on the AS400 / iSeries Subject: Re: Converting VARCHAR fields Hi, The CVTOPT(*VARCHAR) I added after finding it on a web site. I originally tried using EVAL and MOVE, neither which seemed to work. I go rid of the *VARCHAR and changed to code to: C EVAL WkEmp = InEmp and in debug, this is what I get: WKEMP = ' *01138 ' With the note, cannot show this data at the display station. I added the DS after I couldn't get anything else to work. <===================================================> Terri Harteau Felker Brothers Corporation **************** "The happiest people don't necessarily have the best of everything. They just make the best of everything!" ****************
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.