<?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: mmdd format in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676264#M23683</link>
    <description>Show your code please. You cannot use MONTH/DAY() on a character variable so you first need to convert it.</description>
    <pubDate>Wed, 12 Aug 2020 17:53:44 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-08-12T17:53:44Z</dc:date>
    <item>
      <title>mmdd format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676259#M23680</link>
      <description>&lt;P&gt;hi, I have a date 05/13 in a variable named 'date'.&lt;/P&gt;&lt;P&gt;1) now i want to split, date and month. How to split the date as day and month.&lt;/P&gt;&lt;P&gt;2) its is also in character format. how do i convert it to numeric..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; date&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05/13.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want this as&amp;nbsp; &amp;nbsp; &amp;nbsp;day&amp;nbsp; &amp;nbsp;month&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="branch"&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Aug 2020 17:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676259#M23680</guid>
      <dc:creator>Raj00007</dc:creator>
      <dc:date>2020-08-12T17:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: mmdd format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676260#M23681</link>
      <description>&lt;P&gt;SCAN() will allow you to separate the components based on a delimiter, in this case your /. &lt;BR /&gt;INPUT() will convert the values to numeric. &lt;BR /&gt;&lt;BR /&gt;Another approach is to read it in as a date and then use DAY() and MONTH() functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
	have='05/13';
	
	*character extraction;
	month_char=scan(have, 1, '/');
	day_char=scan(have, 2, '/');
	
	*conversion to numeric;
	month_num=input(month_char, 8.);
	day_char=input(day_char, 8.);
	
	*same as above but single step;
	month_num2=input(scan(have, 1, '/'), 8.);
	day_num2=input(scan(have, 2, '/'), 8.);
	
	*date method - requires year or custom informat;
	have_date=input(catt(have, '/2020'), mmddyy10.);
	month_num3=month(have_date);
	day_num3=day(have_date);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 19:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676260#M23681</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-12T19:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: mmdd format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676263#M23682</link>
      <description>i tried using day and month functions, but it is showing error. can you please write the code here</description>
      <pubDate>Wed, 12 Aug 2020 17:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676263#M23682</guid>
      <dc:creator>Raj00007</dc:creator>
      <dc:date>2020-08-12T17:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: mmdd format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676264#M23683</link>
      <description>Show your code please. You cannot use MONTH/DAY() on a character variable so you first need to convert it.</description>
      <pubDate>Wed, 12 Aug 2020 17:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676264#M23683</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-12T17:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: mmdd format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676269#M23684</link>
      <description>data springrain;&lt;BR /&gt;set lib.SPRING_RAIN;&lt;BR /&gt;num = input (date, mmdd5.);&lt;BR /&gt;day = day (num);&lt;BR /&gt;month = month (num);&lt;BR /&gt;run;&lt;BR /&gt;proc print;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;here the informat mmdd5. says invalid. what is the right informat for 05/13 . and also day and month functions are no working.</description>
      <pubDate>Wed, 12 Aug 2020 18:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676269#M23684</guid>
      <dc:creator>Raj00007</dc:creator>
      <dc:date>2020-08-12T18:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: mmdd format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676276#M23685</link>
      <description>There is no informat for just mmdd so you need to either add the year or create a custom informat.</description>
      <pubDate>Wed, 12 Aug 2020 18:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676276#M23685</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-12T18:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: mmdd format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676279#M23686</link>
      <description>&lt;P&gt;Since a SAS date value &lt;STRONG&gt;must&lt;/STRONG&gt; have a year there cannot be an informat to create a date from something without a year value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your best bet is likely to parse the character value and create numeric values of Month and Day and then create a date with the MDY function where you supply the year value.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 19:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676279#M23686</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-12T19:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: mmdd format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676286#M23687</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;month=scan(date,1,'/');

day=scan(date,2,'/');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Aug 2020 19:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/mmdd-format/m-p/676286#M23687</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-12T19:40:12Z</dc:date>
    </item>
  </channel>
</rss>

