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

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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