<?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: From YYYYMMDD macro var create DDMMYYYY macro var in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755237#M238313</link>
    <description>&lt;P&gt;1) yymmdd10 was a mistake, working but the "10" should be changed to "8".&amp;nbsp; I quoted the macro-variable to avoid the&amp;nbsp; following notes, which are in-fact error:&lt;/P&gt;
&lt;PRE&gt; NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
       72:1   
 NOTE: Invalid argument to function INPUT at Zeile 72 Spalte 33.
&lt;/PRE&gt;
&lt;P&gt;2) Try it with ddmmyy8. - you will see the difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Try it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2021 06:37:52 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2021-07-20T06:37:52Z</dc:date>
    <item>
      <title>From YYYYMMDD macro var create DDMMYYYY macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755225#M238306</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;User define a macro variable&amp;nbsp; YYYYMMDD&amp;nbsp; and I want that another macro variable called DDMMYYYY will be created automatically.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;%let YYYYMMDD=20210719;&lt;/P&gt;
&lt;P&gt;so DDMMYYYY should be 19072021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the way to do it please via %let&amp;nbsp; ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 04:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755225#M238306</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-07-20T04:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: From YYYYMMDD macro var create DDMMYYYY macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755227#M238307</link>
      <description>&lt;P&gt;I know to do it via data step.&lt;/P&gt;
&lt;P&gt;What is the reason that I must use compress function ?(Otherwise it is not working well)&lt;/P&gt;
&lt;P&gt;Why the macro variable that is created via %LET is not compressed?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let YYYYMMDD=20210628 

Data tt;
dd=substr(compress(&amp;amp;YYYYMMDD.),7,2);/**want to get 28**/
mm=substr(compress(&amp;amp;YYYYMMDD.),5,2);/**want to get 06**/
yyyy=substr(compress(&amp;amp;YYYYMMDD),1,4);/**want to get 2021**/
DDMMYYYY=CATS(dd,mm,yyyy);
call symputx('DDMMYYYY',DDMMYYYY);
Run;
%put &amp;amp;DDMMYYYY.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 05:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755227#M238307</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-07-20T05:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: From YYYYMMDD macro var create DDMMYYYY macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755229#M238309</link>
      <description>&lt;P&gt;I would not do this in a %let statement, all those %sysfunc-calls will make the code hardly readable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   call symputx('DDMMYYYY', put(input("&amp;amp;yyyymmdd.", yymmdd10.), ddmmyyn8.));
run;

%put &amp;amp;=DDMMYYYY.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Jul 2021 05:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755229#M238309</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-07-20T05:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: From YYYYMMDD macro var create DDMMYYYY macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755230#M238310</link>
      <description>&lt;P&gt;Well, after actually thinking - should do this more often before i answer - there is only one %sysfunc necessary:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let DDMMYYYY = %sysfunc(inputn(&amp;amp;yyyymmdd., yymmdd8.), ddmmyyn8.);
%put &amp;amp;=DDMMYYYY;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Jul 2021 05:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755230#M238310</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-07-20T05:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: From YYYYMMDD macro var create DDMMYYYY macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755233#M238311</link>
      <description>Great, I have 3 questions please:&lt;BR /&gt;1-input("&amp;amp;yyyymmdd.", yymmdd10.)&lt;BR /&gt;Here you transform from char date into sas date.&lt;BR /&gt;The char date (&amp;amp;yyyymmdd.)  has 8 digits .&lt;BR /&gt;Why did you use  yymmdd10. and not  yymmdd8. ?&lt;BR /&gt;Why did you put &amp;amp;yyyymmdd. into double quotation marks?&lt;BR /&gt;&lt;BR /&gt;2-PUT( SAS date that you created, DDMMYYN8.)&lt;BR /&gt;Here you transform SAS date into char date.&lt;BR /&gt;Why did you use DDMMYYN8. and not DDMMYY8. ?&lt;BR /&gt;&lt;BR /&gt;3- DATA _NULL_ &lt;BR /&gt;Can you also write DATA NULL?&lt;BR /&gt;What is difference between DATA _NULL_   and DATA  NULL ? (Or maybe both are same)?&lt;BR /&gt;&lt;BR /&gt;thank you&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Tue, 20 Jul 2021 06:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755233#M238311</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-07-20T06:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: From YYYYMMDD macro var create DDMMYYYY macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755237#M238313</link>
      <description>&lt;P&gt;1) yymmdd10 was a mistake, working but the "10" should be changed to "8".&amp;nbsp; I quoted the macro-variable to avoid the&amp;nbsp; following notes, which are in-fact error:&lt;/P&gt;
&lt;PRE&gt; NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
       72:1   
 NOTE: Invalid argument to function INPUT at Zeile 72 Spalte 33.
&lt;/PRE&gt;
&lt;P&gt;2) Try it with ddmmyy8. - you will see the difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Try it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 06:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755237#M238313</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-07-20T06:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: From YYYYMMDD macro var create DDMMYYYY macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755262#M238331</link>
      <description>&lt;P&gt;You could just use the %substr() function. One line of code, no data step required,&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 08:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-YYYYMMDD-macro-var-create-DDMMYYYY-macro-var/m-p/755262#M238331</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-20T08:54:30Z</dc:date>
    </item>
  </channel>
</rss>

