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 2025: Call for Content

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!

Submit your idea!

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
  • 1109 views
  • 0 likes
  • 2 in conversation