<?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: How do i read (data,column names,datatype &amp;amp; size) from sas7bdat file and export it to an exc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251839#M47651</link>
    <description>&lt;P&gt;Your code is a bit convoluted. I'm posting a cleaned up version that's a bit more clear, as well as using proc contents to create your metadata file. The number of rows would be the same for all variables so that isn't a helpful field.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname sample '/folders/myfolders/samples/';

data new;
set sample.sales;
run;

proc print data=new;
run;

/*Export code was fine*/

proc contents data=new;
run;

ods excel file='/folders/myfolders/samples/new_metadata.xlsx' style=meadow;

proc contents data=new;
run;

ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 23 Feb 2016 20:00:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-02-23T20:00:07Z</dc:date>
    <item>
      <title>How do i read (data,column names,datatype &amp; size) from sas7bdat file and export it to an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251832#M47647</link>
      <description>&lt;P&gt;I am new to SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do i read (data,column names,datatype &amp;amp; size) from sas7bdat file and export it to an excel file&lt;/P&gt;&lt;P&gt;A sheet having all the data and second sheet having all the columns name , datatype of that column and size of that column.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 19:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251832#M47647</guid>
      <dc:creator>shahrushabh2710</dc:creator>
      <dc:date>2016-02-23T19:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do i read (data,column names,datatype &amp; size) from sas7bdat file and export it to an exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251837#M47650</link>
      <description>&lt;P&gt;I have this working&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* reading a SAS File */&lt;/P&gt;&lt;P&gt;data new;&lt;BR /&gt;set '/folders/myfolders/samples/sales.sas7bdat';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* printing the data from a SAS File */&lt;BR /&gt;proc&lt;BR /&gt;print data='/folders/myfolders/samples/sales.sas7bdat';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* exporting a SAS File (all data) to excel */&lt;/P&gt;&lt;P&gt;proc export&lt;BR /&gt;data=new&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;outfile="/folders/myfolders/all_excel/sales.sas7bdat.xlsx"&lt;BR /&gt;replace; sheet="all_data";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what i want is something like attached image&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12297i3C25FAB86B6A466B/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;</description>
      <pubDate>Tue, 23 Feb 2016 19:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251837#M47650</guid>
      <dc:creator>shahrushabh2710</dc:creator>
      <dc:date>2016-02-23T19:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do i read (data,column names,datatype &amp; size) from sas7bdat file and export it to an exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251839#M47651</link>
      <description>&lt;P&gt;Your code is a bit convoluted. I'm posting a cleaned up version that's a bit more clear, as well as using proc contents to create your metadata file. The number of rows would be the same for all variables so that isn't a helpful field.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname sample '/folders/myfolders/samples/';

data new;
set sample.sales;
run;

proc print data=new;
run;

/*Export code was fine*/

proc contents data=new;
run;

ods excel file='/folders/myfolders/samples/new_metadata.xlsx' style=meadow;

proc contents data=new;
run;

ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2016 20:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251839#M47651</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-23T20:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do i read (data,column names,datatype &amp; size) from sas7bdat file and export it to an exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251853#M47657</link>
      <description>&lt;P&gt;works great, thanks you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although i just want 3 sheets in an excel file one named "All Data" that has all the data, second one with name "Some Data" that has only the selected columns passed in query (example would be appreciated) and the third sheet with name as schema that has only the column name type and size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc&lt;BR /&gt;contents data=new;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;works awesome but gives a whole lot of data, i just want&amp;nbsp;&lt;SPAN&gt;column name type and size and i just want in the order they are not sorted alphabetically.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PS: The exact excel file that i want is attached&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 20:29:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251853#M47657</guid>
      <dc:creator>shahrushabh2710</dc:creator>
      <dc:date>2016-02-23T20:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do i read (data,column names,datatype &amp; size) from sas7bdat file and export it to an exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251858#M47661</link>
      <description>&lt;P&gt;If you want to use ODS Excel you can achieve this by nesting the following between the ODS Excel/ODS Excel Close; code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Running a proc print of your data first&lt;/P&gt;
&lt;P&gt;2. Running a proc print, including only your selection - use the VAR statement to filter out variables for example.&lt;/P&gt;
&lt;P&gt;3. Running a proc contents but only selecting the output. You can look into the options in proc contents to restrict the output.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 20:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251858#M47661</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-23T20:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do i read (data,column names,datatype &amp; size) from sas7bdat file and export it to an exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251862#M47665</link>
      <description>&lt;P&gt;not sure if i understand, can you explain with code ?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 20:44:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-read-data-column-names-datatype-amp-size-from-sas7bdat/m-p/251862#M47665</guid>
      <dc:creator>shahrushabh2710</dc:creator>
      <dc:date>2016-02-23T20:44:39Z</dc:date>
    </item>
  </channel>
</rss>

