<?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 SAS 9.2, reading Excell sheets and getting their names through Symget in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-2-reading-Excell-sheets-and-getting-their-names-through/m-p/323131#M271157</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;We have 9.2 and 9.4 in shop.&lt;/P&gt;&lt;P&gt;However the following code (with different datafile and dbms characteristics) works in 9.4 but not in 9.2.&lt;/P&gt;&lt;P&gt;We have to make it to run on machine with 9.2&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; readexcel(sheet);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;proc import out= &amp;amp;sheet&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;datafile = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;path\&amp;amp;name..xls"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;dbms = EXCEL2000 REPLACE;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;sheet =&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;sheet"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;getnames=yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data &amp;amp;sheet;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;length nm $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;40&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;set &amp;amp;sheet;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;nm=symget(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'sheet'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; readexcel;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;When&amp;nbsp;macro is executed all data from the sheet&amp;nbsp;is there in the set, but column&amp;nbsp;"nm"&amp;nbsp; that suppose to have Sheet name&amp;nbsp;is empty, and&amp;nbsp;we get&amp;nbsp;message:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function SYMGET at line 2 column 47.&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jan 2017 23:35:28 GMT</pubDate>
    <dc:creator>User12321</dc:creator>
    <dc:date>2017-01-06T23:35:28Z</dc:date>
    <item>
      <title>SAS 9.2, reading Excell sheets and getting their names through Symget</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-2-reading-Excell-sheets-and-getting-their-names-through/m-p/323131#M271157</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;We have 9.2 and 9.4 in shop.&lt;/P&gt;&lt;P&gt;However the following code (with different datafile and dbms characteristics) works in 9.4 but not in 9.2.&lt;/P&gt;&lt;P&gt;We have to make it to run on machine with 9.2&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; readexcel(sheet);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;proc import out= &amp;amp;sheet&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;datafile = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;path\&amp;amp;name..xls"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;dbms = EXCEL2000 REPLACE;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;sheet =&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;sheet"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;getnames=yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data &amp;amp;sheet;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;length nm $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;40&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;set &amp;amp;sheet;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;nm=symget(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'sheet'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; readexcel;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;When&amp;nbsp;macro is executed all data from the sheet&amp;nbsp;is there in the set, but column&amp;nbsp;"nm"&amp;nbsp; that suppose to have Sheet name&amp;nbsp;is empty, and&amp;nbsp;we get&amp;nbsp;message:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function SYMGET at line 2 column 47.&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 23:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-9-2-reading-Excell-sheets-and-getting-their-names-through/m-p/323131#M271157</guid>
      <dc:creator>User12321</dc:creator>
      <dc:date>2017-01-06T23:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.2, reading Excell sheets and getting their names through Symget</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-2-reading-Excell-sheets-and-getting-their-names-through/m-p/323133#M271158</link>
      <description>&lt;P&gt;Why are you using symget and not the macro variable directly?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nm="&amp;amp;sheet";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks like symget expects double quotes. From the docs&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;argument&lt;BR /&gt;can be one of the following items:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;the name of a macro variable within &lt;U&gt;double&lt;/U&gt; quotation marks but without an ampersand&lt;/STRONG&gt;&lt;BR /&gt;the name of a DATA step character variable, specified with no quotation marks, which contains a macro variable name&lt;BR /&gt;a character expression that constructs a macro variable name&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2017 01:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-9-2-reading-Excell-sheets-and-getting-their-names-through/m-p/323133#M271158</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-07T01:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.2, reading Excell sheets and getting their names through Symget</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-2-reading-Excell-sheets-and-getting-their-names-through/m-p/323389#M271159</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;It worked.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 15:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-9-2-reading-Excell-sheets-and-getting-their-names-through/m-p/323389#M271159</guid>
      <dc:creator>User12321</dc:creator>
      <dc:date>2017-01-09T15:52:52Z</dc:date>
    </item>
  </channel>
</rss>

