The format hex converts between strings/numbers an the hexadecimal representation of the memory that the string/number occupies.
Strings
data tq84_data;
length txt $9;
/* A is 41 in hex, B 42 etc. */
txt = cat('ABC', '010203'x, 'DEF');
put txt= $hex.; /* txt=414243010203444546 */
run;
The following example uses the x
modifier to create a string from a hexadecimal representation. With the hex
format, it prints, of course, the same represanation from which it was created:
data _null_;
chr = '0102030405060708090a0b'x;
put chr $hex50.; /* 0102030405060708090A0B */
run;