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;

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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