<?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: Create a CONSTANT or LITERAL in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-CONSTANT-or-LITERAL-in-SAS/m-p/148362#M297677</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For a constant like PI or E see the CONSTANT function.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p0l7s11dwvzfq5n1wnw997dye8fx.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p0l7s11dwvzfq5n1wnw997dye8fx.htm"&gt;SAS(R) 9.3 Functions and CALL Routines: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For constants/literals see&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p0cq7f0icfjr8vn19vyunwmmsl7m.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p0cq7f0icfjr8vn19vyunwmmsl7m.htm"&gt;SAS(R) 9.3 Language Reference: Concepts, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For readonly symbol&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p0ivgabci0y2den1usf43mxdkpgp.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p0ivgabci0y2den1usf43mxdkpgp.htm"&gt;SAS(R) 9.4 Macro Language: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p1lhhti7fjxgb1n1fuiubqk11h4d.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p1lhhti7fjxgb1n1fuiubqk11h4d.htm"&gt;SAS(R) 9.4 Macro Language: Reference&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Nov 2013 15:07:37 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2013-11-19T15:07:37Z</dc:date>
    <item>
      <title>Create a CONSTANT or LITERAL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-CONSTANT-or-LITERAL-in-SAS/m-p/148360#M297675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a CONSTANT or LITERAL in SAS macro language, i mean a variable that can not be changed during the execution of the programme.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro Variables created with %let (global or local) can be changed... what i need is to define a variable that can not be changed (the classic example is the number pi=3,14151...). For instance, if I have constant1= 12345, if I writte in my programme %let constant1=789 the constant can not be changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In C language it is used the #define function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 11:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-CONSTANT-or-LITERAL-in-SAS/m-p/148360#M297675</guid>
      <dc:creator>jaimepbs</dc:creator>
      <dc:date>2013-11-19T11:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create a CONSTANT or LITERAL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-CONSTANT-or-LITERAL-in-SAS/m-p/148361#M297676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you considered defining a function to return the value you're interested in, would that be of help? E.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro constant(const);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; %if &amp;amp;const=pi %then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; %else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; %if &amp;amp;const=e %then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.71828&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; %else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; %if &amp;amp;const=c %then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 299792458&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend constant;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put "pi=%constant(pi)";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put "e =%constant(e)";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put "c =%constant(c)";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 12:19:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-CONSTANT-or-LITERAL-in-SAS/m-p/148361#M297676</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2013-11-19T12:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create a CONSTANT or LITERAL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-CONSTANT-or-LITERAL-in-SAS/m-p/148362#M297677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For a constant like PI or E see the CONSTANT function.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p0l7s11dwvzfq5n1wnw997dye8fx.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p0l7s11dwvzfq5n1wnw997dye8fx.htm"&gt;SAS(R) 9.3 Functions and CALL Routines: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For constants/literals see&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p0cq7f0icfjr8vn19vyunwmmsl7m.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p0cq7f0icfjr8vn19vyunwmmsl7m.htm"&gt;SAS(R) 9.3 Language Reference: Concepts, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For readonly symbol&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p0ivgabci0y2den1usf43mxdkpgp.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p0ivgabci0y2den1usf43mxdkpgp.htm"&gt;SAS(R) 9.4 Macro Language: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p1lhhti7fjxgb1n1fuiubqk11h4d.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p1lhhti7fjxgb1n1fuiubqk11h4d.htm"&gt;SAS(R) 9.4 Macro Language: Reference&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 15:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-CONSTANT-or-LITERAL-in-SAS/m-p/148362#M297677</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-11-19T15:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create a CONSTANT or LITERAL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-CONSTANT-or-LITERAL-in-SAS/m-p/148363#M297678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;another option is an environment variable.&lt;/P&gt;&lt;P&gt;yes, they can be changed, but few people are aware of the syntax, nor how to access the symbol table&lt;/P&gt;&lt;P&gt;and so they are more or less, under the radar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.sascommunity.org/wiki/Using_Environment_Variables" title="http://www.sascommunity.org/wiki/Using_Environment_Variables"&gt;http://www.sascommunity.org/wiki/Using_Environment_Variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the SAS statement syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options set = Evar 'value';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; evar maven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 20:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-CONSTANT-or-LITERAL-in-SAS/m-p/148363#M297678</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2013-11-21T20:44:34Z</dc:date>
    </item>
  </channel>
</rss>

