|
Have a *PF with the following: A SSKEYFLDS 16000A VARLEN(200) Using v5r1 RPG-IV, a somewhat novice programmer attempted to MOVEL data to this field and write the record without explicitly manipulating, or making any reference to, the 2-byte field-length prefix. Well, she didn't know that it was VARLEN. Program compiles and program runs with no run-time errors reported. However, DSPPFM shows the field does not have the value MOVEL'd to it, and the field-length prefix value is binary zero. The RPG-IV reference does point out that the old-style MOVE, MOVEL, etc. will not set this field-length prefix, but that EVAL does. One of my colleagues was surprised that the compiler didn't flag this at least as a warning. I offered that I wasn't sure how the compiler would have a good way of knowing; although it apparently knows enough to handle the field-length prefix value when EVAL is used to update the field. Or how about an error at run-time? I speculated that there might be a backward-compatibility issue with RPG-III's handling of it (for better or worse), but couldn't say for sure. Is there a way for the compiler to issue at least a warning whenever MOVEx is used to set a VARLEN field? TIA, GA __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
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.