I want to run a python file from SAS EG using the PROC FCMP procedure, however declaring the python object SAS gives me a syntax error even on the most basic component (see below):
proc fcmp;
declare object py(python);
run;
Running this gives me the following errors:
NOTE: Writing HTML(EGHTML) Body file: EGHTML
27
28
29 proc fcmp;
30 declare object py(python);
______
22
76
ERROR 22-322: Syntax error, expecting one of the following: HASH, HITER.
ERROR 76-322: Syntax error, statement will be ignored.
31 run;
NOTE: Execution aborted because of errors in program.
Reenter the corrected program or enter "QUIT;" to exit procedure.
Can anyone please help
Hi @kashlik123
Just an idea: Calling Phyton functions from FCMP came with 9.4 M6, so it wouldn't work in M5 or older.
Hi @kashlik123
Just an idea: Calling Phyton functions from FCMP came with 9.4 M6, so it wouldn't work in M5 or older.
Run this:
%put &sysvlong;
and post the log.
9.03.01M1P110211
@kashlik123 wrote:
9.03.01M1P110211
That is SAS 9.3 and way before any of the Python stuff is available
I tried running the same code on a different server with SAS 9.4. Here are the results:
30 %put &sysvlong;
9.04.01M3P062415
31
32 proc fcmp;
33 declare object py(python);
ERROR: Object type 'python' not found for object creation.
34 quit;
Any idea what might cause this?
M3 means maintenance level 3, so still too old. Current ML is 9.4M7.
@kashlik123 wrote:
I tried running the same code on a different server with SAS 9.4. Here are the results:
30 %put &sysvlong; 9.04.01M3P062415 31 32 proc fcmp; 33 declare object py(python); ERROR: Object type 'python' not found for object creation. 34 quit;
Any idea what might cause this?
You are using a 10 year old version of SAS.
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.