<?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 import 10 obs using PROC IMPORT in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/import-10-obs-using-PROC-IMPORT/m-p/22829#M5000</link>
    <description>&lt;P&gt;There is no procedure specific option to directly limit the quantity the IMPORT procedure will read in, to my knowledge. You can use the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lesysoptsref/n06qlo77ayax2kn1xobou72cdz20.htm" target="_self"&gt;OBS= system option&lt;/A&gt; to limit the number of records that SAS will process. Setting OBS=10 will limit the processing to the first 10, then set it back to OBS=MAX so subsequent operations consider the full data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;options obs=10;
proc import
&amp;nbsp; datafile="G:\Departments\Research\MAP\1112\Oconee - &amp;amp;admin. - Clean.txt"
&amp;nbsp; out=map_export
&amp;nbsp; dbms=dlm
&amp;nbsp; replace;
&amp;nbsp; delimiter='09'x;
run;

options obs=max;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since this is a text file, you should also consider using the DATA step with an INFILE statement to read the data. It requires more knowledge of the data fields as you read them, but that approach provides much more control over how much data is read in. &lt;A href="https://blogs.sas.com/content/sgf/2021/02/18/turning-text-files-into-sas-data-sets-6-common-problems-and-their-solutions/" target="_self"&gt;See this topic for more guidance&lt;/A&gt; and troubleshooting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(&lt;EM&gt;Editor's note: modified this reply for clarification and more detail on this popular topic.&lt;/EM&gt;)&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2022 15:39:37 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2022-07-20T15:39:37Z</dc:date>
    <item>
      <title>import 10 obs using PROC IMPORT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-10-obs-using-PROC-IMPORT/m-p/22828#M4999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I want to add an option/statement to this step so that only the first 10 obs are imported.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc import data=map_export datafile="G:\Departments\Research\MAP\1112\Oconee - &amp;amp;admin. - Clean.txt" dbms=dlm replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; delimiter='09'x;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 19:50:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-10-obs-using-PROC-IMPORT/m-p/22828#M4999</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2011-10-03T19:50:12Z</dc:date>
    </item>
    <item>
      <title>import 10 obs using PROC IMPORT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-10-obs-using-PROC-IMPORT/m-p/22829#M5000</link>
      <description>&lt;P&gt;There is no procedure specific option to directly limit the quantity the IMPORT procedure will read in, to my knowledge. You can use the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lesysoptsref/n06qlo77ayax2kn1xobou72cdz20.htm" target="_self"&gt;OBS= system option&lt;/A&gt; to limit the number of records that SAS will process. Setting OBS=10 will limit the processing to the first 10, then set it back to OBS=MAX so subsequent operations consider the full data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;options obs=10;
proc import
&amp;nbsp; datafile="G:\Departments\Research\MAP\1112\Oconee - &amp;amp;admin. - Clean.txt"
&amp;nbsp; out=map_export
&amp;nbsp; dbms=dlm
&amp;nbsp; replace;
&amp;nbsp; delimiter='09'x;
run;

options obs=max;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since this is a text file, you should also consider using the DATA step with an INFILE statement to read the data. It requires more knowledge of the data fields as you read them, but that approach provides much more control over how much data is read in. &lt;A href="https://blogs.sas.com/content/sgf/2021/02/18/turning-text-files-into-sas-data-sets-6-common-problems-and-their-solutions/" target="_self"&gt;See this topic for more guidance&lt;/A&gt; and troubleshooting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(&lt;EM&gt;Editor's note: modified this reply for clarification and more detail on this popular topic.&lt;/EM&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 15:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-10-obs-using-PROC-IMPORT/m-p/22829#M5000</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2022-07-20T15:39:37Z</dc:date>
    </item>
  </channel>
</rss>

