<?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: How to change the value stored in the macro variable change dynamically based on a condition? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475953#M122431</link>
    <description>I am dealing with legacy code and cannot afford to change the whole table&lt;BR /&gt;naming etc. But I will keep your suggestions in mind when doing my own&lt;BR /&gt;tables. Thank you&lt;BR /&gt;</description>
    <pubDate>Fri, 06 Jul 2018 11:14:15 GMT</pubDate>
    <dc:creator>pkopersk</dc:creator>
    <dc:date>2018-07-06T11:14:15Z</dc:date>
    <item>
      <title>How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475237#M122191</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;here's what I am trying to accomplish:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; annee=2018;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mois=02;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&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; bs(mois);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;01&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dobs='31jan'&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;02&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dobs='28feb'&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;03&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then &lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'31mar'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;04&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'30apr'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;05&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'31may'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;06&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'30jun'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;07&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'31jul'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;08&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'31aug'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;09&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'30sep'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'31oct'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;11&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'30nov'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;12&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'31dec'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&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; bs;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;dobs;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;So basically, dobs should have the value "30feb2018"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 15:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475237#M122191</guid>
      <dc:creator>pkopersk</dc:creator>
      <dc:date>2018-07-03T15:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475239#M122192</link>
      <description>&lt;P&gt;%let annee=2018;&lt;/P&gt;&lt;P&gt;%let mois=02;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%put &amp;amp;mois;&lt;BR /&gt;　&lt;/P&gt;&lt;P&gt;%macro bs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;mois = 02 %then %let dobs="28feb&amp;amp;annee";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%put &amp;amp;dobs;&lt;BR /&gt;%mend bs;&lt;BR /&gt;%bs&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 15:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475239#M122192</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-03T15:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475240#M122193</link>
      <description>&lt;P&gt;Why not:&lt;/P&gt;
&lt;PRE&gt;%let annee=2018;
%let mois=02;

data _null_;
  call symputx('dobs',  intnx('day',mdy(&amp;amp;mois.,&amp;amp;annee,1),'beginning'));
run;&lt;/PRE&gt;
&lt;P&gt;Its amazing what you can do with Base SAS - which is the actual programming language.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 15:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475240#M122193</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-03T15:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475247#M122197</link>
      <description>&lt;P&gt;It looks like you want the last day of the month. This will depend on the year, what about leap years? Your code doesn't account for that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's better to use INTNX() to get the value. You need a starting date for the INTNX function and then an increment but we don't know what you're starting with.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some examples of working with dates.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Macro-Variables-of-Date-and-Time/ta-p/475194" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Macro-Variables-of-Date-and-Time/ta-p/475194&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you explain what you want, we can likely help you with a more efficient solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207645"&gt;@pkopersk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;here's what I am trying to accomplish:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; annee=2018;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mois=02;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; bs(mois);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;01&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dobs='31jan'&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;02&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dobs='28feb'&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;03&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then &lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'31mar'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;04&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'30apr'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;05&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'31may'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;06&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'30jun'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;07&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'31jul'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;08&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'31aug'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;09&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'30sep'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'31oct'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;11&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'30nov'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;mois = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;12&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%let&lt;/FONT&gt; dobs=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;'31dec'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;annee;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; bs;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;dobs;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;So basically, dobs should have the value "30feb2018"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 16:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475247#M122197</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-03T16:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475253#M122198</link>
      <description>&lt;P&gt;I don't think you can get 30feb2018, perhaps 28feb2018.&amp;nbsp; As others have&amp;nbsp;pointed out, sometimes February has 29 days instead of 28.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But all that aside, you have two choices.&amp;nbsp; You can simply remove all the quotes from the macro if you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;28feb2018&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, you can change them to double quotes and move the closing quote if you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"28feb2018"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For that, change the desired expressions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... %then let dobs="28feb&amp;amp;annee";&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 16:38:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475253#M122198</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-03T16:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475262#M122201</link>
      <description>&lt;P&gt;If you use SAS date values (unformatted) in your macro variables, you can use date functions and formats for all this.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 16:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475262#M122201</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-03T16:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475939#M122420</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; annee=2018;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mois=02;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symputx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'dobs'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'day'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,mdy(&amp;amp;mois,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&amp;amp;annee),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;dobs &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;dobs;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Output:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;21215&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I convert this to 28FEB2018&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 09:57:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475939#M122420</guid>
      <dc:creator>pkopersk</dc:creator>
      <dc:date>2018-07-06T09:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475941#M122422</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207645"&gt;@pkopersk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; annee=2018;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mois=02;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#000080" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff" size="2"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff" size="2"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symputx(&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080" size="2"&gt;'dobs'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, intnx(&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080" size="2"&gt;'day'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,mdy(&amp;amp;mois,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&amp;amp;annee),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;dobs &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008080" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#000080" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;dobs;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Output:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;21215&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I convert this to 28FEB2018&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The question is, what for? If you need it for comparison or calculation purposes, the raw numerical value is ideal. If you need it for display anywhere, format it there. Note that the best (because standardized) format for a date is e8601da. (which is equivalent to yymmddd10.), as it conforms to the ISO 8601 standard.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 10:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475941#M122422</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-06T10:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475942#M122423</link>
      <description>&lt;P&gt;Macro is always and only text.&amp;nbsp; You cannot apply datastep formats to something which does not exist in datastep language. This is one of the reasons i highly recommend you use Base SAS programming for data manipulation, and leave macro requirements out of it.&lt;/P&gt;
&lt;PRE&gt;%let annee=2018;
%let mois=02;

data _null_;  
  call symputx('dobs', put(intnx('day',mdy(&amp;amp;mois,1,&amp;amp;annee),0)-1,date9.));
run;

%put &amp;amp;dobs;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jul 2018 10:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475942#M122423</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-06T10:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475944#M122424</link>
      <description>I have a huge table where each column has the name following this format:&lt;BR /&gt;DDMMMYYYY where MMM is a string representing the 3 first letters of each&lt;BR /&gt;month.&lt;BR /&gt;&lt;BR /&gt;I want to have to replace the first two variables %annee and %mois and run&lt;BR /&gt;the program.&lt;BR /&gt;&lt;BR /&gt;The macro variable %dobs has to dynamically adapt to my input and has to be&lt;BR /&gt;a macro variable because it is used everywhere in the program.&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jul 2018 10:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475944#M122424</guid>
      <dc:creator>pkopersk</dc:creator>
      <dc:date>2018-07-06T10:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475948#M122427</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207645"&gt;@pkopersk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I have a huge table where each column has the name following this format:&lt;BR /&gt;DDMMMYYYY where MMM is a string representing the 3 first letters of each&lt;BR /&gt;month.&lt;BR /&gt;&lt;BR /&gt;I want to have to replace the first two variables %annee and %mois and run&lt;BR /&gt;the program.&lt;BR /&gt;&lt;BR /&gt;The macro variable %dobs has to dynamically adapt to my input and has to be&lt;BR /&gt;a macro variable because it is used everywhere in the program.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I see at least two violations of sound programming practice here:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;first, using non-standard variable names starting with a digit. Although possible, those cause only unnecessary typing by forcing you to use the 'some garbage in here'n construct. Get rid of such things three days before yesterday.&lt;/LI&gt;
&lt;LI&gt;second (and more severe), keeping data (dates) in structure (column names). Transpose to a long format upon import into SAS, and all handling of such data turns from PITA to trivial. That would also take care of the variable naming issue in one fell swoop. Since then dates are stored as SAS date values, formatting the raw value of the macro variable is a non-issue.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;Edit: added the missing "severe".&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 11:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475948#M122427</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-06T11:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475949#M122428</link>
      <description>&lt;P&gt;Yes, what we have here is a classic case of bad data modelling using Excel thinking.&amp;nbsp; You have put "data" as column names, and that data is an abstract form in itself.&amp;nbsp; A simple normalisation will remove this issue completely:&lt;/P&gt;
&lt;P&gt;From:&lt;BR /&gt;id&amp;nbsp; &amp;nbsp;01jan2018&amp;nbsp; 02Jan2018&amp;nbsp; 03Jan2018&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; abc&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;def&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ghi&lt;/P&gt;
&lt;P&gt;To:&lt;/P&gt;
&lt;P&gt;id&amp;nbsp; date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; res&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp;01jan2018&amp;nbsp; abc&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp;02jan2018&amp;nbsp; def&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp;03jan2018&amp;nbsp; ghi&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do note that you can always transpose that data up when you have finished your programming so the end product looks like the starting product, but your programming internally will be much much easier.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 10:56:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475949#M122428</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-06T10:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475953#M122431</link>
      <description>I am dealing with legacy code and cannot afford to change the whole table&lt;BR /&gt;naming etc. But I will keep your suggestions in mind when doing my own&lt;BR /&gt;tables. Thank you&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jul 2018 11:14:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/475953#M122431</guid>
      <dc:creator>pkopersk</dc:creator>
      <dc:date>2018-07-06T11:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value stored in the macro variable change dynamically based on a condition?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/476016#M122463</link>
      <description>&lt;P&gt;Use functions.&lt;/P&gt;
&lt;P&gt;You don't really need a macro since it is just a one liner.&amp;nbsp; But if you do make a macro then make it more useful by using parameters and creating a "function" style macro.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let annee=2018;
%let mois=02;

%macro bs(year,month);
%sysfunc(intnx(month,%sysfunc(mdy(&amp;amp;month,1,&amp;amp;year)),0,e),date9)
%mend bs ;

%let dobs=%bs(&amp;amp;annee,&amp;amp;mois);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;PRE&gt;589  %let dobs=%bs(&amp;amp;annee,&amp;amp;mois);
590  %put &amp;amp;=annee &amp;amp;=mois &amp;amp;=dobs ;
ANNEE=2018 MOIS=02 DOBS=28FEB2018&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 14:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-stored-in-the-macro-variable-change/m-p/476016#M122463</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-06T14:20:34Z</dc:date>
    </item>
  </channel>
</rss>

