<?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: Substring for data in dataset and sql table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Substring-for-data-in-dataset-and-sql-table/m-p/366940#M87323</link>
    <description>&lt;P&gt;plz post it as text not picture, I don't want type it by hand.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And don't forget to post the output .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
x='CSTG_XXXXX_ARERT';
y=prxchange('s/^[a-z]+_|[a-z]$//i',-1,strip(x));
put x= y=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Jun 2017 13:15:41 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-06-14T13:15:41Z</dc:date>
    <item>
      <title>Substring for data in dataset and sql table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substring-for-data-in-dataset-and-sql-table/m-p/366882#M87307</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the guides and helps from fellow members here, i now can have data from dictionary in dataset by using this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set sashelp.vcolumn (where=(libname="CDSSTG"));

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, i want to remove the first 5 character from this column called memname and also remove the last character.&lt;/P&gt;&lt;P&gt;I did read up some guides for substr but if i want to apply it for the entire column in a dataset, may i know if i need to use loop?&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9412iE96B5D65A0495BF7/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="proc content substrs.PNG" title="proc content substrs.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need your guide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 09:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substring-for-data-in-dataset-and-sql-table/m-p/366882#M87307</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2017-06-14T09:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Substring for data in dataset and sql table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substring-for-data-in-dataset-and-sql-table/m-p/366885#M87308</link>
      <description>&lt;P&gt;Like:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; sashelp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;vcolumn &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;libname&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"CDSSTG"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  memname=substr(memname,6,lengthn(tmp)-6);
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 09:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substring-for-data-in-dataset-and-sql-table/m-p/366885#M87308</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-14T09:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Substring for data in dataset and sql table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substring-for-data-in-dataset-and-sql-table/m-p/366940#M87323</link>
      <description>&lt;P&gt;plz post it as text not picture, I don't want type it by hand.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And don't forget to post the output .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
x='CSTG_XXXXX_ARERT';
y=prxchange('s/^[a-z]+_|[a-z]$//i',-1,strip(x));
put x= y=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jun 2017 13:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substring-for-data-in-dataset-and-sql-table/m-p/366940#M87323</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-06-14T13:15:41Z</dc:date>
    </item>
  </channel>
</rss>

