<?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 Export first 5 obs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848083#M335297</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to export first 5 observations.&lt;/P&gt;
&lt;P&gt;What is the way to do directly in proc export please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I want also to export observations 6-10&lt;/P&gt;
&lt;P&gt;What is the way to do directly in proc export please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;PROC EXPORT data =sashelp.cars(Where=(_N_&amp;lt;=5)) outfile ="path/dd.csv";&lt;BR /&gt;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 06 Dec 2022 11:32:20 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2022-12-06T11:32:20Z</dc:date>
    <item>
      <title>Export first 5 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848083#M335297</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to export first 5 observations.&lt;/P&gt;
&lt;P&gt;What is the way to do directly in proc export please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I want also to export observations 6-10&lt;/P&gt;
&lt;P&gt;What is the way to do directly in proc export please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;PROC EXPORT data =sashelp.cars(Where=(_N_&amp;lt;=5)) outfile ="path/dd.csv";&lt;BR /&gt;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Dec 2022 11:32:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848083#M335297</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-12-06T11:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Export first 5 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848095#M335302</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=sashelp.cars(obs=5) outfile ="path/dd.csv";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_N_ only has meaning within a data step, it has no meaning elsewhere.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 12:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848095#M335302</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-06T12:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Export first 5 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848102#M335305</link>
      <description>&lt;P&gt;To export observations 6 through 10:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=sashelp.cars (firstobs=6 obs=10) outfile ="folder/next5.csv";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Dec 2022 13:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848102#M335305</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-12-06T13:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Export first 5 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848164#M335337</link>
      <description>&lt;P&gt;Use the OBS= and FIRSTOBS= dataset option.&lt;/P&gt;
&lt;P&gt;sashelp.cars(obs=5)&lt;/P&gt;
&lt;P&gt;sashelp.cars(firstobs=6 obs=10)&lt;/P&gt;
&lt;P&gt;sashelp.cars(firstobs=11 obs=15)&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 17:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848164#M335337</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-06T17:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Export first 5 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848245#M335357</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To export the first 5 observations using PROC EXPORT, you can use the following code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC EXPORT data = sashelp.cars(where=(_N_&amp;lt;=5)) outfile="path/dd.csv";
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To export observations 6-10 using PROC EXPORT, you can use the following code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC EXPORT data = sashelp.cars(where=(_N_&amp;gt;5) and (_N_&amp;lt;=10)) outfile="path/dd.csv";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In both cases, you need to specify the name of the SAS dataset you want to export (in this case, &lt;CODE&gt;sashelp.cars&lt;/CODE&gt;), the file path and name for the output CSV file (in this case, &lt;CODE&gt;path/dd.csv&lt;/CODE&gt;), and the &lt;CODE&gt;WHERE&lt;/CODE&gt; clause that specifies which observations you want to export.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 00:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848245#M335357</guid>
      <dc:creator>webart999ARM</dc:creator>
      <dc:date>2022-12-07T00:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Export first 5 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848275#M335372</link>
      <description>Sorry but your code give an error.&lt;BR /&gt;As it was said here we cannot use _N_  in proc export</description>
      <pubDate>Wed, 07 Dec 2022 06:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-first-5-obs/m-p/848275#M335372</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-12-07T06:44:38Z</dc:date>
    </item>
  </channel>
</rss>

