Extracting DEF-14a Filings /w Perl
Posted: 07 March 2016 11:24 AM   [ Ignore ]
Newbie
Rank
Total Posts:  6
Joined  2016-03-07

Hi all,

For my thesis I need data that can be obtained from the DEF-14a filings on EDGAR. Is it possible to retrieve a DEF-14a index of the filings done between 2004 and 2014? I have been looking through the other threads, however mostly 10-K filings are needed. Also I’m still quite a newb with Perl so I’m having a hard time changing the Perl code for retrieving the 10-K filings (if that’s even possible).

Thanks in advance,
Gideau

Profile
 
 
Posted: 09 March 2016 09:39 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Gideau,

I have reorganized some code used for a paper and put it online, see https://github.com/JoostImpink/regulation-induced-disclosures

In ‘step 2’ you can change the 10-K form types into DEF-14A.

Perl has an active online community, so finding online help should be doable.

Best Regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 14 March 2016 08:12 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  6
Joined  2016-03-07

Hi Joost,

Thanks for the response! I’ve been trying to use the code from your website, however I can’t seem to get it right. I’ve attached the SAS code that specifies the errors (4) that have occurred when running the script. Also for some reason SAS wouldn’t let me use the assigned ProjectDir, which is why I used full file paths througout the code. As I’m not sure what is going wrong I was hoping you could share your insights:).

Thanks in advance!
Gideau

PS: I’m using SAS university edition on a server. Not sure if this could affect the way the code works…

File Attachments
14DEF_code.txt  (File Size: 2KB - Downloads: 174)
14DEF_errors.txt  (File Size: 4KB - Downloads: 129)
Profile
 
 
Posted: 14 March 2016 08:02 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Gideau,

SAS points out what it doesn’t like (in the errors file). When you create a table, you give it a name/location by specifying the library (directory) and dataset name, like ‘create table myLib.funda as ...’ where myLib is the library name (needs to be assigned), and funda would be the dataset name.

By the way, are you sure that the form name is ‘def 14a’ (with a space)?

Best,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 15 March 2016 04:14 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  6
Joined  2016-03-07

Hi Joost,

Thanks for the fast response! I’ve been trying it again and for some reason it’s been working (well almost). Now there’s only 1 error between me and the indexed DEF 14A files:
459           edgar.filings b
460         where
461           formtype IN (“DEF 14A”);
ERROR: File EDGAR.FILINGS.DATA does not exist.

SAS is telling me that the edgar.filings does not exist. I have checked everything such as file name etc.

Again SAS also tells me the following:
64       /*Location where the SEC archive is extracted */
65       libname edgar “&projectDir;.edgar”;
NOTE: Library EDGAR does not exist.

I’m not sure why it says that the edgar library does not exist, since it should be and is there. I’ve tried to use the file path instead of just edgar.filings, however no luck in that either. I’m probably missing something, but until now I have no clue what it might be and I hope you might have!

Thanks really much again and sorry to bother you with this presumably simple stuff smile

Gideau

Profile
 
 
Posted: 15 March 2016 05:23 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Gideau,

Instead of a macro variable, try to hardcode, like libname edgar “C:\temp”; (make sure it exists)

Best Regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 15 March 2016 05:57 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  6
Joined  2016-03-07

Yesss I’m one step further, it worked!

Thanks a lot smile

Profile
 
 
Posted: 15 March 2016 08:17 AM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  6
Joined  2016-03-07

Hi Joost,

Okay I’m sorry to bother you again with all these questions.. However again I can’t seem to get something right.

In step 3 of your nice and detailed guide the following occurs:
I’m trying to let Perl run the script in order to download all the DEF 14A files that are now succesfully indexed through SAS. However, when I run the script perl gives me the following error:
“Can’t call method “filingsToDownload"without a package or object reference at download.pl at line 32.”

The piece of code until line 32 looks like this:

# Directory to write the filings (make sure it exists)
$write_dir '..\DEF14A_filings';
#
# Filename that holds downloadIds and the urls 
# (make sure it exists in same folder as this script)
$filings '..\perl_download_these.txt';
#######################################################

# helper function to retrieve url (filing from Edgar)
sub get_http {
 my $url 
shift;
 
my $request HTTP::Request->new(GET => $url);
 
my $response $ua->request($request);
 if (!
$response->is_success{
  
print STDERR "GET '%s' failed: %s\n",
  
$url$response->status_line;
  return 
undef;
 
}
 
return $response->content;
}
# user agent object for handling HTTP requests
my $ua LWP::UserAgent->new;

# open file that holds all downloadIds and urls
open filingsToDownload $filings or die $!; 

Which is still basically the same as the original, except that I changed the output directory.
Everything exists, and the file that holds the downloadIds is in the same directory as the script so again I’m a bit clueless on what’s happening here.

Once again thank you for helping me!

Profile
 
 
Posted: 15 March 2016 09:34 AM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  6
Joined  2016-03-07

Update: I managed to get it working and it’s downloading the files now:).

I changed line 32 to open dlthis, “perl_download_these.txt” or die $!;  and that worked smile.

Profile
 
 
Posted: 15 March 2016 10:51 AM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

excellent smile

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile