<?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: How to change value name when re-structuring data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-value-name-when-re-structuring-data/m-p/699379#M213955</link>
    <description>&lt;P&gt;Thanks for posting a nice example dataset.&lt;/P&gt;
&lt;P&gt;Do the transposition from wide to long with PROC TRANSPOSE, and use an informat for the conversion:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose
  data=swimminutes
  out=long (rename=(col1=minutes))
;
by name age;
var mon--wed;
run;

proc format;
invalue myweekday
  "Mon" = 1
  "Tue" = 2
  "Wed" = 3
;
run;

data want;
set long;
day = input(_name_,myweekday.);
drop _name_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 17 Nov 2020 07:45:16 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-11-17T07:45:16Z</dc:date>
    <item>
      <title>How to change value name when re-structuring data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-value-name-when-re-structuring-data/m-p/699376#M213954</link>
      <description>&lt;P&gt;Hi SAS Communities,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the end of my data, in the variable of Day, I would like to change Mon to 1, Tue to 2, and Wed to 3. Do you mind telling me what I can code to change it? I tried to use If/Else if statement but it doesn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	WORK.SwimLong2;
	SET	WORK.SwimMinutes;
	KEEP	Name Age Day Minutes;

	ARRAY	Date {3} $3 _TEMPORARY_	('Mon', 'Tue', 'Wed');
	ARRAY	Time {3}	Mon -- Wed;

	DO	i = 1 TO DIM(Time);
		Day	= Date{i};
		Minutes	= Time{i};
		OUTPUT	WORK.SwimLong2;
		
	END;

	RUN;

PROC PRINT DATA = WORK.SwimLong2;
	RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="This is how my output look like. I would like to change Mon to 1, Tue to 2 and Wed to 3." style="width: 258px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51749i2D74AEDBA25234DC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Snap1.jpg" alt="This is how my output look like. I would like to change Mon to 1, Tue to 2 and Wed to 3." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;This is how my output look like. I would like to change Mon to 1, Tue to 2 and Wed to 3.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Valerie&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 04:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-value-name-when-re-structuring-data/m-p/699376#M213954</guid>
      <dc:creator>valerieyim</dc:creator>
      <dc:date>2020-12-12T04:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to change value name when re-structuring data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-value-name-when-re-structuring-data/m-p/699379#M213955</link>
      <description>&lt;P&gt;Thanks for posting a nice example dataset.&lt;/P&gt;
&lt;P&gt;Do the transposition from wide to long with PROC TRANSPOSE, and use an informat for the conversion:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose
  data=swimminutes
  out=long (rename=(col1=minutes))
;
by name age;
var mon--wed;
run;

proc format;
invalue myweekday
  "Mon" = 1
  "Tue" = 2
  "Wed" = 3
;
run;

data want;
set long;
day = input(_name_,myweekday.);
drop _name_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Nov 2020 07:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-value-name-when-re-structuring-data/m-p/699379#M213955</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-17T07:45:16Z</dc:date>
    </item>
  </channel>
</rss>

