I was trying to see how UNICODEC() converted some UTF-8 characters into strings that I could transmit with 7-bit ASCII.
When I looked at my PROC FREQ output in SAS Studio the version generated with the 'PAREN' style was gone or invisible.
But when I sent the same text to RTF, PDF, LISTING or LOG it is is visible.
The FREQ Procedure Cumulative Cumulative __hex__ __paren__ __esc__ __ncr__ Frequency Percent Frequency Percent ----------------------------------------------------------------------------------------------- E28099 <u2019> \u2019 ’ 4 50.00 4 50.00 E289A4 <u2264> \u2264 ≤ 1 12.50 5 62.50 E289A5 <u2265> \u2265 ≥ 3 37.50 8 100.00
So why is the output window not showing the <u2019> strings?
Is it because it thinks they are some type of HTML tag? If so why?
Does this mean that any character string I try to print might be missing some characters if they just happen to have a < and > in that order?
Perhaps it is just the PROC FREQ output?
This code does not have the issue with the HTML output window that SAS/Studio uses.
data test5;
file print;
length char paren $10 ;
do char='E28099'x,'E289A4'x,'E289A5'x ;
paren=unicodec(char,'paren');
put char= paren= ;
end;
run;
Yes. They are HTML tag . If you want display them , you need a special STYLE .
data have;
input (__hex__ __paren__ __esc__ __ncr__ ) (: $80.);
cards4;
E28099 <u2019> \u2019 ’
E289A4 <u2264> \u2264 ≤
E289A5 <u2265> \u2265 ≥
;;;;
proc report data=have nowd style(column)={protectspecialchars=yes} ;
run;
HTML tags are enclosed in angular brackets. Browsers treat strings like yours as "a tag I do not understand" and discard them. This is a safety measure so that older browsers don't stumble over later tags.
HTML compatible output should use < and > instead of the brackets.
Yes. They are HTML tag . If you want display them , you need a special STYLE .
data have;
input (__hex__ __paren__ __esc__ __ncr__ ) (: $80.);
cards4;
E28099 <u2019> \u2019 ’
E289A4 <u2264> \u2264 ≤
E289A5 <u2265> \u2265 ≥
;;;;
proc report data=have nowd style(column)={protectspecialchars=yes} ;
run;
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.