BookmarkSubscribeRSS Feed
ynot
SAS Employee
All the examples I've seen for the SAS (9.2) Function Compiler (fcmp) just have numbers, and I get returned error messages that my 'problem' column must be Numeric when I try to run the fcmp "read_array" code.

So, if I 'can' use text, what is the syntax for allowing it? (I know in non-fcmp arrays, I can add a $ to say that all the columns are text, so is there a similar way to do that in fcmp arrays, either "all the columns" or preferably mixed so that I can have 1 column as Text and a few other columns as Numeric).

I can post my simple test code, if needed.
2 REPLIES 2
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello Ynot,

I made some experimenting with character arrays and it looks like character values can not be passed or returned from functions or subroutines.May be it is worth to address your question to SAS Support.

Sincerely,
SPR
ynot
SAS Employee
I am posting my findings here, for reference.

Re FCMP "read_array" (that allows for multiple columns, read from an entire dataset)
--- "Currently, Read_Array() only supports NUMERIC arrays."

And, FCMP [multi-dimenstional or single] arrays are exactly like DATA step arrays... all elements have to have the same type.

Here is an example of declaring a Character Array in PROC FCMP.

proc fcmp;
array y[2] $ / nosymbols;
y[1] = 'foo';
y[2] = 'bar';
put y=;
run;

Thanks. Message was edited by: ynot

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 958 views
  • 0 likes
  • 2 in conversation