|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 at right, 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., 40 characters), only the first 40 characters are displayed and the rest of the string is displayed using the flyover attribute.
A few additional points about this example:
- The use of the NOQUOTELENMAX 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 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.
ods listing close;
ods html file='\temp.html';
ods pdf file='\temp.pdf' notoc;
proc report data=sashelp.vslib nowd;
columns libname path;
if length(path) > 40 then
do; /* only show first 40 chars, use flyover for remainder */
flyoverText = '...'||substr(path,41);
path = substr(path,1,40)||'...';
end; /* only show first 40 chars, use flyover for remainder */
ods _all_ close;
Feel free to comment on this tip.