DATA Step, Macro, Functions and more

Data _null_ (put statement and fonts)

Posts: 29

Data _null_ (put statement and fonts)

Is there a way to change the font  and font size while creating the report using data _null_ (PUT statement). SAS itself provides the default font and size to the output winow using PUT statement , i want to change the font to Arial and font size to 12 using put statement . Are there any global options to change font and font size while displaying in Output window or in RTF file?.

Also i want to apply two different font and sizes like for body text one font (Times Roman) and  font size (10) ; for column headings (also want to BOLD the header + another font Courier New) and size (12) .

Super User
Posts: 10,500

Re: Data _null_ (put statement and fonts)

If you add: File Print; to the data step the results are sent to the results window using your currently active style.

Using the old school and PUT to a file is pretty much plain text output that you'd have to post process to RTF.

You can attempt to use ODS RTF TEXT with escapechar to control text output but you're going to have lots of work ahead if you want anything to align. I would really look at my output and see if one of the report procedures like Tabulate, Reprot or Print would generate something acceptable. Those procedures provide inline options to override the current style font, size and many other appearance options.

Posts: 8,743

Re: Data _null_ (put statement and fonts)


DATA step output is controlled by the style template much better when you use FILE PRINT ODS. Regular old-fashioned FILE PRINT is considered "batch" level output and really has no formatting, as ballardw explains. I think that unless you want to get into the world of style templates and FILE PRINT ODS, that you will want to investigate PROC PRINT, PROC REPORT or PROC TABULATE for generating your report.

  Depending on the type of code you're writing with FILE PRINT and your PUT statements, you may or may not be able to replicate that for ODS RTF. It really depends on what you are trying to create. And since you didn't show data or output, your best bet for help might be to work with Tech Support on this question, because they can look at ALL your code and ALL your data and you can show them what you want to get and then they can make a recommendation.


Ask a Question
Discussion stats
  • 2 replies
  • 1 like
  • 3 in conversation