12-27-2012 10:16 AM
I am using Proc FCMP to create an output array for each observation in my data set. I would like to aggregate those arrays into one data set at the end of Proc FCMP that I can use as input to the next part of my program. What I tried to do was use the write_array function passing it a macro variable for the data set name (something like rc = write_array('setdata&i', outarray) where I'm using i to loop through each data point earlier on in the procedure. My thought was then to take each of the setdata&i data sets and aggregate them after the Proc FCMP, but Proc FCMP doesn't seem to like having a macro variable stand in for the data set name. I've played around with the quotes, etc but nothing seemed to work. Can anyone help with the right syntax, or an alternative method to aggregate the arrays into one data set?
Thanks in advance!
12-27-2012 04:45 PM
You design does not sound very good. Are you attempting to perform some sort of transposition? The &i variable will not resolve inside single quotes. Using macro variables inside a compiled function in PROC FCMP would be a pretty poor practice and would not work unless the variable is defined as a global and would potentially have issues being resolved even then. Why don't you take the time and describe in full what it is you are attempting to do with your input data, provide sample input and output. The only answer to your current question I could provide is that there is no way to provide you with the syntax of write_array to accomplish what you are seeking to do, which I am not really even sure what that it...
12-28-2012 03:06 PM
If you have SAS risk dimensions licensed you can try some thing like this(don't know is this what you are looking for)
ENVIRONMENT OPEN = <options>;
WRITEARRAYS OUT= datasetname ;