Hi,
I am trying to call a compiled c program using SAS. The c script was compiled using VS. Does anyone know how to do that? so that I can execute the c syntax in a do loop.
Many thanks!!
C.
This compiled program, is it compiled to an EXE? If so then you call that via your OS using X command or %sysfunc(). If its compiled to something else, a DLL or something then it will be different.
This compiled program, is it compiled to an EXE? If so then you call that via your OS using X command or %sysfunc(). If its compiled to something else, a DLL or something then it will be different.
It's compiled as an EXE and called by SAS for execution.
I realized that there are other options for compiling the script file such as DLL, and the DLL can be used by SAS with combination to Proc FTP.
Lots of options...for a newbie to C and VS.
Thanks everyone!
If it is something you can call from the commandline, you can use it as argument in a system() function call or in the call system() subroutine in a data step.
Caveat: you cannot run an executable on your desktop from SAS code that runs on a remote workspace server (SAS Studio or Enterprise Guide with a remote SAS server).
To catch the output from external commands to the SAS log, use filename pipe:
filename oscmd pipe "command 2>&1";
data _null_;
infile oscmd;
input;
put _infile_;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.