<?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 Need help combining 2 observations on PROC TRANSPOSE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189716#M35793</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a PROC APPEND to gather my data monthly.&amp;nbsp; I am then using PROC TRANSPOSE to change the format of my data.&amp;nbsp; Each month I will have a new column added to the end of my spreadsheet to compare pricing month to month.&amp;nbsp; I ran a test to compare what happens when a price changes from one month to the next.&amp;nbsp; Everything looks good except I when there was a pricing change from one month to the next it created a new line.&amp;nbsp; I just want one line with the price from month to month.&amp;nbsp; I pasted below to show you what it looks like now along with the last part of my code.&amp;nbsp; I just need everything on one line, not two.&amp;nbsp; Not sure if I need to modify my TRANPOSE or insert a new DATA STEP afterwards to combine the 2.&amp;nbsp; I still want the old rate to appear in last month columns and I still want the new rate to compare in this months column.&amp;nbsp; Everything else with the program works perfectly.&amp;nbsp; Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT data=work.mobpp4;&lt;BR /&gt;BY soc DESCENDING effective_date;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC TRANSPOSE DATA = rashare.gf_temp_mobility_RC_jan19 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=work.longf (DROP = _name_ _Label_)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PREFIX = EXTRACT_PERIOD_&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BY SOC Feature_Code soc_description effective_date expiration_date Extract_Date;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID Extract_Year_Month;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VAR RATE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 996px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="104"&gt;SOC&lt;/TD&gt;&lt;TD width="104"&gt;Feature_Code&lt;/TD&gt;&lt;TD width="104"&gt;Description&lt;/TD&gt;&lt;TD width="104"&gt;effective_date&lt;/TD&gt;&lt;TD width="121"&gt;Extract_Date&lt;/TD&gt;&lt;TD width="193"&gt;Exctract_Period_Y2015_M02&lt;/TD&gt;&lt;TD width="266"&gt;Extract_Period_Y2015_M01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;0MGS1OP&lt;/TD&gt;&lt;TD&gt;UTGSTD&lt;/TD&gt;&lt;TD&gt;Sharing option&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;8/7/2008&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;1/19/2015&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD align="right"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;0MGS1OP&lt;/TD&gt;&lt;TD&gt;UTGSTD&lt;/TD&gt;&lt;TD&gt;Sharing option&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;8/17/2008&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;1/19/2015&lt;/TD&gt;&lt;TD align="right"&gt;30&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Giuliano Filoso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jan 2015 21:32:29 GMT</pubDate>
    <dc:creator>Giuliano</dc:creator>
    <dc:date>2015-01-19T21:32:29Z</dc:date>
    <item>
      <title>Need help combining 2 observations on PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189716#M35793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a PROC APPEND to gather my data monthly.&amp;nbsp; I am then using PROC TRANSPOSE to change the format of my data.&amp;nbsp; Each month I will have a new column added to the end of my spreadsheet to compare pricing month to month.&amp;nbsp; I ran a test to compare what happens when a price changes from one month to the next.&amp;nbsp; Everything looks good except I when there was a pricing change from one month to the next it created a new line.&amp;nbsp; I just want one line with the price from month to month.&amp;nbsp; I pasted below to show you what it looks like now along with the last part of my code.&amp;nbsp; I just need everything on one line, not two.&amp;nbsp; Not sure if I need to modify my TRANPOSE or insert a new DATA STEP afterwards to combine the 2.&amp;nbsp; I still want the old rate to appear in last month columns and I still want the new rate to compare in this months column.&amp;nbsp; Everything else with the program works perfectly.&amp;nbsp; Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT data=work.mobpp4;&lt;BR /&gt;BY soc DESCENDING effective_date;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC TRANSPOSE DATA = rashare.gf_temp_mobility_RC_jan19 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=work.longf (DROP = _name_ _Label_)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PREFIX = EXTRACT_PERIOD_&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BY SOC Feature_Code soc_description effective_date expiration_date Extract_Date;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID Extract_Year_Month;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VAR RATE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 996px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="104"&gt;SOC&lt;/TD&gt;&lt;TD width="104"&gt;Feature_Code&lt;/TD&gt;&lt;TD width="104"&gt;Description&lt;/TD&gt;&lt;TD width="104"&gt;effective_date&lt;/TD&gt;&lt;TD width="121"&gt;Extract_Date&lt;/TD&gt;&lt;TD width="193"&gt;Exctract_Period_Y2015_M02&lt;/TD&gt;&lt;TD width="266"&gt;Extract_Period_Y2015_M01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;0MGS1OP&lt;/TD&gt;&lt;TD&gt;UTGSTD&lt;/TD&gt;&lt;TD&gt;Sharing option&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;8/7/2008&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;1/19/2015&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD align="right"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;0MGS1OP&lt;/TD&gt;&lt;TD&gt;UTGSTD&lt;/TD&gt;&lt;TD&gt;Sharing option&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;8/17/2008&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;1/19/2015&lt;/TD&gt;&lt;TD align="right"&gt;30&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Giuliano Filoso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 21:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189716#M35793</guid>
      <dc:creator>Giuliano</dc:creator>
      <dc:date>2015-01-19T21:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 observations on PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189717#M35794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason you have two lines, is the different effective_date values. In order to have only one line per group of BY variables, all values should be equal. You can move effective_date from BY statement to VAR statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 21:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189717#M35794</guid>
      <dc:creator>Marina</dc:creator>
      <dc:date>2015-01-19T21:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 observations on PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189718#M35795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I know but if I move the effective_date to a VAR statement then it throws everything else off.&amp;nbsp; I have to somehow keep this exact format and join my 2 obervations in 1 line. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 22:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189718#M35795</guid>
      <dc:creator>Giuliano</dc:creator>
      <dc:date>2015-01-19T22:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 observations on PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189719#M35796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need more control over your transpose use a data step instead. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 22:14:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189719#M35796</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-19T22:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 observations on PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189720#M35797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And just forget about the Transpose all together?&amp;nbsp; Do a Merge maybe?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 22:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189720#M35797</guid>
      <dc:creator>Giuliano</dc:creator>
      <dc:date>2015-01-19T22:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 observations on PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189721#M35798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A merge would work, I would use SQL over data step though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 22:23:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189721#M35798</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-19T22:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 observations on PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189722#M35799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Ok thank you.&amp;nbsp; I will give that a shot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 22:27:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189722#M35799</guid>
      <dc:creator>Giuliano</dc:creator>
      <dc:date>2015-01-19T22:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 observations on PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189723#M35800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does not matter what you use, proc transpose or merge, as long as you have different effective dates, you will end up either with multiple observations or with multiple effective_date columns (if you rename it in one of the contributing datasets - the same as if you are to move it in VAR statement in transpose). If you know what date you need to keep as effective_date, e.g. earliest or latest or whatever, you could add data step to collapse multiple observations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 22:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-combining-2-observations-on-PROC-TRANSPOSE/m-p/189723#M35800</guid>
      <dc:creator>Marina</dc:creator>
      <dc:date>2015-01-19T22:42:24Z</dc:date>
    </item>
  </channel>
</rss>

