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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.