<?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 about the question of sort data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/about-the-question-of-sort-data/m-p/50281#M13707</link>
    <description>i want to merge figure1. and 2 to figure 3.&lt;BR /&gt;
the data is complicate &lt;BR /&gt;
you can see here &lt;BR /&gt;
&lt;A href="http://min.us/mvoikgu#1" target="_blank"&gt;http://min.us/mvoikgu#1&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://min.us/mvoikgu#2" target="_blank"&gt;http://min.us/mvoikgu#2&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://min.us/mvoikgu#3" target="_blank"&gt;http://min.us/mvoikgu#3&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
data is as following&lt;BR /&gt;
figure1.&lt;BR /&gt;
&lt;BR /&gt;
Code	 CVX0504(PS)	 CVX0604(PS)	 CVX0704(PS)&lt;BR /&gt;
2004/5/12 18.2              19.61            #NA&lt;BR /&gt;
2004/5/13 18.38             19.58	     #NA&lt;BR /&gt;
2004/5/14 18.55	            19.67	     #NA&lt;BR /&gt;
2004/5/17 19.37             20.21	     #NA&lt;BR /&gt;
2004/5/18  19.25            20.07            #NA&lt;BR /&gt;
2004/5/19 18.35	            19.17            #NA&lt;BR /&gt;
2004/5/20 #NA              19.34            #NA&lt;BR /&gt;
2004/5/21 #NA	             19.17	    #NA&lt;BR /&gt;
2004/5/24 #NA	             18.77	 19.04&lt;BR /&gt;
2004/5/25 #NA                17.5	    18&lt;BR /&gt;
2004/5/26 #NA	             17.61	 18.09&lt;BR /&gt;
2004/5/27 #NA                17.35	 17.9&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
figure 2.&lt;BR /&gt;
Type STDT&lt;BR /&gt;
CVX0504	2004/5/19&lt;BR /&gt;
CVX0604	2004/6/16&lt;BR /&gt;
CVX0704	2004/7/14&lt;BR /&gt;
&lt;BR /&gt;
figure3.&lt;BR /&gt;
date	 code	   exdate   settle_price&lt;BR /&gt;
2004/5/12 CVX0504 2004/5/19   18.2&lt;BR /&gt;
2004/5/12 CVX0604 2004/6/16   19.61&lt;BR /&gt;
2004/5/13 CVX0504 2004/5/19   18.38&lt;BR /&gt;
2004/5/13 CVX0604 2004/6/16   19.58&lt;BR /&gt;
2004/5/14 CVX0504 2004/5/19  18.55&lt;BR /&gt;
2004/5/14 CVX0604 2004/6/16   19.67&lt;BR /&gt;
2004/5/17 CVX0504 2004/5/19   19.37&lt;BR /&gt;
2004/5/17 CVX0604 2004/6/16   20.21&lt;BR /&gt;
2004/5/18 CVX0504 2004/5/19  19.25&lt;BR /&gt;
2004/5/18 CVX0604 2004/6/16   20.07&lt;BR /&gt;
2004/5/19 CVX0504 2004/5/19   18.35&lt;BR /&gt;
2004/5/19 CVX0604 2004/6/16   19.17&lt;BR /&gt;
2004/5/20 CVX0604 2004/6/16    19.34&lt;BR /&gt;
2004/5/21 CVX0604 2004/6/16    19.17&lt;BR /&gt;
2004/5/24 CVX0604 2004/6/16   18.77&lt;BR /&gt;
2004/5/24 CVX0704 2004/7/14    19.04&lt;BR /&gt;
2004/5/25 CVX0604 2004/6/16     17.5&lt;BR /&gt;
2004/5/25 CVX0704 2004/7/14	 18&lt;BR /&gt;
2004/5/26 CVX0604 2004/6/16    17.61&lt;BR /&gt;
2004/5/26 CVX0704 2004/7/14    18.09&lt;BR /&gt;
2004/5/27 CVX0604 2004/6/16	 17.35&lt;BR /&gt;
2004/5/27 CVX0704 2004/7/14	 17.9&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
in detail&lt;BR /&gt;
i want a data there are settle price of various expiration date daily&lt;BR /&gt;
&lt;BR /&gt;
please help me, thx&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: bqk

Message was edited by: bqk</description>
    <pubDate>Wed, 13 Apr 2011 23:56:52 GMT</pubDate>
    <dc:creator>bqk</dc:creator>
    <dc:date>2011-04-13T23:56:52Z</dc:date>
    <item>
      <title>about the question of sort data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/about-the-question-of-sort-data/m-p/50281#M13707</link>
      <description>i want to merge figure1. and 2 to figure 3.&lt;BR /&gt;
the data is complicate &lt;BR /&gt;
you can see here &lt;BR /&gt;
&lt;A href="http://min.us/mvoikgu#1" target="_blank"&gt;http://min.us/mvoikgu#1&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://min.us/mvoikgu#2" target="_blank"&gt;http://min.us/mvoikgu#2&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://min.us/mvoikgu#3" target="_blank"&gt;http://min.us/mvoikgu#3&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
data is as following&lt;BR /&gt;
figure1.&lt;BR /&gt;
&lt;BR /&gt;
Code	 CVX0504(PS)	 CVX0604(PS)	 CVX0704(PS)&lt;BR /&gt;
2004/5/12 18.2              19.61            #NA&lt;BR /&gt;
2004/5/13 18.38             19.58	     #NA&lt;BR /&gt;
2004/5/14 18.55	            19.67	     #NA&lt;BR /&gt;
2004/5/17 19.37             20.21	     #NA&lt;BR /&gt;
2004/5/18  19.25            20.07            #NA&lt;BR /&gt;
2004/5/19 18.35	            19.17            #NA&lt;BR /&gt;
2004/5/20 #NA              19.34            #NA&lt;BR /&gt;
2004/5/21 #NA	             19.17	    #NA&lt;BR /&gt;
2004/5/24 #NA	             18.77	 19.04&lt;BR /&gt;
2004/5/25 #NA                17.5	    18&lt;BR /&gt;
2004/5/26 #NA	             17.61	 18.09&lt;BR /&gt;
2004/5/27 #NA                17.35	 17.9&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
figure 2.&lt;BR /&gt;
Type STDT&lt;BR /&gt;
CVX0504	2004/5/19&lt;BR /&gt;
CVX0604	2004/6/16&lt;BR /&gt;
CVX0704	2004/7/14&lt;BR /&gt;
&lt;BR /&gt;
figure3.&lt;BR /&gt;
date	 code	   exdate   settle_price&lt;BR /&gt;
2004/5/12 CVX0504 2004/5/19   18.2&lt;BR /&gt;
2004/5/12 CVX0604 2004/6/16   19.61&lt;BR /&gt;
2004/5/13 CVX0504 2004/5/19   18.38&lt;BR /&gt;
2004/5/13 CVX0604 2004/6/16   19.58&lt;BR /&gt;
2004/5/14 CVX0504 2004/5/19  18.55&lt;BR /&gt;
2004/5/14 CVX0604 2004/6/16   19.67&lt;BR /&gt;
2004/5/17 CVX0504 2004/5/19   19.37&lt;BR /&gt;
2004/5/17 CVX0604 2004/6/16   20.21&lt;BR /&gt;
2004/5/18 CVX0504 2004/5/19  19.25&lt;BR /&gt;
2004/5/18 CVX0604 2004/6/16   20.07&lt;BR /&gt;
2004/5/19 CVX0504 2004/5/19   18.35&lt;BR /&gt;
2004/5/19 CVX0604 2004/6/16   19.17&lt;BR /&gt;
2004/5/20 CVX0604 2004/6/16    19.34&lt;BR /&gt;
2004/5/21 CVX0604 2004/6/16    19.17&lt;BR /&gt;
2004/5/24 CVX0604 2004/6/16   18.77&lt;BR /&gt;
2004/5/24 CVX0704 2004/7/14    19.04&lt;BR /&gt;
2004/5/25 CVX0604 2004/6/16     17.5&lt;BR /&gt;
2004/5/25 CVX0704 2004/7/14	 18&lt;BR /&gt;
2004/5/26 CVX0604 2004/6/16    17.61&lt;BR /&gt;
2004/5/26 CVX0704 2004/7/14    18.09&lt;BR /&gt;
2004/5/27 CVX0604 2004/6/16	 17.35&lt;BR /&gt;
2004/5/27 CVX0704 2004/7/14	 17.9&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
in detail&lt;BR /&gt;
i want a data there are settle price of various expiration date daily&lt;BR /&gt;
&lt;BR /&gt;
please help me, thx&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: bqk

Message was edited by: bqk</description>
      <pubDate>Wed, 13 Apr 2011 23:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/about-the-question-of-sort-data/m-p/50281#M13707</guid>
      <dc:creator>bqk</dc:creator>
      <dc:date>2011-04-13T23:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: about the question of sort data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/about-the-question-of-sort-data/m-p/50282#M13708</link>
      <description>Can you plz post these data into the forum afterwards?&lt;BR /&gt;
It  spend lots of time to input data.&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
 input date : yymmdd10. cvx0504 cvx0604 cvx0704 ;&lt;BR /&gt;
 format date yymmdd10.;&lt;BR /&gt;
datalines;&lt;BR /&gt;
2004/5/12 18.2 19.61 .&lt;BR /&gt;
2004/5/13 18.38 19.58 .&lt;BR /&gt;
2004/5/14 18.55 19.67 .&lt;BR /&gt;
2004/5/17 19.37 20.21 .&lt;BR /&gt;
2004/5/18 19.25 20.07 .&lt;BR /&gt;
2004/5/19 18.35 19.17 .&lt;BR /&gt;
2004/5/20 . 19.34 .&lt;BR /&gt;
2004/5/21 . 19.17 .&lt;BR /&gt;
2004/5/24 . 18.77 19.04&lt;BR /&gt;
2004/5/25 . 17.5 18&lt;BR /&gt;
2004/5/26 . 17.61 18.09&lt;BR /&gt;
2004/5/27 . 17.35 17.9&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data index;&lt;BR /&gt;
input code $ exdate : yymmdd10.;&lt;BR /&gt;
format exdate yymmdd10.;&lt;BR /&gt;
datalines;&lt;BR /&gt;
cvx0504 2004/5/19&lt;BR /&gt;
cvx0604 2004/6/16&lt;BR /&gt;
cvx0704 2004/7/14&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data want;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 length code $ 8;&lt;BR /&gt;
 array cv{*} cvx:;&lt;BR /&gt;
 do i=1 to dim(cv);&lt;BR /&gt;
  if not missing(cv{i}) then do;&lt;BR /&gt;
                               code=vname(cv{i});&lt;BR /&gt;
                               settle_price=cv{i};&lt;BR /&gt;
                               output;&lt;BR /&gt;
                             end;&lt;BR /&gt;
 end;&lt;BR /&gt;
 keep date code settle_price;&lt;BR /&gt;
run;&lt;BR /&gt;
data want(drop=rc);&lt;BR /&gt;
 declare hash hh(hashexp:10);&lt;BR /&gt;
  hh.definekey('code');&lt;BR /&gt;
  hh.definedata('exdate');&lt;BR /&gt;
  hh.definedone();&lt;BR /&gt;
&lt;BR /&gt;
 do until(last);&lt;BR /&gt;
  set index end=last;&lt;BR /&gt;
  hh.add();&lt;BR /&gt;
 end;&lt;BR /&gt;
&lt;BR /&gt;
 do until(_last);&lt;BR /&gt;
  set want end=_last;&lt;BR /&gt;
  rc=hh.find();&lt;BR /&gt;
  output;&lt;BR /&gt;
 end;&lt;BR /&gt;
stop;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp

Message was edited by: Ksharp</description>
      <pubDate>Thu, 14 Apr 2011 07:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/about-the-question-of-sort-data/m-p/50282#M13708</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-04-14T07:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: about the question of sort data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/about-the-question-of-sort-data/m-p/50283#M13709</link>
      <description>thanks&lt;BR /&gt;
the way you use is fast, correct, and flexible&lt;BR /&gt;
thank you so much</description>
      <pubDate>Thu, 14 Apr 2011 12:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/about-the-question-of-sort-data/m-p/50283#M13709</guid>
      <dc:creator>bqk</dc:creator>
      <dc:date>2011-04-14T12:43:31Z</dc:date>
    </item>
  </channel>
</rss>

