<?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: Convert a string year into a date year like wise 3 letter string month to date formatted month in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-a-string-year-into-a-date-year-like-wise-3-letter-string/m-p/266266#M15714</link>
    <description>&lt;P&gt;What messages do you get in the log window?&lt;/P&gt;</description>
    <pubDate>Tue, 26 Apr 2016 02:43:08 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-04-26T02:43:08Z</dc:date>
    <item>
      <title>Convert a string year into a date year like wise 3 letter string month to date formatted month</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-a-string-year-into-a-date-year-like-wise-3-letter-string/m-p/266258#M15713</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I was trying to convert a year '2015' which is in character format into date format by using input function.&lt;BR /&gt;Eg : input(year, 4.) It either gives me a missing value or a value as 1965. Can some one help me what source informat should I be using&lt;BR /&gt;&lt;BR /&gt;Like wise I have a column which has 3 letter month 'Feb' in character format and I used same input function and I get missing values. I tried with all possible source informats but still unable to find the right solution.&lt;BR /&gt;&lt;BR /&gt;Please tell me if we can do it without concatenating year and month.&lt;BR /&gt;&lt;BR /&gt;I want it individual conversion.&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Karthik&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2016 02:41:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-a-string-year-into-a-date-year-like-wise-3-letter-string/m-p/266258#M15713</guid>
      <dc:creator>Karthikk</dc:creator>
      <dc:date>2016-04-26T02:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a string year into a date year like wise 3 letter string month to date formatted month</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-a-string-year-into-a-date-year-like-wise-3-letter-string/m-p/266266#M15714</link>
      <description>&lt;P&gt;What messages do you get in the log window?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2016 02:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-a-string-year-into-a-date-year-like-wise-3-letter-string/m-p/266266#M15714</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-04-26T02:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a string year into a date year like wise 3 letter string month to date formatted month</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-a-string-year-into-a-date-year-like-wise-3-letter-string/m-p/266267#M15715</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I couldn't find informats so used some date logic to get it. &amp;nbsp;A SAS date requires a day, month and year though they don't need to be displayed. A date is the number of days since Jan 1, 1960. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input year_char $ month_char $;
cards;
1990 SEP
2014 JAN
2015 MAY
;
run;

data want;
set have;

year=mdy(1, 1, input(year_char, 4.));
month=input(catt("01", month_char, "2015"), date9.);

format month monname3.;
format year year4.;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2016 02:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-a-string-year-into-a-date-year-like-wise-3-letter-string/m-p/266267#M15715</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-26T02:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a string year into a date year like wise 3 letter string month to date formatted month</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-a-string-year-into-a-date-year-like-wise-3-letter-string/m-p/266303#M15724</link>
      <description>&lt;P&gt;To get a good answer, it is a good idea to post test data (in the form of a datastep) and what the output should look like. &amp;nbsp;I guess with the below:&lt;/P&gt;
&lt;PRE&gt;data want;
  year="2015";
  month="Feb";
  numeric_year=input(year,4.);
  numeric_month=month(input(cats("01",month,"2000"),date9.));
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Apr 2016 07:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-a-string-year-into-a-date-year-like-wise-3-letter-string/m-p/266303#M15724</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-26T07:40:53Z</dc:date>
    </item>
  </channel>
</rss>

