1 The SAS System 14:08 Saturday, February 22, 2020 NOTE: Unable to open SASUSER.REGSTRY. WORK.REGSTRY will be opened instead. NOTE: All registry changes will be lost at the end of the session. WARNING: Unable to copy SASUSER registry to WORK registry. Because of this, you will not see registry customizations during this session. NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead. NOTE: All profile changes will be lost at the end of the session. NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.4 (TS1M1) Licensed to TEXAS A&M UNIVERSITY - SFA T&R, Site 70080788. NOTE: This session is executing on the X64_SRV12 platform. NOTE: Updated analytical products: SAS/STAT 13.1 SAS/ETS 13.1 SAS/OR 13.1 SAS/IML 13.1 SAS/QC 13.1 NOTE: Additional host information: X64_SRV12 WIN 6.2.9200 Server NOTE: SAS initialization used: real time 1.39 seconds cpu time 2.18 seconds 1 libname data 'data'; NOTE: Libref DATA was successfully assigned as follows: Engine: V9 Physical Name: D:\HPM-Users\phpm672\demo4\data 2 libname src 'src'; NOTE: Libref SRC was successfully assigned as follows: Engine: V9 Physical Name: D:\HPM-Users\phpm672\demo4\src 3 4 ods html body='demo2.html'; NOTE: Writing HTML Body file: demo2.html 5 /* 6 data data.flu10; 7 set src.flu10; 8 9 data data.flu9; 10 set src.flu9; 11 12 data data.flu9d; 13 set src.flu9d; 14 */ 15 16 *---------- Append: add more rows for same columns; 17 proc print data=data.flu10(obs=100); 18 title "data.flu10"; 19 NOTE: There were 4 observations read from the data set DATA.FLU10. NOTE: The PROCEDURE PRINT printed page 1. NOTE: PROCEDURE PRINT used (Total process time): real time 0.21 seconds cpu time 0.09 seconds 2 The SAS System 14:08 Saturday, February 22, 2020 20 proc print data=data.flu9(obs=100); 21 title "data.flu9"; 22 NOTE: There were 5 observations read from the data set DATA.FLU9. NOTE: The PROCEDURE PRINT printed page 2. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 23 data data.append; 24 set data.flu10 data.flu9; 25 NOTE: Data file DATA.APPEND.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. NOTE: There were 4 observations read from the data set DATA.FLU10. NOTE: There were 5 observations read from the data set DATA.FLU9. NOTE: The data set DATA.APPEND has 9 observations and 5 variables. NOTE: DATA statement used (Total process time): real time 0.06 seconds cpu time 0.04 seconds 26 proc print data=data.append(obs=100); NOTE: Data file DATA.APPEND.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 27 title "data.append: append set"; 28 29 * Using proccopy & proc append; 30 * more efficient, but less flexible; NOTE: There were 9 observations read from the data set DATA.APPEND. NOTE: The PROCEDURE PRINT printed page 3. NOTE: PROCEDURE PRINT used (Total process time): real time 0.09 seconds cpu time 0.01 seconds 31 proc copy in=data out=work memtype=data; 32 select flu10; 33 NOTE: Copying DATA.FLU10 to WORK.FLU10 (memtype=DATA). NOTE: There were 4 observations read from the data set DATA.FLU10. NOTE: The data set WORK.FLU10 has 4 observations and 5 variables. NOTE: PROCEDURE COPY used (Total process time): real time 0.07 seconds cpu time 0.04 seconds 34 proc append base=flu10 data=data.flu9; 35 NOTE: Appending DATA.FLU9 to WORK.FLU10. NOTE: There were 5 observations read from the data set DATA.FLU9. NOTE: 5 observations added. NOTE: The data set WORK.FLU10 has 9 observations and 5 variables. NOTE: PROCEDURE APPEND used (Total process time): 3 The SAS System 14:08 Saturday, February 22, 2020 real time 0.03 seconds cpu time 0.00 seconds 36 proc print data=flu10 (obs=100); 37 title "flu10: proc append"; 38 39 *---------- Append: add more rows for diff columns; NOTE: There were 9 observations read from the data set WORK.FLU10. NOTE: The PROCEDURE PRINT printed page 4. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 40 proc print data=data.flu10(obs=100); 41 title; 42 NOTE: There were 4 observations read from the data set DATA.FLU10. NOTE: The PROCEDURE PRINT printed page 5. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.00 seconds 43 proc print data=data.flu9d(obs=100); NOTE: Data file DATA.FLU9D.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 44 NOTE: There were 5 observations read from the data set DATA.FLU9D. NOTE: The PROCEDURE PRINT printed page 6. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 45 data data.append2; 46 set data.flu10(in=aa) data.flu9d(in=bb); NOTE: Data file DATA.FLU9D.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 47 if aa then month='Oct'; 48 else if bb then month='Sep'; 49 NOTE: There were 4 observations read from the data set DATA.FLU10. NOTE: There were 5 observations read from the data set DATA.FLU9D. NOTE: The data set DATA.APPEND2 has 9 observations and 8 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 50 proc print data=data.append2(obs=100); 51 title "data.append2: add more rows for diff columns"; 52 *---------- add more columns, matching up (1-to-1) rows by key(=date) no shared col; NOTE: There were 9 observations read from the data set DATA.APPEND2. NOTE: The PROCEDURE PRINT printed page 7. 4 The SAS System 14:08 Saturday, February 22, 2020 NOTE: PROCEDURE PRINT used (Total process time): real time 0.09 seconds cpu time 0.03 seconds 53 proc sort data=data.flu10; 54 by date; 55 NOTE: Input data set is already sorted, no sorting done. NOTE: PROCEDURE SORT used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 56 proc sort data=data.flu109d; NOTE: Data file DATA.FLU109D.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 57 by date; 58 NOTE: Input data set is already sorted, no sorting done. NOTE: PROCEDURE SORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 59 proc print data=data.flu10(obs=100); 60 title; 61 NOTE: There were 4 observations read from the data set DATA.FLU10. NOTE: The PROCEDURE PRINT printed page 8. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 62 proc print data=data.flu109d(obs=100); NOTE: Data file DATA.FLU109D.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 63 NOTE: There were 5 observations read from the data set DATA.FLU109D. NOTE: The PROCEDURE PRINT printed page 9. NOTE: PROCEDURE PRINT used (Total process time): real time 0.12 seconds cpu time 0.01 seconds 64 data data.addcol; 65 merge data.flu10(in=aa) data.flu109d(in=bb); NOTE: Data file DATA.FLU109D.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 66 by date; 67 NOTE: There were 4 observations read from the data set DATA.FLU10. NOTE: There were 5 observations read from the data set DATA.FLU109D. NOTE: The data set DATA.ADDCOL has 7 observations and 7 variables. 5 The SAS System 14:08 Saturday, February 22, 2020 NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 68 proc print data=data.addcol(obs=100); 69 title "data.addcol: add more columns, matching up (1-to-1) rows by key(=date) no shared col"; 70 71 *---------- add more columns, matching up (1-to-1) rows by key(=date) w/ shared col; NOTE: There were 7 observations read from the data set DATA.ADDCOL. NOTE: The PROCEDURE PRINT printed page 10. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 72 data flu109; 73 set data.flu109; NOTE: Data file DATA.FLU109.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 74 usa=100; 75 NOTE: There were 5 observations read from the data set DATA.FLU109. NOTE: The data set WORK.FLU109 has 5 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 76 proc sort data=data.flu10; 77 by date; 78 NOTE: Input data set is already sorted, no sorting done. NOTE: PROCEDURE SORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 79 proc sort data=flu109; 80 by date; 81 NOTE: There were 5 observations read from the data set WORK.FLU109. NOTE: The data set WORK.FLU109 has 5 observations and 4 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 82 proc print data=data.flu10(obs=100); 83 title; 84 NOTE: There were 4 observations read from the data set DATA.FLU10. NOTE: The PROCEDURE PRINT printed page 11. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 6 The SAS System 14:08 Saturday, February 22, 2020 85 proc print data=flu109(obs=100); 86 NOTE: There were 5 observations read from the data set WORK.FLU109. NOTE: The PROCEDURE PRINT printed page 12. NOTE: PROCEDURE PRINT used (Total process time): real time 0.04 seconds cpu time 0.00 seconds 87 data data.addcol2; 88 merge data.flu10(in=aa) flu109(in=bb); 89 by date; 90 91 src=aa*10+bb; 92 NOTE: There were 4 observations read from the data set DATA.FLU10. NOTE: There were 5 observations read from the data set WORK.FLU109. NOTE: The data set DATA.ADDCOL2 has 7 observations and 8 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 93 proc print data=data.addcol2(obs=100); 94 title "add more columns, matching up (1-to-1) rows by key(=date) w/ shared col": WARNING: The TITLE statement is ambiguous due to invalid options or unquoted text. 95 96 proc freq; 97 tables src; ______ 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 98 99 *---------- add more columns, matching up (1-to-N) rows by key(=qtr) no shared col; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE PRINT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 100 data flu109; 101 set data.flu109; NOTE: Data file DATA.FLU109.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 102 qtr=qtr(date); 103 NOTE: There were 5 observations read from the data set DATA.FLU109. NOTE: The data set WORK.FLU109 has 5 observations and 5 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 104 proc sort data=flu109; 105 by qtr; 106 7 The SAS System 14:08 Saturday, February 22, 2020 NOTE: There were 5 observations read from the data set WORK.FLU109. NOTE: The data set WORK.FLU109 has 5 observations and 5 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.01 seconds cpu time 0.00 seconds 107 proc sort data=data.qtr; NOTE: Data file DATA.QTR.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 108 by qtr; 109 NOTE: Input data set is already sorted, no sorting done. NOTE: PROCEDURE SORT used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 110 proc print data=flu109(obs=100); 111 title; NOTE: There were 5 observations read from the data set WORK.FLU109. NOTE: The PROCEDURE PRINT printed page 13. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.00 seconds 112 proc print data=data.qtr(obs=100); NOTE: Data file DATA.QTR.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 113 NOTE: There were 4 observations read from the data set DATA.QTR. NOTE: The PROCEDURE PRINT printed page 14. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 114 data data.addcol3; 115 merge data.qtr(in=aa) flu109(in=bb); NOTE: Data file DATA.QTR.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 116 by qtr; 117 118 if bb; 119 NOTE: There were 4 observations read from the data set DATA.QTR. NOTE: There were 5 observations read from the data set WORK.FLU109. NOTE: The data set DATA.ADDCOL3 has 5 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 120 proc print data=data.addcol3(obs=100); 8 The SAS System 14:08 Saturday, February 22, 2020 121 title "data.addcol3: add more columns, matching up (1-to-N) rows by key(=qtr) no shared col"; 122 *---------- add more columns, matching up (N-to-N) rows by key(=qtr) no shared col; 123 *---------- Do not do using merge. Use proc sql; 124 * NOTE: MERGE statement has more than one data set with repeats of BY values.; 125 NOTE: There were 5 observations read from the data set DATA.ADDCOL3. NOTE: The PROCEDURE PRINT printed page 15. NOTE: PROCEDURE PRINT used (Total process time): real time 0.09 seconds cpu time 0.01 seconds 126 proc sort data=flu109; 127 by qtr; 128 NOTE: Input data set is already sorted, no sorting done. NOTE: PROCEDURE SORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 129 proc sort data=data.dqtr; NOTE: Data file DATA.DQTR.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 130 by qtr; 131 NOTE: Input data set is already sorted, no sorting done. NOTE: PROCEDURE SORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 132 proc print data=flu109(obs=100); 133 title; NOTE: There were 5 observations read from the data set WORK.FLU109. NOTE: The PROCEDURE PRINT printed page 16. NOTE: PROCEDURE PRINT used (Total process time): real time 0.09 seconds cpu time 0.01 seconds 134 proc print data=data.dqtr(obs=100); NOTE: Data file DATA.DQTR.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 135 NOTE: There were 5 observations read from the data set DATA.DQTR. NOTE: The PROCEDURE PRINT printed page 17. NOTE: PROCEDURE PRINT used (Total process time): real time 0.09 seconds cpu time 0.03 seconds 136 data data.addcol4; 137 merge data.dqtr(in=aa) flu109(in=bb); NOTE: Data file DATA.DQTR.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce 9 The SAS System 14:08 Saturday, February 22, 2020 performance. 138 by qtr; 139 140 if bb; 141 NOTE: MERGE statement has more than one data set with repeats of BY values. NOTE: There were 5 observations read from the data set DATA.DQTR. NOTE: There were 5 observations read from the data set WORK.FLU109. NOTE: The data set DATA.ADDCOL4 has 5 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 142 proc print data=data.addcol4(obs=100); 143 title "dd more columns, matching up (N-to-N) rows by key(=qtr) no shared col: DO NOT use merge. Use proc sql"; 144 145 *---------- combine rows by key(=yyyymm); NOTE: There were 5 observations read from the data set DATA.ADDCOL4. NOTE: The PROCEDURE PRINT printed page 18. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 146 data append; 147 set data.append; NOTE: Data file DATA.APPEND.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 148 149 yyyymm=year(date)*100+month(date); 150 NOTE: There were 9 observations read from the data set DATA.APPEND. NOTE: The data set WORK.APPEND has 9 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 151 proc sort data=append; 152 by yyyymm; 153 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The data set WORK.APPEND has 9 observations and 6 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.01 seconds cpu time 0.00 seconds 154 proc print data=append(obs=100); 155 title; 156 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The PROCEDURE PRINT printed page 19. NOTE: PROCEDURE PRINT used (Total process time): real time 0.14 seconds cpu time 0.03 seconds 10 The SAS System 14:08 Saturday, February 22, 2020 157 proc summary data=append; 158 by yyyymm; 159 var usa california florida texas; 160 output out=data.sum sum= max(usa)=max_usa; 161 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The data set DATA.SUM has 2 observations and 8 variables. NOTE: PROCEDURE SUMMARY used (Total process time): real time 0.04 seconds cpu time 0.04 seconds 162 proc print data=data.sum(obs=100); 163 title "combine rows by key(=yyyymm): sum"; 164 NOTE: There were 2 observations read from the data set DATA.SUM. NOTE: The PROCEDURE PRINT printed page 20. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 165 proc summary data=append; 166 by yyyymm; 167 var usa california florida texas; 168 output out=data.sum2 sum= ; 169 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The data set DATA.SUM2 has 2 observations and 7 variables. NOTE: PROCEDURE SUMMARY used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 170 proc print data=data.sum2(obs=100); 171 title "combine rows by key(=yyyymm): sum + max USA"; 172 NOTE: There were 2 observations read from the data set DATA.SUM2. NOTE: The PROCEDURE PRINT printed page 21. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.00 seconds 173 proc summary data=append; 174 by yyyymm; 175 var usa california florida texas; 176 output out=sum(drop=_type_ rename=(_freq_=nrows)) 177 sum(california)=sca 178 max(florida)=maxfl 179 min(texas)=mintx 180 sum(texas)=stx; 181 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The data set WORK.SUM has 2 observations and 6 variables. NOTE: PROCEDURE SUMMARY used (Total process time): 11 The SAS System 14:08 Saturday, February 22, 2020 real time 0.03 seconds cpu time 0.01 seconds 182 proc print data=sum(obs=100); 183 title "combine rows by key(=yyyymm): combo"; 184 NOTE: There were 2 observations read from the data set WORK.SUM. NOTE: The PROCEDURE PRINT printed page 22. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 185 proc summary data=append; 186 var usa california florida texas; 187 output out=data.sum sum=; 188 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The data set DATA.SUM has 1 observations and 6 variables. NOTE: PROCEDURE SUMMARY used (Total process time): real time 0.04 seconds cpu time 0.03 seconds 189 proc print data=data.sum(obs=100); 190 title "combine rows by key(=yyyymm): no by statement"; 191 192 *---------- proc transpose: flip row & col; NOTE: There were 1 observations read from the data set DATA.SUM. NOTE: The PROCEDURE PRINT printed page 23. NOTE: PROCEDURE PRINT used (Total process time): real time 0.04 seconds cpu time 0.00 seconds 193 proc print data=append(obs=100); 194 title; 195 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The PROCEDURE PRINT printed page 24. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 196 proc transpose data=append out=data.tappend; 197 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The data set DATA.TAPPEND has 6 observations and 10 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.04 seconds cpu time 0.00 seconds 198 proc print data=data.tappend(obs=100); 199 title "proc transpose data=append out=data.tappend"; 200 12 The SAS System 14:08 Saturday, February 22, 2020 NOTE: There were 6 observations read from the data set DATA.TAPPEND. NOTE: The PROCEDURE PRINT printed page 25. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 201 proc transpose data=append out=data.tappend; 202 id date; 203 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The data set DATA.TAPPEND has 5 observations and 10 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.06 seconds cpu time 0.03 seconds 204 proc print data=data.tappend(obs=100); 205 title "proc transpose... id date;"; 206 NOTE: There were 5 observations read from the data set DATA.TAPPEND. NOTE: The PROCEDURE PRINT printed page 26. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 207 proc transpose data=append out=data.tappend(rename=(_name_=state)); 208 id date; 209 var usa california florida texas; 210 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The data set DATA.TAPPEND has 4 observations and 10 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.04 seconds cpu time 0.01 seconds 211 proc print data=data.tappend(obs=100); 212 title "proc transpose... id date; var ...;"; 213 214 *---------- proc transpose: by group(key=yyyymm). consolidate first then transpose; 215 *---------- there must be only 1 row per key; 216 * ERROR: The ID value "_201309" occurs twice in the input data set; 217 * The following section must be commented out to run; 218 /* 219 proc sort data=append; 220 by yyyymm; 221 222 proc transpose data=append out=data.tappend(rename=(_name_=state)); 223 id yyyymm; 224 var usa california florida texas; 225 226 proc print data=data.tappend(obs=100); 227 */ 228 229 * Dangerous unless you know what you are doing; 230 * Using sort nodupkey to make it one record per key; 13 The SAS System 14:08 Saturday, February 22, 2020 NOTE: There were 4 observations read from the data set DATA.TAPPEND. NOTE: The PROCEDURE PRINT printed page 27. NOTE: PROCEDURE PRINT used (Total process time): real time 0.15 seconds cpu time 0.01 seconds 231 proc print data=append(obs=100); 232 title; 233 234 * Estimates in first week of each month; NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The PROCEDURE PRINT printed page 28. NOTE: PROCEDURE PRINT used (Total process time): real time 0.09 seconds cpu time 0.01 seconds 235 proc sort data=append out=xdup nodupkey; 236 by yyyymm; 237 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: 7 observations with duplicate key values were deleted. NOTE: The data set WORK.XDUP has 2 observations and 6 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.04 seconds cpu time 0.01 seconds 238 proc print data=xdup(obs=100); 239 NOTE: There were 2 observations read from the data set WORK.XDUP. NOTE: The PROCEDURE PRINT printed page 29. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 240 proc transpose data=xdup out=data.tappend(rename=(_name_=state)); 241 id yyyymm; 242 var usa california florida texas; 243 NOTE: There were 2 observations read from the data set WORK.XDUP. NOTE: The data set DATA.TAPPEND has 4 observations and 3 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.06 seconds cpu time 0.03 seconds 244 proc print data=data.tappend(obs=100); 245 title "proc transpose... id yyyymm: first week"; 246 * Using summary to combine records to make it one record per key; 247 * best option, when in doubt; 248 NOTE: There were 4 observations read from the data set DATA.TAPPEND. NOTE: The PROCEDURE PRINT printed page 30. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds 14 The SAS System 14:08 Saturday, February 22, 2020 cpu time 0.00 seconds 249 proc print data=append(obs=100); 250 title; NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The PROCEDURE PRINT printed page 31. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 251 proc sort data=append; 252 by yyyymm; 253 NOTE: Input data set is already sorted, no sorting done. NOTE: PROCEDURE SORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 254 proc summary data=append; 255 by yyyymm; 256 var usa california florida texas; 257 output out=sum sum=; 258 NOTE: There were 9 observations read from the data set WORK.APPEND. NOTE: The data set WORK.SUM has 2 observations and 7 variables. NOTE: PROCEDURE SUMMARY used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 259 proc print data=sum(obs=100); 260 NOTE: There were 2 observations read from the data set WORK.SUM. NOTE: The PROCEDURE PRINT printed page 32. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 261 proc transpose data=sum out=data.tappend(rename=(_name_=state)) prefix=flu; 262 id yyyymm; 263 var usa california florida texas; 264 NOTE: There were 2 observations read from the data set WORK.SUM. NOTE: The data set DATA.TAPPEND has 4 observations and 3 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.04 seconds cpu time 0.00 seconds 265 proc print data=data.tappend(obs=100); 266 title "proc transpose... id yyyymm : sum"; 267 268 * transpose back; 15 The SAS System 14:08 Saturday, February 22, 2020 NOTE: There were 4 observations read from the data set DATA.TAPPEND. NOTE: The PROCEDURE PRINT printed page 33. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 269 proc transpose data=data.tappend out=back; 270 id state; 271 var flu201309-flu201310; 272 NOTE: There were 4 observations read from the data set DATA.TAPPEND. NOTE: The data set WORK.BACK has 2 observations and 5 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 273 proc print data=back(obs=100); 274 title "proc transpose ... back"; 275 NOTE: There were 2 observations read from the data set WORK.BACK. NOTE: The PROCEDURE PRINT printed page 34. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 276 data back; 277 set back; 278 279 yyyymm=.; 280 yyyymm=substr(_name_, 4); 281 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 280:8 NOTE: There were 2 observations read from the data set WORK.BACK. NOTE: The data set WORK.BACK has 2 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 282 proc print data=back(obs=100); 283 title "proc transpose ... back fully"; 284 285 *---------- proc transpose: flip row & col by group(key=yyyymm); NOTE: There were 2 observations read from the data set WORK.BACK. NOTE: The PROCEDURE PRINT printed page 35. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 286 proc print data=data.wkappend(obs=100); NOTE: Data file DATA.WKAPPEND.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 287 title; 16 The SAS System 14:08 Saturday, February 22, 2020 288 NOTE: There were 9 observations read from the data set DATA.WKAPPEND. NOTE: The PROCEDURE PRINT printed page 36. NOTE: PROCEDURE PRINT used (Total process time): real time 0.09 seconds cpu time 0.01 seconds 289 proc transpose data=data.wkappend out=data.tappend(rename=(_name_=state)); NOTE: Data file DATA.WKAPPEND.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 290 by yyyymm; 291 id week; 292 var usa california florida texas; 293 NOTE: There were 9 observations read from the data set DATA.WKAPPEND. NOTE: The data set DATA.TAPPEND has 8 observations and 7 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 294 proc print data=data.tappend(obs=100); 295 title "proc transpose .. by group"; 296 297 * transpose back by key; NOTE: There were 8 observations read from the data set DATA.TAPPEND. NOTE: The PROCEDURE PRINT printed page 37. NOTE: PROCEDURE PRINT used (Total process time): real time 0.06 seconds cpu time 0.01 seconds 298 proc transpose data=data.tappend out=back(rename=(_name_=week)); 299 by yyyymm; 300 id state; 301 var wk1-wk5; 302 NOTE: There were 8 observations read from the data set DATA.TAPPEND. NOTE: The data set WORK.BACK has 10 observations and 6 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time): real time 0.06 seconds cpu time 0.04 seconds 303 proc print data=back(obs=100); 304 title "proc transpose .. by group.. back"; 305 NOTE: There were 10 observations read from the data set WORK.BACK. NOTE: The PROCEDURE PRINT printed page 38. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.03 seconds 306 data back; 307 set back; 17 The SAS System 14:08 Saturday, February 22, 2020 308 *ERROR: Syntax error while parsing WHERE clause.; 309 *where sum (of usa california florida texas)>.; 310 if sum (of usa california florida texas)>.; 311 NOTE: Missing values were generated as a result of performing an operation on missing values. Each place is given by: (Number of times) at (Line):(Column). 1 at 310:4 NOTE: There were 10 observations read from the data set WORK.BACK. NOTE: The data set WORK.BACK has 9 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.03 seconds 312 proc print data=back(obs=100); 313 title "proc transpose .. by group.. back fully"; 314 315 run; NOTE: There were 9 observations read from the data set WORK.BACK. NOTE: The PROCEDURE PRINT printed page 39. NOTE: PROCEDURE PRINT used (Total process time): real time 0.07 seconds cpu time 0.01 seconds 316 ods html close; 317 318 319 320 321 322 ERROR: Errors printed on page 6. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 9.42 seconds cpu time 4.85 seconds