<?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 transpose SAS file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362143#M85540</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a question. &amp;nbsp;I use "Column" data set at SAS help. &amp;nbsp;I try to transpose all the rows to the columns. &amp;nbsp;&lt;STRONG&gt;I found out only the numeric variables could be transposed.&lt;/STRONG&gt; &amp;nbsp;How to do the whole data set including the character variables? &amp;nbsp;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data=sashelp.column&lt;BR /&gt;out=transp;&lt;BR /&gt;run;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm being pedantic but if your question is how to include characters why are you stating that only numeric variables could be transposed. Clearly it can but you don't know, so the question is, how do you do something? Always be as clear as possible, stating something isn't possible means you've already assumed something, incorrectly in this case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RTM&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If you &lt;FONT color="#FF0000"&gt;omit the VAR statement,&lt;/FONT&gt; then the TRANSPOSE procedure transposes &lt;FONT color="#FF0000"&gt;all numeric variables in the input data set&lt;/FONT&gt; that are not listed in another statement.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p19h5tsoknssr4n18gbl9xle0kq1.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p19h5tsoknssr4n18gbl9xle0kq1.htm&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 27 May 2017 03:34:25 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-05-27T03:34:25Z</dc:date>
    <item>
      <title>How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362116#M85538</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question. &amp;nbsp;I use "Column" data set at SAS help. &amp;nbsp;I try to transpose all the rows to the columns. &amp;nbsp;I found out only the numeric variables could be transposed. &amp;nbsp;How to do the whole data set including the character variables? &amp;nbsp;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc transpose data=sashelp.column&lt;BR /&gt;out=transp;&lt;BR /&gt;run;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 01:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362116#M85538</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-05-27T01:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362127#M85539</link>
      <description>Not all char variables, right? Because that would make little sense.&lt;BR /&gt;Please share a  sample desired output to describe you inquiry.</description>
      <pubDate>Sat, 27 May 2017 02:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362127#M85539</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-05-27T02:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362143#M85540</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a question. &amp;nbsp;I use "Column" data set at SAS help. &amp;nbsp;I try to transpose all the rows to the columns. &amp;nbsp;&lt;STRONG&gt;I found out only the numeric variables could be transposed.&lt;/STRONG&gt; &amp;nbsp;How to do the whole data set including the character variables? &amp;nbsp;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data=sashelp.column&lt;BR /&gt;out=transp;&lt;BR /&gt;run;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm being pedantic but if your question is how to include characters why are you stating that only numeric variables could be transposed. Clearly it can but you don't know, so the question is, how do you do something? Always be as clear as possible, stating something isn't possible means you've already assumed something, incorrectly in this case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RTM&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If you &lt;FONT color="#FF0000"&gt;omit the VAR statement,&lt;/FONT&gt; then the TRANSPOSE procedure transposes &lt;FONT color="#FF0000"&gt;all numeric variables in the input data set&lt;/FONT&gt; that are not listed in another statement.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p19h5tsoknssr4n18gbl9xle0kq1.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p19h5tsoknssr4n18gbl9xle0kq1.htm&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 03:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362143#M85540</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-27T03:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362181#M85541</link>
      <description>&lt;P&gt;My data set has 500 variables, mixing with character and numeric variable. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 15:12:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362181#M85541</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-05-27T15:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362183#M85542</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;My data set has 500 variables, mixing with character and numeric variable. &amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why is this relevant?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 15:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362183#M85542</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-27T15:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362189#M85545</link>
      <description>&lt;P&gt;Not sure why you'd want to do that, but the following is a way to accomplish it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the second time in the past 24 hours that I recommended the transpose macro (&lt;A href="http://www.sascommunity.org/wiki/A_Better_Way_to_Flip_(Transpose)_a_SAS_Dataset" target="_blank"&gt;http://www.sascommunity.org/wiki/A_Better_Way_to_Flip_(Transpose)_a_SAS_Dataset&lt;/A&gt; ) as a solution for a transposition problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It really wasn't designed to accomplish a transposition that didn't involve a by variable but, in this case, MRACCESS could be used as a by variable since each record has a value of 0 for that variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After running the macro, the following would do what you want:&lt;/P&gt;
&lt;PRE&gt;%transpose(data=sashelp.column, out=transp, by=mraccess, autovars=all)
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Autovars is one of the features I've always wanted to see added to proc transpose. It has three possible values: NUM (the default), CHAR or ALL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 15:57:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362189#M85545</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-27T15:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362215#M85562</link>
      <description>&lt;P&gt;Use the _ALL_ variable list. &amp;nbsp;If you don't tell it what variables it will assume you want to use _NUMERIC_ variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want;
  var _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you include at least one character varriable then PROC TRANSPOSE will need to convert the numeric variables&amp;nbsp;to character so the values can be put into a single unified column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to exclude the BY variables you will need to code for that yourself.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have
   out=want(where=(upcase(_name_) not in ('VAR1' 'VAR2')))
;
  by var1 var2;
  var _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 17:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362215#M85562</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-27T17:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362562#M85663</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found out all of the column names were assigned to the 2nd row of the SAS data set. &amp;nbsp;The first row was assigned variables names as "COL1", "COL2", "COL3", etc. &amp;nbsp; &amp;nbsp;How to eliminate the first row cause I would like to use the original column names? &amp;nbsp;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 22:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362562#M85663</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-05-29T22:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362563#M85664</link>
      <description>&lt;P&gt;What do you want your resulting file to look like? Originally, you only asked how to transpose both character and numeric variables. Apparently, you want something more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 22:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362563#M85664</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-29T22:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362568#M85666</link>
      <description>&lt;P&gt;Column1 is pre-transpose file, &amp;nbsp;Column2 is post-transpose file. &amp;nbsp; I would like to use the 2nd row of the post-transpose file as variable names.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13888iCB7C2C2EB45A5B5D/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Column1.png" title="Column1.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13889i6211BED290115613/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Column2.png" title="Column2.png" /&gt;</description>
      <pubDate>Mon, 29 May 2017 23:01:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362568#M85666</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-05-29T23:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362575#M85668</link>
      <description>&lt;P&gt;Note that when you transpose data, you can only have one type per column - so it will all have to be character variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data will be hard to use in this format. Are you really looking to have a dataset in this form or some type of report produced?&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 00:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362575#M85668</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-30T00:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362594#M85675</link>
      <description>&lt;P&gt;Is the following what you are trying to do?&lt;/P&gt;
&lt;PRE&gt;proc transpose data=sashelp.column out=column2 (drop=_:) let;
  var colname--objname;
  id colname;
run;

data column2;
  set column2 (firstobs=2);
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 03:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362594#M85675</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-30T03:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362598#M85676</link>
      <description>&lt;P&gt;The variables ("columns") created by PROC TRANSPOSE will have generated names like COL1, COL2, only if you don't tell PROC TRANSPOSE where to find the names. &amp;nbsp;Use the ID statement to tell PROC TRANSPOSE what variable in the original data has the names to use for the new variables.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 03:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362598#M85676</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-30T03:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose SAS file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362626#M85685</link>
      <description>&lt;P&gt;Hi, ybz!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA HAVE;&lt;BR /&gt;INPUT NUMERIC_COL CHAR_COL $;&lt;BR /&gt;DATALINES;&lt;BR /&gt;1 A&lt;BR /&gt;2 B&lt;BR /&gt;3 C&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC TRANSPOSE DATA=HAVE OUT=WANT;&lt;BR /&gt;VAR _ALL_;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 06:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transpose-SAS-file/m-p/362626#M85685</guid>
      <dc:creator>kanivan51</dc:creator>
      <dc:date>2017-05-30T06:28:59Z</dc:date>
    </item>
  </channel>
</rss>

