BookmarkSubscribeRSS Feed
🔒 This topic is locked. We are no longer accepting replies to this topic. Need further help? Please sign in and ask a new question.
SAS_Tipster
Moderator

Does your nice-looking report occasionally have very long character values that dominate the screen real estate? If so, the flyover style attribute may be just what you need. In the example below, PROC REPORT is used to generate a report. A compute block is used to check the length of the long character variable and if it is longer than some pre-determined length (e.g., 20 characters), only the first 20 characters are displayed and the rest of the string is displayed using the flyover attribute.

 

ods listing close;
ods html file='\temp.html';
ods pdf file='\temp.pdf' notoc;
options noquotelenmax;
proc report data=sashelp.vslib nowd;
 columns libname path;
 compute path;
   if length(path) > 20 then
   do;  /* only show first 20 chars, use flyover for remainder */
      flyoverText = '...'||substr(path,21);
      path = substr(path,1,20)||'...';
      call define(_col_,'style','style=[flyover="'||strip(flyoverText)||'"]');
   end; /* only show first 20 chars, use flyover for remainder */
 endcomp;
run;
ods _all_ close;

A few additional points about this example:

  • The use of the SAS Tip:Using the NOQUOTELENMAX Option option to suppress the erroneous mismatched quotes warning message.
  • The flyover attribute works in both the HTML and PDF destinations.
  • Generating both HTML and PDF output at the same time.
  • Use of ods _all_ close; to close both destinations.
  • The maximum length could be specified using a macro variable.
  • The maximum length that can be displayed in the HTML destination is dependent on the browser. If the generated flyover text is too long, your browser may truncate the value.

Thanks to Don Henderson for sharing this tip on sasCommunity.org.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Visit a random SAS tip This SAS Tips board is not open for replies or comments, but we welcome your feedback and questions. Have a question or comment about this tip? Start a new topic in one of our discussion boards, and reference this tip topic.
Discussion stats
  • 0 replies
  • 1590 views
  • 1 like
  • 1 in conversation