Learning SAS? Welcome to the exclusive online community for all SAS learners.

SAS macro for weighted Cox model

Posts: 23

SAS macro for weighted Cox model

[ Edited ]

Hi all, Not sure if someone will be able to help me with this, but here goes!


I have run into a situation where my Cox regression analysis violates the proportional hazards assumption. I have found some papers that talk about getting an average regression effect ("averaged over the censoring-corrected density of event times"). Article: https://cemsiis.meduniwien.ac.at/fileadmin/msi_akim/CeMSIIS/KB/programme/wcm.pdf

This article goes through a macro that does weighted estimation to give a hazard ratio estimate.


I was able to download the macro files at this link: https://cemsiis.meduniwien.ac.at/en/kb/science-research/software/statistical-software/wcmcoxphw/

Unfortunately, the article's instructions to install the macro do not seem to apply to SAS University.

Below are the instructions:


1. (a) Create a new folder (e. g. c:\MYFOLDER\DLLs) where you save the files wcm.def, wcm.dll andwcmexe.exe included in the ZIP file.

(b) In file wcm.sas change the default value of the path option in the macro header to path=%str(c:\MYFOLDER\DLLs\) and save wcm.sas.

2. In the following, we assume that SAS9 has been installed into the folderC:\Program Files\SAS\SAS 9.1\. In that folder, you will find a file called SASV9.CFG. Open it, it points to one or several other SASV9.CFG files which contain information that is used each time SAS is opened. If you have only an english version of SAS 9 installed, then the file reads like

-CONFIG "C:\Program Files\SAS\SAS 9.1\nls\en\SASV9.CFG"

Now open C:\Program Files\SAS\SAS 9.1\nls\en\SASV9.CFG.

After the two lines

      /* Setup the SAS System load image search paths definition */

      -PATH          (

insert the line "c:\MYFOLDER\DLLs"
and save C:\Program Files\SAS\SAS 9.1\nls\en\SASV9.CFG. This point has to repeated for each file that appears in the CONFIG statement of C:\Program Files\SAS\SAS 9.1\SASV9.CFG

3. Restart SAS 9.



The roadblock is with step #2 since I do not know where to access SASV9.CFG on SAS University.


Can anyone give me some advice as to how I can download this macro in SAS university? I would be forever grateful! I have been frustrated with this analysis for a long time, so I'm hoping that this macro's method will work!


Thank you!

Super User
Posts: 13,886

Re: SAS macro for weighted Cox model

The SAS UE is considered a training environment and as such is not designed to allow adding in third party DLLs. Also the UE is a LINUX application which is why it is run in an emulator like VMware to run LINUX on a windows platform. So UE could not use a Windows based DLL. And lastly the DLL appears old enough it might not be compatible with later versions of Windows.


You might be better off starting with posting the code you were using. That may give us a better starting point for where to look for options that will run in SAS UE. Since there are several procedures that do COX regression we would tend to be guessing  what you have attempted so far.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation