|
>From: "Andrew Goade" <agoade@hubgroup.com> >Date: Wed, 9 Jan 2002 15:04:45 -0600 > >I was wondering if anyone had an easy way to convert from numeric data >types to character types and back. I have a data structure that contains >alpha, packed, and binary fields. It gets moved into a long alpha field >and passed to another program. Instead of reading the long alpha field >into back into the data structure, I would like to substring out the >variables and move them to hold fields. When I substring out the binary (4 >positions in the buffer) to a 4 alpha field and try to move it to a 9b 0 >field, my program blows up. The hex values of the fields are the same, so >it makes me wonder why RPG won't do the conversion. Andy, when you use MOVE to move alpha to numeric, RPG assumes that the alpha contains numeric characters (like '0' - '9'). If you want to just transfer the binary data from the character field directly to the binary field, you should define a character overlay for your binary field, and move to the overlay, character to character, without conversion. Same with your packed data. Barbara Morris
This mailing list archive is Copyright 1997-2026 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.