<?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: Proc Transpose issue with Name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312853#M312978</link>
    <description>&lt;P&gt;Hi Jag - thanks for the suggestion; unfortunately, it didn't work. I keep seeing Name of Former Variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 20 Nov 2016 01:47:57 GMT</pubDate>
    <dc:creator>KDS_1113</dc:creator>
    <dc:date>2016-11-20T01:47:57Z</dc:date>
    <item>
      <title>Proc Transpose issue with Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312848#M312976</link>
      <description>&lt;P&gt;I have a dataset I'd like to transpose:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5915iE4401718C1FFB54F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="gep2.PNG" title="gep2.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code and get the table below:&lt;/P&gt;&lt;PRE&gt;proc transpose data=gep2
out=gep3
NAME=Year;
id countrycode;
var _2001-_2018;
run;&lt;/PRE&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5917i47E720046E4B4C61/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="gep3.PNG" title="gep3.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Isn't NAME=Year supposed to rename my first column? If not, what is the best way to rename this variable?&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 01:06:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312848#M312976</guid>
      <dc:creator>KDS_1113</dc:creator>
      <dc:date>2016-11-20T01:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose issue with Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312852#M312977</link>
      <description>You could use rename option like below&lt;BR /&gt;&lt;BR /&gt;proc transpose data=gep2 out=gep3(rename=(_NAME_=Year));&lt;BR /&gt;id countrycode;&lt;BR /&gt;var _2001-_2018;&lt;BR /&gt;run;</description>
      <pubDate>Sun, 20 Nov 2016 01:42:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312852#M312977</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-11-20T01:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose issue with Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312853#M312978</link>
      <description>&lt;P&gt;Hi Jag - thanks for the suggestion; unfortunately, it didn't work. I keep seeing Name of Former Variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 01:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312853#M312978</guid>
      <dc:creator>KDS_1113</dc:creator>
      <dc:date>2016-11-20T01:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose issue with Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312858#M312979</link>
      <description>&lt;PRE&gt;
Your code is right.
What you saw is LABEL not variable NAME.
Right click the table and check column attribution .


&lt;/PRE&gt;</description>
      <pubDate>Sun, 20 Nov 2016 02:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312858#M312979</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-20T02:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose issue with Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312863#M312980</link>
      <description>&lt;P&gt;Thanks, when i do a proc print it does show up correctly; however, when i try plotting I gett the same "Name of Former Variable"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5918i0255FDCD4DF69CBD/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="gepplot.PNG" title="gepplot.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 03:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312863#M312980</guid>
      <dc:creator>KDS_1113</dc:creator>
      <dc:date>2016-11-20T03:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose issue with Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312866#M312981</link>
      <description>&lt;P&gt;Change the label, either in your proc print, graphing procedure, data step or proc datasets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;label year = 'Year';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm surprised your graph is correct, since you have a categorical/character variable. You may want to consider switching it to a numeric variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your transpose is simple, perhaps consider a data step to transpose instead to move to a fully long solution? It would be easier to create graphs and such using GROUP or BY option but I'm not sure what you're doing later on. Untested because you haven't posted sample data in text form and I'm not typing out data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

array yrs(*) _2001-_2018;

do i=1 to dim(yrs);
Value = yrs(i);
Year=input(compress(vname(yrs(i)), , 'kd'), 8.);
output;
end;


drop _2001 - _2018;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your graphing procedure would then be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=want;
series x=year y=value/group=countryName;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In general, the graphs from SGPLOT are of better quality than SAS/GRAPH procedures.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 05:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312866#M312981</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-20T05:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose issue with Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312932#M312982</link>
      <description>&lt;P&gt;Another way to switch to long format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=gep2
	out=gep3
	NAME=YearStr;
by CountryName CountryCode notsorted;
var _2001-_2018;
run;

data gep4;
set gep3;
Year = input(substr(yearStr, 2), 4.0);
rename col1=Value;
drop yearStr _name_;
run;

proc sgplot data=gep4;
series x=year y=value / group=CountryName;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 22:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-issue-with-Name/m-p/312932#M312982</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-11-20T22:03:38Z</dc:date>
    </item>
  </channel>
</rss>

