<?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 How to aggregate institutional ownership from thomson reuters? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-aggregate-institutional-ownership-from-thomson-reuters/m-p/189217#M47821</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 struggling to figure out a very straightforward task-- calculating the % of institutional ownership for stocks at the end of each year from the Thomson s34 file.&amp;nbsp; I currently run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname mywork 'C:\Users\Mine\SASfiles';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro signon;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %let wrds=wrds.wharton.upenn.edu 4016;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; options comamid=TCP remote=WRDS;&lt;/P&gt;&lt;P&gt;signon wrds username=_prompt_;&lt;/P&gt;&lt;P&gt;%mend signon;&lt;/P&gt;&lt;P&gt;%signon;&lt;/P&gt;&lt;P&gt;libname comp remote ('/wrds/comp/sasdata/nam' '/wrds/comp/sasdata/nam/index') server=wrds;&lt;/P&gt;&lt;P&gt;libname ibes remote ('/wrds/ibes/sasdata') server=wrds;&lt;/P&gt;&lt;P&gt;libname tfn remote('/wrds/tfn/sasdata/s34') server=wrds;&lt;/P&gt;&lt;P&gt;libname rwork slibref=work server=wrds;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options sasautos=('/wrds/wrdsmacros/', SASAUTOS) MAUTOSOURCE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let bdate='01jan2001'd;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*start calendar date of fiscal period beginning*/&lt;/P&gt;&lt;P&gt;%let edate='31dec2012'd;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*end calendar date of fiscal period end&amp;nbsp; */&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table thom as select mgrno, country, cusip, fdate, ticker, stkname, stkcdesc, shares/1000000 as sharesown, shrout1, shares/(shrout1*1000000) as instown from tfn.s34 where&lt;/P&gt;&lt;P&gt;(stkcdesc= 'COM' or stkcdesc='CMA' or stkcdesc='CMB' or stkcdesc='CMC' or stkcdesc='') and&lt;/P&gt;&lt;P&gt;year(fdate)&amp;gt;=%sysfunc(year(&amp;amp;bdate)) and year(fdate)&amp;lt;=%sysfunc(year(&amp;amp;edate)) and month(fdate)=12 and not missing(shrout1) and shrout2 ne 0;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;proc download data=thom out=mywork.thom;&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;&lt;P&gt;proc sort data=mywork.thom out=mywork.nodupthom nodupkey; by fdate mgrno cusip; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table mywork.totali as select cusip, fdate, sum(instown) as totalown from mywork.thom group by fdate, cusip;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this procedure results in a number of observations greater than 100% !&amp;nbsp; Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jan 2015 17:52:48 GMT</pubDate>
    <dc:creator>Prometheus</dc:creator>
    <dc:date>2015-01-19T17:52:48Z</dc:date>
    <item>
      <title>How to aggregate institutional ownership from thomson reuters?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-aggregate-institutional-ownership-from-thomson-reuters/m-p/189217#M47821</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 struggling to figure out a very straightforward task-- calculating the % of institutional ownership for stocks at the end of each year from the Thomson s34 file.&amp;nbsp; I currently run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname mywork 'C:\Users\Mine\SASfiles';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro signon;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %let wrds=wrds.wharton.upenn.edu 4016;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; options comamid=TCP remote=WRDS;&lt;/P&gt;&lt;P&gt;signon wrds username=_prompt_;&lt;/P&gt;&lt;P&gt;%mend signon;&lt;/P&gt;&lt;P&gt;%signon;&lt;/P&gt;&lt;P&gt;libname comp remote ('/wrds/comp/sasdata/nam' '/wrds/comp/sasdata/nam/index') server=wrds;&lt;/P&gt;&lt;P&gt;libname ibes remote ('/wrds/ibes/sasdata') server=wrds;&lt;/P&gt;&lt;P&gt;libname tfn remote('/wrds/tfn/sasdata/s34') server=wrds;&lt;/P&gt;&lt;P&gt;libname rwork slibref=work server=wrds;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options sasautos=('/wrds/wrdsmacros/', SASAUTOS) MAUTOSOURCE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let bdate='01jan2001'd;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*start calendar date of fiscal period beginning*/&lt;/P&gt;&lt;P&gt;%let edate='31dec2012'd;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*end calendar date of fiscal period end&amp;nbsp; */&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table thom as select mgrno, country, cusip, fdate, ticker, stkname, stkcdesc, shares/1000000 as sharesown, shrout1, shares/(shrout1*1000000) as instown from tfn.s34 where&lt;/P&gt;&lt;P&gt;(stkcdesc= 'COM' or stkcdesc='CMA' or stkcdesc='CMB' or stkcdesc='CMC' or stkcdesc='') and&lt;/P&gt;&lt;P&gt;year(fdate)&amp;gt;=%sysfunc(year(&amp;amp;bdate)) and year(fdate)&amp;lt;=%sysfunc(year(&amp;amp;edate)) and month(fdate)=12 and not missing(shrout1) and shrout2 ne 0;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;proc download data=thom out=mywork.thom;&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;&lt;P&gt;proc sort data=mywork.thom out=mywork.nodupthom nodupkey; by fdate mgrno cusip; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table mywork.totali as select cusip, fdate, sum(instown) as totalown from mywork.thom group by fdate, cusip;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this procedure results in a number of observations greater than 100% !&amp;nbsp; Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 17:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-aggregate-institutional-ownership-from-thomson-reuters/m-p/189217#M47821</guid>
      <dc:creator>Prometheus</dc:creator>
      <dc:date>2015-01-19T17:52:48Z</dc:date>
    </item>
  </channel>
</rss>

