10-10-2017
larkjr18
Fluorite | Level 6
Member since
09-25-2016
- 25 Posts
- 2 Likes Given
- 0 Solutions
- 1 Likes Received
-
Latest posts by larkjr18
Subject Views Posted 40734 07-21-2017 10:58 AM 1036 05-31-2017 04:55 PM 358 03-30-2017 11:50 PM 1908 03-30-2017 10:13 PM 2592 03-30-2017 09:16 PM 1918 03-30-2017 09:01 PM 2598 03-30-2017 08:36 PM 1937 03-30-2017 08:32 PM 5160 03-30-2017 08:26 PM 2602 03-30-2017 08:20 PM -
Activity Feed for larkjr18
- Posted Finding the Number of Rows and Columns for each dataset in a library on SAS Programming. 07-21-2017 10:58 AM
- Posted Graphs legend changing the colors when I drill into the hierachy on SAS Visual Analytics. 05-31-2017 04:55 PM
- Posted Re: print only data with invalid dates on SAS Programming. 03-30-2017 11:50 PM
- Posted Re: calculating the average of multiple data points on SAS Programming. 03-30-2017 10:13 PM
- Posted Re: print only data with invalid dates on SAS Programming. 03-30-2017 09:16 PM
- Posted Re: calculating the average of multiple data points on SAS Programming. 03-30-2017 09:01 PM
- Posted Re: print only data with invalid dates on SAS Programming. 03-30-2017 08:36 PM
- Posted calculating the average of multiple data points on SAS Programming. 03-30-2017 08:32 PM
- Posted Re: Replacing Embedded blanks with 0's on SAS Programming. 03-30-2017 08:26 PM
- Posted Re: print only data with invalid dates on SAS Programming. 03-30-2017 08:20 PM
- Posted Re: print only data with invalid dates on SAS Programming. 03-30-2017 01:38 PM
- Posted Re: Replacing Embedded blanks with 0's on SAS Programming. 03-30-2017 01:25 PM
- Got a Like for Re: Extracting the first non-zero digit from a numeric variable + delete duplicates. 03-29-2017 11:06 PM
- Posted Re: Extracting the first non-zero digit from a numeric variable + delete duplicates on SAS Programming. 03-29-2017 10:58 PM
- Posted Re: print only data with invalid dates on SAS Programming. 03-29-2017 10:51 PM
- Posted Re: print only data with invalid dates on SAS Programming. 03-29-2017 10:40 PM
- Posted print only data with invalid dates on SAS Programming. 03-29-2017 10:21 PM
- Posted Extracting the first non-zero digit from a numeric variable + delete duplicates on SAS Programming. 03-29-2017 10:17 PM
- Posted Replacing Embedded blanks with 0's on SAS Programming. 03-29-2017 10:11 PM
- Posted Re: where statement with missing char data points on SAS Programming. 03-29-2017 11:39 AM
-
Posts I Liked
Subject Likes Author Latest Post 2 2 -
My Liked Posts
Subject Likes Posted 1 03-29-2017 10:58 PM
07-21-2017
10:58 AM
Hey guys, I'm relatively new to SAS and am trying to write a piece of code in SAS enterprise that finds the number of rows and columns for each data set in a library of 20 or so datasets. I know I need some sort of macro and possibly a nobs= statement but overall I'm generally lost. Any tips or suggestions to point me in the right direction would be much appreciated.
... View more
05-31-2017
04:55 PM
When you cick from the stacked bar to one of the hierachy sections below the color of the legend items gets all jumbled. Also wondering how I can add values to each portion of the stacked column. Ex putting 671.9 in the 2017 column in the blue section.
... View more
03-30-2017
11:50 PM
Isn't that what the length statement does? Create the num_dob variable?
... View more
03-30-2017
10:13 PM
Just figured out that I had by and not var thank you for the help though.
... View more
03-30-2017
09:16 PM
Sorry there's just alot to do with little time so I've been racing through the code. I guess I don't truley know the order of operations. Do you think you could expand on your hint?
... View more
03-30-2017
09:01 PM
When I tried proc means yesterday it didn't work. Here is my code for it. proc means data=hi.femalesq6(firstobs=10 obs=40); where sex='F' and type='M'; by GPA; run; Also posted a picture of the output.
... View more
03-30-2017
08:36 PM
Sorry about that, here is my relevant code right now: libname hi 'C:\Users\larkj\Desktop'; proc format library = hi; value season 1='Fall' 2='Spring' 3='Summer'; value $sx 'M'='Male' 'F'='Female'; value race .='Missing' 2='Hispanic' 3='Puerto Rican' 4='Mexican American' 5='Asian American' 6='Caucasian' 7='American Indian' 8='African American' 9='Other'; ; run; options fmtsearch=(hi); data hi.student (drop=i); infile 'C:\Users\larkj\Desktop\STUDENT.DAT'; length num_dob 8; input ssn 1-9 sex $ 11 term 17 type $ 19 div $ 21-24 major 26-30 ed $ 32 state $ 34-35 sat 37-40 satm 42-44 satv 46-48 gpa 50-53 rank 55-58 act 60-63 toefl 65-68 honor $ 70 ethnic 72 year_dob 101-102 month_dob 103-104 day_dob 105-106 ; num_dob= input(char_dob,mmddyy10.); if char_dob eq '0' then call missing(num_dob); else num_dob=input(char_dob,mmddyy10. ??); Char_DOB = input(catx("/", month_dob, day_dob, year_dob),?? mmddyy8.); Total_DOB = input(catx("/", month_dob, day_dob, year_dob),?? mmddyy8.); if ((month_dob = 02) AND (day_dob= 29)) then Total_DOB = mdy(03,01,year_dob)-1; else Total_DOB = mdy(month_dob,15,year_dob); format Total_DOB mmddyy8. term Season. sex $Sx. ethnic Race.; array change (6) gpa sat satm satv act toefl; do i = 1 TO 6; if change(i) = 0 then change(i) = .; end; Char_DOBc = put(Char_DOB,mmddyy8.); drop Char_DOB; rename Char_DOBc = Char_DOB; run; PROC CONTENTS DATA=hi.student; RUN; proc print data=hi.student; format term Season. sex $Sx. ethnic Race. Total_DOB mmddyy8. ; run; proc print data=hi.student; where num_dob=.; var SSN Total_DOB; run; Here is my problem that the log is saying: 2359 proc print data=hi.student; 2360 where num_dob=.; ERROR: Variable num_dob is not on file HI.STUDENT. 2361 var SSN Total_DOB; 2362 run;
... View more
03-30-2017
08:32 PM
Create a SAS data set for observations starting with the 10th and ending with the 40th based on the female-master-applicant data set, which you have created for item 5. Use the appropriate data set option and the assignment statement or the SUM statement to calculate the average GPA (Ave_GPA) for those 31 students. Show the average GPA (i.e., the value of the Ave_GPA variable) from SAS Log or PROC PRINT output. This is the general code I have right now: data hi.femalesq6; infile 'C:\Users\larkj\Desktop\STUDENT.DAT'; input SSN 1-9 sex $ 11 type $ 19 GPA 50-53; run; proc print data=hi.femalesq6(firstobs= 10 obs=40); where sex='F' and type='M'; run; When I add some kinda sum statement it just seems to create a new variable and print the same numbers as the gpa.
... View more
03-30-2017
08:26 PM
Wow that worked great thank you!!! It is still printing all the other observations but just as 0's any way to stop that?
... View more
03-30-2017
08:20 PM
Hmm the proc print statement is still tell me num_dob is not on file in hi.student.
... View more
03-30-2017
01:38 PM
Do I need to create the num_dob var before I can run your code? I assumed that since there is a var=put statement in your code it would create it but when I try to run the proc print it says it can't find num_dob in the set.
... View more
03-30-2017
01:25 PM
The z9. worked great is there any way to create a new data file with just the observations that added the extra 0's?
... View more
03-29-2017
10:58 PM
1 Like
That worked great, don't know why I didn't do that before. Thank you
... View more
03-29-2017
10:51 PM
Here is my code: I also added pics of the data set and proc contents libname hi 'C:\Users\larkj\Desktop'; proc format library = hi; value season 1='Fall' 2='Spring' 3='Summer'; value $sx 'M'='Male' 'F'='Female'; value race .='Missing' 2='Hispanic' 3='Puerto Rican' 4='Mexican American' 5='Asian American' 6='Caucasian' 7='American Indian' 8='African American' 9='Other'; ; run; options fmtsearch=(hi) data hi.student (drop=i); infile 'C:\Users\larkj\Desktop\STUDENT.DAT'; input ssn 1-9 sex $ 11 term 17 type $ 19 div $ 21-24 major 26-30 ed $ 32 state $ 34-35 sat 37-40 satm 42-44 satv 46-48 gpa 50-53 rank 55-58 act 60-63 toefl 65-68 honor $ 70 ethnic 72 year_dob 101-102 month_dob 103-104 day_dob 105-106 ; Char_DOB = input(catx("/", month_dob, day_dob, year_dob),?? mmddyy8.); Total_DOB = input(catx("/", month_dob, day_dob, year_dob),?? mmddyy8.); if ((month_dob = 02) AND (day_dob= 29)) then Total_DOB = mdy(03,01,year_dob)-1; else Total_DOB = mdy(month_dob,15,year_dob); format Total_DOB mmddyy8. term Season. sex $Sx. ethnic Race.; array change (6) gpa sat satm satv act toefl; do i = 1 TO 6; if change(i) = 0 then change(i) = .; end; Char_DOBc = put(Char_DOB,mmddyy8.); drop Char_DOB; rename Char_DOBc = Char_DOB; run; PROC CONTENTS DATA=hi.student; RUN; proc print data=hi.student; format term Season. sex $Sx. ethnic Race. Total_DOB mmddyy8. ; run; proc print data=hi.student; where Char_DOB = '.'; var SSN Total_DOB Char_DOB; run;
... View more
03-29-2017
10:40 PM
I'm getting this in the SAS log when I run it NOTE: No observations were selected from data set HI.STUDENT. NOTE: There were 0 observations read from the data set HI.STUDENT. WHERE Char_DOB='.'; NOTE: PROCEDURE PRINT used (Total process time): real time 0.01 seconds cpu time 0.01 seconds
... View more