<?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: Import character date field in YYYY-Q1 format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727616#M226340</link>
    <description>&lt;P&gt;Ngā mihi&amp;nbsp;maioha&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 00:50:31 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2021-03-19T00:50:31Z</dc:date>
    <item>
      <title>Import character date field in YYYY-Q1 format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727604#M226329</link>
      <description>&lt;P&gt;I have a MS SQL-Server table that contains a character field with date values representing a quarter year with the format YYYY-Q1.&amp;nbsp; The SAS provided informat YYQ. won't work because the field contains a hyphen (-) between the year and the quarter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried creating a picture informat, but with no success.&lt;/P&gt;
&lt;P&gt;proc format;&lt;/P&gt;
&lt;P&gt;picture yyqtr&lt;BR /&gt;low-high = "%Y-Q%q" (DATATYPE=datetime);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 00:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727604#M226329</guid>
      <dc:creator>Jim_Cooper_hmsa</dc:creator>
      <dc:date>2021-03-19T00:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Import character date field in YYYY-Q1 format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727608#M226332</link>
      <description>&lt;P&gt;Use COMPRESS() to remove the -?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;want = input(compress(var, "-"), YYQ6.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1597"&gt;@Jim_Cooper_hmsa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a MS SQL-Server table that contains a character field with date values representing a quarter year with the format YYYY-Q1.&amp;nbsp; The SAS provided informat YYQ. won't work because the field contains a hyphen (-) between the year and the quarter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried creating a picture informat, but with no success.&lt;/P&gt;
&lt;P&gt;proc format;&lt;/P&gt;
&lt;P&gt;picture yyqtr&lt;BR /&gt;low-high = "%Y-Q%q" (DATATYPE=datetime);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 00:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727608#M226332</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-19T00:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Import character date field in YYYY-Q1 format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727611#M226335</link>
      <description>&lt;P&gt;The &lt;EM&gt;picture &lt;/EM&gt;syntax is only for formats.&lt;/P&gt;
&lt;P&gt;If you want to create an informat, this works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  invalue nodash 's/-//' (regexpe)=[yyq6.];
data T;
  DATE=input('2020-Q1',nodash7.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 00:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727611#M226335</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-03-19T00:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Import character date field in YYYY-Q1 format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727613#M226337</link>
      <description>&lt;P&gt;Chris,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is very cool.&amp;nbsp; I think that I was approaching the problem from the wrong direction.&amp;nbsp; i should have been looking for an INVALUE solution instead of a PICTURE solution,&amp;nbsp; This is awesome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mahalo Nui&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 00:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727613#M226337</guid>
      <dc:creator>Jim_Cooper_hmsa</dc:creator>
      <dc:date>2021-03-19T00:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Import character date field in YYYY-Q1 format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727616#M226340</link>
      <description>&lt;P&gt;Ngā mihi&amp;nbsp;maioha&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 00:50:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-character-date-field-in-YYYY-Q1-format/m-p/727616#M226340</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-03-19T00:50:31Z</dc:date>
    </item>
  </channel>
</rss>

