<?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 a table file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612021#M178501</link>
    <description>&lt;P&gt;They key is this&lt;/P&gt;
&lt;PRE&gt;NOTE: The quoted string currently being processed has become more than 262 bytes long. You might have unbalanced quotation marks.&lt;/PRE&gt;
&lt;P&gt;at the beginning of the log. You had unbalanced quotes in previous code. Restart your SAS session and run the code again.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2019 13:51:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-12-16T13:51:56Z</dc:date>
    <item>
      <title>Reading a table file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/611984#M178487</link>
      <description>&lt;P&gt;I have a data set named param.tbl which contains data that looks like this:&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CMT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ETA1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;1.0000E+00 0.0000E+00 1.0000E+00 1.2000E+01 7.4460E-01&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;1.0000E+00 0.0000E+00 2.0000E+00 1.2000E+01 7.4460E-01&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;1.0000E+00 0.0000E+00 3.0000E+00 1.2000E+01 7.4460E-01&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The actual data set has about 500 rows and I have presented a 3 row sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;When I use the code below, I get the log below, and the data is not read in. Can someone tell me how to correct the code so that the data will be read into SAS?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;LOG&lt;/FONT&gt;&lt;/P&gt;&lt;DIV class="sasNote"&gt;NOTE: The quoted string currently being processed has become more than 262 bytes long. You might have unbalanced quotation marks.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;2 TITLE;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;3 FOOTNOTE;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;4 OPTIONS LOCALE=en_US DFLANG=LOCALE;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;5 DATA _NULL_;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;6 RUN;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;7 OPTIONS VALIDVARNAME=V7;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;8 OPTIONS VALIDMEMNAME=EXTEND;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;9 FILENAME _HTMLOUT TEMP;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;10 FILENAME _RTFOUT TEMP ENCODING='UTF-8';&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;11 FILENAME _PDFOUT TEMP;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;12 FILENAME _GSFNAME TEMP;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;13 FILENAME _DATAOUT TEMP;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;14 %LET SYSCC=0;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;15 %LET _CLIENTAPP='SAS Studio';&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;16 %LET _CLIENTAPPABREV=Studio;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;17 %LET _CLIENTAPPVERSION=3.8;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;18 %LET _CLIENTVERSION=3.8;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;19 %LET _CLIENTMODE=basic;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;20 %LET _SASSERVERNAME=%BQUOTE(localhost);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;21 %LET _SASHOSTNAME=%BQUOTE(localhost);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;22 %LET _SASPROGRAMFILEHOST=%BQUOTE(localhost);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;23 %LET _CLIENTUSERID=%BQUOTE(sasdemo);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;24 %LET _CLIENTUSERNAME=%BQUOTE(sasdemo);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;25 %LET CLIENTMACHINE=%BQUOTE(192.168.61.1);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;26 %LET _CLIENTMACHINE=%BQUOTE(192.168.61.1);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;27 %let SASWORKLOCATION="%sysfunc(getoption(work))/";&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;28 FILENAME _CWD '.';&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;29 DATA _NULL_;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;30 CALL SYMPUT('_SASWORKINGDIR',PATHNAME('_CWD'));&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;31 RUN;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;32 FILENAME _CWD;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;33&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;34 %LET _SASPROGRAMFILE = %NRQUOTE(%NRSTR(/folders/myfolders/BOOTSTRAPAPTENSIO_PED/ReadFitFile.sas));&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;35 %LET _BASEURL = %BQUOTE(&lt;A href="http://192.168.61.128/SASStudio/" target="_blank" rel="noopener"&gt;http://192.168.61.128/SASStudio/&lt;/A&gt;);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;36 %LET _EXECENV=SASStudio;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;______________________________________________________________________________________________________________________&lt;/DIV&gt;&lt;DIV class="sasError"&gt;49&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;between a quoted string and the succeeding identifier is recommended.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;37 DATA _NULL_;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;38 CALL&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;38 ! SYMPUT("GRAPHINIT"&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_&lt;/DIV&gt;&lt;DIV class="sasError"&gt;49&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;38 ! ,"");&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;39 CALL&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;39 ! SYMPUT("GRAPHTERM"&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_&lt;/DIV&gt;&lt;DIV class="sasError"&gt;49&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&lt;FONT&gt;&lt;BR /&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I have attached code written to read the data set.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do i=1% to 5;
data NEW_SUBJ&amp;amp;i;
infile "/folders/myfolders/test&amp;amp;i..nm7/PARAM.TBL"  FIRSTOBS=2;
input ID TIME CMT AGE ;
RUN;

DATA NEW_SUBK&amp;amp;i;
SET NEW_SUBJ&amp;amp;i;
IF ID=. THEN DELETE;
RUN;
%END;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Dec 2019 10:00:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/611984#M178487</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2019-12-16T10:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a table file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612021#M178501</link>
      <description>&lt;P&gt;They key is this&lt;/P&gt;
&lt;PRE&gt;NOTE: The quoted string currently being processed has become more than 262 bytes long. You might have unbalanced quotation marks.&lt;/PRE&gt;
&lt;P&gt;at the beginning of the log. You had unbalanced quotes in previous code. Restart your SAS session and run the code again.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 13:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612021#M178501</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-16T13:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a table file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612024#M178502</link>
      <description>&lt;P&gt;After several minutes of staring at your code wondering what could be wrong it struck me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do i=1% to 5;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is probably a typo for for this intended code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do i=1 to 5;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The percent sign after the 1 probably yields the message you get, although I didn't test that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;-- Jan.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 13:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612024#M178502</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2019-12-16T13:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a table file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612028#M178503</link>
      <description>&lt;P&gt;You seem to be using an interface like Enterprise Guide or SAS/Studio that submits your code to a remote SAS server.&amp;nbsp; The error message is probably related to unbalanced quotes. Try restarting the SAS session you are using to run the code and see if that helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your posted code has two obvious problems. First is the misplaced % on the %TO part of your %DO loop.&lt;/P&gt;
&lt;P&gt;Second is that to use a %DO loop you need to wrap that code into a macro definition. Which means you also need to call the macro once it is defined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So try something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro read5;
%do i=1 %to 5;

data NEW_SUBJ&amp;amp;i;
  infile "/folders/myfolders/test&amp;amp;i..nm7/PARAM.TBL" firstobs=2 truncover;
  input ID TIME CMT AGE ;
  if id=. then delete;
run;

%end;
%mend read5;

options mprint;
%read5;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Turning on the MPRINT option will have SAS show the lines of code that the macro generates in the LOG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 14:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612028#M178503</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-16T14:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a table file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612041#M178507</link>
      <description>&lt;P&gt;Once I used the macro and edited the do loop it ran with no problem.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 14:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612041#M178507</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2019-12-16T14:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a table file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612042#M178508</link>
      <description>A solution was supplied by a later reply by using a macro and correcting the&lt;BR /&gt;do loop.&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Dec 2019 14:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612042#M178508</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2019-12-16T14:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a table file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612043#M178509</link>
      <description>This would work in side a macro as suggested by a later reply.&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Dec 2019 14:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-table-file/m-p/612043#M178509</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2019-12-16T14:51:49Z</dc:date>
    </item>
  </channel>
</rss>

