<?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: Rename name of column to certain number in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269951#M9651</link>
    <description>Thank you. It works!!!!</description>
    <pubDate>Thu, 12 May 2016 04:04:06 GMT</pubDate>
    <dc:creator>bigban777</dc:creator>
    <dc:date>2016-05-12T04:04:06Z</dc:date>
    <item>
      <title>Rename name of column to certain number</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269925#M9647</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am doing project about glucose levels after meal.&lt;/P&gt;&lt;P&gt;i transposed matrix&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA glucose1;
set missqlucose (firstobs = 1 obs = 6);
run;

PROC TRANSPOSE data=glucose1 out=gtrans1 name=time prefix=p;
VAR g1-g10;
run;

PROC PRINT DATA= gtrans1;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and i got that table&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3130i3E624A5EB63BB362/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="к.PNG" title="к.PNG" /&gt;&lt;/P&gt;&lt;P&gt;So, here p1....p6 different lines on graph, where g1-g10 is X-axis and values in table is Y-axis.&lt;/P&gt;&lt;P&gt;Example for p1-line x=g1, y=4.90.&lt;/P&gt;&lt;P&gt;Moreovere, I need change g1....g10 to certain number(time):&lt;/P&gt;&lt;P&gt;g1=-15;&lt;BR /&gt;g2=0;&lt;BR /&gt;g3=30;&lt;BR /&gt;g4=60;&lt;BR /&gt;g5=90;&lt;BR /&gt;g6=120;&lt;BR /&gt;g7=180;&lt;BR /&gt;g8=240;&lt;BR /&gt;g9=300;&lt;BR /&gt;g10=360;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So when i tried plot graph&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC GPLOT DATA = gtrans2;
TITLE 'Figure1 Glucose level after 10:00a.m';
PLOT 
p1*time=3
p2*time=3
p3*time=3
p4*time=3
p5*time=3
p6*time=3
/overlay frame
	 haxis=-15 to 400 
	 vaxis= 3 to 10 by 1
	 vref=0
		lhref=25;
	 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And i got this&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3129i9C7A6EAE7AAB7071/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Снимок.PNG" title="Снимок.PNG" /&gt;&lt;/P&gt;&lt;P&gt;So, question: How rename g1...g10 to time(certain numbers) and plot the graph for that numbers?&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 01:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269925#M9647</guid>
      <dc:creator>bigban777</dc:creator>
      <dc:date>2016-05-12T01:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rename name of column to certain number</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269929#M9648</link>
      <description>&lt;P&gt;Since your time intervals aren't equal you can't apply a format, you need to recode the values. You can recode either via if/then, select, or the input function with a custom format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest an if/then or a select if your just learning SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some examples of recording using if/then&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/modules/vars.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/modules/vars.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here's an example of Select (and another if/then)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/library/SASTranMan_os.html#SELECT%20case%20distinction" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/library/SASTranMan_os.html#SELECT%20case%20distinction&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 02:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269929#M9648</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-12T02:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rename name of column to certain number</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269933#M9649</link>
      <description>&lt;P&gt;I use your recomendations&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA gtrans2;
SET gtrans1;

IF (time='g1' )  THEN time = -15;
IF (time='g2' )  THEN time = 0;
IF (time='g3' )  THEN time = 30;
IF (time='g4' )  THEN time = 60;
IF (time='g5' )  THEN time = 90;
IF (time='g6' )  THEN time = 120;
IF (time='g7' )  THEN time = 180;
IF (time='g8' )  THEN time = 240;
IF (time='g9' )  THEN time = 300;
IF (time='g10')  THEN time = 360;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but now, when i use gplot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC GPLOT DATA = gtrans2 sort by time;
TITLE 'Figure1 Glucose level after 10:00a.m';
PLOT 
p1*time=3
p2*time=3
p3*time=3
p4*time=3
p5*time=3
p6*time=3
/overlay frame
	 haxis=-15 to 400 by 15 
	 vaxis= 3 to 10 by 1
	 vref=0
		lhref=25;
	 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;i got this;&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/3131iEEF87A8E6BDCD7E4/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Снимок.PNG" title="Снимок.PNG" /&gt;&lt;/P&gt;&lt;P&gt;so, i got following problems:&lt;/P&gt;&lt;P&gt;1) They have same length interval (but should be different&lt;/P&gt;&lt;P&gt;2) not sorted&lt;/P&gt;&lt;P&gt;3) i need interval 15, so: -15 0 15 30 45 ......Although i have for -15, 0, &amp;nbsp; &amp;nbsp;but no data for 15, 'cause next one is 30. So line should be &amp;nbsp; &amp;nbsp; from 0 to 30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 02:40:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269933#M9649</guid>
      <dc:creator>bigban777</dc:creator>
      <dc:date>2016-05-12T02:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rename name of column to certain number</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269947#M9650</link>
      <description>&lt;P&gt;READ THE LOG.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you reused a variable that already existed - Time - which looks like it was a character. Do you have a note in your log about conversion from numeric to character or something of the sort?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since Time is still character it's not sorting numerically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new variable, TIME2,&amp;nbsp;that is numeric and use that variable in your graphing procedure instead.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you should use if/else if instead of multiple if's. It helps to speed it up, since as soon as one condition is met it stops checking th rest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA gtrans2;
SET gtrans1;

IF (time='g1' )  THEN time2 = -15;
else IF (time='g2' )  THEN time2 = 0;
else IF (time='g3' )  THEN time2 = 30;

*rest of code follows similar format;


run;&lt;/CODE&gt;&lt;/PRE&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>Thu, 12 May 2016 03:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269947#M9650</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-12T03:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rename name of column to certain number</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269951#M9651</link>
      <description>Thank you. It works!!!!</description>
      <pubDate>Thu, 12 May 2016 04:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Rename-name-of-column-to-certain-number/m-p/269951#M9651</guid>
      <dc:creator>bigban777</dc:creator>
      <dc:date>2016-05-12T04:04:06Z</dc:date>
    </item>
  </channel>
</rss>

