<?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: Array reference creates trailing spaces when called in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Array-reference-creates-trailing-spaces-when-called/m-p/563794#M158089</link>
    <description>&lt;P&gt;Thank you, the solution worked&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jun 2019 17:40:53 GMT</pubDate>
    <dc:creator>Samiresh</dc:creator>
    <dc:date>2019-06-05T17:40:53Z</dc:date>
    <item>
      <title>Array reference creates trailing spaces when called</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-reference-creates-trailing-spaces-when-called/m-p/563785#M158085</link>
      <description>&lt;P&gt;When ever i call upon the array reference it creates trailing or leading spaces which causes the program to fail. Please observe the below code where in the array reference i insert the size of the dataset and i call it to use in naming convention&lt;BR /&gt;&lt;BR /&gt;i used such naming convention before and it never failed. is it some settings i should turn on or i am missing any syntax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;table - trigger file&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Name&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;place&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Rock&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;RI&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;NY&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ST&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Your&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;PC&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;code&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data trigger_file_s1;&lt;BR /&gt;set trigger_file;&lt;BR /&gt;row_num = _n_;&lt;BR /&gt;run;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select max(row_num) into :max_size&lt;BR /&gt;from trigger_file_s1;&lt;BR /&gt;quit;&lt;BR /&gt;data tablename_&amp;amp;max_size.&lt;BR /&gt;set trigger_file_s1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;Error log:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MPRINT(DATAINGESTION): data trigger_file_s1;&lt;BR /&gt;MPRINT(DATAINGESTION): set trigger_file;&lt;BR /&gt;MPRINT(DATAINGESTION): row_num = _n_;&lt;BR /&gt;MPRINT(DATAINGESTION): run;&lt;BR /&gt;NOTE: There were 6 observations read from the data set WORK.TRIGGER_FILE.&lt;BR /&gt;NOTE: The data set WORK.TRIGGER_FILE_S1 has 6 observations and 3 variables.&lt;BR /&gt;NOTE: Compressing data set WORK.TRIGGER_FILE_S1 increased size by 100.00 percent.&lt;BR /&gt;Compressed is 2 pages; un-compressed would require 1 pages.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;MPRINT(DATAINGESTION): proc sql noprint;&lt;BR /&gt;MPRINT(DATAINGESTION): select max(row_num) into :max_size from trigger_file_s1;&lt;BR /&gt;MPRINT(DATAINGESTION): quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;10 The SAS System 16:06 Wednesday, June 5, 2019&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable MAX_SIZE resolves to 6&lt;BR /&gt;NOTE: Line generated by the invoked macro "DATAINGESTION".&lt;BR /&gt;1194 record_count ; run; data trigger_file_s1; set trigger_file; row_num = _n_; run; proc sql noprint;&lt;BR /&gt;1194 ! select max(row_num) into :max_size from trigger_file_s1; quit; data tablename_&amp;amp;max_size. set trigger_file_s1; run&lt;BR /&gt;___&lt;BR /&gt;56&lt;BR /&gt;1194 ! ;&lt;BR /&gt;ERROR 56-185: SET is not allowed in the DATA statement when option DATASTMTCHK=COREKEYWORDS. Check for a missing semicolon in the&lt;BR /&gt;DATA statement, or use DATASTMTCHK=NONE.&lt;BR /&gt;NOTE: Line generated by the macro variable "MAX_SIZE".&lt;BR /&gt;1194 tablename_ 6&lt;BR /&gt;_&lt;BR /&gt;22&lt;BR /&gt;200&lt;BR /&gt;MPRINT(DATAINGESTION): data tablename_ 6 set trigger_file_s1;&lt;BR /&gt;MPRINT(DATAINGESTION): run;&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 17:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-reference-creates-trailing-spaces-when-called/m-p/563785#M158085</guid>
      <dc:creator>Samiresh</dc:creator>
      <dc:date>2019-06-05T17:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Array reference creates trailing spaces when called</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-reference-creates-trailing-spaces-when-called/m-p/563791#M158087</link>
      <description>That's a result of using INTO within SQL.  Eliminate the extra blanks by adding:&lt;BR /&gt;&lt;BR /&gt;%let max_size = &amp;amp;max_size;&lt;BR /&gt;&lt;BR /&gt;before trying to use the macro variable</description>
      <pubDate>Wed, 05 Jun 2019 17:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-reference-creates-trailing-spaces-when-called/m-p/563791#M158087</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-06-05T17:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Array reference creates trailing spaces when called</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-reference-creates-trailing-spaces-when-called/m-p/563792#M158088</link>
      <description>&lt;P&gt;Issue is with the misisng semicolon after tablename_&amp;amp;max_size.&lt;/P&gt;
&lt;P&gt;keep the semicolon and it should work. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data trigger_file_s1;
set trigger_file;
row_num = _n_;
run;
proc sql noprint;
select max(row_num) into :max_size
from trigger_file_s1;
quit;
data tablename_&amp;amp;max_size.;
set trigger_file_s1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Jun 2019 17:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-reference-creates-trailing-spaces-when-called/m-p/563792#M158088</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-06-05T17:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Array reference creates trailing spaces when called</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-reference-creates-trailing-spaces-when-called/m-p/563794#M158089</link>
      <description>&lt;P&gt;Thank you, the solution worked&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 17:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-reference-creates-trailing-spaces-when-called/m-p/563794#M158089</guid>
      <dc:creator>Samiresh</dc:creator>
      <dc:date>2019-06-05T17:40:53Z</dc:date>
    </item>
  </channel>
</rss>

