BookmarkSubscribeRSS Feed
anavabi
Calcite | Level 5

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;

3 REPLIES 3
data_null__
Jade | Level 19

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
anavabi
Calcite | Level 5
  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
data_null__
Jade | Level 19

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1636 views
  • 0 likes
  • 2 in conversation