Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing sas.log data to create a sas table

Status
Not open for further replies.

ja01

Technical User
Dec 14, 2005
48
US
In a sas.log file I have the following:
smith (data type is text or $)
2006-03-02:00:00:00 (data type is date time)
my report (data type is text or $)
The log file lists everything vertical or 1 line for each entry

Issue#1 : I need to parse the data into sas and create a table that looks like this: smith 03/02/06 my report
Essentially I need to display data from the sas.log table horizontally not vertically.

Issue#2: The entry "my report" is an example of how some of the entries have spaces in it. SAS cuts off data like this when it encounters a space

Issue#3: I want to display the date as a simple short date format (ie 3/2/07)
The sas.log is in my c drive, so I need to read it into SAS

Here is the code I have so far:
data
'c:\myname'; "The nameI want to give the file"
infile 'c:\reports.sas "The location of the file.
input name$ 1-30/Date yymmdd 10./reportname$ 1-30;
run;
Am I missing something here because the data does not come out formatted. I seem to get stumped with the date.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top