Good morning. I am not a programmer but I use webfocus to design and created basic reports. One of the issues that I am having is that I need to convert data from hex to decimal. In excel, I can convert back and from using hex2dec or dec2hex. What I have, for example, is 4D01A443 (hex) that I need to convert to 1291953219 (dec) so that I can join two tables to create a report. The "userid" in one table is the hex code but in the 'user' table the "userid" is a dec code.
Probably need UFMT function.
WebFOCUS 8206, Unix, Windows
What version of WebFOCUS are you on ?
There are new functions being added in new releases.
WebFocus Enterprise Edition
Product Release: 8.2
Service Pack: 0.1
Build/GEN Number: 164
Build/GEN Date: May 5, 2017
You should put that in your signature, under Go / Personal Zone / Profile / View/Edit Complete Profile
Then add it to "(**required) Product Signature: Please fill out your WebFOCUS release, OS/Platform, and expected Output format(s), AND also the fields below:"
You can use HTML in it.
I'm beginning to this that there are two ways to do this.
1. Write something, say a DEFINE FUNCTION that converts each char of the string to a number, then multiplying them out to get the integer. I think I've done that before, a long time ago.
2. If you are calling a relational DB, you could use DB_EXPR to call a native DB function like CONVERT or CAST
Yes, shoot or re-educate the designers of your tables! This should never be designed this way!
Seriously though, There are some good suggestions here. Also consider doing a search on the forum for "HEX TO DEC" as this question has been asked (and answered) before, so you may find other suggestins in previous answers.
|Powered by Social Strata|