<?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: Macro variable not resolving ?? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109750#M22780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A bit confused about your requirement.&lt;/P&gt;&lt;P&gt;Do you wish to use an existing environment variable? If so, contact the responsible party for defining such variables, whoever that can be.&lt;/P&gt;&lt;P&gt;Or do want to how to define a macro variable as such? Macro variables can be defined anywhere in SAS programs, best place depends on your situation. So, please describe in more detail what kind of macro variable yo9uo need, and do you intend to use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Jun 2013 20:55:11 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2013-06-17T20:55:11Z</dc:date>
    <item>
      <title>Macro variable not resolving ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109749#M22779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am writing a code in SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have preexisting Macro variables in my envt which resolve&lt;BR /&gt;to something. How do I know where they are defined in unix solaris? Any&lt;BR /&gt;particular command I can use to see where the envt variables are defined in a&lt;BR /&gt;common location?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If at all I need to create a new macro var&amp;nbsp; &amp;amp;xyz&amp;nbsp; where do I create it? And how to write it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used &lt;SPAN style="line-height: 115%; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp; %let XYZ=%sysget(XYZ);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 115%; font-family: 'Courier New'; font-size: 9pt;"&gt;%put XYZ=&amp;amp;XYZ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see the following error in the log: &lt;SPAN style="line-height: 115%; font-family: 'Courier New'; font-size: 9pt;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable XYZ resolves to&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 115%; font-family: 'Courier New'; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 115%; font-family: 'Courier New'; font-size: 9pt;"&gt;But I do not see anything after resolves to – meaning it is not&lt;BR /&gt;resolved. Any suggestions appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 115%; font-family: 'Courier New'; font-size: 9pt;"&gt;I am not sure if this is an environmental specific question, but&lt;BR /&gt;thought I’d ask anyways.. Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 20:19:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109749#M22779</guid>
      <dc:creator>swathi123</dc:creator>
      <dc:date>2013-06-17T20:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109750#M22780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A bit confused about your requirement.&lt;/P&gt;&lt;P&gt;Do you wish to use an existing environment variable? If so, contact the responsible party for defining such variables, whoever that can be.&lt;/P&gt;&lt;P&gt;Or do want to how to define a macro variable as such? Macro variables can be defined anywhere in SAS programs, best place depends on your situation. So, please describe in more detail what kind of macro variable yo9uo need, and do you intend to use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 20:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109750#M22780</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-06-17T20:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109751#M22781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using existing variable is what i need. How do i define them? where do i locate them?&lt;/P&gt;&lt;P&gt;in order for me to write a new envtl variable i need to first understand the existing envtl variables right?&lt;/P&gt;&lt;P&gt;Hope I was clear&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 21:16:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109751#M22781</guid>
      <dc:creator>swathi123</dc:creator>
      <dc:date>2013-06-17T21:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109752#M22782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am assuming that you have a macro somewhere in a directory. Just call the macro using %include statement. Eg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename test1 '/home/o568484/test.sas'; /*directory for the location of the macro in unix */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%include test1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If test.sas contains &lt;SPAN style="font-family: 'Courier New'; font-size: 9pt;"&gt;%let XYZ=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 9pt;"&gt;When you include&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 9pt;"&gt;%put &amp;amp;XYZ = ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 9pt;"&gt;You should not get the error. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 9pt;"&gt;I hope this would help.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 22:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109752#M22782</guid>
      <dc:creator>devnand</dc:creator>
      <dc:date>2013-06-17T22:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109753#M22783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are talking about reading environment variables, SAS generally isn't involved with setting them, they mostly come from the operating system. So where they are set dependins on your OS and environment. The exceptions would be those created using SET in the SAS configuration file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't found anything that allows SAS to send values to environment variables unless you want to think of RSUBMIT login information for database access as such.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the environment variable XYZ in your example wasn't set by the OS then you wouldn't get anything.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 23:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109753#M22783</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-06-17T23:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109754#M22784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to see what macro variables are defined currently then use %PUT _ALL_; or %PUT _GLOBAL_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to see what ENVIRONMENT variables were defined before SAS started then you will need to use operating system commands.&amp;nbsp; You could try this simple data step which should work on Unix or Windows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'set' pipe ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 00:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/109754#M22784</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-06-18T00:40:39Z</dc:date>
    </item>
  </channel>
</rss>

