<?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 Transposing rows to columns creates a variable name which is numeric in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442851#M28580</link>
    <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone provide any help with the following issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have dataset which is based on rows of information that I need to transpose into columns. The issue is that rows look like this initially;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Rows&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I transform the data I get the following;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;TD&gt;A4&lt;/TD&gt;&lt;TD&gt;G5&lt;/TD&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The all numeric values in the rows are actual errors so when I transpose them I'd like to fix any column which begins with a numeric value as issue_4. issue_5 etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 12:26:56 GMT</pubDate>
    <dc:creator>Sean_OConnor</dc:creator>
    <dc:date>2018-03-06T12:26:56Z</dc:date>
    <item>
      <title>Transposing rows to columns creates a variable name which is numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442851#M28580</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone provide any help with the following issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have dataset which is based on rows of information that I need to transpose into columns. The issue is that rows look like this initially;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Rows&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I transform the data I get the following;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;TD&gt;A4&lt;/TD&gt;&lt;TD&gt;G5&lt;/TD&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The all numeric values in the rows are actual errors so when I transpose them I'd like to fix any column which begins with a numeric value as issue_4. issue_5 etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 12:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442851#M28580</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2018-03-06T12:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing rows to columns creates a variable name which is numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442862#M28581</link>
      <description>&lt;P&gt;There is no option as far as I remember, but just do it in a datastep before:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  if lengthn(compress(rows,'','kd))=0 then rows=cats("issue_",rows);
run;&lt;/PRE&gt;
&lt;P&gt;Assumes length of rows is long enough.&amp;nbsp; Then transpose the result.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 12:55:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442862#M28581</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-06T12:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing rows to columns creates a variable name which is numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442876#M28588</link>
      <description>&lt;P&gt;Easiest would be to place "issue_" in front of all names, not just the numeric ones.&amp;nbsp; PROC TRANsPOSE supports this option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;prefix=issue_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 13:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442876#M28588</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-06T13:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing rows to columns creates a variable name which is numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442879#M28589</link>
      <description>&lt;P&gt;You can add prefix 'ISSUE_' before transposing it.&lt;/P&gt;
&lt;P&gt;And make sure your X variable is long enough to hold 'issue_'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x $;
if notdigit(strip(x))=0 then x=cats('issue_',x);
cards;
A1
A4
G5
X
4
5
;
proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Mar 2018 13:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442879#M28589</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-03-06T13:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing rows to columns creates a variable name which is numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442886#M28590</link>
      <description>&lt;P&gt;Thanks K this works a treat. However, I left one key thing out in my opening post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have a row with a value called 3X which creates issues also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I amend the great piece of code below to search for any value which begins with number. Anything which starts with a number is incorrect e.g. A1 would be a valid entry but 1A wouldn't hence 1A would be changed to issue_1A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any input would be great.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 14:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442886#M28590</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2018-03-06T14:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing rows to columns creates a variable name which is numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442903#M28591</link>
      <description>&lt;P&gt;It's &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;'s idea, so give him the credit.&amp;nbsp; Here's a method I have been waiting for an opportunity to use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; ('0' &amp;lt;=: &lt;SPAN class="token function"&gt;strip&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="token punctuation"&gt;) &amp;lt;=: '9') &lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; x&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;cats&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'issue_'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;x&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 14:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/442903#M28591</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-06T14:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing rows to columns creates a variable name which is numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/443232#M28619</link>
      <description>&lt;P&gt;That would be simpler .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x $;
if anydigit(strip(x))=1 then x=cats('issue_',x);
cards;
A1
A4
G5
X
4
5
3X 
;
proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Mar 2018 10:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transposing-rows-to-columns-creates-a-variable-name-which-is/m-p/443232#M28619</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-03-07T10:18:10Z</dc:date>
    </item>
  </channel>
</rss>

