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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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