1    /* SAS PROGRAM FOR ACROSS-SITE DIALLEL ANALYSIS */
2
3    /* This program will run a full BLUP to predict parental GCA and
4       individual tree breeding values.  The program is set up to handle
5       a dataset with up to 99 parents.  I suspect that many folks might
6       run into memory problems with that many parents, but the code should function.  */
7
8    libname outdir 'D:\NewProjects\2005_MontBombaSelections\MontBombaDiallel';
NOTE: Libref OUTDIR was successfully assigned as follows:
      Engine:        V9
      Physical Name: D:\NewProjects\2005_MontBombaSelections\MontBombaDiallel
9    /* Set Var1 = variable for Analysis */
10   %let var1=VOL12;
11   %let var2=ht12;
12   %let var3=dbh12;
13   run;
14
15   /* The SAS data set for the diallel analysis must contain the following variables:
16      testid, rep, female, male, VOL (or the trait of interest).  The data set may
17      also contain many other variables.  */
18
19   data diallel; set outdir.montdia2005;
20     if test=1 then testid="12.16";
21     if test=2 then testid="12.14";
22     if fill12="X" then delete;
23     tree=tn;
24     *if substr(female,1,2)='CC' or substr(male,1,2)='CC' then delete;
25     if &var1=. then delete;
26
27     keep testid set rep female male VOL12 ht12 dbh12 tree st12 bd12 ba12;
28   run;

NOTE: There were 6326 observations read from the data set OUTDIR.MONTDIA2005.
NOTE: The data set WORK.DIALLEL has 6326 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.25 seconds
      cpu time            0.06 seconds


29
30   /* Calculation of Test means */
31
32   PROC SORT data=diallel; by testid set rep;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set WORK.DIALLEL has 6326 observations and 12 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.11 seconds
      cpu time            0.08 seconds


33   proc means data=diallel; by testid;
34   var &var1 &var2 &var3;
35   output out=outdir.testmns
36   mean= &var1 &var2 &var3;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set OUTDIR.TESTMNS has 2 observations and 6 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.56 seconds
      cpu time            0.24 seconds


37   PROC MEANS noprint data=diallel;
38   var &var1 &var2 &var3;
39   output out=outdir.grandmns mean= &var1 &var2 &var3;
40
41   /* Calculation of covariances */
42   /* This section calculates the Coefficient of Variation for the traits of interest.
43      This will only be necessary for traits where the mean and variance are correlated,
44      which is typical of growth traits like height, dbh, and volume.  The CV is calculated
45      in each rep, and then averaged across reps. */
46

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set OUTDIR.GRANDMNS has 1 observations and 5 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.07 seconds
      cpu time            0.05 seconds


47   PROC MEANS noprint data=diallel; by testid set rep;
48   var &var1 &var2 &var3;
49   output out=repmns
50   mean=&var1 &var2 &var3 std=sd&var1 sd&var2 sd&var3;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set WORK.REPMNS has 36 observations and 11 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.05 seconds
      cpu time            0.05 seconds


51   data cv; set repmns;
52   cv&var1 = 100*sd&var1/&var1;
53   cv&var2 = 100*sd&var2/&var2;
54   cv&var3 = 100*sd&var3/&var3 ;

NOTE: There were 36 observations read from the data set WORK.REPMNS.
NOTE: The data set WORK.CV has 36 observations and 14 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds


55   PROC MEANS data=cv;
56   var cv&var1 cv&var2 cv&var3;
57   run;

NOTE: There were 36 observations read from the data set WORK.CV.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


58
59   /* Set up macro variables for cv */
60   data cv; set cv;
61     call symput('cv1',cv&var1);
62     call symput('cv2',cv&var2);
63     call symput('cv3',cv&var3);

NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      1:1   1:1   1:1
NOTE: There were 36 observations read from the data set WORK.CV.
NOTE: The data set WORK.CV has 36 observations and 14 variables.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      cpu time            0.06 seconds


64   proc print data=cv; run;

NOTE: There were 36 observations read from the data set WORK.CV.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.06 seconds
      cpu time            0.03 seconds


65
66   /* Standardization of the growth variables */
67   /* The value for 'std=xx' is the mean CV from the above procedure */
68   PROC STANDARD data=diallel mean=100 std=&cv1 out=diallel; by testid set rep;
69   var &var1;

NOTE: The data set WORK.DIALLEL has 6326 observations and 12 variables.
NOTE: PROCEDURE STANDARD used (Total process time):
      real time           0.04 seconds
      cpu time            0.05 seconds


70   PROC STANDARD data=diallel mean=100 std=&cv2 out=diallel; by testid set rep;
71   var &var2;

NOTE: The data set WORK.DIALLEL has 6326 observations and 12 variables.
NOTE: PROCEDURE STANDARD used (Total process time):
      real time           0.05 seconds
      cpu time            0.06 seconds


72   PROC STANDARD data=diallel mean=100 std=&cv3 out=diallel; by testid set rep;
73   var &var3;run;

NOTE: The data set WORK.DIALLEL has 6326 observations and 12 variables.
NOTE: PROCEDURE STANDARD used (Total process time):
      real time           0.06 seconds
      cpu time            0.06 seconds


74
75   /* ANALYSIS OF DIALLEL DATA */
76
77   /* Generate a list of the male and female parents */
78   PROC SORT data=diallel; by female;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set WORK.DIALLEL has 6326 observations and 12 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.06 seconds
      cpu time            0.06 seconds


79   data females; set diallel; by female;
80   if first.female; parent=female; keep parent;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set WORK.FEMALES has 39 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds


81   PROC SORT data=diallel; by male;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set WORK.DIALLEL has 6326 observations and 12 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.06 seconds
      cpu time            0.06 seconds


82   data males; set diallel; by male;
83   if first.male; parent=male; keep parent;
84
85   /* Combine the two lists of females and males into one list of parents */

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set WORK.MALES has 44 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.05 seconds


86   data parents; set females males;

NOTE: There were 39 observations read from the data set WORK.FEMALES.
NOTE: There were 44 observations read from the data set WORK.MALES.
NOTE: The data set WORK.PARENTS has 83 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.05 seconds


87   PROC SORT; by parent;

NOTE: There were 83 observations read from the data set WORK.PARENTS.
NOTE: The data set WORK.PARENTS has 83 observations and 1 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.04 seconds
      cpu time            0.05 seconds


88   data parents; set parents; by parent; if first.parent; run;

NOTE: There were 83 observations read from the data set WORK.PARENTS.
NOTE: The data set WORK.PARENTS has 52 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds


89   proc freq data=parents;
90     tables parent / all;
91     output out=numpar n;
92   run;

NOTE: There were 52 observations read from the data set WORK.PARENTS.
NOTE: The data set WORK.NUMPAR has 1 observations and 1 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.36 seconds
      cpu time            0.08 seconds


93   data numpar; set numpar;
94     call symput('numpar',n);
95   run;

NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      94:24
NOTE: There were 1 observations read from the data set WORK.NUMPAR.
NOTE: The data set WORK.NUMPAR has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds


96
97   /* Create variables for use in Proc Mixed to designate
98      P1 P2 ... PN  and test*P1 test*P2 ... test*PN
99      in the Random statements */
100  data listpar;
101  length mixpar $400;
102  length mixpxt $1100;
103  mixpar='P1X';
104  mixpxt='testid*P1X';

NOTE: The data set WORK.LISTPAR has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.04 seconds


105  data listpar; set listpar;
106  do i=2 to &numpar;
107   mixpar = compress(mixpar||'P'||i)||'X';
108   mixpxt = compress(mixpxt||'testid*P'||i)||'X';
109  end;
110  output;

NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      107:33   108:40
NOTE: There were 1 observations read from the data set WORK.LISTPAR.
NOTE: The data set WORK.LISTPAR has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.06 seconds


111  data listpar; set listpar;
112    mixpar=translate(mixpar,' P','XP');
113    mixpxt=translate(mixpxt,' t','Xt');
114  run;

NOTE: There were 1 observations read from the data set WORK.LISTPAR.
NOTE: The data set WORK.LISTPAR has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.05 seconds


115  proc print;
116  run;

WARNING: Data too long for column "mixpar"; truncated to 92 characters to fit.
WARNING: Data too long for column "mixpxt"; truncated to 92 characters to fit.
NOTE: There were 1 observations read from the data set WORK.LISTPAR.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.02 seconds
      cpu time            0.02 seconds


117  data mixlist; set listpar;
118  call symput('mixpar',mixpar);
119  call symput('mixpxt',mixpxt);
120  run;

NOTE: There were 1 observations read from the data set WORK.LISTPAR.
NOTE: The data set WORK.MIXLIST has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds


121
122  /* Create dummy variables for each parent to generate a Design Matrix for parents*/
123  PROC IML;
NOTE: IML Ready
124  use parents;
124!              read all var {parent} into P;
125  nparents=nrow(P);
126  close parents;
127
128  codes99='P1':'P99';
129  codes=codes99[1:nparents];
130  print codes P;
131
132  use diallel;
133  read all var {female male} into FM;
134  /* FM is the list of female and male parents for all observations */
135  n=nrow(FM);
136  /* n = number of observations */
137
138  /* Create parent design matrix D (n rows x nparents columns)
139     There is a 1 in the two colums corresponding to the male and female parents */
140    D=shape(0,N,nparents);
141    do I=1 to N;
142      do J=1 to nparents;
143        if FM[I,1]=P[J,1] | FM[I,2]=P[J,1] then D[I,J]=1;
144      end;
145    end;
146
147  /* Create a SAS data set DUMMY from the design matrix D */
148  create DUMMY from D [colname=codes];
149  append from D /*[colname=codes]*/;
150  quit;
NOTE: Exiting IML.
NOTE: The data set WORK.DUMMY has 6326 observations and 52 variables.
NOTE: 187 workspace compresses.
NOTE: PROCEDURE IML used (Total process time):
      real time           3.04 seconds
      cpu time            2.85 seconds


151
152  /* Merge the dummy variables onto the diallel data set */
153  data diallel;
154  merge diallel DUMMY;
155  run;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: There were 6326 observations read from the data set WORK.DUMMY.
NOTE: The data set WORK.DIALLEL has 6326 observations and 64 variables.
NOTE: DATA statement used (Total process time):
      real time           0.55 seconds
      cpu time            0.11 seconds


156
157  /* Run Proc Mixed on Macro Variable var1 */
158
159  ODS listing close;
160
161  PROC MIXED data=diallel covtest noitprint; class female male rep testid;
162       model &var1=testid rep(testid) / outpm=pm&var1;  /* testid and rep are fixed effects
162! */
163       random &mixpar/type=toep(1) solution vi;
164       /* GCA effects.
165          The option TYPE=TOEP(1) estimates a single variance component across all levels of
165! parent.
166          The option SOLUTION generates the BLUPs which will be output later */
167       random female*male;
168       /* SCA effects */
169       random &mixpxt/type=toep(1);
170       /* GCA x Test (Parent x Test)
171          The option TYPE=TOEP(1) estimates a single variance component across all levels of
171! parent */
172       random female*male*testid;
173       /* SCA x Test */
174       ODS output covparms=parms&var1;
175       /* Write the parameter estimates into a SAS data set */
176       ODS output solutionR=BLUP&var1;
177       /* Write the BLUP solutions into a SAS data set */
178       ODS output invV=vi&var1;
179       /* Write the inverse(V) matrix into SAS data set for later use in IML to predict
180          within-family additive genetic value */
181  run;

NOTE: The data set WORK.VIVOL12 has 6326 observations and 6328 variables.
NOTE: The data set WORK.BLUPVOL12 has 485 observations and 9 variables.
NOTE: The data set WORK.PARMSVOL12 has 5 observations and 5 variables.
NOTE: The data set WORK.PMVOL12 has 6326 observations and 71 variables.
NOTE: PROCEDURE MIXED used (Total process time):
      real time           7:49:44.15
      cpu time            7:48:02.56


182
183  ODS listing;
184
185  /* Clean the parameter estimate data set */
186  PROC SORT data=parms&var1; by covparm;

NOTE: There were 5 observations read from the data set WORK.PARMSVOL12.
NOTE: The data set WORK.PARMSVOL12 has 5 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.23 seconds
      cpu time            0.05 seconds


187  data parms&var1; set parms&var1; by covparm;
188  Trait="&var1"; /* Para definir uma caracterstica em especfico */
189  if first.covparm and covparm='Variance' then covparm='GCA';
190  if last.covparm and covparm='Variance' then covparm='GCA*testid';

NOTE: There were 5 observations read from the data set WORK.PARMSVOL12.
NOTE: The data set WORK.PARMSVOL12 has 5 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.52 seconds
      cpu time            0.05 seconds


191  PROC PRINT; run;

NOTE: There were 5 observations read from the data set WORK.PARMSVOL12.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.16 seconds
      cpu time            0.01 seconds


192
193  data gca gxt sca sxt error; set parms&var1;
194  if covparm='GCA' then output gca;
195  if covparm='GCA*testid' then output gxt;
196  if covparm='female*male' then output sca;
197  if covparm='female*male*testid' then output sxt;
198  if covparm='Residual' then output error;

NOTE: There were 5 observations read from the data set WORK.PARMSVOL12.
NOTE: The data set WORK.GCA has 1 observations and 6 variables.
NOTE: The data set WORK.GXT has 1 observations and 6 variables.
NOTE: The data set WORK.SCA has 1 observations and 6 variables.
NOTE: The data set WORK.SXT has 1 observations and 6 variables.
NOTE: The data set WORK.ERROR has 1 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.25 seconds
      cpu time            0.13 seconds


199  data gca; set gca; vgca=estimate; keep trait vgca;

NOTE: There were 1 observations read from the data set WORK.GCA.
NOTE: The data set WORK.GCA has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.09 seconds
      cpu time            0.04 seconds


200  data gxt; set gxt; vgxt=estimate; keep trait vgxt;

NOTE: There were 1 observations read from the data set WORK.GXT.
NOTE: The data set WORK.GXT has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.04 seconds


201  data sca; set sca; vsca=estimate; keep trait vsca;

NOTE: There were 1 observations read from the data set WORK.SCA.
NOTE: The data set WORK.SCA has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.14 seconds
      cpu time            0.04 seconds


202  data sxt; set sxt; vsxt=estimate; keep trait vsxt;

NOTE: There were 1 observations read from the data set WORK.SXT.
NOTE: The data set WORK.SXT has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.06 seconds
      cpu time            0.03 seconds


203  data error; set error; verror=estimate; keep trait verror;

NOTE: There were 1 observations read from the data set WORK.ERROR.
NOTE: The data set WORK.ERROR has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.04 seconds


204  data outdir.parms&var1; merge gca gxt sca sxt error;
205  vphen = 2*vgca + 2*vgxt + vsca + vsxt + verror;
206  h2=4*vgca/vphen;
207  rbg=vgca/(vgca+vgxt);
208  d2=4*vsca/vphen;
209  rbd=vsca/(vsca+vsxt);
210  gainpot=2*sqrt(vgca);

NOTE: There were 1 observations read from the data set WORK.GCA.
NOTE: There were 1 observations read from the data set WORK.GXT.
NOTE: There were 1 observations read from the data set WORK.SCA.
NOTE: There were 1 observations read from the data set WORK.SXT.
NOTE: There were 1 observations read from the data set WORK.ERROR.
NOTE: The data set OUTDIR.PARMSVOL12 has 1 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.37 seconds
      cpu time            0.09 seconds


211  proc print; run;

NOTE: There were 1 observations read from the data set OUTDIR.PARMSVOL12.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.09 seconds
      cpu time            0.02 seconds


212
213
214  /* Clean the BLUP data set */
215  data gca&var1 sca&var1; set blup&var1;
216  trait="&var1";
217  if testid='   ';
218  if female='   ' and male='   ' then output gca&var1; else output sca&var1;

NOTE: There were 485 observations read from the data set WORK.BLUPVOL12.
NOTE: The data set WORK.GCAVOL12 has 52 observations and 10 variables.
NOTE: The data set WORK.SCAVOL12 has 112 observations and 10 variables.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      cpu time            0.08 seconds


219  data gca&var1; set gca&var1;
220  gca=estimate;
221  keep effect gca trait;

NOTE: There were 52 observations read from the data set WORK.GCAVOL12.
NOTE: The data set WORK.GCAVOL12 has 52 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.08 seconds
      cpu time            0.04 seconds


222  data gca&var1; merge gca&var1 parents;

NOTE: There were 52 observations read from the data set WORK.GCAVOL12.
NOTE: There were 52 observations read from the data set WORK.PARENTS.
NOTE: The data set WORK.GCAVOL12 has 52 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.04 seconds


223  data outdir.gca&var1; set gca&var1;

NOTE: There were 52 observations read from the data set WORK.GCAVOL12.
NOTE: The data set OUTDIR.GCAVOL12 has 52 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      cpu time            0.04 seconds


224  proc print;

NOTE: There were 52 observations read from the data set OUTDIR.GCAVOL12.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.03 seconds
      cpu time            0.02 seconds


225  data sca&var1; set sca&var1;
226  sca=estimate;
227  keep female male sca trait;

NOTE: There were 112 observations read from the data set WORK.SCAVOL12.
NOTE: The data set WORK.SCAVOL12 has 112 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.09 seconds
      cpu time            0.04 seconds


228  data outdir.sca&var1; set sca&var1;

NOTE: There were 112 observations read from the data set WORK.SCAVOL12.
NOTE: The data set OUTDIR.SCAVOL12 has 112 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.08 seconds
      cpu time            0.04 seconds


229  proc print;
230  run;

NOTE: There were 112 observations read from the data set OUTDIR.SCAVOL12.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.01 seconds
      cpu time            0.02 seconds


231
232
233  /* CALCULATION OF INDVIDUAL TREE BVs */
234
235  /* Calculate within-family gains as h2w * (y - fixed effects) */
236
237  /* Test and Rep Effects -- estimated from Xb in Proc Mixed */
238  data pm&var1; set pm&var1;
239  xb&var1=pred;
240  keep testid set rep female male tree xb&var1;
241

NOTE: There were 6326 observations read from the data set WORK.PMVOL12.
NOTE: The data set WORK.PMVOL12 has 6326 observations and 7 variables.
NOTE: DATA statement used (Total process time):
      real time           0.38 seconds
      cpu time            0.07 seconds


242  proc sort data=diallel; by testid set rep female male tree;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set WORK.DIALLEL has 6326 observations and 64 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.13 seconds
      cpu time            0.13 seconds


243  proc sort data=pm&var1; by testid set rep female male tree;

NOTE: There were 6326 observations read from the data set WORK.PMVOL12.
NOTE: The data set WORK.PMVOL12 has 6326 observations and 7 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.40 seconds
      cpu time            0.06 seconds


244  data diallel; merge diallel pm&var1; by testid set rep female male tree;
245  ymxb&var1=&var1-xb&var1;
246
247  /* Merge GCA values onto the full data set */

NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: There were 6326 observations read from the data set WORK.PMVOL12.
NOTE: The data set WORK.DIALLEL has 6326 observations and 66 variables.
NOTE: DATA statement used (Total process time):
      real time           0.62 seconds
      cpu time            0.15 seconds


248  data gcafemale&var1; set gca&var1;
249  female=parent; gcafemale&var1=gca;
250  keep female gcafemale&var1;

NOTE: There were 52 observations read from the data set WORK.GCAVOL12.
NOTE: The data set WORK.GCAFEMALEVOL12 has 52 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds


251  data gcamale&var1; set gca&var1;
252  male=parent; gcamale&var1=gca;
253  keep male gcamale&var1;
254

NOTE: There were 52 observations read from the data set WORK.GCAVOL12.
NOTE: The data set WORK.GCAMALEVOL12 has 52 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.01 seconds


255  proc sort data=diallel; by female;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set WORK.DIALLEL has 6326 observations and 66 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.55 seconds
      cpu time            0.12 seconds


256  proc sort data=gcafemale&var1; by female;

NOTE: There were 52 observations read from the data set WORK.GCAFEMALEVOL12.
NOTE: The data set WORK.GCAFEMALEVOL12 has 52 observations and 2 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds


257  data diallel; merge diallel (in=a) gcafemale&var1; by female; if a;
258

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: There were 52 observations read from the data set WORK.GCAFEMALEVOL12.
NOTE: The data set WORK.DIALLEL has 6326 observations and 67 variables.
NOTE: DATA statement used (Total process time):
      real time           0.46 seconds
      cpu time            0.12 seconds


259  proc sort data=diallel; by male;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set WORK.DIALLEL has 6326 observations and 67 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.45 seconds
      cpu time            0.12 seconds


260  proc sort data=gcamale&var1; by male;

NOTE: There were 52 observations read from the data set WORK.GCAMALEVOL12.
NOTE: The data set WORK.GCAMALEVOL12 has 52 observations and 2 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.03 seconds
      cpu time            0.04 seconds


261  data diallel; merge diallel (in=a) gcamale&var1; by male; if a;
262  drop &mixpar;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: There were 52 observations read from the data set WORK.GCAMALEVOL12.
NOTE: The data set WORK.DIALLEL has 6326 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.41 seconds
      cpu time            0.08 seconds


263  proc print data=diallel;
264  var testid rep female male tree
265      gcafemale&var1 gcamale&var1;
266  run;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.16 seconds
      cpu time            0.16 seconds


267
268  PROC IML;
NOTE: IML Ready
269    use parms&var1;
270    read all var {estimate} into parms&var1;
271    close parms&var1;
272    use diallel;
273    read all var {ymxb&var1} into ymxb&var1;
273!                                             /* the residuals are all y - fixed effects */
274    close diallel;
275    use vi&var1;
NOTE: Initial allocation of symbol space exhausted. You may specify SYMSIZE= option on PROC IML
      statement to increase its allocation for more efficiency.
276    read all into vi&var1;
NOTE: I/O required temporary file to be opened.
277    close vi&var1;
278        /* VI is inverse of the observation (y) matrix */
279    n=nrow(vi&var1);
279!                    k=ncol(vi&var1);
279!                                     vi&var1=vi&var1[,3:k];
280    Gw&var1=2*parms&var1[2]*vi&var1*ymxb&var1;
281         /* COV[2] is the first element of the random effect variance component
282            estimation matrix.  The first random term in the MIXED proc above is
283            the P1-P12 term, i.e., the parental term.  The variance is the GCA variance,
284            or 1/4 additive variance. */
285    create Gw&var1 from Gw&var1 [colname='gw'];
286    append from Gw&var1 /*[colname='gw']*/;
287  QUIT;
NOTE: Exiting IML.
NOTE: The data set WORK.GWVOL12 has 6326 observations and 1 variables.
NOTE: PROCEDURE IML used (Total process time):
      real time           4:46.41
      cpu time            28.05 seconds


288
289  data diallel; merge diallel gw&var1;
290  bv&var1 = gcafemale&var1 + gcamale&var1 + gw;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: There were 6326 observations read from the data set WORK.GWVOL12.
NOTE: The data set WORK.DIALLEL has 6326 observations and 18 variables.
NOTE: DATA statement used (Total process time):
      real time           3.37 seconds
      cpu time            0.10 seconds


291  data outdir.diallel; set diallel; run;

NOTE: There were 6326 observations read from the data set WORK.DIALLEL.
NOTE: The data set OUTDIR.DIALLEL has 6326 observations and 18 variables.
NOTE: DATA statement used (Total process time):
      real time           0.60 seconds
      cpu time            0.06 seconds


292
293  proc print;
294  var testid rep female male tree gcafemale&var1 gcamale&var1 gw bv&var1;
295  run;

NOTE: There were 6326 observations read from the data set OUTDIR.DIALLEL.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           1.09 seconds
      cpu time            0.25 seconds


