<?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 make sas read 3 last digit in a csv column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/799765#M314507</link>
    <description>&lt;P&gt;If it is sure of 4 digits, I think you can use the substr function to get the second and subsequent characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename txt temp;
data _null_;
  file txt;
  put '1234';
  put '5678';
  put '9012';
run;

data want;
  infile txt dsd;
  length num 8 lastdgt $3;
  input num;
  lastdgt=substr(strip(put(num,best.)),2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 03 Mar 2022 07:24:16 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2022-03-03T07:24:16Z</dc:date>
    <item>
      <title>how to make sas read 3 last digit in a csv column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/799758#M314500</link>
      <description>&lt;P&gt;Hi All! I have a CSV table and one of them contains 4 digit numbers. However, in that column, I just need the 3 last digits for analysis. How do I make SAS read-only the 3 last digits?&lt;/P&gt;&lt;P&gt;Thank you in advance for your answer&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 07:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/799758#M314500</guid>
      <dc:creator>Meeru</dc:creator>
      <dc:date>2022-03-03T07:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to make sas read 3 last digit in a csv column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/799763#M314505</link>
      <description>&lt;P&gt;Use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;substr(string,length(string)-2)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Mar 2022 07:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/799763#M314505</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-03T07:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to make sas read 3 last digit in a csv column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/799765#M314507</link>
      <description>&lt;P&gt;If it is sure of 4 digits, I think you can use the substr function to get the second and subsequent characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename txt temp;
data _null_;
  file txt;
  put '1234';
  put '5678';
  put '9012';
run;

data want;
  infile txt dsd;
  length num 8 lastdgt $3;
  input num;
  lastdgt=substr(strip(put(num,best.)),2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Mar 2022 07:24:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/799765#M314507</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-03-03T07:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to make sas read 3 last digit in a csv column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/799783#M314521</link>
      <description>You can't.  However you can read all 4 digits and then calculate the contents of the last 3.  Assuming you are dealing with integers only, and assuming you read the value into a numeric variable, you could use &lt;BR /&gt;&lt;BR /&gt;last3 = mod(var, 1000);&lt;BR /&gt;&lt;BR /&gt;If those assumptions are wrong, the solution would change.</description>
      <pubDate>Thu, 03 Mar 2022 09:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/799783#M314521</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-03-03T09:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to make sas read 3 last digit in a csv column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/802742#M316055</link>
      <description>&lt;P&gt;Thank you everyone!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 06:57:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-sas-read-3-last-digit-in-a-csv-column/m-p/802742#M316055</guid>
      <dc:creator>Meeru</dc:creator>
      <dc:date>2022-03-18T06:57:38Z</dc:date>
    </item>
  </channel>
</rss>

