<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS Proc Summary in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-Summary/m-p/910061#M358928</link>
    <description>&lt;P&gt;Saying you want PROC SUMMARY results to go into a PDF file isn't specific enough. There are many choices of output that you can create from PROC SUMMARY. What specifically do you want from PROC SUMMARY to go in the PDF file?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Why do you need all of this in a PDF file anyway? These types of statistics can be stored in a SAS data set, where they would be much more useful in the long run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a way to obtain the names of all data sets in a library:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/How-can-I-read-the-filenames-from-a-library-into-a-dataset/td-p/91395" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/How-can-I-read-the-filenames-from-a-library-into-a-dataset/td-p/91395&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a way to create a data dictionary for all data sets in a library:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Library-Datasets-Summary-Macro-DATA-SPECS/ta-p/544757" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Library-Datasets-Summary-Macro-DATA-SPECS/ta-p/544757&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jan 2024 13:10:37 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-01-02T13:10:37Z</dc:date>
    <item>
      <title>SAS Proc Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-Summary/m-p/910032#M358915</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to run proc summary for all the datasets in one library and store it in on pdf file how can i do it.&lt;BR /&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shivraj&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 07:06:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-Summary/m-p/910032#M358915</guid>
      <dc:creator>shivrajpawar98</dc:creator>
      <dc:date>2024-01-02T07:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-Summary/m-p/910061#M358928</link>
      <description>&lt;P&gt;Saying you want PROC SUMMARY results to go into a PDF file isn't specific enough. There are many choices of output that you can create from PROC SUMMARY. What specifically do you want from PROC SUMMARY to go in the PDF file?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Why do you need all of this in a PDF file anyway? These types of statistics can be stored in a SAS data set, where they would be much more useful in the long run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a way to obtain the names of all data sets in a library:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/How-can-I-read-the-filenames-from-a-library-into-a-dataset/td-p/91395" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/How-can-I-read-the-filenames-from-a-library-into-a-dataset/td-p/91395&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a way to create a data dictionary for all data sets in a library:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Library-Datasets-Summary-Macro-DATA-SPECS/ta-p/544757" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Library-Datasets-Summary-Macro-DATA-SPECS/ta-p/544757&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 13:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-Summary/m-p/910061#M358928</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-01-02T13:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-Summary/m-p/910250#M358997</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;
&lt;PRE&gt;%macro libraryProcMeans(library);
	%macro a; %mEnd a; /* restores color coding in SAS Enterprise Guide */

	/* Standardize capitalization of &amp;amp;library */
	%let library = %upcase(&amp;amp;library);

	/* Create space separated list of dataset names, and save
	   them into a macro variable named libraryList */
	proc sql noPrint;
		%local libraryList;
		select memname 
				into :libraryList separated by ' '
			from dictionary.tables 
			where libname="&amp;amp;library"
				and memtype="DATA"
		;
	quit;

	/* Loop over spaced separated items in &amp;amp;libraryList */
	%local i next_name;
	%let i=1;
	%do %while (%scan(&amp;amp;libraryList, &amp;amp;i) ne );
	   %let next_name = %scan(&amp;amp;libraryList, &amp;amp;i);

	   %** DO whatever needs to be done for &amp;amp;NEXT_NAME;
	   title"&amp;amp;library..&amp;amp;next_name";
	   ods noProctitle;
	   proc summary data=&amp;amp;library..&amp;amp;next_name print;
	   run;
	   title;	
	   ods procTitle;

	   %let i = %eval(&amp;amp;i + 1);
	%end;

%mEnd libraryProcMeans;

/* To output to default location and PDF */
ods pdf file="FULL_FILE_PATH\FILE_NAME.pdf";
%libraryProcMeans(sashelp)
ods pdf close;&lt;/PRE&gt;
&lt;P&gt;Though, you'll probably want to customize the PROC SUMMARY, or even replace it with a PROC MEANS.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shout out to Cindy Puryear's &lt;A href="https://blogs.sas.com/content/sastraining/2015/01/30/sas-authors-tip-getting-the-macro-language-to-perform-a-do-loop-over-a-list-of-values/" target="_self"&gt;blog post&lt;/A&gt; that helped me make this response&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 14:17:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-Summary/m-p/910250#M358997</guid>
      <dc:creator>Al14</dc:creator>
      <dc:date>2024-01-03T14:17:40Z</dc:date>
    </item>
  </channel>
</rss>

