• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Integrating SAS and C++

Joined
4/29/10
Messages
2
Points
11
Hello all,

I will appreciate if you can help me with this problem.

I have a SAS database call it D((x(i)) of loan level data for a Mortgage deal comprising of static variables such as loan level information and dynamic information like time dependent Home Price Appreciation, Interest Rates etc.

I have an SAS code that has a regression model with model coefficients that takes the input of the Mortgage data and throws out the probability of default, prepayment, and loss given default for x(i,t)

I want to write a C++ program to integrate this and generate an excel output for an aggregated deal level monthly prepayment, default and loss severity curve.

The C++ program should do the following :
a) Read a deal name from a database of dealnames from an Excel File
b) Then read the database of loan level information from the loan level database called D for the deal
c) Run the regression model for each loan
d) Generate aggregated curves for prepayment, default and loss severity
e) Output the curves into excel for the specific deal name

I have heard people do it by packaging the SAS code into a dll and then using their C++ program to read it. But would appreciate if someone can help me with the same.

Any help will be greatly appreciated.
 
Well unfortunately I have the data and the coefficients of the SAS Model in a text file and have to build the C++ program on a different server. So I have to code the C++ program on a different server and would need to import the coefficients to the C++ server and then write the program to read from that.

Let me know if there us a way out.
 
export text file

You can export the text file to your server then read from there.

SAS does not put the field names in the output file unless you tell it to
do so, or you're using some utility that will do it for you.

something like this..

Data _null_;
set yourdata;
file "yourfile.tab" dlm='09'x dsd lrecl=1000;
put
...
;
Run;

let me know your results. Alternatively, check it out PROC EXPORT function. In version 9.1 and above the export function has improved a lot to support cross platforms integration through IOM.

cheers,
 
Back
Top