<?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 How to cut out a part of text in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-cut-out-a-part-of-text/m-p/760849#M240652</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've a text variable that looks like this:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;period&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;2019-01-01T15:00:00.0/2019-01-01T16:00:00.0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;2019-01-01T16:00:00.0/2019-01-01T17:00:00.0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;but I'd like to exclude first part of this text to the 2 new vars (date in yymmdd10. format and hour as intg) like bellow:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;period&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;date&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;hour&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;2019-01-01T15:00:00.0/2019-01-01T16:00:00.0&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;2019-01-01&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;2019-01-01T16:00:00.0/2019-01-01T17:00:00.0&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;2019-01-01&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;16&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;How can I achieve this one?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 07:41:44 GMT</pubDate>
    <dc:creator>PatrykSAS</dc:creator>
    <dc:date>2021-08-11T07:41:44Z</dc:date>
    <item>
      <title>How to cut out a part of text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-cut-out-a-part-of-text/m-p/760849#M240652</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've a text variable that looks like this:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;period&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;2019-01-01T15:00:00.0/2019-01-01T16:00:00.0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;2019-01-01T16:00:00.0/2019-01-01T17:00:00.0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;but I'd like to exclude first part of this text to the 2 new vars (date in yymmdd10. format and hour as intg) like bellow:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;period&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;date&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;hour&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;2019-01-01T15:00:00.0/2019-01-01T16:00:00.0&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;2019-01-01&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;2019-01-01T16:00:00.0/2019-01-01T17:00:00.0&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;2019-01-01&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;16&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;How can I achieve this one?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 07:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-cut-out-a-part-of-text/m-p/760849#M240652</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-08-11T07:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to cut out a part of text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-cut-out-a-part-of-text/m-p/760853#M240655</link>
      <description>&lt;P&gt;Ok, I've done simple substr and it works&lt;/P&gt;
&lt;P&gt;input(substr(t1.__Observation_period,1,10),yymmdd10.)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 07:54:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-cut-out-a-part-of-text/m-p/760853#M240655</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-08-11T07:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to cut out a part of text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-cut-out-a-part-of-text/m-p/760858#M240658</link>
      <description>&lt;P&gt;The E8601DTw.d informat will read those values into a single datetime variable as well if of interest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might also test what happens without the Substr and just use&lt;/P&gt;
&lt;P&gt;input(t1.__Observation_period,yymmdd10.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The length on an informat controls how many characters are read. This is "nice" data where the first 10 characters are in a common layout, no 1 digit month or day of month values.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 08:13:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-cut-out-a-part-of-text/m-p/760858#M240658</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-11T08:13:30Z</dc:date>
    </item>
  </channel>
</rss>

