BookmarkSubscribeRSS Feed
deleted_user
Not applicable
So I imported my csv file into SAS and created a SAS data table. The data table contains the variable name and the values in column format. The problem is I am used to having input statements from a data file and have no clue how to input the data using the data table. The data is messy and looks similar to:

Name Location Date Time

Joe@Johnson Oakland 04/12/2001 04:18:35
Greg@Smith Boston 03/22/2001 06:14:45


I need to seperate name into two seperate columns first and last and then have location and date (total day format) and time (total second format). This data was imported from a .csv file so originally looked like Joe@Johnson,Oakland,04/12/2001/04:18:35 . I tried using informat statements and DLM=',' and DLM='@' statements but have most trouble with the date and time variables. Any help would be appreciated.
1 REPLY 1
LinusH
Tourmaline | Level 20
To read a SAS table, use the SET-statement.
To read out parts of a string which contains a delimiter, use the SCAN function.
To read data and time data, use corresponding informats during input operation, or in the subsequent step by using the input function. See on-line documentation for details.

Regards,
Linus
Data never sleeps

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 890 views
  • 0 likes
  • 2 in conversation