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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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