BookmarkSubscribeRSS Feed
bnawrocki
Quartz | Level 8

I have added a Unicode "star" character to my PROC REPORT output, but it causes the row heights in the report to be too tall, with lots of wasted space. I'm writing to ODS PDF output, if that helps. 

 

My output examples both with and without the Unicode character are attached.

 

My code to create the text value is this:

SIR_int="^{unicode 2605} Better";

 

 

At this point, I'm open to alternatives to using the Unicode character.

 

 


WithoutUnicode.PNGWithUnicode.PNG
8 REPLIES 8
Cynthia_sas
SAS Super FREQ
Hi:
What is the rest of your code? Are you using PRINT, REPORT, DATA step to produce your report? I am guessing that the star is slightly raised. you could try changing the CELLPADDING attribute, but the WAY you change it will depend on the way you are creating the data for your destination.

As an example, if you were using PROC REPORT, I would recommend experimenting with different values for CELLPADDING like this:
proc report data=class(obs=5)
style(report)={cellpadding=5px};

cynthia
bnawrocki
Quartz | Level 8

Yes, I am using PROC REPORT, and I have set various cellpadding values. My code is:

**Create Report**;
proc report data=report_&infection split='\' 
   style(report)={cellspacing=0 cellpadding=2} 

   style(header)={ background=cxE0E0EB foreground=black font_face=calibri font_weight=bold font_size=8pt}
   style(column)={ background=white foreground=black font_face=calibri font_weight=medium font_size=8pt bordertopcolor=white};

   column unit infCount exp1 sig SIR_int row printed_row;


   define unit     / display center "Unit Type" style(column)={width=31.75%} ;
   define infCount / display "Observed\&infText" center style(column)={width=17.75%};
   define exp1	/ display "Predicted\&infText" center style(column)={width=17.75%};
   define SIR_int  / display center "How Does This Facility\Compare to the National\Experience?" style(column)={width=31.75%};
   define sig      / display noprint;
   define row      / order noprint;
   define printed_row / display noprint;
		
   ** Use the appropriate font/color for SIR interpretation text;
	
   compute SIR_int;
      if sig=1
         then call define(_col_,"style", "style={color=black}");
      else if sig=2
         then call define(_col_,"style", "style=[color=red]");
      else if sig=3 
         then call define(_col_,"style", "style=[color=green]");
	   else if sig=4
         then call define(_col_,"style", "style=[color=black]");
   endcomp;
	
   compute printed_row;
      if unit = "All reporting units" or unit = "Facility-wide inpatient" then do;
         do i = 1 to 5; ** column sequence from column statement above, so for cols 1 to 5;
            ** "merge" means to NOT overwrite other styles on this cell;
            call define(i,"style/merge","style={font_weight=bold}");
            if printed_row > 1 then do; ** write overline for this row if it is not the only row in the output;
               call define(i,"style/merge","style={bordertopcolor=black}");
            end;  
         end; 
      end;
   endcomp;
	
run;

I also tried setting cellpadding=2px and 1px (in addition to just cellpadding=2, as above), and no change in output.

 

I'm not sure it's my code that's causing the issue, though. The same issue is in a PROC REPORT output you added as a response to the SAS Communities question entitled "Can a format use unicode characters and have different font sizes" back on 04-20-2015, where the PROC REPORT rows containing Unicode arrow-characters are significantly taller than the other rows.

Cynthia_sas
SAS Super FREQ

HI:

  I understand what you're saying and I see that it is related to that previous posting. When I ran a test just now, in SAS 9.4, this is what I got:

star_nostar.png

 

and here's the code I used:

title;
data class;
  length newname $40;
  set sashelp.class;
  SIR_int="^{unicode 2605} Better";
  newname = catt(SIR_int, '~', name);
run;

ods escapechar='^';

ods pdf file='c:\temp\with_and_without.pdf' startpage=no;
  proc report data=class(obs=5);
    column ('Without unicode character' name age sex height);
  run;

  proc report data=class(obs=5);
    column ('With unicode character' newname age sex height);
  run;

  proc report data=class(obs=5)
     style(report)={cellpadding=5px};
    column ('cellpadding=5px' newname age sex height);
  run;
ods pdf close;

 

With cellpadding=5px, the 3rd output does not exactly the same as the top output, but it is close. For a closer look at what's going on, you may want to open a track with Tech Support.

 

cynthia

bnawrocki
Quartz | Level 8

Thanks, Cynthia_sas. Although when I use your example code I see the same results in the SAS Results Viewer window of SAS 9.4, when I write the results to a PDF file, I again see the extra spacing around the PROC REPORT table cells containing Unicode symbols.

 

As advised, I opened a track with SAS Tech Support yesterday. I received an update today, saying they believe this is a defect in SAS, and will update me if/when additional information is known. Until then, as a workaround, I'll find an appropriate ASCII character to use in place of the Unicode "star" character.

craig_dickstein
Calcite | Level 5

bnawrocki -- did you ever hear back from Tech Support on this track?  I seem to be having the same trouble with NE and SE arrows (indicating a trend up or down).   THANKS   -craig

bnawrocki
Quartz | Level 8

craig_dickstein:

I never heard back from Tech Support. I think I dropped it because I found a different way to produce the symbol without the padding issue, and I also switched jobs, so I didn't follow up with them. I haven't needed to use a Unicode character since then. Could you open an issue on this with Tech Support, and let us know what you find out here?

craig_dickstein
Calcite | Level 5

thanks -- I have submitted a problem track via the online facility.   -craig

craig_dickstein
Calcite | Level 5

The result of my problem report is as follows: 

"The spacing is a known issue that is being addressed in a future release of SAS.  You can try setting a uniform column width as follows:    proc report data=your_data  style(column)=[cellheight=.25in];"

 

For my application CELLHEIGHT does not help.

 

-craig

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 8 replies
  • 2362 views
  • 0 likes
  • 3 in conversation