The IBM examples specifically show printf of D(*,*) -- see the link that someone provided earlier, or the P/G.
Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Thomas David Rivers Sent: Wednesday, April 26, 2017 10:15 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Can XLC printf() take "%D(*,*)"? Charles Mills wrote: >I don't seem to be able to declare a D variable in C++. > > > > > Nope - _Decimal types are not support in C++ (it would mess up the type hiearchy too much which gets into name mangling issues, etc...) So - you can only declare _Decimal values in C. Systems/C doesn't support %D(*,*) - you have to explicity specify the precision so the printf() var-args code can retrieve the proper number of bytes from the argument list. Although - now that you point it out, I don't see a reason why it couldnt' support that... you would need to do something like: printf("%D(*,*)\n", digitsof(d), precisionof(d), d); Seems like that would be a really good idea! The description of %D in the IBM XLC manuals simply says: %D(n,p) Fixed-point value consisting of a series of one or more decimal digits possibly containing a decimal-point. I doesn't seem to provide for D(*,*) - so - from the documentation, it doesn't look like IBM supports it either. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN