<?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: How to get data according to the benchmark of other dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378435#M90925</link>
    <description>&lt;P&gt;How could it happen? I copy your codes without change, but my result is&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Output&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;company profit date EPS date_event &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;199701&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;AUG96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;199701&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;MAY96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;201404&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;APR13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;201404&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;MAY13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;201404&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;JUN13&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 22 Jul 2017 16:06:07 GMT</pubDate>
    <dc:creator>lixuan</dc:creator>
    <dc:date>2017-07-22T16:06:07Z</dc:date>
    <item>
      <title>How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378400#M90900</link>
      <description>&lt;P&gt;Hi, I ask the question 2 days before , but there is a new problem . The data just like following . I wanna&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;pick the data from dataset 'have_event' &amp;nbsp;if it's date is in 12 months before the date of dataset 'have_base'. &amp;nbsp;I also show the result I want and the code i tried wihch didn't work.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;data have_base;&lt;BR /&gt;input company$ _date:$6. profit;&lt;BR /&gt;date = input(_date !! '01',yymmdd8.);&lt;BR /&gt;format date yymmn6.;&lt;BR /&gt;drop _date;&lt;BR /&gt;datalines;&lt;BR /&gt;a 199701 5&lt;BR /&gt;a 199606 9&lt;BR /&gt;b 201404 6&lt;BR /&gt;f 200004 78&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data have_event;&lt;BR /&gt;input company$ _date:$6. EPS;&lt;BR /&gt;date = input(_date !! '01',yymmdd8.);&lt;BR /&gt;format date yymmn6.;&lt;BR /&gt;drop _date;&lt;BR /&gt;datalines;&lt;BR /&gt;a 199608 5&lt;BR /&gt;a 199706 30&lt;BR /&gt;a 199605 4&lt;BR /&gt;a 199712 9&lt;BR /&gt;a 199806 10&lt;BR /&gt;c 201404 6&lt;BR /&gt;k 200004 78&lt;BR /&gt;n 198607 56&lt;BR /&gt;a 198504 3&lt;BR /&gt;b 201304 3&lt;BR /&gt;b 201305 6&lt;BR /&gt;b 201306 8&lt;BR /&gt;b 201504 80&lt;BR /&gt;b 201603 5&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=have_event;&lt;BR /&gt;by company;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;merge&lt;BR /&gt; have_base (in=b rename=(date=date_b))&lt;BR /&gt; have_event (in=e)&lt;BR /&gt;;&lt;BR /&gt;by company;&lt;BR /&gt;if b and e;&lt;BR /&gt;if date &amp;gt;= intnx('month',date_b, -12);&lt;BR /&gt;/*if 0&amp;gt;=intck('month',date,date_b) &amp;gt;=-12;*/&lt;BR /&gt;drop profit date_b;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=want noobs;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The result I want should be :&lt;/P&gt;&lt;P&gt;a 199608 5&lt;BR /&gt;a 199605 4&lt;BR /&gt;a 199605 4&lt;BR /&gt;b 201304 3&lt;BR /&gt;b 201305 6&lt;BR /&gt;b 201306 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example , as for &amp;nbsp;a, The date in dataset 'have_base' &amp;nbsp;is &amp;nbsp;'199701' and '199606', so the date in 'have_event' dataset &amp;nbsp;should be (199601 to 199612) and in(199506 to 199605) and I get the right EPS.&lt;/P&gt;&lt;P&gt;Thanks&amp;amp;regards&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 10:26:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378400#M90900</guid>
      <dc:creator>lixuan</dc:creator>
      <dc:date>2017-07-22T10:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378415#M90911</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sql;
create table test as select a.*,b.eps,b.date as date_event format=monyy6. from have_base as a, have_event as b where intnx('month',a.date, -12)&amp;lt;=b.date&amp;lt;=a.date;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jul 2017 13:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378415#M90911</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-07-22T13:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378417#M90912</link>
      <description>&lt;P&gt;You have two base dates for company 'a'. &amp;nbsp;Which one do you want to use?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 14:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378417#M90912</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-22T14:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378420#M90915</link>
      <description>&lt;P&gt;I want use both. For example, in 'have_base' dataset, somthing happened in the date, and in 'have_event' dataset, the character has benn recorded. I want to konw the change of chatacter before or after the date of 'have_base" dataset. Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 14:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378420#M90915</guid>
      <dc:creator>lixuan</dc:creator>
      <dc:date>2017-07-22T14:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378424#M90918</link>
      <description>&lt;P&gt;Maybe it's a impossible mission. I explain &amp;nbsp;more detailly. as you see, a in 'have_base' have two records.&lt;/P&gt;&lt;P&gt;First, &amp;nbsp;date of a &amp;nbsp;in dataset 'have_event' should be compared &amp;nbsp;with the first record of a in 'have_base'. If date of a in 'have_event' &amp;nbsp;is in 12 months before the date of first record in 'have_base', it will be picked out, and I get the first two records of result which contains two a .&lt;/P&gt;&lt;P&gt;Second, I prefer doing the same thing with the second record of 'have_base'. That is treating &amp;nbsp;the date of second record a in 'have_base' as a benchmark to find the right record in 'have_event'. As a result, I get the third record a in my result.&lt;/P&gt;&lt;P&gt;My english is poor, and I wonder if I express my idea clearly . I hope to get your help, thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 15:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378424#M90918</guid>
      <dc:creator>lixuan</dc:creator>
      <dc:date>2017-07-22T15:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378427#M90920</link>
      <description>&lt;P&gt;Thank you, I changed your code and ran it .&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table test as select a.*,b.eps,b.date as date_event format=monyy6.
from have_base as a, 
	 have_event as b
where intnx('month',a.date, -12)&amp;lt;=b.date&amp;lt;=a.date
	 &amp;amp;a.company=b.company;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The result is follwing ,but actually it skips one observation:&lt;SPAN&gt;a 199605 4(EPS). Because the second record in 'have_base' has a date 199606, and I also wanna get the record in 'have_event' which is in 12 months before 199606.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;company profit date EPS date_event &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;199701&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;AUG96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;199701&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;MAY96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;201404&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;APR13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;201404&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;MAY13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;201404&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;JUN13&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 22 Jul 2017 15:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378427#M90920</guid>
      <dc:creator>lixuan</dc:creator>
      <dc:date>2017-07-22T15:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378431#M90923</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I followed the same getting your expected output. Could you please check again&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table test as select a.*,b.eps,b.date as date_event format=monyy6. from have_base as a, have_event as b where intnx('month',a.date, -12)&amp;lt;=b.date&amp;lt;=a.date
and a.company=b.company;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10479iA17A581224E90662/image-size/original?v=1.0&amp;amp;px=-1" alt="image.png" title="image.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 15:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378431#M90923</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-07-22T15:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378435#M90925</link>
      <description>&lt;P&gt;How could it happen? I copy your codes without change, but my result is&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Output&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;company profit date EPS date_event &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;199701&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;AUG96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;199701&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;MAY96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;201404&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;APR13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;201404&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;MAY13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;201404&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;JUN13&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 22 Jul 2017 16:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378435#M90925</guid>
      <dc:creator>lixuan</dc:creator>
      <dc:date>2017-07-22T16:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378436#M90926</link>
      <description>&lt;P&gt;Did you chang my input before? Could you post all the codes? thank u&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 16:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378436#M90926</guid>
      <dc:creator>lixuan</dc:creator>
      <dc:date>2017-07-22T16:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378438#M90928</link>
      <description>&lt;P&gt;I did not change anything except the format monyy6.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have_base;
input company$ _date:$6. profit;
date = input(_date !! '01',yymmdd8.);
format date  monyy6.;
drop _date;
datalines;
a 199701 5
a 199606 9
b 201404 6
f 200004 78
;
run;

data have_event;
input company$ _date:$6. EPS;
date = input(_date !! '01',yymmdd8.);
format date monyy6.;
drop _date;
datalines;
a 199608 5
a 199706 30
a 199605 4
a 199712 9
a 199806 10
c 201404 6
k 200004 78
n 198607 56
a 198504 3
b 201304 3
b 201305 6
b 201306 8
b 201504 80
b 201603 5
;
run;
proc sort data=have_event;
by company;
run;


proc sql;
create table test as select a.*,b.eps,b.date as date_event format=monyy6. from have_base as a, have_event as b where intnx('month',a.date, -12)&amp;lt;=b.date&amp;lt;=a.date
and a.company=b.company;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jul 2017 16:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378438#M90928</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-07-22T16:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378439#M90929</link>
      <description>&lt;P&gt;Yeah, I get the same result with yours, but I don't know why. In my opinion, format should not influence the result. Do you know the reason?&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;company profit date EPS date_event &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;JAN97&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;AUG96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;JAN97&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;MAY96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;JUN96&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;MAY96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;APR14&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;APR13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;APR14&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;MAY13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;APR14&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;JUN13&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 22 Jul 2017 16:28:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378439#M90929</guid>
      <dc:creator>lixuan</dc:creator>
      <dc:date>2017-07-22T16:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378440#M90930</link>
      <description>&lt;P&gt;I agree with you the format should not influence, i ran the code again with the earlier format yymmn6. that you used and i get the same&amp;nbsp; result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have_base;
input company$ _date:$6. profit;
date = input(_date !! '01',yymmdd8.);

format date yymmn6.;
drop _date;
datalines;
a 199701 5
a 199606 9
b 201404 6
f 200004 78
;
run;

data have_event;
input company$ _date:$6. EPS;
date = input(_date !! '01',yymmdd8.);
format date yymmn6.;
drop _date;
datalines;
a 199608 5
a 199706 30
a 199605 4
a 199712 9
a 199806 10
c 201404 6
k 200004 78
n 198607 56
a 198504 3
b 201304 3
b 201305 6
b 201306 8
b 201504 80
b 201603 5
;
run;
proc sort data=have_event;
by company;
run;


proc sql;
create table test as select a.*,b.eps,b.date as date_event  from have_base as a, have_event as b where intnx('month',a.date, -12)&amp;lt;=b.date&amp;lt;=a.date
and a.company=b.company;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jul 2017 16:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378440#M90930</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-07-22T16:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378445#M90933</link>
      <description>&lt;P&gt;OK, thank you very much. I will try it again. You do me a good favor!&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 17:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378445#M90933</guid>
      <dc:creator>lixuan</dc:creator>
      <dc:date>2017-07-22T17:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data according to the benchmark of other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378449#M90936</link>
      <description>&lt;P&gt;&amp;nbsp;Hi ,Jag. Whatever I try, I can't get the wrong result. I don't know, maybe it's just the software's mistake. thank you&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 17:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-data-according-to-the-benchmark-of-other-dataset/m-p/378449#M90936</guid>
      <dc:creator>lixuan</dc:creator>
      <dc:date>2017-07-22T17:47:58Z</dc:date>
    </item>
  </channel>
</rss>

