<?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: PROC CONTENTS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-CONTENTS/m-p/544868#M150691</link>
    <description>&lt;P&gt;Hints: Q1 and Q3: option OUT=;&lt;/P&gt;
&lt;P&gt;Hint: Q3 _all_&lt;/P&gt;
&lt;P&gt;Hints Q2 Q4 : group by, count(*)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or &lt;STRONG&gt;R&lt;/STRONG&gt;ead &lt;STRONG&gt;T&lt;/STRONG&gt;he &lt;STRONG&gt;F&lt;/STRONG&gt;riendly &lt;STRONG&gt;M&lt;/STRONG&gt;anual, i.e. online documentation for Proc Contents.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2019 14:24:27 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-03-21T14:24:27Z</dc:date>
    <item>
      <title>PROC CONTENTS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-CONTENTS/m-p/544828#M150681</link>
      <description>&lt;P&gt;Q1.Using the procefure 'PROC CONTENTS'&amp;nbsp; to the SAS data set Fin_account' you can obtain an output data set containg the following data structure information (a) variable name (b)varable type (c)length (d)column lable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q2. Applying the 'PROC SQL' on the output data set inn Q1. abve , to create a data set which can tell you how many character and numeric fields in the data set work.'Fin_account'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q3.Using the 'PROC CONTENTS' to send data dictionary of all data sets in the library work into a SAS TABLE 'alldata' using work.all-&lt;/P&gt;&lt;P&gt;option .The resulting table only keeps the following three fields&amp;nbsp;&lt;/P&gt;&lt;P&gt;a)variable name&lt;/P&gt;&lt;P&gt;b) variable type&lt;/P&gt;&lt;P&gt;c) libraray name&lt;/P&gt;&lt;P&gt;d) name of the table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q4. Applying the 'PROC SQL' onn the output table in Q2 above to create a data set&amp;nbsp; which can tell you how many character and numeric fields in for each data set in the library ' WORK'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 12:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-CONTENTS/m-p/544828#M150681</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-03-21T12:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: PROC CONTENTS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-CONTENTS/m-p/544836#M150682</link>
      <description>&lt;P&gt;Are you asking 4 questions? Proc sql's dictionary.columns table can do this all in one place:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let libname=SASHELP; *note UPPERCASE;
%let table=CARS; *note UPPERCASE;

*Q1;
proc sql noprint;
	create table q1(keep=name type length label) as
	select * from dictionary.COLUMNS
	where libname="&amp;amp;libname" and memname="&amp;amp;table";
quit; 

*Q2;
proc sql noprint;
	create table q2 as
	select count(*) as count, type from q1
	group by type;
quit; 

*Q3 (also keeping type for your Q4);
proc sql noprint;
	create table alldata(keep=name libname memname type) as
	select * from dictionary.COLUMNS
	where libname="WORK";
quit; 

*Q4 - I'm assuming you mean reference table from Q3, not Q2;
proc sql noprint;
	create table q4 as
	select memname, type, count(*) as count from alldata
	group by type, memname
	order by memname, type;
quit; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2019 13:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-CONTENTS/m-p/544836#M150682</guid>
      <dc:creator>noling</dc:creator>
      <dc:date>2019-03-21T13:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: PROC CONTENTS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-CONTENTS/m-p/544841#M150684</link>
      <description>&lt;P&gt;You should be able to do your homework yourself if you properly attended the lessons.&lt;/P&gt;
&lt;P&gt;If you run into problems while trying, post example data, code and log.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 13:12:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-CONTENTS/m-p/544841#M150684</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-21T13:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: PROC CONTENTS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-CONTENTS/m-p/544868#M150691</link>
      <description>&lt;P&gt;Hints: Q1 and Q3: option OUT=;&lt;/P&gt;
&lt;P&gt;Hint: Q3 _all_&lt;/P&gt;
&lt;P&gt;Hints Q2 Q4 : group by, count(*)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or &lt;STRONG&gt;R&lt;/STRONG&gt;ead &lt;STRONG&gt;T&lt;/STRONG&gt;he &lt;STRONG&gt;F&lt;/STRONG&gt;riendly &lt;STRONG&gt;M&lt;/STRONG&gt;anual, i.e. online documentation for Proc Contents.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 14:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-CONTENTS/m-p/544868#M150691</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-21T14:24:27Z</dc:date>
    </item>
  </channel>
</rss>

