data _null_;
/* Input values */
red=42;
green=31;
blue=170;
/* Convert to hex */
hexred=put(red,hex2.);
hexgreen=put(green,hex2.);
hexblue=put(blue,hex2.);
/* Create as a SAS RGB color */
sasrgb="CX"||hexred||hexgreen||hexblue;
/* Write the new value to the Log */
put sasrgb;
run;