Help using Base SAS procedures

Can a SAS FCmp Array contain TEXT values?

SAS Employee
Posts: 2

Can a SAS FCmp Array contain TEXT values?

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.
Super Contributor
Super Contributor
Posts: 365

Re: Can a SAS FCmp Array contain TEXT values?

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.

SAS Employee
Posts: 2

Re: Can a SAS FCmp Array contain TEXT values?

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=;

Thanks. Message was edited by: ynot
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation