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!

HOW DO YOU READ A PARTICULAR COLUMN FROM AN EXISTING DATA? 2 1

Status
Not open for further replies.

cosmid

Programmer
Feb 14, 2008
73
US
Sorry about the 2nd post. In my previous post, I tried to paste data and it stretched the screen and I am not able to write anymore replies in that post because the reply windows are no where to be find.

I just want to let you know that the file is save in .sas7bdat format. The data are collected using FSEdit. It was collected in two different tables with the exact format. I combined the table into just a single table and then trying to do analysis to all the data. Maybe I should save the data again in different format? Or how do you read a .sas7bdat file? Aren't they same when reading a .dat, .txt, etc. file?
 
It's a SAS dataset, not a flat file.
You can't use infile with a SAS dataset.
You need to use a libname statement to point to the folder that the dataset is in, then work with it as normal.
Code:
libname mydata 'path to folder containing dataset';

data dset2;
    set mydata.dset1;
    y=year(DateEvent);
run;

If this doesn't work, you've got a version problem. SAS7bdat files came in at version 7 of SAS, so if you're still using version 6, you won't be able to read it.
Another possible issue is if you've got say a Mainframe dataset that you're trying to read into PC SAS. In that case you need to use proc cport to export the data from the source system, then proc cimport to read it into the destination system.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top