Balanced Incomplete Block Design

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: OPTEX8                                              */
 /*   TITLE: Balanced Incomplete Block Design                    */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Optimal Designs,                                    */
 /*   PROCS: OPTEX                                               */
 /*    DATA:                                                     */
 /*                                                              */
 /*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
 /*          First Edition, Volume 1 and Volume 2                */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/

 options ps=60;

 data can;
    do tmt = 1 to 7;
       do blk = 1 to 7;
          output;
          end;
       end;
 proc optex data=can seed=8327 coding=orth;
    class tmt blk;
    model tmt blk;
    generate n=21;
 run;


 data can;
    do tmt = 1 to 7;
       output;
       end;
 proc optex data=can seed=73462 coding=orth;
    class tmt;
    model tmt;
    blocks structure=(7)3;
    output out=bibd blockname=blk;
 run;

 proc print data=bibd;
 run;