|
Is there any references in IBM manuals to cvthc? I've checked the ILE C for AS/400 Run-Time Reference but can't find it. I know that it's in the QC2UTIL1 service program. I was trying to use QXXPTOI but that only returns integer values. I need this to return values whose size and decimal positions is only known at runtime. Regards, Gerry Tucker Senior Analyst Programmer Technicolor Distribution Services Wembley, U.K. >-----Original Message----- >From: Buck Calabro [mailto:Buck.Calabro@commsoft.net] >Sent: 29 January 2002 18:48 >To: rpg400-l@midrange.com >Subject: RE: Converting string containing packed decimal to numeric >decimal > > >Gerry wrote: > >>Is there a quick way to a string >>containing packed decimal data into >>its decimal equivalent, knowing the >>number of length and decimal positions? > >One way is the C function(?) cvtch. I'm pretty sure you'll >find hits in the >archives and maybe on the FAQ. > > D H2C Pr ExtProc('cvthc') > D * Value > D * Value > D 10I 0 Value > > D RecPtr S * inz > D SrcPtr S * inz > D Size S 10I 0 inz > > C Eval SrcPtr = %addr(AMARecHex) > C Eval RecPtr = %addr(AMARecChr) > C Eval Size=Recl * 2 > C* RECL is the length of the packed data. > > C CALLP H2C(RecPtr : > C SrcPtr : > C Size) > >After converting from hex to char, it'll be fairly simple to >map that to a >data structure and re-define as zoned. > > --buck >_______________________________________________ >This is the RPG programming on the AS400 / iSeries (RPG400-L) >mailing list >To post a message email: RPG400-L@midrange.com >To subscribe, unsubscribe, or change list options, >visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l >or email: RPG400-L-request@midrange.com >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.