BookmarkSubscribeRSS Feed
Smitha9
Fluorite | Level 6

Hi,

I have a txt file which looks like

ID SNO         start               stop           Lon       Len       Tod           date

1      2     09/02/2003   12/06/2020     10004   10006    10007   20040809  

 

the start and stop are in mm/dd/yyyy format

date is yyyymmdd format.

I want all the txt to convert to SAS dataset.

And the date must be formatted to mm/dd/yyyy

can I do this in SAS?

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

Google is your friend. Use the data step and the Infile Statement 🙂

Kurt_Bremser
Super User
data want;
input ID $ SNO $ start :mmddyy10. stop :mmddyy10. Lon Len Tod date :yymmdd8.;
format start stop date mmddyy10.;
datalines;
1      2     09/02/2003   12/06/2020     10004   10006    10007   20040809  
;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 575 views
  • 2 likes
  • 3 in conversation