But if you don't like API and love SQL ...take a look at this SQL statement
D usrf01 ds
D TypeCode 1 2s 0
D Category 3 4p 0
D Amount 5 8p 2
// get the amount and check the sign
(case when substr(hex(substr(usrf01,5,4)),8,1) = 'D'
then -1 else 1 end),
7,2) as Price
Il giorno lun 9 set 2019 alle ore 14:47 David Gibbs via RPG400-L <
rpg400-l@xxxxxxxxxxxxxxxxxx> ha scritto:
Does anyone have a routine handy (or know of an API) that will convert
hex characters to decimal or integer?
For example: If I have the character value 'BC614E' I would get
I had hoped there would be something in SQL, since there is a HEX
function that will convert a numeric into character hex, but it
doesn't appear to exist.
IBM i on Power Systems: For when you can't afford to be out of business!
I'm riding in the American Diabetes Association's Tour de Cure to
raise money for diabetes research, education, advocacy, and awareness.
You can make a tax-deductible donation to my ride by visiting
You can see where my donations come from by visiting my interactive
donation map ... https://mideml.diabetessucks.net/map (it's a geeky
I may have diabetes, but diabetes doesn't have me!
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
Please contact support@xxxxxxxxxxxx for any subscription related
Help support midrange.com by shopping at amazon.com with our affiliate