<?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 problem with dates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/problem-with-dates/m-p/622531#M77281</link>
    <description>&lt;P&gt;Hello. Have dataset with colum of dates; column labeled "action_date" and has type "Date" and length 8 with format "MMDDYY10."&lt;/P&gt;&lt;P&gt;Dates look like this when I print the dataset:&amp;nbsp; 11/28/2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run this code, I expect to get a number. I'm actually getting nothing; the entire column is populated with periods. In the log, I do have a bunch of identical notes: "Invalid argument to function INPUT at line 28 column 12."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;data work.fy17_usa_p_test;&lt;BR /&gt;set work.fy17_usa_p;&lt;BR /&gt;new_date = input(action_date, mmddyy10.);&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;At the end of the day, I'm just trying to change the date format from 11/28/2016 to 2016-11-28.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;I think I'll go with something like&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;data work.fy17_usa_p_test;&lt;BR /&gt;set work.fy17_usa_p;&lt;BR /&gt;new_date = input(action_date, mmddyy10.);&lt;BR /&gt;format new_date yymmdd10.;&lt;BR /&gt;drop action_date;&lt;BR /&gt;rename new_date = action_date;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;but before getting there I need to get the input(action_date, mmddyy10.) to work.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Thanks in advance.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;P.S.: Here's a sample of the log:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;NOTE: Invalid argument to function INPUT at line 28 column 12.&lt;BR /&gt;WARNING: Limit set by ERRORS= option reached.&amp;nbsp; Further errors of this type will not be printed.&lt;BR /&gt;assistance_award_unique_key=ASST_NON_17E5624332740002_7300 award_id_fain=17E5624332740002 award_id_uri=&lt;BR /&gt;federal_action_obligation=20000 non_federal_funding_amount=5000 total_funding_amount=25000 face_value_of_loan=0&lt;BR /&gt;original_subsidy_cost=. total_subsidy_cost=0 total_loan_value=-25000 action_date=12/20/2016 action_date_fiscal_year=2017&lt;BR /&gt;period_perform_start=12/01/2016 awarding_agency_code=73 awarding_agency_name=SMALL BUSINESS ADMINISTRATION (SBA)&lt;BR /&gt;awarding_sub_agency_code=7300 awarding_sub_agency_name=SMALL BUSINESS ADMINISTRATION awarding_office_code=733510&lt;BR /&gt;awarding_office_name=&amp;nbsp; funding_agency_code=73 funding_agency_name=SMALL BUSINESS ADMINISTRATION (7300) funding_sub_agency_code=7300&lt;BR /&gt;funding_sub_agency_name=SMALL BUSINESS ADMINISTRATION funding_office_code=733510 funding_office_name=&amp;nbsp; recipient_duns=&lt;BR /&gt;recipient_name=KGS CONSTRUCTION SERVICES, INC. recipient_parent_name=&amp;nbsp; recipient_parent_duns=&amp;nbsp; recipient_country_code=USA&lt;BR /&gt;recipient_country_name=UNITED STATES recipient_address_line_1=10363 PIPER LN recipient_address_line_2=&amp;nbsp; recipient_city_name=MANASSAS&lt;BR /&gt;recipient_county_code=683 recipient_county_name=MANASSAS CITY recipient_state_code=VA recipient_state_name=VIRGINIA&lt;BR /&gt;recipient_zip_code=20110 recipient_zip_last_4_code=2053 recipient_foreign_city_name=&amp;nbsp; recipient_foreign_province_name=&lt;BR /&gt;recipient_foreign_postal_code=&amp;nbsp; cfda_number=59.016 cfda_title=SURETY BOND GUARANTEES assistance_type_code=11&lt;BR /&gt;assistance_type_description=&amp;nbsp; award_description=PARKING GARAGE REPAIRS business_funds_indicator_code=NON bus_funds_indicator_desc=&lt;BR /&gt;business_types_code=23 business_types_description=&amp;nbsp; correction_delete_indicator_code=&amp;nbsp; correction_delete_indicator_desc=&lt;BR /&gt;action_type_code=A action_type_description=&amp;nbsp; record_type_code=2 record_type_description=&amp;nbsp; recipient_city_code=&amp;nbsp; new_date=. _ERROR_=1&lt;BR /&gt;_N_=20&lt;BR /&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; missing values.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 151235 at 28:12&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Feb 2020 19:21:28 GMT</pubDate>
    <dc:creator>Badjuju</dc:creator>
    <dc:date>2020-02-05T19:21:28Z</dc:date>
    <item>
      <title>problem with dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/problem-with-dates/m-p/622531#M77281</link>
      <description>&lt;P&gt;Hello. Have dataset with colum of dates; column labeled "action_date" and has type "Date" and length 8 with format "MMDDYY10."&lt;/P&gt;&lt;P&gt;Dates look like this when I print the dataset:&amp;nbsp; 11/28/2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run this code, I expect to get a number. I'm actually getting nothing; the entire column is populated with periods. In the log, I do have a bunch of identical notes: "Invalid argument to function INPUT at line 28 column 12."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;data work.fy17_usa_p_test;&lt;BR /&gt;set work.fy17_usa_p;&lt;BR /&gt;new_date = input(action_date, mmddyy10.);&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;At the end of the day, I'm just trying to change the date format from 11/28/2016 to 2016-11-28.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;I think I'll go with something like&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;data work.fy17_usa_p_test;&lt;BR /&gt;set work.fy17_usa_p;&lt;BR /&gt;new_date = input(action_date, mmddyy10.);&lt;BR /&gt;format new_date yymmdd10.;&lt;BR /&gt;drop action_date;&lt;BR /&gt;rename new_date = action_date;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;but before getting there I need to get the input(action_date, mmddyy10.) to work.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Thanks in advance.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;P.S.: Here's a sample of the log:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;NOTE: Invalid argument to function INPUT at line 28 column 12.&lt;BR /&gt;WARNING: Limit set by ERRORS= option reached.&amp;nbsp; Further errors of this type will not be printed.&lt;BR /&gt;assistance_award_unique_key=ASST_NON_17E5624332740002_7300 award_id_fain=17E5624332740002 award_id_uri=&lt;BR /&gt;federal_action_obligation=20000 non_federal_funding_amount=5000 total_funding_amount=25000 face_value_of_loan=0&lt;BR /&gt;original_subsidy_cost=. total_subsidy_cost=0 total_loan_value=-25000 action_date=12/20/2016 action_date_fiscal_year=2017&lt;BR /&gt;period_perform_start=12/01/2016 awarding_agency_code=73 awarding_agency_name=SMALL BUSINESS ADMINISTRATION (SBA)&lt;BR /&gt;awarding_sub_agency_code=7300 awarding_sub_agency_name=SMALL BUSINESS ADMINISTRATION awarding_office_code=733510&lt;BR /&gt;awarding_office_name=&amp;nbsp; funding_agency_code=73 funding_agency_name=SMALL BUSINESS ADMINISTRATION (7300) funding_sub_agency_code=7300&lt;BR /&gt;funding_sub_agency_name=SMALL BUSINESS ADMINISTRATION funding_office_code=733510 funding_office_name=&amp;nbsp; recipient_duns=&lt;BR /&gt;recipient_name=KGS CONSTRUCTION SERVICES, INC. recipient_parent_name=&amp;nbsp; recipient_parent_duns=&amp;nbsp; recipient_country_code=USA&lt;BR /&gt;recipient_country_name=UNITED STATES recipient_address_line_1=10363 PIPER LN recipient_address_line_2=&amp;nbsp; recipient_city_name=MANASSAS&lt;BR /&gt;recipient_county_code=683 recipient_county_name=MANASSAS CITY recipient_state_code=VA recipient_state_name=VIRGINIA&lt;BR /&gt;recipient_zip_code=20110 recipient_zip_last_4_code=2053 recipient_foreign_city_name=&amp;nbsp; recipient_foreign_province_name=&lt;BR /&gt;recipient_foreign_postal_code=&amp;nbsp; cfda_number=59.016 cfda_title=SURETY BOND GUARANTEES assistance_type_code=11&lt;BR /&gt;assistance_type_description=&amp;nbsp; award_description=PARKING GARAGE REPAIRS business_funds_indicator_code=NON bus_funds_indicator_desc=&lt;BR /&gt;business_types_code=23 business_types_description=&amp;nbsp; correction_delete_indicator_code=&amp;nbsp; correction_delete_indicator_desc=&lt;BR /&gt;action_type_code=A action_type_description=&amp;nbsp; record_type_code=2 record_type_description=&amp;nbsp; recipient_city_code=&amp;nbsp; new_date=. _ERROR_=1&lt;BR /&gt;_N_=20&lt;BR /&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; missing values.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 151235 at 28:12&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 19:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/problem-with-dates/m-p/622531#M77281</guid>
      <dc:creator>Badjuju</dc:creator>
      <dc:date>2020-02-05T19:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: problem with dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/problem-with-dates/m-p/622537#M77282</link>
      <description>&lt;P&gt;You only use the INPUT function if the data variable you are trying to convert is character. In your case it is numeric and already a SAS date. If you want to assign your date to a new date variable this will do it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;new_date = action_date;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Feb 2020 19:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/problem-with-dates/m-p/622537#M77282</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-02-05T19:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: problem with dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/problem-with-dates/m-p/622538#M77283</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/228445"&gt;@Badjuju&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;@As action_date is already a SAS date, there is no need to use the input function and create a new variable to then delete the first one.&lt;/P&gt;
&lt;P&gt;I think you can simply apply the new format to action_date:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.fy17_usa_p_test;
set work.fy17_usa_p;
format action_date yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Feb 2020 19:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/problem-with-dates/m-p/622538#M77283</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-05T19:39:51Z</dc:date>
    </item>
  </channel>
</rss>

