BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BenConner
Pyrite | Level 9

Hi,

 

I need to be able to assign a unicode character value (SymbolA '1F6B9'x) to a computed variable in Proc Report. Can someone point me to where that is covered in the documentation?  Haven't had much success so far.

 

Thanks!

 

--Ben

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  I found it. With Arial Unicode MS, it is the same Unicode value. I used the UNICODE function of ODS ESCAPECHAR:

weeman.png

 

ods escapechar='^';
proc report data=pcts nowd;
column client weeman;

define client /display;
define weeman / computed;

compute weeman / character length=50;
 * SymbolA '1F6B9'x;
  weeman='^{unicode 1f6b9}';
  call define(_col_,'style','style={font_face="Arial Unicode MS" font_size=24pt}');
endcomp;
run;

cynthia

View solution in original post

7 REPLIES 7
jklaverstijn
Rhodochrosite | Level 12

Hi Ben,

 

There is a nice tech paper called "Multilingual Computing with SAS 9.4" that you may find informative. 

 

Also there are some install-time choices where SAS is either installed as single-byte or multi-byte. Depending on the type of deployemnt you have, ranging from local SAS to a remote server access via Enterprise Guide, the technical implications will vary.

BenConner
Pyrite | Level 9

Thanks so much for the reference!  While I didn't do the install and am guessing, I'm willing to bet it was a single-byte installation, so will have to tweak it a bit.  The good news is I don't have to carry these in to the proc report step as incoming data values so that simplifies it a bit.

 

--Ben

BenConner
Pyrite | Level 9

I read the white paper and while it gave me good background information, there wasn't enough detail for me to figure out what to do.  Here's a sample code snippet that doesn't work:

 

data pcts;
   client=1; pctype=1; pct=65; output;
run;

proc report data=pcts nowd;
column client weeman;

define client /display;
define weeman / computed;

compute weeman / character length=10;
 * SymbolA '1F6B9'x;
  weeman='01f6b9'x;
  call define('weeman','style','style={fontfamily=SymbolA}');
endcomp;
run;

 

I would like the 'weeman' variable to display the actual SymbolA unicode font value represented by '1f6b9'x.  SAS wanted me to put the 0 in front of the hex string.   Am still missing something basic here.

 

--Ben

Cynthia_sas
SAS Super FREQ
Hi:
I do not have the SymbolA font, so I can't run a test. If you look at Arial Unicode MS font is there an equivalent symbol???

cynthia
BenConner
Pyrite | Level 9

Ah.  Found it.  Needed the ODS escapechar= parm and to define weeman as:

 

weeman='^{unicode "1f6b9"x}';

 

Thanks!

 

--Ben

 

Cynthia_sas
SAS Super FREQ

Hi:

  I found it. With Arial Unicode MS, it is the same Unicode value. I used the UNICODE function of ODS ESCAPECHAR:

weeman.png

 

ods escapechar='^';
proc report data=pcts nowd;
column client weeman;

define client /display;
define weeman / computed;

compute weeman / character length=50;
 * SymbolA '1F6B9'x;
  weeman='^{unicode 1f6b9}';
  call define(_col_,'style','style={font_face="Arial Unicode MS" font_size=24pt}');
endcomp;
run;

cynthia

BenConner
Pyrite | Level 9

Thanks, Cynthia! 

 

This is a good example of taking a graphic image that originally was coded as a series of Drawtext and Drawrectangle GTL statements and converting it to a simpler Proc Report. 

 

The original approach actually had 10 of these images plus some additional text information.  While I don't have an issue with GTL, drawtext statements do not recognize dynamic variables and as a result the SGRender proc can't take advantage of a BY statement when you have a lot of these to generate.  By finding a Proc Report solution, they can be created with one execution of Proc Report and the output directed to a Document Store, and the final output assembled later as needed.

 

Much appreciated!

 

--Ben

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 4119 views
  • 0 likes
  • 3 in conversation