<?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 Transpose from Mssql to SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225433#M53931</link>
    <description>&lt;P&gt;You posted three columns of data, but no column names. Your SQL references 4 varaibles: ID DEGER2 COLUMN and COLUMN2.&lt;/P&gt;&lt;P&gt;What does your output look like? &amp;nbsp;Do have variables named AAA and ABA? &amp;nbsp;Do you have a observations for ID=1,2,3,4,5? Or do you have observations for ID=11,21,22,23,.... ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Sep 2015 19:36:53 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-09-14T19:36:53Z</dc:date>
    <item>
      <title>Proc Transpose from Mssql to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225285#M53920</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a mssql code's below which i'm trying to write to SAS programming language.I am a little bir confused. Could you help me, please ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;begin tran&lt;BR /&gt;SELECT *&lt;BR /&gt;INTO&amp;nbsp;newtable&lt;BR /&gt;FROM&amp;nbsp;maintable&lt;BR /&gt;PIVOT&lt;BR /&gt;(&lt;BR /&gt;SUM(result)&lt;BR /&gt;FOR resul_id&lt;BR /&gt;IN ([847],[848],[849],[850],[851],[852],[853],[854],[855],[856],[857],[858],[859],[860],[861],[862],[863],[864],[865],[866],[867],[868],[869],[870],[871],[872],[873],[874],[875],[876],[877],[878],[879],[880],[881],[882],[883],[884],[885],[886],[887],[888],[889],[890],[891],[892],[893],[894],[895])&lt;BR /&gt;) PivotTable&lt;BR /&gt;commit tran&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Code -&amp;gt;&lt;/P&gt;&lt;P&gt;proc transpose data=maintable&lt;BR /&gt;out=&lt;SPAN&gt;newtable&lt;/SPAN&gt;&lt;BR /&gt;Name=Pivot;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2015 22:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225285#M53920</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2015-09-12T22:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose from Mssql to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225299#M53921</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in Proc Transpose you can't do Sum and apply in() function. you have to make your MSSQL query in two queries in SAS (Proc Transpose and Proc SQL).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you need to make both in one step then you have to go through Data Step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let me know if you need any further clarifications&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2015 06:34:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225299#M53921</guid>
      <dc:creator>MSaber</dc:creator>
      <dc:date>2015-09-13T06:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose from Mssql to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225304#M53922</link>
      <description>&lt;P&gt;What are your inputs and outputs? &amp;nbsp;Perhaps PROC SUMMARY is what you want. &amp;nbsp;If you are subsetting then you probably want a WHERE clause.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2015 13:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225304#M53922</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-09-13T13:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose from Mssql to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225421#M53929</link>
      <description>&lt;P&gt;I solved the problem. It wants three steps.&lt;/P&gt;&lt;P&gt;The data which i tried to transpose to pivot is below.&lt;/P&gt;&lt;P&gt;1 323 AAA&lt;BR /&gt;2 432 AAA&lt;BR /&gt;3 654 ABA&lt;BR /&gt;4 21 AAA&lt;BR /&gt;5 23 ABA&lt;BR /&gt;1 56 AAA&lt;BR /&gt;2 22 ABA&lt;BR /&gt;3 31 AAA&lt;BR /&gt;5 87 AAA&lt;BR /&gt;3 43 ABA&lt;BR /&gt;2 11 ABA&lt;BR /&gt;1 323 AAA&lt;/P&gt;&lt;P&gt;And this is the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table work.summary1 as&lt;BR /&gt;select id,deger2,sum(column) as deger from work.sqltosas&lt;BR /&gt;group by id,column2;&lt;BR /&gt;quit;&lt;BR /&gt;proc sort data=work.summary1&lt;BR /&gt;out=work.sorted;&lt;BR /&gt;by column2;&lt;BR /&gt;run;&lt;BR /&gt;proc transpose data=work.sorted&lt;BR /&gt;out=work.yenisas(drop=_: ) let;&lt;BR /&gt;&lt;BR /&gt;var column;&lt;BR /&gt;by column2;&lt;BR /&gt;id id;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 18:35:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225421#M53929</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2015-09-14T18:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose from Mssql to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225433#M53931</link>
      <description>&lt;P&gt;You posted three columns of data, but no column names. Your SQL references 4 varaibles: ID DEGER2 COLUMN and COLUMN2.&lt;/P&gt;&lt;P&gt;What does your output look like? &amp;nbsp;Do have variables named AAA and ABA? &amp;nbsp;Do you have a observations for ID=1,2,3,4,5? Or do you have observations for ID=11,21,22,23,.... ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 19:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225433#M53931</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-09-14T19:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose from Mssql to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225467#M53936</link>
      <description>&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/110i5649188FAC074A89/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="pivot.png" title="pivot.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 21:41:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225467#M53936</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2015-09-14T21:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose from Mssql to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225698#M53964</link>
      <description>&lt;P&gt;Are there any simple methods to make this&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;You posted three columns of data, but no column names. Your SQL references 4 varaibles: ID DEGER2 COLUMN and COLUMN2.&lt;/P&gt;&lt;P&gt;What does your output look like? &amp;nbsp;Do have variables named AAA and ABA? &amp;nbsp;Do you have a observations for ID=1,2,3,4,5? Or do you have observations for ID=11,21,22,23,.... ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2015 20:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-from-Mssql-to-SAS/m-p/225698#M53964</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2015-09-15T20:10:09Z</dc:date>
    </item>
  </channel>
</rss>

