BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Steelersgirl
Calcite | Level 5

I am trying to read a data set in to SAS that includes dates. I have been trying the following code, but it isn't working. 

 

DATA baseball;
FILENAME webpage URL 'http://people.stat.sc.edu/hitchcock/baseballroster.txt';
INFILE webpage missover;
INPUT name $ 1-15 height 19-22 weight 24-26 position $ 29-38 yearsonteam @40 birthday MMDDYY8. 42-49 starting MMDDYY8. 51-58;
RUN;

PROC PRINT DATA=baseball;
RUN; 

 

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

I read the yearsonteam, dates with modified list input

 

DATA baseball;
 FILENAME webpage URL 'http://people.stat.sc.edu/hitchcock/baseballroster.txt';
 INFILE webpage missover;
 INPUT name $ 1-15 height $ 19-22 weight 24-26 position $ 29-38 yearsonteam  birthday : MMDDYY8.  starting : MMDDYY8. ;
 format birthday starting mmddyy8.;
 RUN;

 

View solution in original post

1 REPLY 1
novinosrin
Tourmaline | Level 20

I read the yearsonteam, dates with modified list input

 

DATA baseball;
 FILENAME webpage URL 'http://people.stat.sc.edu/hitchcock/baseballroster.txt';
 INFILE webpage missover;
 INPUT name $ 1-15 height $ 19-22 weight 24-26 position $ 29-38 yearsonteam  birthday : MMDDYY8.  starting : MMDDYY8. ;
 format birthday starting mmddyy8.;
 RUN;

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 1 reply
  • 926 views
  • 0 likes
  • 2 in conversation