<?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: Looking for date format MONDD. - similarly to MONYY. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-date-format-MONDD-similarly-to-MONYY/m-p/708577#M217776</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FORMAT using PICTURE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  picture mmmdd
    low-high='%b%0d' (datatype=date);
run;

%macro RandBetween(min, max);
   (&amp;amp;min + floor((1+&amp;amp;max-&amp;amp;min)*rand("uniform")))
%mend;

data want;
  do i = 1 to 4;
    date = %RandBetween("01Jan2019"d,"01Jan2020"d);
    mmmdd = date;
    format date  mmddyy10.
           mmmdd mmmdd.    ;
    output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;i	date	        mmmdd&lt;/STRONG&gt;
1	03/24/2019	MAR24
2	06/28/2019	JUN28
3	04/24/2019	APR24
4	08/20/2019	AUG20&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Dec 2020 15:29:32 GMT</pubDate>
    <dc:creator>PhilC</dc:creator>
    <dc:date>2020-12-29T15:29:32Z</dc:date>
    <item>
      <title>Looking for date format MONDD. - similarly to MONYY.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-date-format-MONDD-similarly-to-MONYY/m-p/708571#M217773</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am looking for a nicer way how to save date in the format MONDD. (like DEC29). I don't see this format build in and currently I am using concatenation of monname3. and day2.&lt;BR /&gt;Is there a simplier way for that for example by creating a bespoke format?&lt;BR /&gt;&lt;BR /&gt;Thank you in advance,&lt;BR /&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 14:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-date-format-MONDD-similarly-to-MONYY/m-p/708571#M217773</guid>
      <dc:creator>cactooos</dc:creator>
      <dc:date>2020-12-29T14:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for date format MONDD. - similarly to MONYY.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-date-format-MONDD-similarly-to-MONYY/m-p/708575#M217775</link>
      <description>&lt;P&gt;This one comes close:&lt;/P&gt;
&lt;PRE&gt;%put %sysfunc(today(),NLDATEMDM6.) ;
Dec 29&lt;/PRE&gt;
&lt;P&gt;But it leaves a space between the month and the date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also you can use the PICTURE statement in PROC FORMAT to generate your own custom format.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 15:07:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-date-format-MONDD-similarly-to-MONYY/m-p/708575#M217775</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-12-29T15:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for date format MONDD. - similarly to MONYY.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-date-format-MONDD-similarly-to-MONYY/m-p/708577#M217776</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FORMAT using PICTURE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  picture mmmdd
    low-high='%b%0d' (datatype=date);
run;

%macro RandBetween(min, max);
   (&amp;amp;min + floor((1+&amp;amp;max-&amp;amp;min)*rand("uniform")))
%mend;

data want;
  do i = 1 to 4;
    date = %RandBetween("01Jan2019"d,"01Jan2020"d);
    mmmdd = date;
    format date  mmddyy10.
           mmmdd mmmdd.    ;
    output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;i	date	        mmmdd&lt;/STRONG&gt;
1	03/24/2019	MAR24
2	06/28/2019	JUN28
3	04/24/2019	APR24
4	08/20/2019	AUG20&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Dec 2020 15:29:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-date-format-MONDD-similarly-to-MONYY/m-p/708577#M217776</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2020-12-29T15:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for date format MONDD. - similarly to MONYY.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-date-format-MONDD-similarly-to-MONYY/m-p/708578#M217777</link>
      <description>&lt;P&gt;I am using this later as a variable name so would rather need DEC29 or DEC_29.&lt;/P&gt;&lt;P&gt;EDIT: Was not sure how to put the zero inside but found some solution, posting here if anyone search for MONDD.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;proc format;
picture mondd (default=5) other='%b%0d' (datatype=date);
run;

data _null_;
 	call symputx( 'withzero', put(today()-21,  mondd.)) ;
run;

%put &amp;amp;withzero ;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Dec 2020 15:30:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-date-format-MONDD-similarly-to-MONYY/m-p/708578#M217777</guid>
      <dc:creator>cactooos</dc:creator>
      <dc:date>2020-12-29T15:30:01Z</dc:date>
    </item>
  </channel>
</rss>

