|
D InEmp S 25A Varying Inz('TEST') D WkEmp S 25A D SvEmp S 8A // What's wrong with this statement? Eval SvEmp = InEmp --- below could be an example of what's wrong. // Note the Inz value above. // InEmp has a max size of 25A, but is only 4a due to the value moved into it. C MOVE InEmp WkEmp // results in something like ' TEST' // because the size of InEmp is 4a ('TEST' is 4 alpha), and the MOVE right aligns it in WKEmp C MOVEL WkEmp SvEmp // This statement truncates the right portion of WKEmp, so you're moving the left aligned spaces into // SvEmp and truncating the actual value you want. Kurt Anderson Application Developer Highsmith Inc -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of THarteau@xxxxxxxxxxxxxxxxxx Sent: Friday, September 23, 2005 3:05 PM To: RPG programming on the AS400 / iSeries Subject: Varying length fields Hi, I think I am missing something basic, but I have been looking at archives for the past hour and can't find anything. I have an input parameter that is defined as varying. I want to move it to another field to use in an SQL insert. The field just comes up blank. D InEmp S 25A Varying D WkEmp S 25 D SvEmp S 8A C MOVE InEmp WkEmp C MOVEL WkEmp SvEmp C/EXEC SQL C+ INSERT INTO V64BPCSUSF/SVL (SVID, SVEMP, SVORD, SVOPR, SVHRS, SVGQT, C+ SVSQT) VALUES('SV', :SvEmp, :WkOrdN, :OpNo, :Hrs, :QtyG, C+ :QtyS) WITH NC C/END-EXEC What am I missing? <===================================================> Terri Harteau Felker Brothers Corporation **************** "The happiest people don't necessarily have the best of everything. They just make the best of everything!" **************** -- 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 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.