DATA Step, Macro, Functions and more

Proc Plan Question

Reply
New Contributor
Posts: 2

Proc Plan Question

In the below SAS code, how can I add a column to the output dataset which includes plot number from 1 to 12? Thanks

proc plan seed=17431;

   factors  Block=3 entry=4 / noprint;

   output out=Test;

run;

Respected Advisor
Posts: 3,799

Re: Proc Plan Question

How about this?

proc plan seed=17431;
  
factors Block=3 ordered entry=4 random plot=1 of 12 perm / noprint;
  
output out=Test;
   run;
proc print;
  
run;

12-10-2014 2-14-28 PM.png
New Contributor
Posts: 2

Re: Proc Plan Question

Posted in reply to data_null__
  1. Thanks. This was helpful. What if I want to add a column with name of the entries, say entry 1 is AA entry 2 is BB, entry 3 is CC and entry 4 is DD. Thanks
Respected Advisor
Posts: 3,799

Re: Proc Plan Question

You can use OUTPUT statement options change ENTRY into a string variable.

proc plan seed=17431;
  
factors Block=3 ordered entry=4 random plot=1 of 12 perm / noprint;
  
output out=Test entry cvals=('AA' 'BB' 'CC' 'DD');
   run;
proc print;
  
run;
12-10-2014 4-23-27 PM.png
Ask a Question
Discussion stats
  • 3 replies
  • 215 views
  • 0 likes
  • 2 in conversation