<?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 Data read problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-read-problem/m-p/262713#M51351</link>
    <description>&lt;P&gt;I tried to create the data set below, however, I could only read 3 records intead of all of the 7 records. &amp;nbsp;I am wondering what is wrong. &amp;nbsp;Thank you very much !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data med_search;&lt;BR /&gt;input med $ 100 ;&lt;BR /&gt;datalines;&lt;BR /&gt;omeprazole (Prilosec, Prilosec OTC)&lt;BR /&gt;dexlansoprazole (Dexilent, Kapidex)&lt;BR /&gt;rabeprazole (Aciphex)&lt;BR /&gt;pantoprazole (Protonix)&lt;BR /&gt;Esomeprazole (Nexium)&lt;BR /&gt;Lansoprazole (Prevacid)&lt;BR /&gt;Zegerid (omeprazole with sodium bicarbonate)&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 10 Apr 2016 01:40:57 GMT</pubDate>
    <dc:creator>Ivy</dc:creator>
    <dc:date>2016-04-10T01:40:57Z</dc:date>
    <item>
      <title>Data read problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-read-problem/m-p/262713#M51351</link>
      <description>&lt;P&gt;I tried to create the data set below, however, I could only read 3 records intead of all of the 7 records. &amp;nbsp;I am wondering what is wrong. &amp;nbsp;Thank you very much !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data med_search;&lt;BR /&gt;input med $ 100 ;&lt;BR /&gt;datalines;&lt;BR /&gt;omeprazole (Prilosec, Prilosec OTC)&lt;BR /&gt;dexlansoprazole (Dexilent, Kapidex)&lt;BR /&gt;rabeprazole (Aciphex)&lt;BR /&gt;pantoprazole (Protonix)&lt;BR /&gt;Esomeprazole (Nexium)&lt;BR /&gt;Lansoprazole (Prevacid)&lt;BR /&gt;Zegerid (omeprazole with sodium bicarbonate)&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Apr 2016 01:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-read-problem/m-p/262713#M51351</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2016-04-10T01:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data read problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-read-problem/m-p/262929#M51434</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/70526"&gt;@Ivy﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two issues:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The missing period after the informat specification ($ 100) means that &lt;EM&gt;column input&lt;/EM&gt; is requested, reading from column 100 alone (i.e. only one character!). Since none of the data lines is that long, "SAS went to a new line when INPUT statement reached past the end of a line." (Did you notice this NOTE in the log?)&lt;/LI&gt;
&lt;LI&gt;With&amp;nbsp;the missing period added, it would be&amp;nbsp;&lt;EM&gt;formatted input&lt;/EM&gt;, but the informat length 100 exceeds the record length, so that SAS would again "flow over" to the next observation.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One possible solution is to use &lt;EM&gt;list input&lt;/EM&gt; with the "&amp;amp;" modifier, without which SAS would stop reading a line at the first blank (i.e. read only the first "word"):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input med &amp;amp;$100.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS would now read until the first &lt;EM&gt;double&lt;/EM&gt; blank or the end of the data line, whichever comes first. Hence, you might lose portions of the drug names if double blanks occurred. Therefore, a more robust approach would be to use &lt;EM&gt;formatted input&lt;/EM&gt; in conjunction with the TRUNCOVER option of the INFILE statement (which needs to be inserted in order to specify this option). Without TRUNCOVER, the default option would be FLOWOVER with the unwanted effect described in item 2 above.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile datalines truncover;
input med $100.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2016 15:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-read-problem/m-p/262929#M51434</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-11T15:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Data read problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-read-problem/m-p/263035#M51471</link>
      <description>Thank you very much, FreelanceReinhard ! That works !</description>
      <pubDate>Mon, 11 Apr 2016 21:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-read-problem/m-p/263035#M51471</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2016-04-11T21:08:02Z</dc:date>
    </item>
  </channel>
</rss>

