Doesn't CPYF handle some data conversion these days?  Seems I remember it
handling alpha to numeric (and reverse) transformations under certain
conditions...

--Paul E Musselman
PaulMmn@ix.netcom.com





>On Wed, Dec 02, 1998 at 06:08:56PM -0600, Bill Megenity wrote:
>> I am building/reformatting a database using Query/400. I would like to
>> convert a character field to a numeric value. I can use DIGITS to go the
>> other way, but is there a way to go this direction?
>
>One way to do this conversion without programming is to use CPYF.
>If you have DDS like: A            CHAR10        10A and you want
>it to look like: A            DEC10         10P 0, you can go through
>an intermediate step of A            DEC10         10S 0.
>
>Create a copy of your file's DDS and change it from CHAR10 10A to
>DEC10 10S 0 so the field takes up the same number of bytes, and has
>the name you want for the final version of the file.
>CPYF oldfile intermediatefile FMTOPT(*NOCHK) to copy the file
>byte for byte.
>
>Create a copy of the intermediate file DDS and change it from
>DEC10 10S 0 to DEC10 10P 0, then CPYF intermediatefile finalfile
>FMTOPT(*MAP).  That'll convert the data from signed to packed.
>
>Buck Calabro
>CommSoft, Albany, NY
>mailto:mcalabro@commsoft.net


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.