<?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: When to use  firstobs vs data row vs  get names=no? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/When-to-use-firstobs-vs-data-row-vs-get-names-no/m-p/893676#M39761</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437294"&gt;@POOJA_J&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm trying to understand the syntax of different codes.&lt;/P&gt;
&lt;P&gt;My question is when to use DATAROW, FIRSTOBS=, GETNAMES=NO?&lt;/P&gt;
&lt;P&gt;I understand&amp;nbsp; firstobs displays the obs starting from the particular row no mentioned. Data row is used in the proc import statement to specify from which line to start the data reading and get names = no will skip the description lines written at top of the file. I'm trying to know what else can be the possible things to know apart from those I mentioned. Pretty much all doing the same task.&lt;/P&gt;
&lt;P&gt;Or its something more that anyone can please explain .&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You seem to mixing from apples and oranges here.&amp;nbsp; DATAROW= and GETNAMES= are STATEMENTS that can be used as part of PROC IMPORT step.&amp;nbsp; &amp;nbsp;You can use the GETNAMES= statement to tell PROC IMPORT to treat the first line of the source as names for the variables.&amp;nbsp; You can use the DATAROW= statement to tell PROC IMPORT on which line it should start reading the data.&amp;nbsp; Note that one problem with PROC IMPORT is that no matter where you tell it the data starts it still wants to look at the first line for the names if you tell it to get names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two places (at least) where you can use FIRSTOBS=.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FIRSTOBS= can be a DATASET OPTION that can be used when reading in a dataset.&amp;nbsp; For example in a SET or MERGE statement.&amp;nbsp; But also in PROC STATMENT that let's you specify an input dataset.&amp;nbsp; It says how many observations to skip before start reading the data.&amp;nbsp; So FIRSTOBS=5 says to skip the first 4 observations and instead start reading at the 5th observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FIRSTOBS= can also be an option on the INFILE statement that will control how many lines of the input file will be skipped before it starts reading the lines.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 00:16:43 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-09-12T00:16:43Z</dc:date>
    <item>
      <title>When to use  firstobs vs data row vs  get names=no?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/When-to-use-firstobs-vs-data-row-vs-get-names-no/m-p/893675#M39760</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to understand the syntax of different codes.&lt;/P&gt;&lt;P&gt;My question is when to use DATAROW, FIRSTOBS=, GETNAMES=NO?&lt;/P&gt;&lt;P&gt;I understand&amp;nbsp; firstobs displays the obs starting from the particular row no mentioned. Data row is used in the proc import statement to specify from which line to start the data reading and get names = no will skip the description lines written at top of the file. I'm trying to know what else can be the possible things to know apart from those I mentioned. Pretty much all doing the same task.&lt;/P&gt;&lt;P&gt;Or its something more that anyone can please explain .&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 23:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/When-to-use-firstobs-vs-data-row-vs-get-names-no/m-p/893675#M39760</guid>
      <dc:creator>POOJA_J</dc:creator>
      <dc:date>2023-09-11T23:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: When to use  firstobs vs data row vs  get names=no?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/When-to-use-firstobs-vs-data-row-vs-get-names-no/m-p/893676#M39761</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437294"&gt;@POOJA_J&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm trying to understand the syntax of different codes.&lt;/P&gt;
&lt;P&gt;My question is when to use DATAROW, FIRSTOBS=, GETNAMES=NO?&lt;/P&gt;
&lt;P&gt;I understand&amp;nbsp; firstobs displays the obs starting from the particular row no mentioned. Data row is used in the proc import statement to specify from which line to start the data reading and get names = no will skip the description lines written at top of the file. I'm trying to know what else can be the possible things to know apart from those I mentioned. Pretty much all doing the same task.&lt;/P&gt;
&lt;P&gt;Or its something more that anyone can please explain .&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You seem to mixing from apples and oranges here.&amp;nbsp; DATAROW= and GETNAMES= are STATEMENTS that can be used as part of PROC IMPORT step.&amp;nbsp; &amp;nbsp;You can use the GETNAMES= statement to tell PROC IMPORT to treat the first line of the source as names for the variables.&amp;nbsp; You can use the DATAROW= statement to tell PROC IMPORT on which line it should start reading the data.&amp;nbsp; Note that one problem with PROC IMPORT is that no matter where you tell it the data starts it still wants to look at the first line for the names if you tell it to get names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two places (at least) where you can use FIRSTOBS=.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FIRSTOBS= can be a DATASET OPTION that can be used when reading in a dataset.&amp;nbsp; For example in a SET or MERGE statement.&amp;nbsp; But also in PROC STATMENT that let's you specify an input dataset.&amp;nbsp; It says how many observations to skip before start reading the data.&amp;nbsp; So FIRSTOBS=5 says to skip the first 4 observations and instead start reading at the 5th observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FIRSTOBS= can also be an option on the INFILE statement that will control how many lines of the input file will be skipped before it starts reading the lines.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 00:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/When-to-use-firstobs-vs-data-row-vs-get-names-no/m-p/893676#M39761</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-12T00:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: When to use  firstobs vs data row vs  get names=no?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/When-to-use-firstobs-vs-data-row-vs-get-names-no/m-p/893681#M39762</link>
      <description>Thanks a lot for detailed explanation. I appreciate it.</description>
      <pubDate>Tue, 12 Sep 2023 00:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/When-to-use-firstobs-vs-data-row-vs-get-names-no/m-p/893681#M39762</guid>
      <dc:creator>POOJA_J</dc:creator>
      <dc:date>2023-09-12T00:38:07Z</dc:date>
    </item>
  </channel>
</rss>

