BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
nicnad
Fluorite | Level 6

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ


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

4 REPLIES 4
Cynthia_sas
SAS Super FREQ


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;

nicnad
Fluorite | Level 6

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?

Cynthia_sas
SAS Super FREQ

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

nicnad
Fluorite | Level 6

Thank you very much for the precision.

Best regards.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 959 views
  • 3 likes
  • 2 in conversation