This is a generic post I've written a while ago that illustrates how to convert your data to a data step to post in the forums:
@sastuck wrote:
Thanks @Reeza , I don't know how I overlooked that. The code is running now, but is taking a long time (?)
Also, @ballardw mentioned that its data is best presented as a datastep. Could you show me how this is done? For future reference. Thanks for the headsup by the way!
%data2datastep(CompuStat_Execucomp,practice,,5);
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; WARNING: Apparent invocation of macro DATA2DATASTEP not resolved. 70 71 %data2datastep(CompuStat_Execucomp,practice,,5); _ 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 72 73 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 85
I'm close, but must be missing something. Any tips?
You didn’t run the macro first. Make sure to follow the instructions step by step, print it off and check off each line if you have to, since you seem to consistently missing steps that have been identified.
I know this could probably be a question on it's own. I hope you don't mind me asking you here. I'm getting closer:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; WARNING: Apparent invocation of macro DATA2DATASTEP not resolved. 70 71 %data2datastep(CompuStat_Execucomp,practice,,5) _ 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 72 73 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 74 ODS HTML CLOSE; 75 &GRAPHTERM; ;*';*";*/;RUN;QUIT; 76 QUIT;RUN; 77 ODS HTML5 (ID=WEB) CLOSE; 78 79 ODS PDF (ID=WEB) CLOSE; NOTE: ODS PDF(WEB) printed no output. (This sometimes results from failing to place a RUN statement before the ODS PDF(WEB) CLOSE statement.) 80 FILENAME _GSFNAME; NOTE: Fileref _GSFNAME has been deassigned. 81 DATA _NULL_; 82 RUN; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds memory 325.15k OS Memory 32436.00k Timestamp 05/04/2018 08:29:50 PM Step Count 100 Switch Count 0 Page Faults 0 Page Reclaims 24 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 83 OPTIONS VALIDMEMNAME=COMPAT; 84 OPTIONS NOTES STIMER SOURCE SYNTAXCHECK; 85
That makes no sense. I don't want your code.
What steps did you take and which step in the instructions specifically did not work for you.
Make sure you do #4, including the RUN and SAVE steps.
Step 5 is not working for me. This is because
%data2datastep(CompuStat_Execucomp,practice,,5)
not valid or it is used out of proper order.
%data2datastep(cars,sashelp,,5)
The error you're posting indicated that you did not do step 4 correctly.
Can you show the screenshot and logs from running that step.
Here's what I entered:
%include '~/425/425_Final_Paper/practice program.sas' /lrecl=1000;
Here's the log:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 72 73 74 %include '~/425/425_Final_Paper/practice program.sas' /lrecl=1000; NOTE: Libref PRACTICE was successfully assigned as follows: Engine: V9 Physical Name: /home/sastuck/425/425_Final_Paper NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to WORK.PARMS.PARMS.SLIST. 83 /********************************************************************** 84 * PRODUCT: SAS 85 * VERSION: 9.4 86 * CREATOR: External File Interface 87 * DATE: 04MAY18 88 * DESC: Generated SAS Datastep Code 89 * TEMPLATE SOURCE: (None Specified.) 90 ***********************************************************************/ 91 data PRACTICE.COMPUSTAT_EXECUCOMP ; 92 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */ 93 infile '~/425/425_Final_Paper/CompuStat_Execucomp.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 ; 94 informat EXEC_FULLNAME $614. ; 95 informat CFOANN $7. ; 96 informat EXECDIR $2. ; 97 informat OLD_DATAFMT_FLAG $4. ; 98 informat INTERLOCK $3. ; 99 informat REPRICE best32. ; 100 informat EXECRANK $8. ; 101 informat CO_PER_ROL $5. ; 102 informat CONAME $34. ; 103 informat TITLEANN $246. ; 104 informat CEOANN $3. ; 105 informat SALARY best32. ; 106 informat BONUS $12. ; 107 informat STOCK_AWARDS $30. ; 108 informat OPTION_AWARDS $52. ; 109 informat NONEQ_INCENT $37. ; 110 informat PENSION_CHG $9. ; 111 informat OTHCOMP $9. ; 112 informat TOTAL_SEC best32. ; 113 informat TOTAL_CURR best32. ; 114 informat TOTAL_ALT1 best32. ; 115 informat TOTAL_ALT2 best32. ; 116 informat TERM_PYMT best32. ; 117 informat CHG_CTRL_PYMT best32. ; 118 informat SHROWN_TOT best32. ; 119 informat SHROWN_TOT_PCT best32. ; 120 informat SHROWN_EXCL_OPTS best32. ; 121 informat SHROWN_EXCL_OPTS_PCT best32. ; 122 informat OPT_EXER_NUM best32. ; 123 informat OPT_EXER_VAL best32. ; 124 informat SHRS_VEST_NUM best32. ; 125 informat SHRS_VEST_VAL best32. ; 126 informat AGE best32. ; 127 informat OPTION_AWARDS_NUM best32. ; 128 informat OPTION_AWARDS_FV best32. ; 129 informat STOCK_AWARDS_FV best32. ; 130 informat OPT_UNEX_EXER_NUM best32. ; 131 informat OPT_UNEX_UNEXER_NUM best32. ; 132 informat OPT_UNEX_EXER_EST_VAL best32. ; 133 informat OPT_UNEX_UNEXER_EST_VAL best32. ; 134 informat STOCK_UNVEST_NUM best32. ; 135 informat STOCK_UNVEST_VAL best32. ; 136 informat EIP_UNEARN_NUM best32. ; 137 informat EIP_UNEARN_VAL best32. ; 138 informat PENSION_VALUE_TOT best32. ; 139 informat PENSION_PYMTS_TOT best32. ; 140 informat DEFER_CONTRIB_EXEC_TOT best32. ; 141 informat DEFER_CONTRIB_CO_TOT best32. ; 142 informat DEFER_EARNINGS_TOT best32. ; 143 informat DEFER_WITHDR_TOT best32. ; 144 informat DEFER_BALANCE_TOT best32. ; 145 informat DEFER_RPT_AS_COMP_TOT best32. ; 146 informat EXECRANKANN best32. ; 147 informat OTHANN $1. ; 148 informat TDC1 best32. ; 149 informat TDC2 best32. ; 150 informat RSTKGRNT $1. ; 151 informat OPTION_AWARDS_BLK_VALUE $1. ; 152 informat OPTION_AWARDS_RPT_VALUE $1. ; 153 informat LTIP $1. ; 154 informat ALLOTHTOT $1. ; 155 informat ALLOTHPD $1. ; 156 informat SAL_PCT best32. ; 157 informat TOTAL_CURR_PCT best32. ; 158 informat TOTAL_SEC_PCT best32. ; 159 informat TOTAL_ALT1_PCT best32. ; 160 informat TOTAL_ALT2_PCT best32. ; 161 informat TDC1_PCT best32. ; 162 informat TDC2_PCT best32. ; 163 informat RET_YRS $1. ; 164 informat COMMENT $1. ; 165 informat GVKEY best32. ; 166 informat EXECID best32. ; 167 informat YEAR best32. ; 168 informat RSTKVYRS $1. ; 169 informat BECAMECEO best32. ; 170 informat JOINED_CO best32. ; 171 informat REJOIN $1. ; 172 informat LEFTOFC best32. ; 173 informat LEFTCO best32. ; 174 informat RELEFT $1. ; 175 informat PCEO $3. ; 176 informat PCFO $3. ; 177 informat TITLE $215. ; 178 informat REASON $7. ; 179 informat EXEC_LNAME $22. ; 180 informat EXEC_FNAME $12. ; 181 informat EXEC_MNAME $9. ; 182 informat GENDER $6. ; 183 informat NAMEPREFIX $3. ; 184 informat PAGE best32. ; 185 informat CUSIP $8. ; 186 informat EXCHANGE $3. ; 187 informat ADDRESS $41. ; 188 informat CITY $15. ; 189 informat STATE $2. ; 190 informat ZIP $5. ; 191 informat TELE $14. ; 192 informat SICDESC $30. ; 193 informat NAICSDESC $52. ; 194 informat INDDESC $44. ; 195 informat SPCODE $2. ; 196 informat TICKER $5. ; 197 informat SUB_TELE best32. ; 198 informat NAICS best32. ; 199 informat SPINDEX best32. ; 200 informat SIC best32. ; 201 format EXEC_FULLNAME $614. ; 202 format CFOANN $7. ; 203 format EXECDIR $2. ; 204 format OLD_DATAFMT_FLAG $4. ; 205 format INTERLOCK $3. ; 206 format REPRICE best12. ; 207 format EXECRANK $8. ; 208 format CO_PER_ROL $5. ; 209 format CONAME $34. ; 210 format TITLEANN $246. ; 211 format CEOANN $3. ; 212 format SALARY best12. ; 213 format BONUS $12. ; 214 format STOCK_AWARDS $30. ; 215 format OPTION_AWARDS $52. ; 216 format NONEQ_INCENT $37. ; 217 format PENSION_CHG $9. ; 218 format OTHCOMP $9. ; 219 format TOTAL_SEC best12. ; 220 format TOTAL_CURR best12. ; 221 format TOTAL_ALT1 best12. ; 222 format TOTAL_ALT2 best12. ; 223 format TERM_PYMT best12. ; 224 format CHG_CTRL_PYMT best12. ; 225 format SHROWN_TOT best12. ; 226 format SHROWN_TOT_PCT best12. ; 227 format SHROWN_EXCL_OPTS best12. ; 228 format SHROWN_EXCL_OPTS_PCT best12. ; 229 format OPT_EXER_NUM best12. ; 230 format OPT_EXER_VAL best12. ; 231 format SHRS_VEST_NUM best12. ; 232 format SHRS_VEST_VAL best12. ; 233 format AGE best12. ; 234 format OPTION_AWARDS_NUM best12. ; 235 format OPTION_AWARDS_FV best12. ; 236 format STOCK_AWARDS_FV best12. ; 237 format OPT_UNEX_EXER_NUM best12. ; 238 format OPT_UNEX_UNEXER_NUM best12. ; 239 format OPT_UNEX_EXER_EST_VAL best12. ; 240 format OPT_UNEX_UNEXER_EST_VAL best12. ; 241 format STOCK_UNVEST_NUM best12. ; 242 format STOCK_UNVEST_VAL best12. ; 243 format EIP_UNEARN_NUM best12. ; 244 format EIP_UNEARN_VAL best12. ; 245 format PENSION_VALUE_TOT best12. ; 246 format PENSION_PYMTS_TOT best12. ; 247 format DEFER_CONTRIB_EXEC_TOT best12. ; 248 format DEFER_CONTRIB_CO_TOT best12. ; 249 format DEFER_EARNINGS_TOT best12. ; 250 format DEFER_WITHDR_TOT best12. ; 251 format DEFER_BALANCE_TOT best12. ; 252 format DEFER_RPT_AS_COMP_TOT best12. ; 253 format EXECRANKANN best12. ; 254 format OTHANN $1. ; 255 format TDC1 best12. ; 256 format TDC2 best12. ; 257 format RSTKGRNT $1. ; 258 format OPTION_AWARDS_BLK_VALUE $1. ; 259 format OPTION_AWARDS_RPT_VALUE $1. ; 260 format LTIP $1. ; 261 format ALLOTHTOT $1. ; 262 format ALLOTHPD $1. ; 263 format SAL_PCT best12. ; 264 format TOTAL_CURR_PCT best12. ; 265 format TOTAL_SEC_PCT best12. ; 266 format TOTAL_ALT1_PCT best12. ; 267 format TOTAL_ALT2_PCT best12. ; 268 format TDC1_PCT best12. ; 269 format TDC2_PCT best12. ; 270 format RET_YRS $1. ; 271 format COMMENT $1. ; 272 format GVKEY best12. ; 273 format EXECID best12. ; 274 format YEAR best12. ; 275 format RSTKVYRS $1. ; 276 format BECAMECEO best12. ; 277 format JOINED_CO best12. ; 278 format REJOIN $1. ; 279 format LEFTOFC best12. ; 280 format LEFTCO best12. ; 281 format RELEFT $1. ; 282 format PCEO $3. ; 283 format PCFO $3. ; 284 format TITLE $215. ; 285 format REASON $7. ; 286 format EXEC_LNAME $22. ; 287 format EXEC_FNAME $12. ; 288 format EXEC_MNAME $9. ; 289 format GENDER $6. ; 290 format NAMEPREFIX $3. ; 291 format PAGE best12. ; 292 format CUSIP $8. ; 293 format EXCHANGE $3. ; 294 format ADDRESS $41. ; 295 format CITY $15. ; 296 format STATE $2. ; 297 format ZIP $5. ; 298 format TELE $14. ; 299 format SICDESC $30. ; 300 format NAICSDESC $52. ; 301 format INDDESC $44. ; 302 format SPCODE $2. ; 303 format TICKER $5. ; 304 format SUB_TELE best12. ; 305 format NAICS best12. ; 306 format SPINDEX best12. ; 307 format SIC best12. ; 308 input 309 EXEC_FULLNAME $ 310 CFOANN $ 311 EXECDIR $ 312 OLD_DATAFMT_FLAG $ 313 INTERLOCK $ 314 REPRICE 315 EXECRANK $ 316 CO_PER_ROL $ 317 CONAME $ 318 TITLEANN $ 319 CEOANN $ 320 SALARY 321 BONUS $ 322 STOCK_AWARDS $ 323 OPTION_AWARDS $ 324 NONEQ_INCENT $ 325 PENSION_CHG $ 326 OTHCOMP $ 327 TOTAL_SEC 328 TOTAL_CURR 329 TOTAL_ALT1 330 TOTAL_ALT2 331 TERM_PYMT 332 CHG_CTRL_PYMT 333 SHROWN_TOT 334 SHROWN_TOT_PCT 335 SHROWN_EXCL_OPTS 336 SHROWN_EXCL_OPTS_PCT 337 OPT_EXER_NUM 338 OPT_EXER_VAL 339 SHRS_VEST_NUM 340 SHRS_VEST_VAL 341 AGE 342 OPTION_AWARDS_NUM 343 OPTION_AWARDS_FV 344 STOCK_AWARDS_FV 345 OPT_UNEX_EXER_NUM 346 OPT_UNEX_UNEXER_NUM 347 OPT_UNEX_EXER_EST_VAL 348 OPT_UNEX_UNEXER_EST_VAL 349 STOCK_UNVEST_NUM 350 STOCK_UNVEST_VAL 351 EIP_UNEARN_NUM 352 EIP_UNEARN_VAL 353 PENSION_VALUE_TOT 354 PENSION_PYMTS_TOT 355 DEFER_CONTRIB_EXEC_TOT 356 DEFER_CONTRIB_CO_TOT 357 DEFER_EARNINGS_TOT 358 DEFER_WITHDR_TOT 359 DEFER_BALANCE_TOT 360 DEFER_RPT_AS_COMP_TOT 361 EXECRANKANN 362 OTHANN $ 363 TDC1 364 TDC2 365 RSTKGRNT $ 366 OPTION_AWARDS_BLK_VALUE $ 367 OPTION_AWARDS_RPT_VALUE $ 368 LTIP $ 369 ALLOTHTOT $ 370 ALLOTHPD $ 371 SAL_PCT 372 TOTAL_CURR_PCT 373 TOTAL_SEC_PCT 374 TOTAL_ALT1_PCT 375 TOTAL_ALT2_PCT 376 TDC1_PCT 377 TDC2_PCT 378 RET_YRS $ 379 COMMENT $ 380 GVKEY 381 EXECID 382 YEAR 383 RSTKVYRS $ 384 BECAMECEO 385 JOINED_CO 386 REJOIN $ 387 LEFTOFC 388 LEFTCO 389 RELEFT $ 390 PCEO $ 391 PCFO $ 392 TITLE $ 393 REASON $ 394 EXEC_LNAME $ 395 EXEC_FNAME $ 396 EXEC_MNAME $ 397 GENDER $ 398 NAMEPREFIX $ 399 PAGE 400 CUSIP $ 401 EXCHANGE $ 402 ADDRESS $ 403 CITY $ 404 STATE $ 405 ZIP $ 406 TELE $ 407 SICDESC $ 408 NAICSDESC $ 409 INDDESC $ 410 SPCODE $ 411 TICKER $ 412 SUB_TELE 413 NAICS 414 SPINDEX 415 SIC 416 ; 417 if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */ 418 run; NOTE: The infile '~/425/425_Final_Paper/CompuStat_Execucomp.csv' is: Filename=/home/sastuck/425/425_Final_Paper/CompuStat_Execucomp.csv, Owner Name=sastuck,Group Name=oda, Access Permission=-rw-r--r--, Last Modified=03Mar2018:03:40:25, File Size (bytes)=50937550 NOTE: 74300 records were read from the infile '~/425/425_Final_Paper/CompuStat_Execucomp.csv'. The minimum record length was 299. The maximum record length was 1177. NOTE: The data set PRACTICE.COMPUSTAT_EXECUCOMP has 74300 observations and 107 variables. NOTE: DATA statement used (Total process time): real time 1.10 seconds user cpu time 0.58 seconds system cpu time 0.12 seconds memory 14997.50k OS Memory 47404.00k Timestamp 05/04/2018 08:50:41 PM Step Count 160 Switch Count 1 Page Faults 0 Page Reclaims 278 Page Swaps 0 Voluntary Context Switches 4462 Involuntary Context Switches 8 Block Input Operations 0 Block Output Operations 302088 74300 rows created in PRACTICE.COMPUSTAT_EXECUCOMP from ~/425/425_Final_Paper/CompuStat_Execucomp.csv. NOTE: PRACTICE.COMPUSTAT_EXECUCOMP data set was successfully created. NOTE: The data set PRACTICE.COMPUSTAT_EXECUCOMP has 74300 observations and 107 variables. NOTE: PROCEDURE IMPORT used (Total process time): real time 5.90 seconds user cpu time 5.35 seconds system cpu time 0.15 seconds memory 14997.50k OS Memory 47920.00k Timestamp 05/04/2018 08:50:41 PM Step Count 160 Switch Count 9 Page Faults 0 Page Reclaims 6132 Page Swaps 0 Voluntary Context Switches 4545 Involuntary Context Switches 12 Block Input Operations 288 Block Output Operations 302152 NOTE: PROCEDURE CONTENTS used (Total process time): real time 0.17 seconds user cpu time 0.17 seconds system cpu time 0.00 seconds memory 5837.21k OS Memory 38840.00k Timestamp 05/04/2018 08:50:41 PM Step Count 161 Switch Count 0 Page Faults 0 Page Reclaims 292 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 88 NOTE: There were 74300 observations read from the data set PRACTICE.COMPUSTAT_EXECUCOMP. NOTE: The data set PRACTICE.COMPUSTAT_EXECUCOMP has 74300 observations and 108 variables. NOTE: DATA statement used (Total process time): real time 1.05 seconds user cpu time 0.09 seconds system cpu time 0.18 seconds memory 3631.84k OS Memory 40376.00k Timestamp 05/04/2018 08:50:42 PM Step Count 162 Switch Count 24 Page Faults 0 Page Reclaims 498 Page Swaps 0 Voluntary Context Switches 6182 Involuntary Context Switches 9 Block Input Operations 301824 Block Output Operations 302088 NOTE: There were 74300 observations read from the data set PRACTICE.COMPUSTAT_EXECUCOMP. NOTE: The data set WORK.AVG has 1 observations and 3 variables. NOTE: PROCEDURE MEANS used (Total process time): real time 0.27 seconds user cpu time 0.07 seconds system cpu time 0.06 seconds memory 8524.65k OS Memory 44764.00k Timestamp 05/04/2018 08:50:43 PM Step Count 163 Switch Count 2 Page Faults 0 Page Reclaims 1864 Page Swaps 0 Voluntary Context Switches 2706 Involuntary Context Switches 0 Block Input Operations 302112 Block Output Operations 272 ERROR: Variable BONUS in list does not match type prescribed for this list. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.AVG may be incomplete. When this step was stopped there were 0 observations and 0 variables. WARNING: Data set WORK.AVG was not replaced because this step was stopped. NOTE: PROCEDURE MEANS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 1718.81k OS Memory 38324.00k Timestamp 05/04/2018 08:50:43 PM Step Count 164 Switch Count 0 Page Faults 0 Page Reclaims 241 Page Swaps 0 Voluntary Context Switches 4 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 8 ERROR: Variable OPTION_AWARDS in list does not match type prescribed for this list. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.AVG may be incomplete. When this step was stopped there were 0 observations and 0 variables. WARNING: Data set WORK.AVG was not replaced because this step was stopped. NOTE: PROCEDURE MEANS used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds memory 1718.81k OS Memory 38324.00k Timestamp 05/04/2018 08:50:43 PM Step Count 165 Switch Count 0 Page Faults 0 Page Reclaims 241 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 8 NOTE: There were 74300 observations read from the data set PRACTICE.COMPUSTAT_EXECUCOMP. NOTE: The data set WORK.AVG has 1 observations and 3 variables. NOTE: PROCEDURE MEANS used (Total process time): real time 0.05 seconds user cpu time 0.02 seconds system cpu time 0.04 seconds memory 8524.81k OS Memory 44764.00k Timestamp 05/04/2018 08:50:43 PM Step Count 166 Switch Count 2 Page Faults 0 Page Reclaims 1864 Page Swaps 0 Voluntary Context Switches 36 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 264 NOTE: There were 74300 observations read from the data set PRACTICE.COMPUSTAT_EXECUCOMP. NOTE: PROCEDURE MEANS used (Total process time): real time 0.05 seconds user cpu time 0.03 seconds system cpu time 0.03 seconds memory 10255.31k OS Memory 45256.00k Timestamp 05/04/2018 08:50:43 PM Step Count 167 Switch Count 7 Page Faults 0 Page Reclaims 1920 Page Swaps 0 Voluntary Context Switches 38 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 NOTE: There were 13678 observations read from the data set PRACTICE.COMPUSTAT_EXECUCOMP2. NOTE: The data set PRACTICE.COMPUSTAT_EXECUCOMP has 13678 observations and 107 variables. NOTE: DATA statement used (Total process time): real time 0.12 seconds user cpu time 0.01 seconds system cpu time 0.04 seconds memory 3630.43k OS Memory 39864.00k Timestamp 05/04/2018 08:50:43 PM Step Count 168 Switch Count 5 Page Faults 0 Page Reclaims 533 Page Swaps 0 Voluntary Context Switches 936 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 55816 NOTE: PROCEDURE TTEST used (Total process time): real time 3.56 seconds user cpu time 2.29 seconds system cpu time 0.21 seconds memory 45803.15k OS Memory 79628.00k Timestamp 05/04/2018 08:50:47 PM Step Count 169 Switch Count 113 Page Faults 0 Page Reclaims 69985 Page Swaps 0 Voluntary Context Switches 4538 Involuntary Context Switches 16 Block Input Operations 55840 Block Output Operations 75880 WARNING: Apparent invocation of macro DATA2DATASTEP not resolved. 467 +%data2datastep(CompuStat_Execucomp,practice,,5); _ 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 472 473 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 486
Step 4: In the Autoexec, add the reference to the program, and RUN, then SAVE.
The program is the code you downloaded from step 1, not your program.
I deleted the zero's this time before doing the means, but the mins for both genders are still basically zero. How is this possible?
*remove zeros;
data practice.CompuStat_Execucomp;
set practice.CompuStat_Execucomp2;
if salary=. then delete;
run;
title "Table 6. Difference in Means";
title2 "Male and Female CEOs";
proc ttest data=practice.CompuStat_Execucomp;
class gender;
var salary;
run;
GENDER Method N Mean Std Dev Std Err Minimum Maximum FEMALE 528 873.5 327.3 14.2444 0.00100 2000.0 MALE 1315 824.4 429.1 3.7423 0 8100.0 Diff (1-2) Pooled 49.0313 425.7 18.8933 Diff (1-2) Satterthwaite 49.0313 14.7278
It's not exactly 0. Note that its .01 so some of your numbers have decimals.
You can round the numbers (ROUND() function) before removal to make sure all 0.01 and -0.01 values are excluded as well.
PS You're numbering your data sets in what I'd consider the opposite order, start at 0 and move forward. Moving back (0/missing to 2) means you're likely to make mistakes in your future programming. This is more of be careful than something you need to do.
Thanks for the response and suggestion @Reeza. I was looking at Rick Wicklin's blog and found this:
t = int(x); /* towards zero */
and this in the documentation:
ROUND (argument <,rounding-unit> )
would my argument be SALARY and my rounding unit be 0?
Is this done with a data step?
@sastuck wrote:
Thanks for the response and suggestion @Reeza. I was looking at Rick Wicklin's blog and found this:
t = int(x); /* towards zero */
and this in the documentation:
ROUND (argument <,rounding-unit> )
would my argument be SALARY and my rounding unit be 0?
Is this done with a data step?
TRY IT!
Yes, this would be done with a data step.
Here's my attempt:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 70 71 *round really small numbers to zero; 72 data=practice.CompuStat_Execucomp2; ____ 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 73 set practice.CompuStat_Execucomp3; ___ 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 74 ROUND (SALARY <0> ); _____ 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 75 run; 76 77 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 89
It looks as though I got just about ever step of the coding wrong.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.