/**********************************************************************/


/* Test 1:  I/O Rate and Disk Usage (FREQ.SAS)                        */
          
/********************************************************/
/*          S A S   S A M P L E   L I B R A R Y         */
/*                                                      */
/*    NAME: FREQ                                        */
/*   TITLE: FREQUENCY AND CROSS TABULATIONS             */
/* PRODUCT: SAS                                         */
/*  SYSTEM: ALL                                         */
/*    KEYS: DSTAT TABS CAT                              */
/*   PROCS: FREQ PRINT                                  */
/*    DATA:                                             */
/*                                                      */
/* SUPPORT: WMS                         UPDATE:         */
/*     REF:                                             */
/*    MISC:                                             */
/*                                                      */
/*********************************************************/
                                                           
options fullstimer source source2 mprint notes;            
title '----------FREQ SAMPLE RUN----------';               
data a;                                                    
   length default=4;                                       
   do n=1 to 1000;                                         
      y=int(uniform(77777)*5);                             
      x=int(uniform(77777)*7);                             
      w=uniform(77777)*10;                                 
      z=int(uniform(77777)*24);                            
      c=' ';
      if w>2 then c='A';                       
      if w>7 then c='B';                       
      output;                                  
   end;                                        
run;                                           
                                               
proc freq;                                     
   tables (y c) * (x z) w;                     
   tables x*z / norow nocol nopercent;         
   format w 4.1;                               
run;                                           
                                               
proc freq;                                     
   tables x*y /noprint out=b;                  
run;                                           
                                               
proc print;                                    
run;                                           
                                               
proc freq data=a;                              
   tables x*y/all;                             
run;                                           
                                               

/**********************************************************************/


/* Test 2:  Memory Utilization (SORT.SAS)                             */   

options fullstimer source source2 mprint notes;
                                               
data a;                                        
   length default=4;                                                                          
   do n=1 to 1000;                                          
      y=int(uniform(77777)*5);                              
      x=int(uniform(77777)*7);                              
      w=uniform(77777)*10;                                  
      z=int(uniform(77777)*24);                             
      c=' ';                                                
      if w>2 then c='A';                                    
      if w>7 then c='B';                                    
      output;                                               
   end;                                                     
run;                                                        
                                                            
proc sort data=a;                                           
   by x;                                                    
run;                                                        
                                                            
proc means data=a;                                          
run;                                                        


/**********************************************************************/


/* Test 3: CPU and Numerical Processing Speed                         */
        
/**********************************************************/
/*          S A S   S A M P L E   L I B R A R Y           */
/*                                                        */
/*    NAME: MIXEX6                                        */
/*   TITLE: Documentation Example 6 from PROC MIXED       */
/* PRODUCT: STAT                                          */
/*  SYSTEM: ALL                                           */
/*    KEYS: MIXED                                         */
/*   PROCS: MIXED                                         */
/*    DATA:                                               */
/*                                                        */
/* SUPPORT: NMM          UPDATE:                          */
/*     REF:                                               */
/*    MISC: This job may require considerable CPU time.   */
/*                                                        */
/**********************************************************/

options fullstimer source source2 mprint notes;             
  *----------Line-Source Sprinkler Irrigation---------*     
  | Data represent an example where both G and R can  |     
  | be modelled.  The data appear in Hanks et al.     |     
  | (1980), Johnson et al. (1983), and Stroup (1989). |     
  *---------------------------------------------------*;    
                                                            
data line;                                                  
   length cult$ 8;                                          
   input blk cult$ @;                                       
   do sbplt=1 to 12;                                        
      if sbplt le 6 then                                    
         do;                                                
           irrig=sbplt;                                     
           dir='North';                                     
         end;                                               
      else do;                                              
         if sbplt=7 then irrig=6;                           
         if sbplt=8 then irrig=5;                           
         if sbplt=9 then irrig=4;                           
         if sbplt=10 then irrig=3;                          
         if sbplt=11 then irrig=2;                          
         if sbplt=12 then irrig=1;                          
         dir='South';                                       
      end;                                                  
      input y @; output;                                    
   end;                                                     
   cards;                                                   
1 Luke     2.4 2.7 5.6 7.5 7.9 7.1 6.1 7.3 7.4 6.7 3.8 1.8  
1 Nugaines 2.2 2.5 4.3 6.3 7.9 7.1 6.2 5.3 5.3 5.2 5.4 2.9  
1 Bridger  2.9 3.2 5.1 6.9 6.1 7.5 5.6 6.5 6.6 5.3 4.1 3.1  
2 Nugaines 2.4 2.5 4.0 5.8 6.1 6.2 7.0 6.4 6.7 6.4 3.7 2.2  
2 Bridger  2.6 3.1 5.7 6.4 7.7 6.8 6.3 6.2 6.6 6.5 4.2 2.7  
2 Luke     2.2 2.7 4.3 6.9 6.8 8.0 6.5 7.3 5.9 6.6 3.0 2.0  
3 Nugaines 1.8 1.9 3.7 4.9 5.4 5.1 5.7 5.0 5.6 5.1 4.2 2.5  
3 Luke     2.1 2.3 3.7 5.8 6.3 6.3 6.5 5.7 5.8 4.5 2.7 2.3  
3 Bridger  2.7 2.8 4.0 5.0 5.2 5.2 5.9 6.1 6.0 4.3 3.1 3.1  
;                                                           
                                                            
   /* WARNING: This job may require considerable CPU time */
proc mixed;                                                 
   class blk cult dir irrig;                                
   model y=cult|dir|irrig@2;                                
   random blk blk*dir blk*irrig;                            
   repeated / type=toep(4) sub=blk(cult) r;                 
   lsmeans cult|irrig;                                      
   estimate 'c1 vs c2' cult 1 -1 0;                         
   estimate 'linear irrig' irrig -5 -3 -1 1 3 5;            
   estimate 'c1 vs c2 x linear irrig' cult*irrig            
            -5 -3 -1 1 3 5 5 3 1 -1 -3 -5;
run;                                               


/**********************************************************************/


/* Test 4:  Graphics Processing Speed (HAT.SAS)                       */  
                                                   
options fullstimer source source2 mprint notes;    
goptions noprompt                                  
         ftext=zapfb                               
         ctext=white                               
         lfactor=2                                 
         cback=black                               
         htext=1.5;                                
                                                   
data work.cowboy;                                  
   do xaxis= -5 to 5 by .2;                        
      do yaxis= -5 to 5 by .2;                     
         zaxis=sin(sqrt(xaxis*xaxis+yaxis*yaxis)); 
         output;                                   
      end;                                         
   end;                                            
                                                   
proc g3d;                                          
   plot yaxis*xaxis=zaxis/                         
        caxis=white                                
        tilt=0 to 90 by 15                         
        rotate=0 to 90 by 15                       
        nolabel                                    
        noaxis                                     
        ctext=white;
run;                                                      
endsas;                                                   


/**********************************************************************/


/* Test 5: System Load Testing via Batch Submission                   */

% sas freq.sas &; sas sort.sas &; sas glm.sas &;          
sas hat.sas &                                             


/**********************************************************************/