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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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