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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 474 views
  • 2 likes
  • 3 in conversation