<?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 tranpose with multiple var variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/419102#M103019</link>
    <description>&lt;P&gt;Hi, Can this be done using arrays?&lt;/P&gt;</description>
    <pubDate>Thu, 07 Dec 2017 09:27:56 GMT</pubDate>
    <dc:creator>mj5</dc:creator>
    <dc:date>2017-12-07T09:27:56Z</dc:date>
    <item>
      <title>proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399079#M96615</link>
      <description>&lt;P&gt;i have variable&lt;/P&gt;
&lt;P&gt;dose&amp;nbsp; &amp;nbsp;param&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;percent&lt;/P&gt;
&lt;P&gt;1_yt&amp;nbsp; &amp;nbsp; &amp;nbsp;nhdi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 23&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;34&lt;/P&gt;
&lt;P&gt;2_tr&amp;nbsp; &amp;nbsp; &amp;nbsp; sdg&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 32&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to transpose these such that dose will be in the header and percent and param will be as it is.&lt;/P&gt;
&lt;P&gt;I am using the below code but i get percent in one obs and count in other obs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can any one help me what i am missing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data=stab11 out=stab12 ;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;by param ;&lt;BR /&gt;var count percent;&lt;BR /&gt;id dose;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 09:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399079#M96615</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-09-27T09:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399084#M96616</link>
      <description>&lt;P&gt;The proper way to present example data looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input dose $ param $ count percent;
cards;
1_yt nhdi 23 34
2_tr sdg 21 32
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as it saves the people supposed to help you a lot of typing.&lt;/P&gt;
&lt;P&gt;Please show an example of your expected output, based on this example dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 09:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399084#M96616</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-27T09:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399087#M96618</link>
      <description>&lt;P&gt;sorry below is my dataset&lt;/P&gt;
&lt;P&gt;data WORK.INC;&lt;BR /&gt; infile datalines dsd truncover;&lt;BR /&gt; input dose_fmt:$50. PARAM:$200. COUNT:32. PERCENT:32.;&lt;BR /&gt;datalines4;&lt;BR /&gt;ADURN,base Tot Score Less Than Equal To 12,3,3.5&lt;BR /&gt;DE dfg,base Tot Score Less Than Equal To 12,112,29.6&lt;BR /&gt;TOTAL,base Tot Score Less Than Equal To 12,115,24.8&lt;BR /&gt;ADURN,No Active next,1,1.2&lt;BR /&gt;DE dfg,No Active next,15,4&lt;BR /&gt;TOTAL,No Active next,16,3.4&lt;BR /&gt;ADURN,Outpatient Status,2,2.4&lt;BR /&gt;DE dfg,Outpatient Status,6,1.6&lt;BR /&gt;TOTAL,Outpatient Status,8,1.7&lt;BR /&gt;ADURN,YMRS Tot Score Less Than Equal To 12,1,1.2&lt;BR /&gt;DE dfg,YMRS Tot Score Less Than Equal To 12,25,6.6&lt;BR /&gt;TOTAL,YMRS Tot Score Less Than Equal To 12,26,5.6&lt;BR /&gt;;;;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;and i am using the belwo proc transpose&lt;/P&gt;
&lt;P&gt;proc transpose data=inc out=stab12;&amp;nbsp;&lt;BR /&gt; by param ;&lt;BR /&gt; var count percent;&lt;BR /&gt; id dose_fmt;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this output i get percent on one row and count on another whereas i need them to be next to each other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 09:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399087#M96618</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-09-27T09:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399093#M96620</link>
      <description>&lt;P&gt;I hate to repeat myself, but:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show an example of your expected output, based on this example dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 09:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399093#M96620</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-27T09:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399104#M96625</link>
      <description>&lt;P&gt;Data sets don't have headers.&amp;nbsp; Reports have headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I agree with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;in that you need to illustrate what you want the result to be.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 10:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399104#M96625</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-09-27T10:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399106#M96627</link>
      <description>&lt;P&gt;I need like below&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data WORK.FINAL;&lt;BR /&gt; infile datalines dsd truncover;&lt;BR /&gt; input dose_fmt:$6. PARAM:$36. COUNT:BEST. PERCENT:BEST.;&lt;BR /&gt;datalines4;&lt;BR /&gt;ADURN,base Tot Score Less Than Equal To 12,3,3.5&lt;BR /&gt;DE dfg,base Tot Score Less Than Equal To 12,112,29.6&lt;BR /&gt;TOTAL,base Tot Score Less Than Equal To 12,115,24.8&lt;BR /&gt;ADURN,No Active next,1,1.2&lt;BR /&gt;DE dfg,No Active next,15,4&lt;BR /&gt;TOTAL,No Active next,16,3.4&lt;BR /&gt;ADURN,Outpatient Status,2,2.4&lt;BR /&gt;DE dfg,Outpatient Status,6,1.6&lt;BR /&gt;TOTAL,Outpatient Status,8,1.7&lt;BR /&gt;ADURN,YMRS Tot Score Less Than Equal To 12,1,1.2&lt;BR /&gt;DE dfg,YMRS Tot Score Less Than Equal To 12,25,6.6&lt;BR /&gt;TOTAL,YMRS Tot Score Less Than Equal To 12,26,5.6&lt;BR /&gt;;;;;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 10:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399106#M96627</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-09-27T10:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399117#M96629</link>
      <description>&lt;P&gt;This is how my output should look alike&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data WORK.FINAL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;infile datalines dsd truncover;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input dose_fmt:$6. PARAM:$36. COUNT:BEST. PERCENT:BEST.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datalines4;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADURN,base Tot Score Less Than Equal To 12,3,3.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DE dfg,base Tot Score Less Than Equal To 12,112,29.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TOTAL,base Tot Score Less Than Equal To 12,115,24.8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADURN,No Active next,1,1.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DE dfg,No Active next,15,4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TOTAL,No Active next,16,3.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADURN,Outpatient Status,2,2.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DE dfg,Outpatient Status,6,1.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TOTAL,Outpatient Status,8,1.7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADURN,YMRS Tot Score Less Than Equal To 12,1,1.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DE dfg,YMRS Tot Score Less Than Equal To 12,25,6.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TOTAL,YMRS Tot Score Less Than Equal To 12,26,5.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;;;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 11:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399117#M96629</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-09-27T11:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399122#M96633</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/62004"&gt;@vraj1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;This is how my output should look alike&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data WORK.FINAL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;infile datalines dsd truncover;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input dose_fmt:$6. PARAM:$36. COUNT:BEST. PERCENT:BEST.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datalines4;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADURN,base Tot Score Less Than Equal To 12,3,3.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DE dfg,base Tot Score Less Than Equal To 12,112,29.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TOTAL,base Tot Score Less Than Equal To 12,115,24.8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADURN,No Active next,1,1.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DE dfg,No Active next,15,4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TOTAL,No Active next,16,3.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADURN,Outpatient Status,2,2.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DE dfg,Outpatient Status,6,1.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TOTAL,Outpatient Status,8,1.7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADURN,YMRS Tot Score Less Than Equal To 12,1,1.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DE dfg,YMRS Tot Score Less Than Equal To 12,25,6.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TOTAL,YMRS Tot Score Less Than Equal To 12,26,5.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;;;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sorry, but that's exactly your example data. No action needed to get that.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 11:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399122#M96633</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-27T11:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399126#M96635</link>
      <description>&lt;P&gt;Sorry for it. Here is the below correct one&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data WORK.FINAL;&lt;BR /&gt; infile datalines dsd truncover;&lt;BR /&gt; input param:$36. adurn_count:BEST. adurn_percent:$3. de_dfg_count:BEST. de_dfg_percent:$4. total_count:BEST. total_percent:$4.;&lt;BR /&gt;datalines4;&lt;BR /&gt;base Tot Score Less Than Equal To 12,3,3.5,112,29.6,115,24.8&lt;BR /&gt;No Active next,1,1.2,15,4.0,16,3.4&lt;BR /&gt;Outpatient Status,2,2.4,6,1.6,8,1.7&lt;BR /&gt;YMRS Tot Score Less Than Equal To 12,1,1.2,25,6.6,26,5.6&lt;BR /&gt;;;;;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 11:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399126#M96635</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-09-27T11:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399127#M96636</link>
      <description>&lt;P&gt;You can get almost there (the names are a little different) by running two tranposes and merging the results:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=inc;
by param;
run;

proc transpose data=inc out=int1 (drop=_name_) prefix=count_;
by param;
id dose_fmt;
var count;
run;

proc transpose data=inc out=int2 (drop=_name_) prefix=percent_;
by param;
id dose_fmt;
var percent;
run;

data want;
merge int1 int2;
by param;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Sep 2017 11:58:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/399127#M96636</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-27T11:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/419102#M103019</link>
      <description>&lt;P&gt;Hi, Can this be done using arrays?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 09:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/419102#M103019</guid>
      <dc:creator>mj5</dc:creator>
      <dc:date>2017-12-07T09:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc tranpose with multiple var variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/419115#M103022</link>
      <description>&lt;P&gt;Why would you want&amp;nbsp;to do that? You would have to determine the array sizes from the number of distinct values for dose_fmt, and use quite a lot of macro programming and/or call executes to set the final datastep up. Proc transpose is much more flexible, as you have seen, and does most of that work on its own.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS of course one can drive screws in with a hammer, but I much prefer to use a screwdriver. See Maxim 14.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 10:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tranpose-with-multiple-var-variables/m-p/419115#M103022</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-07T10:25:33Z</dc:date>
    </item>
  </channel>
</rss>

