<?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 values to variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611480#M18203</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/303426"&gt;@Melanie621&lt;/a&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 ID  date :mmddyy10. Measurement :$12. Value &amp;amp; $10.;
cards;
1 6/21/06 Weight 170 lbs
1 6/21/06 Height 196 cm
1 6/21/06 Systolic 110 mm/Hg
1 6/21/06 Diastolic 70 mm/Hg
1 7/25/06 Weight 171 lbs
1 7/25/06 Height 196 cm
1 7/25/06 Systolic 109 mm/Hg
1 7/25/06 Diastolic 72 mm/Hg
2 6/21/06 Weight 150 lbs
2 6/21/06 Height 190 cm
2 6/21/06 Systolic 105 mm/Hg
2 6/21/06 Diastolic 75 mm/Hg
;

data temp;
set have;
by id date;
if first.id then n=1;
else if first.date then n+1;
run;

proc transpose data=temp out=want(drop=_name_) delim=_;
by id ;
id  measurement n;
var value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Dec 2019 23:59:49 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-12-12T23:59:49Z</dc:date>
    <item>
      <title>How to change values to variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611475#M18202</link>
      <description>&lt;P&gt;I have a data set that has an odd arrangement&lt;BR /&gt;&lt;BR /&gt;It goes&lt;BR /&gt;&lt;BR /&gt;ID&amp;nbsp; date Measurement Value&lt;BR /&gt;1 6/21/06 Weight 170 lbs&lt;BR /&gt;1 6/21/06 Height 196 cm&lt;BR /&gt;1 6/21/06 Systolic 110 mm/Hg&lt;BR /&gt;1 6/21/06 Diastolic 70 mm/Hg&lt;/P&gt;&lt;P&gt;1 7/25/06 Weight 171 lbs&lt;BR /&gt;1 7/25/06 Height 196 cm&lt;BR /&gt;1 7/25/06 Systolic 109 mm/Hg&lt;BR /&gt;1 7/25/06 Diastolic 72 mm/Hg&lt;BR /&gt;2 6/21/06 Weight 150 lbs&lt;BR /&gt;2 6/21/06 Height 190 cm&lt;BR /&gt;2 6/21/06 Systolic 105 mm/Hg&lt;BR /&gt;2 6/21/06 Diastolic 75 mm/Hg&lt;BR /&gt;&lt;BR /&gt;I'd like it to be :&lt;BR /&gt;ID Date Weight&amp;nbsp; &amp;nbsp; Height&amp;nbsp; &amp;nbsp; Systolic&amp;nbsp; &amp;nbsp; &amp;nbsp;Diastolic&amp;nbsp; &amp;nbsp; &amp;nbsp;Date 2&amp;nbsp; Weight&amp;nbsp; &amp;nbsp;Height&amp;nbsp; &amp;nbsp;Systolic&amp;nbsp; &amp;nbsp; &amp;nbsp;Diastolic&lt;BR /&gt;1 6/21/06 170 lbs 196 cm 110 mm/Hg 70 mm/Hg&amp;nbsp; 7/25/06 171 lbs 196 cm&amp;nbsp; 109 mm/Hg 72 mm/Hg&lt;BR /&gt;2 6/21/06150 lbs 190 cm 105 mm/Hg 75 mm/Hg&lt;BR /&gt;&lt;BR /&gt;Is there a way to do this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 23:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611475#M18202</guid>
      <dc:creator>Melanie621</dc:creator>
      <dc:date>2019-12-12T23:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to change values to variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611480#M18203</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/303426"&gt;@Melanie621&lt;/a&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 ID  date :mmddyy10. Measurement :$12. Value &amp;amp; $10.;
cards;
1 6/21/06 Weight 170 lbs
1 6/21/06 Height 196 cm
1 6/21/06 Systolic 110 mm/Hg
1 6/21/06 Diastolic 70 mm/Hg
1 7/25/06 Weight 171 lbs
1 7/25/06 Height 196 cm
1 7/25/06 Systolic 109 mm/Hg
1 7/25/06 Diastolic 72 mm/Hg
2 6/21/06 Weight 150 lbs
2 6/21/06 Height 190 cm
2 6/21/06 Systolic 105 mm/Hg
2 6/21/06 Diastolic 75 mm/Hg
;

data temp;
set have;
by id date;
if first.id then n=1;
else if first.date then n+1;
run;

proc transpose data=temp out=want(drop=_name_) delim=_;
by id ;
id  measurement n;
var value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Dec 2019 23:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611480#M18203</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-12T23:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to change values to variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611484#M18207</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input ID  date :mmddyy10. Measurement :$12. Value &amp;amp; $10.;
format date mmddyy10.;
cards;
1 6/21/06 Weight 170 lbs
1 6/21/06 Height 196 cm
1 6/21/06 Systolic 110 mm/Hg
1 6/21/06 Diastolic 70 mm/Hg
1 7/25/06 Weight 171 lbs
1 7/25/06 Height 196 cm
1 7/25/06 Systolic 109 mm/Hg
1 7/25/06 Diastolic 72 mm/Hg
2 6/21/06 Weight 150 lbs
2 6/21/06 Height 190 cm
2 6/21/06 Systolic 105 mm/Hg
2 6/21/06 Diastolic 75 mm/Hg
;



data temp;
set have;
by id date;
if first.id then n=1;
else if first.date then n+1;
output;
if last.date then do;
 measurement='date';
 value=put(date,mmddyy10.);
 output;
end;
drop date;
run;

proc transpose data=temp out=want(drop=_name_) ;
by id ;
id  measurement n ;
var value ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611484#M18207</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-13T00:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to change values to variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611490#M18208</link>
      <description>&lt;P&gt;No need to make the N variable for this example data. Just use ID and DATE in the BY statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you might need it if the same measure name appears more than once on the same date.&amp;nbsp; For example if took more than one set of BP readings on the same date.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611490#M18208</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-13T00:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to change values to variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611538#M18214</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input ID  date :mmddyy10. Measurement :$12. Value &amp;amp; $10.;
format date mmddyy10.;
cards;
1 6/21/06 Weight 170 lbs
1 6/21/06 Height 196 cm
1 6/21/06 Systolic 110 mm/Hg
1 6/21/06 Diastolic 70 mm/Hg
1 7/25/06 Weight 171 lbs
1 7/25/06 Height 196 cm
1 7/25/06 Systolic 109 mm/Hg
1 7/25/06 Diastolic 72 mm/Hg
2 6/21/06 Weight 150 lbs
2 6/21/06 Height 190 cm
2 6/21/06 Systolic 105 mm/Hg
2 6/21/06 Diastolic 75 mm/Hg
;

proc transpose data=have out=temp(drop=_name_) ;
by id date;
id  measurement  ;
var value ;
run;
data temp;
 set temp;
 by id;
 if first.id then n=0;
 n+1;
run;
proc transpose data=temp out=temp1(where=(upcase(_name_) not in ('N' 'ID')));
by id n;
var _all_;
run;
proc transpose data=temp1 out=want(drop=_name_) delimiter=_;
by id;
id _name_ n;
var col1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Dec 2019 10:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611538#M18214</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-12-13T10:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to change values to variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611713#M18238</link>
      <description>&lt;P&gt;Am I allowed to say that I cringe when I see height in metric units and weight in English?&lt;/P&gt;
&lt;P&gt;Or is one of the next stages of processing this data to standardize units of measurement?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 19:47:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-values-to-variables/m-p/611713#M18238</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-13T19:47:20Z</dc:date>
    </item>
  </channel>
</rss>

