06-30-2021
mcgannmary1
Obsidian | Level 7
Member since
06-06-2019
- 12 Posts
- 5 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by mcgannmary1
Subject Views Posted 2218 07-05-2019 11:35 AM 2222 07-05-2019 11:30 AM 2226 07-05-2019 11:28 AM 2258 07-05-2019 11:04 AM 2259 07-05-2019 11:03 AM 1662 06-25-2019 04:37 PM 1717 06-24-2019 03:21 PM 1722 06-24-2019 03:13 PM 1725 06-24-2019 03:12 PM 1728 06-24-2019 03:10 PM -
Activity Feed for mcgannmary1
- Posted Re: Proc contents on SAS Programming. 07-05-2019 11:35 AM
- Posted Re: Proc contents on SAS Programming. 07-05-2019 11:30 AM
- Posted Re: Proc contents on SAS Programming. 07-05-2019 11:28 AM
- Posted Re: Proc contents on SAS Programming. 07-05-2019 11:04 AM
- Posted Proc contents on SAS Programming. 07-05-2019 11:03 AM
- Posted Re: Else then else error on SAS Programming. 06-25-2019 04:37 PM
- Liked Re: Else then else error for ballardw. 06-25-2019 04:36 PM
- Liked Re: Else then else error for PGStats. 06-24-2019 03:27 PM
- Liked Re: Else then else error for PGStats. 06-24-2019 03:27 PM
- Liked Re: Else then else error for Reeza. 06-24-2019 03:27 PM
- Posted Re: Else then else error on SAS Programming. 06-24-2019 03:21 PM
- Posted Re: Else then else error on SAS Programming. 06-24-2019 03:13 PM
- Posted Re: Else then else error on SAS Programming. 06-24-2019 03:12 PM
- Posted Re: Else then else error on SAS Programming. 06-24-2019 03:10 PM
- Tagged Re: Else then else error on SAS Programming. 06-24-2019 03:10 PM
- Posted Else then else error on SAS Programming. 06-24-2019 02:23 PM
- Posted ODS odf Error when trying to use If, Else, Then statement on SAS Procedures. 06-19-2019 03:33 PM
- Liked Re: re: ODS PDF Error: No Ouput for twildone. 06-19-2019 02:45 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 1 1
07-05-2019
11:30 AM
Hmmmm....the proc freq still doesn't work. Is there something wrong with the data step? 105 /*proc contents data='H:\PCORI\Deliveries\pcori_preg_diag_final.sas7bdat';*/ 106 /*run; */ 107 108 proc freq; 109 category; -------- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 110 run;
... View more
07-05-2019
11:03 AM
Hi, This should be an easy one. I am trying to run proc contents as written below... /*Count of sterilization failures by type by diagnosis*/ data deliveries; set 'H:Deliveries\pcori_preg_diag_final.sas7bdat'; run; proc contents; deliveries; run; And I am getting this error message: 4 proc contents; NOTE: Writing HTML Body file: sashtml.htm 5 deliveries; ---------- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 6 run; What am I missing? Thank you!
... View more
06-25-2019
04:37 PM
This is extremely helpful! Thanks for taking the time to share this. Best, Mary
... View more
06-24-2019
03:21 PM
I was trying to convert the alphabetic characters to numeric. Are you saying that converting the alphanumeric variables to numeric isn't possible with a statement like this, else if Gradeb='9th' or Gradeb='10th' then GradeNu3=2; How else might I go about creating a numeric variable from this Gradeb variable? Thank you! Mary
... View more
06-24-2019
03:12 PM
This is only slightly better. The SAS System The FREQ Procedure Frequency Percent Row Pct Col Pct Table of GradeNu3 by Grade GradeNu3 Grade(Grade) 10th 11th 12th 9th College/Technical school Ungraded Total 1 17 6.85 14.05 100.00 26 10.48 21.49 100.00 78 31.45 64.46 100.00 0 0.00 0.00 0.00 0 0.00 0.00 0.00 0 0.00 0.00 . 121 48.79 2 0 0.00 0.00 0.00 0 0.00 0.00 0.00 0 0.00 0.00 0.00 1 0.40 100.00 100.00 0 0.00 0.00 0.00 0 0.00 0.00 . 1 0.40 5 0 0.00 0.00 0.00 0 0.00 0.00 0.00 0 0.00 0.00 0.00 0 0.00 0.00 0.00 126 50.81 100.00 100.00 0 0.00 0.00 . 126 50.81 Total 17 6.85 26 10.48 78 31.45 1 0.40 126 50.81 0 0.00 248 100.00 Frequency Missing = 29
... View more
06-24-2019
03:10 PM
Yes, indeed I did! Thank you for catching that. I put that in and re-ran this code: /*Create a new file*/ data oahbl_Recode_20190620; /*Set the file to be accessed*/ set OAH_BL; Gradeb=left(trim(Grade)); If Gradeb<='8th' then GradeNu3=1; else if Gradeb='9th' or Gradeb='10th' then GradeNu3=2; else if Gradeb='11th' or Gradeb='12th' then GradeNu3=3; else if Gradeb=' ' then GradeNu3=.; else if Gradeb='High school graduate or GED' then GradeNu3=4; else if Gradeb='College/Technical school' then GradeNu3=5; run; And end up with the output below: Table of GradeNu3 by GradeGradeNu3 Grade(Grade)10th 11th 12th 9th College/Technicalschool Ungraded Total125TotalFrequency Missing = 29 17 6.85 14.05 100.00 26 10.48 21.49 100.00 78 31.45 64.46 100.00 0 0.00 0.00 0.00 0 0.00 0.00 0.00 0 0.00 0.00 . 121 48.79 0 0.00 0.00 0.00 0 0.00 0.00 0.00 0 0.00 0.00 0.00 1 0.40 100.00 100.00 0 0.00 0.00 0.00 0 0.00 0.00 . 1 0.40 0 0.00 0.00 0.00 0 0.00 0.00 0.00 0 0.00 0.00 0.00 0 0.00 0.00 0.00 126 50.81 100.00 100.00 0 0.00 0.00 . 126 50.81 17 6.85 26 10.48 78 31.45 1 0.40 126 50.81 0 0.00 248 100.00 I checked the raw data and there should be records in groups 3 and 4. Thank you and please excuse the centering of my desk!!
... View more
06-24-2019
02:23 PM
Hi, I'm trying to run what seems like pretty basic code, but continually get an error. Here is the code: set OAH_BL; Gradeb=left(trim(Grade)); If Gradeb<='8th' then GradeNu3=1; else if Gradeb='9th' or Gradeb='10th' then GradeNu3=2; else if Gradeb='11th' or Gradeb='12th' then GradeNu3=3; else if Gradeb=' ' then GradeNu3='.'; else if Gradeb='High school graduate or GED' then GradeNu3=4; else if Gradeb='College/Technical school' then GradeNu3=5; run; proc print; var GradeNu3; run; Here is the log: NOTE: The SAS System stopped processing this step because of errors. 229 If Gradeb<='8th' then GradeNu3=1; -- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 230 else if Gradeb='9th' or Gradeb='10th' then GradeNu3=2; ---- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 231 else if Gradeb='11th' or Gradeb='12th' then GradeNu3=3; ---- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 232 else if Gradeb=' ' then GradeNu3='.'; ---- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 233 else if Gradeb='High school graduate or GED' then GradeNu3=4; ---- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 234 else if Gradeb='College/Technical school' then GradeNu3=5; ---- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 235 run; 236 237 proc print; 238 var GradeNu3; ERROR: Variable GRADENU3 not found. 239 run; Any help would be appreciated. Best, Mary
... View more
06-19-2019
03:33 PM
Hi, I'm trying to write a simple If , Then, Else Statement and run frequencies, but I keep getting this error "NOTE: ODS PDF(EGPDF) printed no output. (This sometimes results from failing to place a RUN statement before the ODS PDF(EGPDF) CLOSE statement.)" Here is the code I'm trying to run. data=work.oahbl_20190619; IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla)' THEN BCCURRMETH2='Hormonal IUD'; ELSE IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla),Condoms' THEN BCCURRMETH2='Hormonal IUD'; ELSE BCCURRMETH2='MISSING'; run; proc freq; run; I've tried adding an ODS close statement as the note suggested, but that doesn't make any difference. I'm still not able to creae theis new BCCURRMETH2 variable. Thank you in advance! Best, Mary
... View more