Is there a possibility to direct put statement to sas file ?
I need to export i
Sample code:
data COM;
array x[5] $3 ('a' 'b' 'c' 'd' 'e');
array c[3] $3;
array i[3];
n=dim(x);
k=dim(i);
i[1]=0;
ncomb=comb(n,k); /* The one extra call goes back */
do j=1 to ncomb+1; /* to the first combination. */
call allcombi(n, k, of i
do h=1 to k;
c
end;
*put @4 j= @10 'i= ' i
put c
output ;
end;
run;
PUT output can be directed to a text file by adding a FILE statement in the data step;
Data com;
file "put the name of your output file here";
<other code>
run;
I'm not sure what you mean by "SAS file" as SAS uses a fair number of different file types: data set, catalog, transport, programs as well as generating output in many more formats.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.