<?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: Increment a Character and Numeric Value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229038#M41409</link>
    <description>&lt;P&gt;Hi.&amp;nbsp; In the second data step, you are giving the variable X a length of 4.&amp;nbsp; That means you would use a Z3. format ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data want (keep=x name sex);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;length x $4.;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;set sashelp.class;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;x = catt('T',put(_n_,z3.));&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;If you really want&amp;nbsp; to figure out whether the format should be Z2., Z3., etc., you could use (less overkill, but still overkill) ...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&lt;BR /&gt;data want (keep=x name sex);&lt;BR /&gt;length x $4.;&lt;BR /&gt;set sashelp.class nobs=obs;&lt;BR /&gt;x = catt('T',putn(_n_,catt('Z',length(cat(obs)),'.')));&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Oct 2015 23:35:08 GMT</pubDate>
    <dc:creator>MikeZdeb</dc:creator>
    <dc:date>2015-10-07T23:35:08Z</dc:date>
    <item>
      <title>Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228988#M41391</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create a variable that contains a letter and an incremented numeric value (e.g T1, T2, T3,...Tn).&amp;nbsp;Does it have to be in a certain format?&amp;nbsp;I have tired everything I know, but can't seem to figure it out. I am sure it is super simple. Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 19:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228988#M41391</guid>
      <dc:creator>wil1212</dc:creator>
      <dc:date>2015-10-07T19:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228989#M41392</link>
      <description>&lt;P&gt;You haven't specified how you want it, but this may give you an idea:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Want;
do i=1 to 100;
Variable_Want=catt('T', put(i, 8. -l));
OUTPUT;
end;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Oct 2015 19:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228989#M41392</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-10-07T19:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228990#M41393</link>
      <description>&lt;P&gt;Hi, if you mean that T1, T2, etc. are&amp;nbsp;variable values, try this&amp;nbsp;(creates 100 observations, value T1 through T100)&amp;nbsp;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;length x $4.;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do _n_=1 to 100;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;x = catt('T',_n_);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;output;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;ps &amp;nbsp;CAT functions work fine with numeric variables. &amp;nbsp;The LOG (no nasty messages). &amp;nbsp;Also, always use a LENGTH statement when creating variables with CATT functions. &amp;nbsp;Otherwise you get the default length of 200.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;133 data want;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;134 length x $4.;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;135 do _n_=1 to 100;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;136 x = catt('T',_n_);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;137 output;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;138 end;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;139 run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set WORK.WANT has 100 observations and 1 variables.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:04:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228990#M41393</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-07T20:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228991#M41394</link>
      <description>Reminder: catt, cats, and catx functions do their own conversions of numbers to strings. So&lt;BR /&gt;&lt;BR /&gt;Variable_Want = cats("T", i);</description>
      <pubDate>Wed, 07 Oct 2015 20:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228991#M41394</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-07T20:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228992#M41395</link>
      <description>&lt;P&gt;Thanks so much. Another question, I do not want to set a limit in the do statement. I would like for it to equal the number of observations in my dataset. Can I exclude the "to 100" part?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228992#M41395</guid>
      <dc:creator>wil1212</dc:creator>
      <dc:date>2015-10-07T20:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228994#M41396</link>
      <description>Remove the loop portion entirely and use the automatic variable _N_. &lt;BR /&gt;&lt;BR /&gt;x = catt('T',_n_);&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228994#M41396</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-10-07T20:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228995#M41397</link>
      <description>&lt;P&gt;It can be even simpler than that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set myData;
x = cats("T", _n_);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228995#M41397</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-07T20:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228996#M41398</link>
      <description>&lt;P&gt;Hi, is this what you mean (use a LENGTH statement) ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data want (keep=x name sex);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;length x $4.;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;set sashelp.class;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;x = catt('T',_n_);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;data set WANT ...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Obs x Name Sex&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 T1 Alfred M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 2 T2 Alice F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 3 T3 Barbara F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 4 T4 Carol F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 5 T5 Henry M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 6 T6 James M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 7 T7 Jane F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 8 T8 Janet F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 9 T9 Jeffrey M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 10 T10 John M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 11 T11 Joyce F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 12 T12 Judy F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 13 T13 Louise F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 14 T14 Mary F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 15 T15 Philip M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 16 T16 Robert M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 17 T17 Ronald M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 18 T18 Thomas M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 19 T19 William M&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/228996#M41398</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-07T20:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229003#M41400</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;new_field = cat('T',_N_);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229003#M41400</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-10-07T20:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229030#M41406</link>
      <description>&lt;P&gt;If you want to&amp;nbsp;pad your alphanumeric ID with leading zeros to maintain sorting, you could do something like the snippet&amp;nbsp;below to detect the number of significant integer digits and generate a format out of it. This will avoid sorting output that looks like this:&amp;nbsp;T1, T10, T100, T11, T12, T13, etc.&amp;nbsp;&lt;img id="robothappy" class="emoticon emoticon-robothappy" src="https://communities.sas.com/i/smilies/16x16_robot-happy.png" alt="Robot Happy" title="Robot Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  SELECT LENGTH(CATT(COUNT(*)))                AS num_digits
       , CATS("z", calculated num_digits, ".") AS pad_zero_format
  INTO :num_digits, :pad_zero_format
  FROM sashelp.class;
quit;
%PUT &amp;amp;num_digits &amp;amp;pad_zero_format;


data want (keep=x name sex);
  length x $4.;
  set sashelp.class;
  x = catt('T',PUT(_n_, &amp;amp;pad_zero_format));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 22:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229030#M41406</guid>
      <dc:creator>hbi</dc:creator>
      <dc:date>2015-10-07T22:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229031#M41407</link>
      <description>&lt;P&gt;This is a bit overkill&amp;nbsp;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt; but if you want to go there, the variable length should also be macro driven:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  SELECT LENGTH(CATT(COUNT(*)))+1                  AS num_digits
       , CATS("z", calculated num_digits - 1, ".") AS pad_zero_format
  INTO :num_digits, :pad_zero_format
  FROM sashelp.class;
quit;
%PUT &amp;amp;num_digits &amp;amp;pad_zero_format;


data want (keep=x name sex);
  length x $&amp;amp;num_digits.;
  set sashelp.class;
  x = catt('T',PUT(_n_, &amp;amp;pad_zero_format));
run;

proc print data=want noobs; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Oct 2015 22:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229031#M41407</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-07T22:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229038#M41409</link>
      <description>&lt;P&gt;Hi.&amp;nbsp; In the second data step, you are giving the variable X a length of 4.&amp;nbsp; That means you would use a Z3. format ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data want (keep=x name sex);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;length x $4.;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;set sashelp.class;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;x = catt('T',put(_n_,z3.));&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;If you really want&amp;nbsp; to figure out whether the format should be Z2., Z3., etc., you could use (less overkill, but still overkill) ...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&lt;BR /&gt;data want (keep=x name sex);&lt;BR /&gt;length x $4.;&lt;BR /&gt;set sashelp.class nobs=obs;&lt;BR /&gt;x = catt('T',putn(_n_,catt('Z',length(cat(obs)),'.')));&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 23:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229038#M41409</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-07T23:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229079#M41416</link>
      <description>&lt;P&gt;May I ask why you need to do this? &amp;nbsp;It seems to me if you need to do calculations on the numeric part, and from your example the rest is just "T", I would personally drop the T completely, and convert the variable to numeric. &amp;nbsp;Much easier to work with, and if at some point you do need the T then add it on at report time. &amp;nbsp;No point having a text field just to store a number and a base character?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 09:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229079#M41416</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-10-08T09:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229130#M41429</link>
      <description>&lt;P&gt;Yes, a bit overkill &lt;img id="robothappy" class="emoticon emoticon-robothappy" src="https://communities.sas.com/i/smilies/16x16_robot-happy.png" alt="Robot Happy" title="Robot Happy" /&gt; ... but cool, nice!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229130#M41429</guid>
      <dc:creator>hbi</dc:creator>
      <dc:date>2015-10-08T14:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a Character and Numeric Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229197#M41452</link>
      <description>&lt;P&gt;To add to RW9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the variable is numeric you can use a PICTURE format to attach any prefix character needed when displayed in almost any report procedure output.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
picture t low-high = '00000009'   (prefix='T');
run;

data junk;
   input x;
datalines   ;
1
23
345
123456
;

proc print data=junk noobs;
var x;
format x t.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The format can handle decimals as well if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 22:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-a-Character-and-Numeric-Value/m-p/229197#M41452</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-08T22:19:39Z</dc:date>
    </item>
  </channel>
</rss>

