Date: Sun, 6 Jul 2008 17:07:18 -0500
Reply-To: "data _null_," <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_," <datanull@GMAIL.COM>
Subject: Re: Calling C++ Routines from SAS
In-Reply-To: <200807062144.m66Al9mw008964@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
I think the MODULE family of functions is the way to do this; from the docs.
Dynamic link libraries (DLLs) are executable files that contain one or
more routines written in any of several programming languages. DLLs
are a mechanism for storing useful routines that might be needed by
many applications.
I don't have the expertise to help you but I found several references
to SASCBTBL searching at lexjansen.com. Also look at devenezia.com,
while I did not see a specific example related to C++ it would seem to
me that once a program is DLLified the underlying language is
"irrelevant".
On 7/6/08, Paul Walker <walker.627@osu.edu> wrote:
> I was wondering if it is possible to call functions written in C++ or C
> from within a datastep. Consider a simple example, a C++ function that
> takes the sum of two values. I would like to call such a function as
> follows, where "call_c_routine" is the imaginary function that allows you
> to run an externally defined C/C++ routine, passing in arguments i,j and
> getting a numeric return value x:
>
> data _null_;
> do i=1 to 10;
> do j=1 to 20;
>
> x = call_c_routine( 'sum', i , j );
> output;
>
> end;
> end;
> run;
>
> Is this possible? I have been looking at ModuleN and SASCBTBL but it
> appears these do not really achieve the above, instead are for more
> windows related tasks rather than calculations.
>
> - Paul
>
|