<?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: how to import a year into sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-a-year-into-sas/m-p/447426#M112394</link>
    <description>&lt;P&gt;Use of the YEAR format with value that only contains a year such as 2018 is going to yield incorrect results.&lt;/P&gt;
&lt;P&gt;Please see:&lt;/P&gt;
&lt;PRE&gt;data junk;
   year = 2018;
run;
proc print data=junk;
   var year;
   format year year4.;
run;&lt;/PRE&gt;
&lt;P&gt;Which displays 1965 because a SAS date value is number of days from 1Jan1960 and 2,018 days from then is in 1965.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With values with only 4 digits you might want to use either F4. or best4. format.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Mar 2018 14:35:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-03-21T14:35:25Z</dc:date>
    <item>
      <title>how to import a year into sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-a-year-into-sas/m-p/447365#M112367</link>
      <description>&lt;P&gt;I am trying to import&amp;nbsp;&lt;STRONG&gt;'&lt;FONT face="Courier New" size="2"&gt;earliest_filing_year&lt;/FONT&gt;'&lt;/STRONG&gt; and &amp;nbsp;&lt;STRONG&gt;'earliest_publn_year&lt;/STRONG&gt;'&amp;nbsp;from a&amp;nbsp;.csv file into SAS by following codes.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SASDATA.TechnicalField ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'R:/Li/PATSTAT/TechnicalField.csv'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DLM&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;','&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DSD&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;missover&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;lrecl&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;32767&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;firstobs&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; appln_id :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; appln_auth :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$29.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; appln_nr :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$29.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; appln_kind :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$29.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; appln_filing_date :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YYMMDD10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; appln_filing_year :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YEAR10.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;appln_nr_epodoc :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; appln_nr_original :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$150.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ipr_type :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$29.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; internat_appln_id :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; int_phase :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$29.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; reg_phase :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$29.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; nat_phase :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$29.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;earliest_filing_date :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YYMMDD10.&lt;/FONT&gt;&lt;U&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; earliest_filing_year :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;yyyy.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;FONT face="Courier New" size="2"&gt; earliest_filing_id :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; earliest_publn_date :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YYMMDD10.&lt;/FONT&gt;&lt;U&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; earliest_publn_year :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;yyyy.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;earliest_pat_publn_id :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; granted :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; docdb_family_id :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; inpadoc_family_id :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; docdb_family_size :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; nb_citing_docdb_fam :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;nb_applicants :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; nb_inventors :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;29.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; appln_filing_date :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YYMMDDd10.&lt;/FONT&gt;&lt;U&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; appln_filing_year :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YEAR10.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;FONT face="Courier New" size="2"&gt; earliest_filing_date :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YYMMDDd10.&lt;/FONT&gt;&lt;U&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; earliest_filing_year :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YEAR10.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;earliest_publn_date :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YYMMDDd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; earliest_publn_year :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YEAR10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;I try to use YEAR. and yyyy. to import&amp;nbsp;the attribute&amp;nbsp;but the log shows that&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;'ERROR 48-59: The informat YEAR was not found or could not be loaded.' and '&lt;/P&gt;&lt;P&gt;ERROR 48-59: The informat YYYY was not found or could not be loaded'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;the domain of the attribute is a '4 digits in the form yyyy (e.g. 2015)&lt;/U&gt;&lt;/P&gt;&lt;P&gt;what should&amp;nbsp;I do for it? thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 10:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-a-year-into-sas/m-p/447365#M112367</guid>
      <dc:creator>France</dc:creator>
      <dc:date>2018-03-21T10:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to import a year into sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-a-year-into-sas/m-p/447386#M112375</link>
      <description>&lt;P&gt;A year on its own is just a number, so import it as that (without any informat).&lt;/P&gt;
&lt;P&gt;The messages just tell you that such &lt;STRONG&gt;in&lt;/STRONG&gt;formats do not exist. (there is a format - note the missing "in" - year., but there is no format yyyy. at all).&lt;/P&gt;
&lt;P&gt;Try these two statements:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input
  appln_id :29.
  appln_auth :$29.
  appln_nr :$29.
  appln_kind :$29.
  appln_filing_date :YYMMDD10.
  appln_filing_year :YEAR10.
  appln_nr_epodoc :$50.
  appln_nr_original :$150.
  ipr_type :$29.
  internat_appln_id :29.
  int_phase :$29.
  reg_phase :$29.
  nat_phase :$29.
  earliest_filing_date :YYMMDD10.
  earliest_filing_year
  earliest_filing_id :29.
  earliest_publn_date :YYMMDD10.
  earliest_publn_year
  earliest_pat_publn_id :29.
  granted :29.
  docdb_family_id :29.
  inpadoc_family_id :29.
  docdb_family_size :29.
  nb_citing_docdb_fam :29.
  nb_applicants :29.
  nb_inventors :29.
;
format
  appln_filing_date YYMMDDd10.
  appln_filing_year YEAR10.
  earliest_filing_date YYMMDDd10.
  earliest_publn_date :YYMMDDd10.
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Mar 2018 12:00:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-a-year-into-sas/m-p/447386#M112375</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-21T12:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to import a year into sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-a-year-into-sas/m-p/447426#M112394</link>
      <description>&lt;P&gt;Use of the YEAR format with value that only contains a year such as 2018 is going to yield incorrect results.&lt;/P&gt;
&lt;P&gt;Please see:&lt;/P&gt;
&lt;PRE&gt;data junk;
   year = 2018;
run;
proc print data=junk;
   var year;
   format year year4.;
run;&lt;/PRE&gt;
&lt;P&gt;Which displays 1965 because a SAS date value is number of days from 1Jan1960 and 2,018 days from then is in 1965.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With values with only 4 digits you might want to use either F4. or best4. format.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 14:35:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-a-year-into-sas/m-p/447426#M112394</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-21T14:35:25Z</dc:date>
    </item>
  </channel>
</rss>

