DATA Step, Macro, Functions and more

Input Statement from SAS Data Table.

Not applicable
Posts: 0

Input Statement from SAS Data Table.

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.
Super User
Posts: 5,884

Re: Input Statement from SAS Data Table.

Posted in reply to deleted_user
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.

Data never sleeps
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation