@Tom wrote:
I still don't get what you are doing and how ARRAY's get into it.
I am writing the arrays to a file which are snapshots of key variables in the data process used for logging. these are side calculations, IE I alrady am outputting multiple other datasets in the data statement I might need to output the same array multiple times at different stages and the lengths would be different so it is a lot easier to use mprint and put to output than to save them as a ton of datasets and output in another step, which is why I am trying to get a solution that works for the given data step.
here is another example of an array I would need to print that has multiple dimensions. I got to print like 10-20 of these in a single data step, and they are not the main output which is why I really cant use multiple data or proc steps
file mprint; put "ExARRAY(EX1,EX2,EX3,EX4)";
put "**************************";
do d1=1 to 2;
do d2 =1 to 2;
do d3 =1 to 7;
put @2 "d1= " d1 2. @9 "d2= " d2 2. @16 "d3= " d3 2.
@23 "V= " ExARRAY(d1,d2,d3,1) 4.
@30 "C= " ExARRAY(d1,d2,d3,2) 3.
@38 "F= " ExARRAY(d1,d2,d3,3) 2.;
end;
end;
end; file LOG;
I already can take the array name and variables as input: %print_array(array=Exarray, dimnames= ex1 ex2 ex3 ex4) and recreate this output code, including the @ placement. What I cannot recreate is the formatting. I have the lengths (for this example 2. 2. 2. 2. 4. 3. 2.) for each array as an integer in another array like in my example, but there is no way I know of in sas to make a format from that aside from macros, which doesnt work since they resolve before I can calculate the needed length for each array, which means I'm stuck doing what I currently do an manually specify the format lengths.
... View more