BookmarkSubscribeRSS Feed
HannahPhD
Obsidian | Level 7

Hi everybody: I am trying to use the following MACRO to calculate quarterly CARs, SUEs, and ARs and I get multiple erros ; However I successfully connect to my WRDS account and have no problem with access. 

 

one of the errors: 

ERROR: Cannot open %INCLUDE file /wrds/comp/samples/size_bm.sas

 

The code and log of errors is attached. Anybody has any idea how can I fix it or can share a working MACRO? I contacted WRDS but they just refer me to manual and complicated programming details which I'm not familiar with. 

 

I appreciate your help very much. 

 

9 REPLIES 9
Rick_SAS
SAS Super FREQ

The error message is

306 %include '/wrds/comp/samples/size_bm.sas';
WARNING: Physical file does not exist, /wrds/comp/samples/size_bm.sas.
ERROR: Cannot open %INCLUDE file /wrds/comp/samples/size_bm.sas.

 

So it seems that the specified file is not in the /wrds/comp/samples directory.

HannahPhD
Obsidian | Level 7

Thanks for the reply. I contacted WRDS and they didn't offer any solution. Is there any other MACROS I can use that you are aware of? 

Reeza
Super User

The error is telling you that it's looking for a file:

 

'/wrds/comp/samples/size_bm.sas'

 

I'm not familiar with WRDS but my guess is that you may not have set something up properly? I would suggest checking the set up instructions in the manual they referred you to.

HannahPhD
Obsidian | Level 7

Thanks for getting back to me. It's a WRDS problem. The code needs to read data from WRDS and generate the results but it fails to read the dara in compustat and CRSP. WRDS support is not helpful at all either. I tried but still can't solve it. 

ballardw
Super User

What operating system are you running?

 

Post the exact code you submitted that generates the error.

HannahPhD
Obsidian | Level 7

Hi: attached is the code and error. baiscally it doesn't read CRSP and Compustat data, so it doesn't calculate bm-ratios. operating system is X64_8HOME WIN . Thanks for the help. 

ballardw
Super User

It will work much better to post code or log results into the code box opened with the {i} on the menu. Microsoft documents, besides problems with potential virus content and such, have a tendency to strip out formatting that helps indicate where actual errors occur

 

Your major problem may start here:

 

%include '/wrds/comp/samples/size_bm.sas';

WARNING: Physical file does not exist, /wrds/comp/samples/size_bm.sas. ERROR: Cannot open %INCLUDE file /wrds/comp/samples/size_bm.sas.

Either the path is incorrect or the code file doesn't exist in that location. If the code in that file is supposed to create the datasets or variables used in later steps then that may be the root cause.

 

If that code was supposed to put the variable USEDFLAG into the dataset LNK that may be the cause of the further errors referencing the missing variable USEDFLAG in LNK. Since the dataset COMP1 was supposed to be made but fails all of the later code that wants COMP1 also fails.

 

So start fixing those issues at the top. Verify the location and name of files, that you or the server running the program if any, has access to the paths used and permissions to read the file(s) and that spelling is correct. Note that case in the name may well matter. If the code references /size_bm.sas and the file is actually named Size_BM then the name may not match and hence not found.

Patrick
Opal | Level 21

Make sure that file /wrds/comp/samples/size_bm.sas physically exists where you're looking for it. Else copy the file to this path or change the path to where size_bm.sas exists.

 

If you don't have such a program at all then create it. Not sure if there is any copyright on this code but I found a source here: https://github.com/jblocher/sas_util/blob/master/size_bm.sas 

 

james3
Calcite | Level 5

Add this after rsubmit

 

%include '!SASROOT/wrdslib.sas' ; 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 2998 views
  • 1 like
  • 6 in conversation