<?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 parameter from another parameter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443694#M111024</link>
    <description>&lt;P&gt;Ah, ok, then use the intnx function like this:&lt;/P&gt;
&lt;PRE&gt;%let vector=1707+1708+1706+1608;

data test /*_null_*/;
  length tmp $2000;
  do i=1 to countw("&amp;amp;vector.");
    pdate=intnx('month',input(cats(scan("&amp;amp;vector.",i,"+"),"01"),yymmdd8.),-12,"e");
    tmp=catx('+',tmp,cats("'",put(pdate,date9.),"'d"));
  end;
  call symputx('want',tmp);
run;

%put &amp;amp;want.;&lt;/PRE&gt;</description>
    <pubDate>Thu, 08 Mar 2018 09:38:07 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-03-08T09:38:07Z</dc:date>
    <item>
      <title>Define the following parameter of dates (YYMM)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443214#M110866</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have the following question&lt;/P&gt;
&lt;P&gt;I define the following parameter of dates (YYMM).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let vector=1708+1707+1706+1612;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to create base on vector parameter another parameter called&amp;nbsp;tarr &amp;nbsp;that includes also 4 arguments with &amp;nbsp;+ symbol between them.&lt;/P&gt;
&lt;P&gt;Each argument is created by subscribing 12 months &amp;nbsp;and take end of month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The wanted parameter is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'31AUG2016'd+'31JUL2016'd+'30JUN2016'd+31DEC2015'd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 11:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443214#M110866</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-03-07T11:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Hello I have the following question I define the following parameter of dates (YYMM).   %let vec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443219#M110867</link>
      <description>&lt;P&gt;To what purpose?&amp;nbsp; Data should go in datasets, datasets and Base SAS are created to manipulate and use data, hence why they have the various formats and functions.&amp;nbsp; Macro is not for processing data it is a text find an replace system.&amp;nbsp; Your wanted is just a more complicated way of refering to the numbers already there.&lt;/P&gt;
&lt;P&gt;Now you can do it of course, but it really isn't good practice as your just patching bad code:&lt;/P&gt;
&lt;PRE&gt;%let vector=1707+1708+1706+1608;

data _null_;
  length tmp $2000;
  do i=1 to countw("&amp;amp;vector.");
    tmp=catx('+',tmp,cats("'",put(input(scan("&amp;amp;vector.",i,"+"),best.),date9.),"'d"));
  end;
  call symputx('want',tmp);
run;

%put &amp;amp;want.;&lt;/PRE&gt;
&lt;P&gt;However there is nothing redeeming about coding like that whatsoever.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 09:20:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443219#M110867</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-07T09:20:55Z</dc:date>
    </item>
    <item>
      <title>Create parameter from another parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443220#M110869</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have the following question&lt;/P&gt;&lt;P&gt;I define the following parameter of dates (YYMM).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let vector=1708+1707+1706+1612;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create base on vector parameter another parameter called&amp;nbsp;tarr &amp;nbsp;that includes also 4 arguments with &amp;nbsp;+ symbol between them.&lt;/P&gt;&lt;P&gt;Each argument is created by subscribing 12 months &amp;nbsp;and take end of month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The wanted parameter is&amp;nbsp;&lt;/P&gt;&lt;P&gt;'31AUG2016'd+'31JUL2016'd+'30JUN2016'd+31DEC2015'd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help to do it please?&lt;/P&gt;&lt;P&gt;I know that in order to find end of month date we can use the function&lt;/P&gt;&lt;P&gt;intnx('month',mon_now_minus12M_date,0,'E')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 09:21:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443220#M110869</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-03-07T09:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Hello I have the following question I define the following parameter of dates (YYMM).   %let vec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443221#M110870</link>
      <description>&lt;P&gt;I merged the two identical questions.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 09:23:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443221#M110870</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-07T09:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create parameter from another parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443226#M110871</link>
      <description>&lt;P&gt;"&lt;/P&gt;
&lt;P&gt;I know that in order to find end of month date we can use the function&lt;/P&gt;
&lt;P&gt;intnx('month',mon_now_minus12M_date,0,'E')&lt;/P&gt;
&lt;P&gt;"&lt;/P&gt;
&lt;P&gt;Even more reason to use Base SAS then, you have the given formula, use that in code, still don't see what a parameter list fits in?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 09:39:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443226#M110871</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-07T09:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Hello I have the following question I define the following parameter of dates (YYMM).   %let vec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443654#M111016</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;The code is running well but the output dates are not as we want.&lt;/P&gt;&lt;PRE&gt;%let vector=1707+1708+1706+1608;&lt;/PRE&gt;&lt;P&gt;The required &amp;nbsp;output is&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let tarr='31Aug2016'd+'31Jul2016'd+'30Jun2016'd+'31Dec2015'd;&lt;/P&gt;&lt;P&gt;(It is calculated by minus 12 months and taking end of month )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Ronein&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 07:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443654#M111016</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-03-08T07:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create parameter from another parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443694#M111024</link>
      <description>&lt;P&gt;Ah, ok, then use the intnx function like this:&lt;/P&gt;
&lt;PRE&gt;%let vector=1707+1708+1706+1608;

data test /*_null_*/;
  length tmp $2000;
  do i=1 to countw("&amp;amp;vector.");
    pdate=intnx('month',input(cats(scan("&amp;amp;vector.",i,"+"),"01"),yymmdd8.),-12,"e");
    tmp=catx('+',tmp,cats("'",put(pdate,date9.),"'d"));
  end;
  call symputx('want',tmp);
run;

%put &amp;amp;want.;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Mar 2018 09:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-the-following-parameter-of-dates-YYMM/m-p/443694#M111024</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-08T09:38:07Z</dc:date>
    </item>
  </channel>
</rss>

