<?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 Summarise data with months down the side, years across the top, and difference from prev mth inside in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702050#M215013</link>
    <description>&lt;P&gt;I have non summarised data (see SASHELP.CITIDAY for a decent looking comparison).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to end up with a report that shows the months down the side (month being from the Date variable in that dataset), Years across the top (again from the Date variable) and the values inside being the %difference for the sum of variable&amp;nbsp;SNYDJCM from one month to the next.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example in January 1988, the sum of&amp;nbsp;SNYDJCM was 14444.12, for February it was 14806.24 and March was 17629.16.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the output, the value for Jan 1988 should be blank as it was the first month so had no growth, Feb 1988 should be 2.51% and Mar 1988 19.07%, and so on and so forth for all the months/years in the dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached a spreadsheet showing this desired output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is anyone able to assist in the best way to do this?&amp;nbsp; Is it possible with some sort of sql code or will it require a summary procedure with (i'm guessing) some transposing?&lt;/P&gt;&lt;P&gt;Many thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Nov 2020 16:05:36 GMT</pubDate>
    <dc:creator>Jamie_H</dc:creator>
    <dc:date>2020-11-27T16:05:36Z</dc:date>
    <item>
      <title>Summarise data with months down the side, years across the top, and difference from prev mth inside</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702050#M215013</link>
      <description>&lt;P&gt;I have non summarised data (see SASHELP.CITIDAY for a decent looking comparison).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to end up with a report that shows the months down the side (month being from the Date variable in that dataset), Years across the top (again from the Date variable) and the values inside being the %difference for the sum of variable&amp;nbsp;SNYDJCM from one month to the next.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example in January 1988, the sum of&amp;nbsp;SNYDJCM was 14444.12, for February it was 14806.24 and March was 17629.16.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the output, the value for Jan 1988 should be blank as it was the first month so had no growth, Feb 1988 should be 2.51% and Mar 1988 19.07%, and so on and so forth for all the months/years in the dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached a spreadsheet showing this desired output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is anyone able to assist in the best way to do this?&amp;nbsp; Is it possible with some sort of sql code or will it require a summary procedure with (i'm guessing) some transposing?&lt;/P&gt;&lt;P&gt;Many thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 16:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702050#M215013</guid>
      <dc:creator>Jamie_H</dc:creator>
      <dc:date>2020-11-27T16:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702060#M215018</link>
      <description>&lt;P&gt;This is apparently not one of the standard training data sets supplied with all installs, maybe it comes with SAS/ETS or similar module I don't have.&lt;/P&gt;
&lt;P&gt;So I can't write code against the set.&lt;/P&gt;
&lt;P&gt;My approach, from the description, would be&lt;/P&gt;
&lt;P&gt;1) get the totals my calendar month, Proc summary with the Date variable formatted with a year and month only format (your choice) as a class or by variable.&lt;/P&gt;
&lt;P&gt;2) in a data step compare the monthly totals, add a variable with the desired comparison calculation, using the Lag function and a year variable (report procedures will want a different variable to do the columns.&lt;/P&gt;
&lt;P&gt;No transpose needed unless you want to make a hard to use data set. Take the data as made in step to into either Proc report or Proc tabulate&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't open xlsx from unknown sources so I am afraid that's about as far as I can go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 16:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702060#M215018</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-27T16:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702067#M215020</link>
      <description>&lt;P&gt;PROC SUMMARY to get the sums, followed by a DATA step to compute the differences, follow by PROC REPORT to obtain the final report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Long data sets are to be created and used here. Only the final PROC REPORT is needed to get the wide report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, many of us, including me, will not download and open your Microsoft Excel file, as Microsoft Office files can be security threats. If you provide (a portion of) the data via &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;, and not via any other method, I could give more details to my solution.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 17:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702067#M215020</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-27T17:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702071#M215022</link>
      <description>&lt;P&gt;Thank you Paige,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Completely understandable about the virus potential.&amp;nbsp; I tried attached a picture of it first, but the website wont allow that.&amp;nbsp; I've copied the output into a .txt file and attached&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 17:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702071#M215022</guid>
      <dc:creator>Jamie_H</dc:creator>
      <dc:date>2020-11-27T17:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702078#M215026</link>
      <description>&lt;P&gt;In addition, for those of you without access to that particular dataset in SASHELP, here is the first 13 months of data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data have;&lt;BR /&gt;input date :date9. SNYDJCM;&lt;BR /&gt;format date date9.;&lt;BR /&gt;datalines;&lt;BR /&gt;01Jan1988&lt;BR /&gt;04Jan1988 740.1999998&lt;BR /&gt;05Jan1988 747.3799992&lt;BR /&gt;06Jan1988 750.3999996&lt;BR /&gt;07Jan1988 757.04&lt;BR /&gt;08Jan1988 711.3599997&lt;BR /&gt;11Jan1988 721.9199991&lt;BR /&gt;12Jan1988 715.1999998&lt;BR /&gt;13Jan1988 713.5899992&lt;BR /&gt;14Jan1988 708.3499994&lt;BR /&gt;15Jan1988 721.8099995&lt;BR /&gt;18Jan1988 724.4299994&lt;BR /&gt;19Jan1988 718.29&lt;BR /&gt;20Jan1988 701.5899992&lt;BR /&gt;21Jan1988 700.6999998&lt;BR /&gt;22Jan1988 709.4599991&lt;BR /&gt;25Jan1988 721.5199995&lt;BR /&gt;26Jan1988 714.0499992&lt;BR /&gt;27Jan1988 712.9399996&lt;BR /&gt;28Jan1988 722.4899998&lt;BR /&gt;29Jan1988 731.3999996&lt;BR /&gt;01Feb1988 731.3999996&lt;BR /&gt;02Feb1988 727.6599998&lt;BR /&gt;03Feb1988 731.2199993&lt;BR /&gt;04Feb1988 720.4799995&lt;BR /&gt;05Feb1988 720.3399992&lt;BR /&gt;08Feb1988 717.3599997&lt;BR /&gt;09Feb1988 712.9799995&lt;BR /&gt;10Feb1988 733.0099993&lt;BR /&gt;11Feb1988 731.1499996&lt;BR /&gt;12Feb1988 736.6399994&lt;BR /&gt;15Feb1988&lt;BR /&gt;16Feb1988 744.7599993&lt;BR /&gt;17Feb1988 744.6699991&lt;BR /&gt;18Feb1988 741.2199993&lt;BR /&gt;19Feb1988 753.0499992&lt;BR /&gt;22Feb1988 760.9899998&lt;BR /&gt;23Feb1988 759.8999996&lt;BR /&gt;24Feb1988 759.0999994&lt;BR /&gt;25Feb1988 754.1699991&lt;BR /&gt;26Feb1988 756.3799992&lt;BR /&gt;29Feb1988 769.7599993&lt;BR /&gt;01Mar1988 767.6999998&lt;BR /&gt;02Mar1988 769.7599993&lt;BR /&gt;03Mar1988 771.0299997&lt;BR /&gt;04Mar1988 769.5499992&lt;BR /&gt;07Mar1988 767.9499998&lt;BR /&gt;08Mar1988 774.04&lt;BR /&gt;09Mar1988 772.5899992&lt;BR /&gt;10Mar1988 756.8899994&lt;BR /&gt;11Mar1988 760.8099995&lt;BR /&gt;14Mar1988 764.5099993&lt;BR /&gt;15Mar1988 764.5799999&lt;BR /&gt;16Mar1988 774.9599991&lt;BR /&gt;17Mar1988 781.1399994&lt;BR /&gt;18Mar1988 782.2299995&lt;BR /&gt;21Mar1988 776.4499998&lt;BR /&gt;22Mar1988 779.1099997&lt;BR /&gt;23Mar1988 781.3999996&lt;BR /&gt;24Mar1988 764.3499994&lt;BR /&gt;25Mar1988 749.3499994&lt;BR /&gt;28Mar1988 748&lt;BR /&gt;29Mar1988 754.1799994&lt;BR /&gt;30Mar1988 747.7099991&lt;BR /&gt;31Mar1988 750.8699999&lt;BR /&gt;01Apr1988&lt;BR /&gt;04Apr1988 747.1299992&lt;BR /&gt;05Apr1988 751.5999994&lt;BR /&gt;06Apr1988 771.8399992&lt;BR /&gt;07Apr1988 771.6199999&lt;BR /&gt;08Apr1988 781.3999996&lt;BR /&gt;11Apr1988 780.9599991&lt;BR /&gt;12Apr1988 785.2799997&lt;BR /&gt;13Apr1988 782.7799997&lt;BR /&gt;14Apr1988 748.7599993&lt;BR /&gt;15Apr1988 747.8899994&lt;BR /&gt;18Apr1988 746.9499998&lt;BR /&gt;19Apr1988 745.2399998&lt;BR /&gt;20Apr1988 739.0299997&lt;BR /&gt;21Apr1988 740.4799995&lt;BR /&gt;22Apr1988 752.0699997&lt;BR /&gt;25Apr1988 758.2099991&lt;BR /&gt;26Apr1988 760.1399994&lt;BR /&gt;27Apr1988 759.2999992&lt;BR /&gt;28Apr1988 756.3199997&lt;BR /&gt;29Apr1988 754.9399996&lt;BR /&gt;02May1988 759.6299992&lt;BR /&gt;03May1988 763.9499998&lt;BR /&gt;04May1988 758.2799997&lt;BR /&gt;05May1988 752.9099998&lt;BR /&gt;06May1988 748.7599993&lt;BR /&gt;09May1988 744.1099997&lt;BR /&gt;10May1988 746.29&lt;BR /&gt;11May1988 733.6799994&lt;BR /&gt;12May1988 733.3599997&lt;BR /&gt;13May1988 739.6399994&lt;BR /&gt;16May1988 745.5699997&lt;BR /&gt;17May1988&lt;BR /&gt;18May1988 723.5899992&lt;BR /&gt;19May1988 726.2399998&lt;BR /&gt;20May1988 725.25&lt;BR /&gt;23May1988 719.2999992&lt;BR /&gt;24May1988 727.29&lt;BR /&gt;25May1988 727.1799994&lt;BR /&gt;26May1988 730.1699991&lt;BR /&gt;27May1988 729.4099998&lt;BR /&gt;30May1988&lt;BR /&gt;31May1988 754.2799997&lt;BR /&gt;01Jun1988 766.3899994&lt;BR /&gt;02Jun1988 764.9499998&lt;BR /&gt;03Jun1988 771.1199999&lt;BR /&gt;06Jun1988 772.7399998&lt;BR /&gt;07Jun1988 766.7999992&lt;BR /&gt;08Jun1988 783.9499998&lt;BR /&gt;09Jun1988 780.8799992&lt;BR /&gt;10Jun1988 784.0199995&lt;BR /&gt;13Jun1988 782.6599998&lt;BR /&gt;14Jun1988 791.25&lt;BR /&gt;15Jun1988 792.1999998&lt;BR /&gt;16Jun1988 779.75&lt;BR /&gt;17Jun1988 782.0899992&lt;BR /&gt;20Jun1988 775.7699995&lt;BR /&gt;21Jun1988 785.1999998&lt;BR /&gt;22Jun1988 799.0499992&lt;BR /&gt;23Jun1988 799.0799999&lt;BR /&gt;24Jun1988 799.8799992&lt;BR /&gt;27Jun1988 787.1999998&lt;BR /&gt;28Jun1988 794.5799999&lt;BR /&gt;29Jun1988 791.3599997&lt;BR /&gt;30Jun1988 801.5799999&lt;BR /&gt;01Jul1988 796.7799997&lt;BR /&gt;04Jul1988&lt;BR /&gt;05Jul1988 805.9299994&lt;BR /&gt;06Jul1988 794.6899996&lt;BR /&gt;07Jul1988 793.0999994&lt;BR /&gt;08Jul1988 787.5799999&lt;BR /&gt;11Jul1988 789.1699991&lt;BR /&gt;12Jul1988 782.6999998&lt;BR /&gt;13Jul1988 787.0099993&lt;BR /&gt;14Jul1988 789.2399998&lt;BR /&gt;15Jul1988 794.1599998&lt;BR /&gt;18Jul1988 789.1699991&lt;BR /&gt;19Jul1988 782.3199997&lt;BR /&gt;20Jul1988 787.1299992&lt;BR /&gt;21Jul1988 777.7399998&lt;BR /&gt;22Jul1988 767.9799995&lt;BR /&gt;25Jul1988 770.7399998&lt;BR /&gt;26Jul1988 772.4399996&lt;BR /&gt;27Jul1988 766.7699995&lt;BR /&gt;28Jul1988 776.1099997&lt;BR /&gt;29Jul1988 794.3899994&lt;BR /&gt;01Aug1988 795.79&lt;BR /&gt;02Aug1988 795.9799995&lt;BR /&gt;03Aug1988 796.3199997&lt;BR /&gt;04Aug1988 793.75&lt;BR /&gt;05Aug1988 790.9899998&lt;BR /&gt;08Aug1988 787.5&lt;BR /&gt;09Aug1988 776.6399994&lt;BR /&gt;10Aug1988 761.2399998&lt;BR /&gt;11Aug1988 762.4899998&lt;BR /&gt;12Aug1988 762.4099998&lt;BR /&gt;15Aug1988 750.9099998&lt;BR /&gt;16Aug1988 755.9399996&lt;BR /&gt;17Aug1988 757.7999992&lt;BR /&gt;18Aug1988 757.7199993&lt;BR /&gt;19Aug1988 756.3999996&lt;BR /&gt;22Aug1988 747.8099995&lt;BR /&gt;23Aug1988 746.8999996&lt;BR /&gt;24Aug1988 759.8399992&lt;BR /&gt;25Aug1988 754.0099993&lt;BR /&gt;26Aug1988 755.4499998&lt;BR /&gt;29Aug1988 763.8899994&lt;BR /&gt;30Aug1988 762.8699999&lt;BR /&gt;31Aug1988 761.0499992&lt;BR /&gt;01Sep1988 752.0099993&lt;BR /&gt;02Sep1988 769.8699999&lt;BR /&gt;05Sep1988&lt;BR /&gt;06Sep1988 775.0899992&lt;BR /&gt;07Sep1988 774.2999992&lt;BR /&gt;08Sep1988 773.6899996&lt;BR /&gt;09Sep1988 776.6399994&lt;BR /&gt;12Sep1988 774.9399996&lt;BR /&gt;13Sep1988 778.3499994&lt;BR /&gt;14Sep1988 783.7199993&lt;BR /&gt;15Sep1988 780.1999998&lt;BR /&gt;16Sep1988 783.8699999&lt;BR /&gt;19Sep1988 780.8799992&lt;BR /&gt;20Sep1988 784.0599995&lt;BR /&gt;21Sep1988 785.7999992&lt;BR /&gt;22Sep1988 782.4299994&lt;BR /&gt;23Sep1988 785.8399992&lt;BR /&gt;26Sep1988 784.29&lt;BR /&gt;27Sep1988 783.6399994&lt;BR /&gt;28Sep1988 785.9499998&lt;BR /&gt;29Sep1988 797.5699997&lt;BR /&gt;30Sep1988 795.4499998&lt;BR /&gt;03Oct1988 795&lt;BR /&gt;04Oct1988 794.6899996&lt;BR /&gt;05Oct1988 797.9499998&lt;BR /&gt;06Oct1988 797.6099997&lt;BR /&gt;07Oct1988 812.7799997&lt;BR /&gt;10Oct1988 812.6299992&lt;BR /&gt;11Oct1988 811.6899996&lt;BR /&gt;12Oct1988 799.9199991&lt;BR /&gt;13Oct1988 802.9299994&lt;BR /&gt;14Oct1988 802.9299994&lt;BR /&gt;17Oct1988 805.1099997&lt;BR /&gt;18Oct1988 813.0799999&lt;BR /&gt;19Oct1988 804.9199991&lt;BR /&gt;20Oct1988 820&lt;BR /&gt;21Oct1988 821.3599997&lt;BR /&gt;24Oct1988 816.9199991&lt;BR /&gt;25Oct1988 818.8499994&lt;BR /&gt;26Oct1988 816.8099995&lt;BR /&gt;27Oct1988 807.5899992&lt;BR /&gt;28Oct1988 809.9799995&lt;BR /&gt;31Oct1988 811.4199991&lt;BR /&gt;01Nov1988 813.2399998&lt;BR /&gt;02Nov1988 814.9799995&lt;BR /&gt;03Nov1988 819.2299995&lt;BR /&gt;04Nov1988 810.8499994&lt;BR /&gt;07Nov1988 803.4099998&lt;BR /&gt;08Nov1988 806.5299997&lt;BR /&gt;09Nov1988 802.54&lt;BR /&gt;10Nov1988 802.0899992&lt;BR /&gt;11Nov1988 786.6499996&lt;BR /&gt;14Nov1988 786.1499996&lt;BR /&gt;15Nov1988 788.4299994&lt;BR /&gt;16Nov1988 775.2999992&lt;BR /&gt;17Nov1988 778.7599993&lt;BR /&gt;18Nov1988 781.9399996&lt;BR /&gt;21Nov1988 783.1899996&lt;BR /&gt;22Nov1988 786.1199999&lt;BR /&gt;23Nov1988 794.6499996&lt;BR /&gt;24Nov1988&lt;BR /&gt;25Nov1988 787.75&lt;BR /&gt;28Nov1988 792.6399994&lt;BR /&gt;29Nov1988 800.1499996&lt;BR /&gt;30Nov1988 805.5799999&lt;BR /&gt;01Dec1988 801.8999996&lt;BR /&gt;02Dec1988 799.1999998&lt;BR /&gt;05Dec1988 809.29&lt;BR /&gt;06Dec1988 815.1699991&lt;BR /&gt;07Dec1988 816.9599991&lt;BR /&gt;08Dec1988 812.5899992&lt;BR /&gt;09Dec1988 815.0999994&lt;BR /&gt;12Dec1988 813.5099993&lt;BR /&gt;13Dec1988 813.7699995&lt;BR /&gt;14Dec1988 812.1399994&lt;BR /&gt;15Dec1988 812.6699991&lt;BR /&gt;16Dec1988 818.7599993&lt;BR /&gt;19Dec1988 826.25&lt;BR /&gt;20Dec1988 823.1299992&lt;BR /&gt;21Dec1988 822.25&lt;BR /&gt;22Dec1988 822.0999994&lt;BR /&gt;23Dec1988 825.0299997&lt;BR /&gt;26Dec1988&lt;BR /&gt;27Dec1988 823.0099993&lt;BR /&gt;28Dec1988 824.1899996&lt;BR /&gt;29Dec1988 830.2399998&lt;BR /&gt;30Dec1988 825.9399996&lt;BR /&gt;02Jan1989&lt;BR /&gt;03Jan1989 816.9499998&lt;BR /&gt;04Jan1989 830.3399992&lt;BR /&gt;05Jan1989 832.7099991&lt;BR /&gt;06Jan1989 835.0799999&lt;BR /&gt;09Jan1989 837.2599993&lt;BR /&gt;10Jan1989 835.9399996&lt;BR /&gt;11Jan1989 841.3699999&lt;BR /&gt;12Jan1989 845.6399994&lt;BR /&gt;13Jan1989 846.3399992&lt;BR /&gt;16Jan1989 846.0699997&lt;BR /&gt;17Jan1989 845.9499998&lt;BR /&gt;18Jan1989 856.5499992&lt;BR /&gt;19Jan1989 856.1699991&lt;BR /&gt;20Jan1989 853.5299997&lt;BR /&gt;23Jan1989 848.9399996&lt;BR /&gt;24Jan1989 861.1399994&lt;BR /&gt;25Jan1989 863&lt;BR /&gt;26Jan1989 871.8899994&lt;BR /&gt;27Jan1989 881.4799995&lt;BR /&gt;30Jan1989 882.8799992&lt;BR /&gt;31Jan1989 891.1199999&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 17:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702078#M215026</guid>
      <dc:creator>Jamie_H</dc:creator>
      <dc:date>2020-11-27T17:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702080#M215028</link>
      <description>&lt;P&gt;You data step needs an: Infile datalines truncover ; (or missover) because of missing values.&lt;/P&gt;
&lt;P&gt;This may get you started.&lt;/P&gt;
&lt;PRE&gt;proc summary data=have nway;
   class date;
   format date monyy.;
   var SNYDJCM;
   output out=summary (drop=_:) sum=;
run;

data want;
   set summary;
   lsynd = lag(SNYDJCM);
   year = year(date);
   change = (SNYDJCM - lsynd)/SNYDJCM;
run;

proc report data=want;
   columns date year, change;
   define date / group order=internal 
                format=monname.  'Month';
   define year/ across;
   define change/ format=percent8.1 ;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Nov 2020 17:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702080#M215028</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-27T17:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702081#M215029</link>
      <description>&lt;P&gt;Hi there -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can just do this with a DATA step with temporary arrays -- first get the start and end year into macro variables, then the data step that follows.&amp;nbsp; The first data step just produces some test input - just swap out TEST for your actual data. Hope this helps.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* this is just example input -- replace with your actual data */
data test;
length dt val 8;
format dt date9. val dollar8.2;
do dt=10000 to 15000;
  val=ranuni(0)*1000;
  output;
end;
run;
/* end of example input */

proc sql noprint;
select year(min(dt)) into :sy from test;
select year(max(dt)) into :ey from test;
quit;

%let sy=%sysfunc(compress(&amp;amp;sy));
%let ey=%sysfunc(compress(&amp;amp;ey));

data monyr;
set test end=last;
length mon 3 year&amp;amp;sy-year&amp;amp;ey 8;
array t {12,&amp;amp;sy:&amp;amp;ey} _temporary_;
t[month(dt),year(dt)]+val;
if last then do;
	array y {&amp;amp;sy:&amp;amp;ey} year&amp;amp;sy-year&amp;amp;ey;
	start=0;
	do mon=1 to 12;
		call missing(of y[*]);
		do yr=lbound(t,2) to hbound(t,2);
			if start then y[yr]=(t[mon,yr]-t[mod(mon-13,12)+12,yr-(mon=1)])/t[mon,yr];
			start=1;
		end;
		output;
	end;
end;
keep mon year:;
run;

proc print data=monyr width=min; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Nov 2020 17:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702081#M215029</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2020-11-27T17:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702087#M215033</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/223320"&gt;@quickbluefish&lt;/a&gt; You could also use the TRIMMED option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select year(min(dt)) into :sy from test;
select year(max(dt)) into :ey from test;
quit;

%let sy=%sysfunc(compress(&amp;amp;sy));
%let ey=%sysfunc(compress(&amp;amp;ey));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select year(min(dt)) into :sy trimmed from test;
select year(max(dt)) into :ey trimmed from test;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select year(min(dt)), year(max(dt)) into :sy trimmed, :ey trimmed from test;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Nov 2020 18:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702087#M215033</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-11-27T18:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702093#M215036</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/129266"&gt;@Jamie_H&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you Paige,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Completely understandable about the virus potential.&amp;nbsp; I tried attached a picture of it first, but the website wont allow that.&amp;nbsp; I've copied the output into a .txt file and attached&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Looks like &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; has already written the code I was going to write. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 18:42:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702093#M215036</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-27T18:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702098#M215039</link>
      <description>Thanks! For some reason, I had in my mind that the 'trimmed' option only worked when you were creating a range (like, select x into :x1-x10 trimmed from...) - thanks for the tip!</description>
      <pubDate>Fri, 27 Nov 2020 19:03:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702098#M215039</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2020-11-27T19:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise data with months down the side, years across the top, and difference from prev mth ins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702437#M215144</link>
      <description>Thank you. This works great!</description>
      <pubDate>Mon, 30 Nov 2020 09:21:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarise-data-with-months-down-the-side-years-across-the-top/m-p/702437#M215144</guid>
      <dc:creator>Jamie_H</dc:creator>
      <dc:date>2020-11-30T09:21:05Z</dc:date>
    </item>
  </channel>
</rss>

