Desktop productivity for business analysts and programmers

How to generate ASCII value of string or number or special character

Reply
Contributor
Posts: 60

How to generate ASCII value of string or number or special character

Hi,

Please let me know how to generate ASCII value of a string value or number or a special character.

for ex.

NameEmployee IDAddress
Ricky Martin 123456#21,North Hampton Street-->15+45

let me know how to find the ascii value of each value in three column.

and please let me know if there is any proc available in sas.

Respected Advisor
Posts: 3,156

Re: How to generate ASCII value of string or number or special character

Check out RANK() function. ACSII maps to single character, not to strings. There is another function COLLATE() returning strings, but for your purpose.

Super Contributor
Posts: 358

Re: How to generate ASCII value of string or number or special character

If you output your strings in $hex format, you can see the hex value of each character.

The ACSII code "is" the character, and the hex code is the location in the translation table (position) of that character in

whichever translation table you are using.

Ask a Question
Discussion stats
  • 2 replies
  • 1801 views
  • 1 like
  • 3 in conversation