<?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: Reading raw files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484437#M125774</link>
    <description>&lt;P&gt;If the data in the external file is not sensitive then paste it into a code box opened with the forums {I} icon. Text pasted in the main message boxes can get reformatted removing white space such that the result may not actually represent your data.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Aug 2018 16:28:39 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-08-06T16:28:39Z</dc:date>
    <item>
      <title>Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484162#M125659</link>
      <description>&lt;P&gt;The following SAS program is submitted:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data numrecords;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;infile ‘file specification’;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input@1 patient $15.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;relative$ 16-26@;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if relative = ‘children’ then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input @54 diagnosis $15. @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;else if relative = ‘parents’ then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input @28 doctor $15.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;clinic $ 44-53&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@54 diagnosis $15. @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input age;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in this raw data why only 2 raw data records are read during each iteration&amp;nbsp;of data step execution ,&amp;nbsp;it is mentioned input age so it should be 1 raw data record read not two .&amp;nbsp;plz help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Aug 2018 15:14:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484162#M125659</guid>
      <dc:creator>sanyam13</dc:creator>
      <dc:date>2018-08-05T15:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484166#M125661</link>
      <description>Hi: Since you don't post a sample of your data, it is hard to guess why the program is working the way it works. Typically, people use a single trailing @ sign because they need to use some information from the beginning of a data row to determine how to read the rest of a data row. Sometimes, the single trailing @ is used to read hierarchical data, where the raw data for one observation spans multiple lines. However, without any data to look at, it is nearly impossible to answer your question. &lt;BR /&gt;&lt;BR /&gt;The bottom line is that every INPUT statement loads a new raw data row to be loaded into the INPUT buffer unless you "hold" the data row with a trailing @. &lt;BR /&gt;&lt;BR /&gt;  I find it odd that you are reading every other piece of data with a specific column pointer (@1, @54) or column location (44-53), but you are reading age with no qualifiers. Where is age located (what position) in the INPUT data row? &lt;BR /&gt;&lt;BR /&gt;  What error messages in the log are you receiving? Are you sure that the values for the variable RELATIVE are exactly, the string 'children' (all lower case) or the string 'parents' (all lower case)?&lt;BR /&gt;&lt;BR /&gt;Without seeing your data, it is hard to speculate.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Sun, 05 Aug 2018 15:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484166#M125661</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-08-05T15:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484224#M125689</link>
      <description>&lt;P&gt;The log often prints messages about what happened.&amp;nbsp; For example, you might see a message about SAS moving on to a new line when it reached past the end of the current line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you read the log?&amp;nbsp; Do you still have it available to post here?&lt;/P&gt;</description>
      <pubDate>Sun, 05 Aug 2018 23:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484224#M125689</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-05T23:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484437#M125774</link>
      <description>&lt;P&gt;If the data in the external file is not sensitive then paste it into a code box opened with the forums {I} icon. Text pasted in the main message boxes can get reformatted removing white space such that the result may not actually represent your data.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 16:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484437#M125774</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-06T16:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484439#M125775</link>
      <description>&lt;P&gt;Perhaps you are reading past the end of the line?&lt;/P&gt;
&lt;P&gt;Try adding the TRUNCOVER option to your INFILE statement.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 16:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/484439#M125775</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-06T16:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/508154#M136440</link>
      <description>&lt;P&gt;The following SAS program is submitted:&lt;/P&gt;&lt;P&gt;data numrecords;&lt;/P&gt;&lt;P&gt;infile 'file specification';&lt;/P&gt;&lt;P&gt;input&amp;nbsp;@1 patient $15.&amp;nbsp;&lt;/P&gt;&lt;P&gt;relative $ 16-26&amp;nbsp;@;&lt;/P&gt;&lt;P&gt;if relative = 'children' then input&amp;nbsp;@54 diagnosis $15.&amp;nbsp;@;&lt;/P&gt;&lt;P&gt;else if relative = 'parents' then input&amp;nbsp;@ 28 doctor $ 15.&lt;/P&gt;&lt;P&gt;clinic $ 44-53&lt;/P&gt;&lt;P&gt;@54 diagnosis $ 15.&amp;nbsp;@;&lt;/P&gt;&lt;P&gt;input age;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;how many raw data records are read during each iteration of the DATA step execution?&lt;/P&gt;&lt;P&gt;A. 1&lt;/P&gt;&lt;P&gt;B. 2&lt;/P&gt;&lt;P&gt;C. 3&lt;/P&gt;&lt;P&gt;D. 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please explain what can be the answer and why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 19:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/508154#M136440</guid>
      <dc:creator>spal12</dc:creator>
      <dc:date>2018-10-28T19:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/508204#M136449</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;If this is a quiz or interview question, the answer is 1 raw data record is being read on each iteration of the DATA step execution. Notice how each INPUT statement ends with a trailing @ except for the last INPUT for age, which releases the held data row.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; If you mock up the data based on the program, this is what you get.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="numrecords.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24446i2655241B3190F69E/image-size/large?v=v2&amp;amp;px=999" role="button" title="numrecords.png" alt="numrecords.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 01:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/508204#M136449</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-10-29T01:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/670082#M201112</link>
      <description>&lt;P&gt;I like your answer, you analysed the question carefully to understand what the author tried to achieve.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 08:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/670082#M201112</guid>
      <dc:creator>xinzhou</dc:creator>
      <dc:date>2020-07-17T08:30:29Z</dc:date>
    </item>
  </channel>
</rss>

