<?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 Read all dataset in a library and store its proc content output in multiple csv files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274280#M269568</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a csv file for each of the dataset present under a library, having the data of proc content output of each dataset.&lt;/P&gt;&lt;P&gt;A macro will solve this, i am able to get the list the dataset with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table columns as&lt;BR /&gt;select distinct(memname) as table_name&lt;BR /&gt;from dictionary.columns&lt;BR /&gt;where libname = 'WRK'&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but how to proceed to read all the file names and fetch them to generate a csv having their proc contents is what i am stuck with...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2016 05:36:23 GMT</pubDate>
    <dc:creator>sAura</dc:creator>
    <dc:date>2016-06-01T05:36:23Z</dc:date>
    <item>
      <title>Read all dataset in a library and store its proc content output in multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274280#M269568</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a csv file for each of the dataset present under a library, having the data of proc content output of each dataset.&lt;/P&gt;&lt;P&gt;A macro will solve this, i am able to get the list the dataset with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table columns as&lt;BR /&gt;select distinct(memname) as table_name&lt;BR /&gt;from dictionary.columns&lt;BR /&gt;where libname = 'WRK'&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but how to proceed to read all the file names and fetch them to generate a csv having their proc contents is what i am stuck with...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 05:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274280#M269568</guid>
      <dc:creator>sAura</dc:creator>
      <dc:date>2016-06-01T05:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read all dataset in a library and store its proc content output in multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274284#M269569</link>
      <description>&lt;P&gt;You're probably better off reading the metadata from sashelp.vtable and sashelp.vcolumn.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 05:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274284#M269569</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-01T05:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Read all dataset in a library and store its proc content output in multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274289#M269570</link>
      <description>&lt;P&gt;Reading the metadata is not the issue, but reading it and putting it into a csv file as a loop for all the dataset within a library is the issue. A separate csv file needs to be created for the metadata of each dataset&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 06:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274289#M269570</guid>
      <dc:creator>sAura</dc:creator>
      <dc:date>2016-06-01T06:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Read all dataset in a library and store its proc content output in multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274291#M269571</link>
      <description>&lt;P&gt;When you read from the sashelp tables, you can specify the &lt;FONT face="courier new,courier"&gt;filevar=&lt;/FONT&gt; option in the &lt;FONT face="courier new,courier"&gt;file&lt;/FONT&gt; statement and then dynamically assign the output filename from the table name in the input dataset. This way you can do everything in a single data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ie&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set sashelp.vcolumn (where=(libname="YOURLIB"));
by memname;
if first.memname then outfilename = '$HOME/desc_' !! trim(memname) !! '.csv';
file "dummy.dat" filevar=outfilename dlm=',';
put name type length;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Jun 2016 06:49:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274291#M269571</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-01T06:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Read all dataset in a library and store its proc content output in multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274304#M269572</link>
      <description>Hi Kurt&lt;BR /&gt;&lt;BR /&gt;Thanks for the resolution, but file creation is giving me an error:&lt;BR /&gt;1140 file "dummy.dat" filevar=outfilename dlm=',' ;&lt;BR /&gt;ERROR: A Physical file reference (i.e. "PHYSICAL FILE REFERENCE" ) or an aggregate file&lt;BR /&gt;storage reference (i.e. AGGREGATE(MEMBER) ) reference cannot be used with the FILEVAR=&lt;BR /&gt;option.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;seems some limitation for the filevar value, is there a way to overcome this.</description>
      <pubDate>Wed, 01 Jun 2016 07:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274304#M269572</guid>
      <dc:creator>sAura</dc:creator>
      <dc:date>2016-06-01T07:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Read all dataset in a library and store its proc content output in multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274305#M269573</link>
      <description>&lt;P&gt;Ups, missed to correct that before posting.&lt;/P&gt;
&lt;P&gt;Should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file dummy filevar=outfilename dlm=',';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Jun 2016 07:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-all-dataset-in-a-library-and-store-its-proc-content-output/m-p/274305#M269573</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-01T07:43:58Z</dc:date>
    </item>
  </channel>
</rss>

