BookmarkSubscribeRSS Feed
larkjr18
Fluorite | Level 6

Isn't that what the length statement does? Create the num_dob variable?

ballardw
Super User
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.);  /*<==== where does a value for char_dob come from??
                                        it is not on the input statement*/
   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.); /* value assigned AFTER use above*/
   Total_DOB = input(catx("/", month_dob, day_dob, year_dob),?? mmddyy8.);

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 16 replies
  • 1631 views
  • 0 likes
  • 4 in conversation