<?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: remove last 3 characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18515#M2788</link>
    <description>Here are a few options:&lt;BR /&gt;
data t;&lt;BR /&gt;
infile cards;&lt;BR /&gt;
input t $8.;&lt;BR /&gt;
length solution1 solution2 solution3 $5.;&lt;BR /&gt;
solution1=scan(t,1,':')||':'||scan(t,2,':');&lt;BR /&gt;
solution2=put(input(t,time8.),time5.);&lt;BR /&gt;
solution3=reverse(substr(reverse(trim(left(t))),4));&lt;BR /&gt;
cards;&lt;BR /&gt;
8:00:00&lt;BR /&gt;
7:45:00&lt;BR /&gt;
10:00:00&lt;BR /&gt;
;</description>
    <pubDate>Tue, 21 Jun 2011 19:31:47 GMT</pubDate>
    <dc:creator>p12937</dc:creator>
    <dc:date>2011-06-21T19:31:47Z</dc:date>
    <item>
      <title>remove last 3 characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18514#M2787</link>
      <description>I want to remove the last 3 characters (i.e. :00) from a variable.&lt;BR /&gt;
For example, how do I change these 3 observations:&lt;BR /&gt;
8:00:00&lt;BR /&gt;
7:45:00&lt;BR /&gt;
10:00:00&lt;BR /&gt;
&lt;BR /&gt;
to this format &lt;BR /&gt;
8:00&lt;BR /&gt;
7:45&lt;BR /&gt;
10:00&lt;BR /&gt;
&lt;BR /&gt;
Thank you.</description>
      <pubDate>Tue, 21 Jun 2011 18:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18514#M2787</guid>
      <dc:creator>gzr2mz39</dc:creator>
      <dc:date>2011-06-21T18:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: remove last 3 characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18515#M2788</link>
      <description>Here are a few options:&lt;BR /&gt;
data t;&lt;BR /&gt;
infile cards;&lt;BR /&gt;
input t $8.;&lt;BR /&gt;
length solution1 solution2 solution3 $5.;&lt;BR /&gt;
solution1=scan(t,1,':')||':'||scan(t,2,':');&lt;BR /&gt;
solution2=put(input(t,time8.),time5.);&lt;BR /&gt;
solution3=reverse(substr(reverse(trim(left(t))),4));&lt;BR /&gt;
cards;&lt;BR /&gt;
8:00:00&lt;BR /&gt;
7:45:00&lt;BR /&gt;
10:00:00&lt;BR /&gt;
;</description>
      <pubDate>Tue, 21 Jun 2011 19:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18515#M2788</guid>
      <dc:creator>p12937</dc:creator>
      <dc:date>2011-06-21T19:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: remove last 3 characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18516#M2789</link>
      <description>What type is your variable? Numeric or Character?&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data t;&lt;BR /&gt;
infile cards;&lt;BR /&gt;
input t $8.;&lt;BR /&gt;
time=put(input(t,time8.),hhmm5.);&lt;BR /&gt;
cards;&lt;BR /&gt;
8:00:00&lt;BR /&gt;
7:45:00&lt;BR /&gt;
10:00:00&lt;BR /&gt;
; &lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 22 Jun 2011 01:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18516#M2789</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-22T01:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: remove last 3 characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18517#M2790</link>
      <description>Numeric.&lt;BR /&gt;
Your response and p12937's response were very helpful.&lt;BR /&gt;
Thank you.</description>
      <pubDate>Wed, 22 Jun 2011 15:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18517#M2790</guid>
      <dc:creator>gzr2mz39</dc:creator>
      <dc:date>2011-06-22T15:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: remove last 3 characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18518#M2791</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
If the type is numeric then assigning another format like Ksharp showed would do:&lt;BR /&gt;
&lt;BR /&gt;
format time hhmm5.;&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Thu, 23 Jun 2011 01:40:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-last-3-characters/m-p/18518#M2791</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-06-23T01:40:26Z</dc:date>
    </item>
  </channel>
</rss>

