Hello
It is possible to run an external C function from SAS (https://support.sas.com/kb/40/562.html)
I have a similar scenario in which I invoke a java jar file from SAS using x commands.
I was wondering if it is possible to use a jar as shown below :
/* From https://support.sas.com/kb/40/562.html for a C language dll)
proc proto stdcall package=work.proto_ds.cfcns;
link 'c:\temp\myfactorial.dll';
int myfactorial(int n) ;
run;
/* What I am looking to do is something like this */
proc proto stdcall package=work.proto_ds.cfcns;
link 'c:\temp\myfactorial.jar';
int myfactorial(int n) ;
run;
Wondering if somebody has attempted something like this.
Only C and C++ are mentioned in the SAS documentation for PROTO and this functionally appears to go back at least to SAS 9.2 and doesn't look like it has changed much since then. I'm wondering if its a side-benefit from SAS being written in C. I doubt that PROTO goes beyond what the documentation says. Maybe there are alternative ways of adding Java functions.
You can't use proc proto, but you can use java objects in a data step, have a look at https://documentation.sas.com/doc/de/pgmsascdc/9.4_3.4/lecompobjref/n186ts6janpgypn1k6dldyuh3xqs.htm for details.
Thanks @andreas_lds for the response.
My intention was to enhance the capability of the SAS program using custom functions.
Unfortunately using the java object does not serve the purpose.
Looks like C/C++ is my only option.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.