DATA Step, Macro, Functions and more

Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

Reply
Occasional Contributor
Posts: 17

Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

[ Edited ]

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. 

 

SAS Super FREQ
Posts: 3,475

Re: Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

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.

Occasional Contributor
Posts: 17

Re: Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

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? 

Super User
Posts: 17,745

Re: Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

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.

Occasional Contributor
Posts: 17

Re: Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

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. 

Super User
Posts: 10,466

Re: Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

What operating system are you running?

 

Post the exact code you submitted that generates the error.

Occasional Contributor
Posts: 17

Re: Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

[ Edited ]

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. 

Super User
Posts: 10,466

Re: Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

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.

Respected Advisor
Posts: 3,886

Re: Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

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 

 

Occasional Learner
Posts: 1

Re: Problem with SAS WRDS MACRO FOR CARs, SUE, and ARs by Denys Glushkov

Add this after rsubmit

 

%include '!SASROOT/wrdslib.sas' ; 

Ask a Question
Discussion stats
  • 9 replies
  • 542 views
  • 1 like
  • 6 in conversation