<?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: why fread is not reading entire record / row? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/why-fread-is-not-reading-entire-record-row/m-p/876808#M346376</link>
    <description>&lt;P&gt;Thank you very much PaigeMiller. I have used length now and it's working.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 May 2023 15:14:17 GMT</pubDate>
    <dc:creator>Moksha</dc:creator>
    <dc:date>2023-05-21T15:14:17Z</dc:date>
    <item>
      <title>why fread is not reading entire record / row?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-fread-is-not-reading-entire-record-row/m-p/876800#M346374</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I have the following code from&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1hogk0ekd1z62n18xx76ou16unt.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1hogk0ekd1z62n18xx76ou16unt.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please, help me to understand why fread is reading only &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;John&lt;/STRONG&gt; &lt;/FONT&gt;from the file and not entire record. How to make fread to read entire row of each observation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;%macro test(outf);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%let filrf=myfile;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%if %sysfunc(fileexist(&amp;amp;outf)) %then %do;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%let rc=%sysfunc(filename(filrf,&amp;amp;outf));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%let fid=%sysfunc(fopen(&amp;amp;filrf));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%if &amp;amp;fid &amp;gt; 0 %then %do;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%let rc=%sysfunc(fread(&amp;amp;fid));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%let rc=%sysfunc(fget(&amp;amp;fid,mystring));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%if &amp;amp;rc = 0 %then %put &amp;amp;mystring;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%else %put file is empty;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%let rc=%sysfunc(fclose(&amp;amp;fid));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%let rc=%sysfunc(filename(filrf));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%else %put file does not exist;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%mend test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;/*Calling the above macro*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%test(c:\Address.dat)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Output in the log:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;%test(c:\Address.dat)&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;John&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;The contents of test.dat are as follows:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;John Garcia&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 114 Maple Ave.&lt;BR /&gt;Sylvia Chung&amp;nbsp; &amp;nbsp; &amp;nbsp; 1302 Washington Drive&lt;BR /&gt;Martha Newton&amp;nbsp; &amp;nbsp; 45 S.E. 14th St.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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>Sun, 21 May 2023 13:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-fread-is-not-reading-entire-record-row/m-p/876800#M346374</guid>
      <dc:creator>Moksha</dc:creator>
      <dc:date>2023-05-21T13:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: why fread is not reading entire record / row?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-fread-is-not-reading-entire-record-row/m-p/876807#M346375</link>
      <description>&lt;P&gt;By default FGET reads to the first space, so it only read John and not beyond.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use another argument — the LENGTH argument — in the FGET function, you can tell it to read more. &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/p1a70mpbj2usaln1r9z4qldliexk.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/p1a70mpbj2usaln1r9z4qldliexk.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2023 15:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-fread-is-not-reading-entire-record-row/m-p/876807#M346375</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-21T15:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: why fread is not reading entire record / row?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-fread-is-not-reading-entire-record-row/m-p/876808#M346376</link>
      <description>&lt;P&gt;Thank you very much PaigeMiller. I have used length now and it's working.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2023 15:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-fread-is-not-reading-entire-record-row/m-p/876808#M346376</guid>
      <dc:creator>Moksha</dc:creator>
      <dc:date>2023-05-21T15:14:17Z</dc:date>
    </item>
  </channel>
</rss>

