<?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: sorting by within values of a variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/sorting-by-within-values-of-a-variable/m-p/502276#M635</link>
    <description>&lt;P&gt;Hi thanks. the idea of dissecting the variable from the start&amp;nbsp;was great as it had more than one million obs. I did that in excel and imported and everything worked well.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Oct 2018 20:31:15 GMT</pubDate>
    <dc:creator>hasnat</dc:creator>
    <dc:date>2018-10-07T20:31:15Z</dc:date>
    <item>
      <title>sorting by within values of a variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/sorting-by-within-values-of-a-variable/m-p/502229#M629</link>
      <description>&lt;P&gt;Hi. Is there anyone out there who can help me how to further sort this data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data E1;&lt;BR /&gt;input KYGVKEY &amp;amp; FYYYYQ &amp;amp; EPSFIQ;&lt;BR /&gt;*Sample data given,&lt;/P&gt;&lt;P&gt;where KYGKEY=firm identifier, FYYYYQ=fiscal year and quarters, EPSFIQ= (an)earning per share;&lt;BR /&gt;CARDS;&lt;BR /&gt;1690 1980.0 0.06&lt;BR /&gt;1690 1980.1 0.06&lt;BR /&gt;1690 1980.3 0.07&lt;BR /&gt;1690 1980.4 0.14&lt;BR /&gt;1690 1981.0 0.08&lt;BR /&gt;1690 1981.1 0.09&lt;BR /&gt;1690 1981.3 0.11&lt;BR /&gt;1690 1981.4 0.04&lt;BR /&gt;1730 1980.0 0.10&lt;BR /&gt;1730 1980.1 0.15&lt;BR /&gt;1730 1980.3 0.08&lt;BR /&gt;1730 1980.4 0.22&lt;BR /&gt;1730 1981.0 1.08&lt;BR /&gt;1730 1981.1 0.19&lt;BR /&gt;1730 1981.3 1.11&lt;BR /&gt;1730 1981.4 0.04&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=E1;&lt;BR /&gt;RUN;&lt;BR /&gt;*Required is to sort/arrange this data by firm's identifier=KYGVKEY, and&lt;BR /&gt;cross-sectional quarters: 1st quarters from 1980 and 1981 comes first&lt;BR /&gt;and 2nd next and so on with corresponding EPSFIQ,&lt;BR /&gt;to compare EPSFIQ of each quarter with corresponding quarter of last year;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Oct 2018 09:22:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/sorting-by-within-values-of-a-variable/m-p/502229#M629</guid>
      <dc:creator>hasnat</dc:creator>
      <dc:date>2018-10-07T09:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: sorting by within values of a variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/sorting-by-within-values-of-a-variable/m-p/502239#M631</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237162"&gt;@hasnat&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SQL is quite good at sorting data in non-standard ways:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table e1s as
select * from e1
order by kygvkey, scan(fyyyyq,2), scan(fyyyyq,1);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But in the long run it will be more convenient to split FYYYYQ into two separate variables for fiscal year and quarter, respectively.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Oct 2018 10:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/sorting-by-within-values-of-a-variable/m-p/502239#M631</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-07T10:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: sorting by within values of a variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/sorting-by-within-values-of-a-variable/m-p/502276#M635</link>
      <description>&lt;P&gt;Hi thanks. the idea of dissecting the variable from the start&amp;nbsp;was great as it had more than one million obs. I did that in excel and imported and everything worked well.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Oct 2018 20:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/sorting-by-within-values-of-a-variable/m-p/502276#M635</guid>
      <dc:creator>hasnat</dc:creator>
      <dc:date>2018-10-07T20:31:15Z</dc:date>
    </item>
  </channel>
</rss>

