Help using Base SAS procedures

proc print data format preferences

Accepted Solution Solved
Reply
Regular Contributor
Posts: 186
Accepted Solution

proc print data format preferences

Hi,

I often use proc print data procedure to summarize variable like this

proc print data = test.mytest;
sum nb_total Mt_Total_CAD;
run;

How can I set my preference in terms of format?

Here is what I would like the output to look like :

Font: Calibri, 11 pt, no spacing before of after the characters

How do I do that?

Thank you for your help and time


Accepted Solutions
Solution
‎02-20-2013 12:01 AM
SAS Super FREQ
Posts: 8,744

Re: proc print data format preferences


HI, in the PROC PRINT statement you can specify STYLE= overrides to do what you want. The PROC PRINT doc has some good examples. There's a program below to get you started.

cynthia

ods html file='c:\temp\demo1.html' style=sasweb;

ods rtf file='c:\temp\demo1.rtf';

ods pdf file='c:\temp\demo1.pdf';

  proc print data=sashelp.class

       style(header)={background=purple font_size=11pt}

       style(grandtotal)={background=pink color=black font_size=14pt font_face='Calibri'}

       style(obs)={background=pink color=black font_size=9pt}

       style(obsheader)={background=green font_size=9pt};

  title '1a) Proc Print Step';

  where age gt 13;

  sum height weight;

  run;

    

  proc print data=sashelp.class

       style(table)={cellpadding=2px}

       style(header)={background=purple font_size=11pt}

       style(grandtotal)={background=pink color=black font_size=14pt font_face='Calibri'}

       style(obs)={background=pink color=black font_size=9pt}

       style(obsheader)={background=green font_size=9pt};

  title '1b) Proc Print Step';

  where age gt 13;

  sum height weight;

  run;

ods _all_ close;

View solution in original post


All Replies
Solution
‎02-20-2013 12:01 AM
SAS Super FREQ
Posts: 8,744

Re: proc print data format preferences


HI, in the PROC PRINT statement you can specify STYLE= overrides to do what you want. The PROC PRINT doc has some good examples. There's a program below to get you started.

cynthia

ods html file='c:\temp\demo1.html' style=sasweb;

ods rtf file='c:\temp\demo1.rtf';

ods pdf file='c:\temp\demo1.pdf';

  proc print data=sashelp.class

       style(header)={background=purple font_size=11pt}

       style(grandtotal)={background=pink color=black font_size=14pt font_face='Calibri'}

       style(obs)={background=pink color=black font_size=9pt}

       style(obsheader)={background=green font_size=9pt};

  title '1a) Proc Print Step';

  where age gt 13;

  sum height weight;

  run;

    

  proc print data=sashelp.class

       style(table)={cellpadding=2px}

       style(header)={background=purple font_size=11pt}

       style(grandtotal)={background=pink color=black font_size=14pt font_face='Calibri'}

       style(obs)={background=pink color=black font_size=9pt}

       style(obsheader)={background=green font_size=9pt};

  title '1b) Proc Print Step';

  where age gt 13;

  sum height weight;

  run;

ods _all_ close;

Regular Contributor
Posts: 186

Re: proc print data format preferences

Thank you very much for the quick reply. This is exactly what I was looking for.

Where can I find each argument I can put in a proc print statement?

SAS Super FREQ
Posts: 8,744

Re: proc print data format preferences

Hi:

  In the PROC PRINT documentation. You can use STYLE= overrides on the PROC PRINT statement, the VAR statement, etc. Really good examples in the documentation. And, my SAS Global Forum paper this year (not available yet) will talk about the different elements that you can use and the statements where you can use them.

cynthia

Regular Contributor
Posts: 186

Re: proc print data format preferences

Thank you very much for the precision.

Best regards.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 184 views
  • 3 likes
  • 2 in conversation