<?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: dat file 1st observation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644170#M192372</link>
    <description>&lt;P&gt;Add&lt;/P&gt;
&lt;PRE&gt;firstobs=2&lt;/PRE&gt;
&lt;P&gt;to the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n1rill4udj0tfun1fvce3j401plo.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;INFILE&lt;/A&gt; statement.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Apr 2020 08:59:30 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-04-30T08:59:30Z</dc:date>
    <item>
      <title>dat file 1st observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644168#M192370</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have successfully updated this dat file but the first observation is the variables (see attachment).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I have used it:&lt;/P&gt;&lt;P&gt;DATA patients;&lt;BR /&gt;INFILE '/.../uis.dat';&lt;BR /&gt;INPUT id $ age $ gender;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 08:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644168#M192370</guid>
      <dc:creator>Sou1</dc:creator>
      <dc:date>2020-04-30T08:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: dat file 1st observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644170#M192372</link>
      <description>&lt;P&gt;Add&lt;/P&gt;
&lt;PRE&gt;firstobs=2&lt;/PRE&gt;
&lt;P&gt;to the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n1rill4udj0tfun1fvce3j401plo.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;INFILE&lt;/A&gt; statement.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 08:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644170#M192372</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-30T08:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: dat file 1st observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644172#M192373</link>
      <description>&lt;P&gt;Thanks so much!!&lt;/P&gt;&lt;P&gt;: )))))&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 09:04:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644172#M192373</guid>
      <dc:creator>Sou1</dc:creator>
      <dc:date>2020-04-30T09:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: dat file 1st observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644173#M192374</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;You can use this&lt;BR /&gt;&lt;BR /&gt;DATA patients;&lt;BR /&gt;INFILE '/.../uis.dat';&lt;BR /&gt;INPUT id $ age $ gender;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;Data patient_new;&lt;BR /&gt;set patients(firstobs = 2);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;This will create a dataset from the second observation</description>
      <pubDate>Thu, 30 Apr 2020 09:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644173#M192374</guid>
      <dc:creator>sdhilip</dc:creator>
      <dc:date>2020-04-30T09:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: dat file 1st observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644177#M192378</link>
      <description>&lt;P&gt;Given what I saw in your screenshot, I suggest changes to your code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data patients;
infile '/.../uis.dat' firstobs=2;
input id $ age gender $;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as age is always numeric, and gender might actually be a character value. Once you know what is in the character columns, you can adapt the lengths by using a informat.&lt;/P&gt;
&lt;P&gt;I also guess that the trailing n for the physical filename is not needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, you do not need to encapsulate screenshots in Word documents. Save your screenshot as a picture, and use the "camera" icon to insert the picture directly in your post. Word documents make it harder for many of us to view the picture, as corporate firewalls block the download of a .docx and/or the use of the previewer (as that works on a cloud storage service)&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 09:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dat-file-1st-observation/m-p/644177#M192378</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-30T09:29:23Z</dc:date>
    </item>
  </channel>
</rss>

