Learning SAS? Welcome to the exclusive online community for all SAS learners.

How to Remove and replace a Data file

Reply
New Contributor
Posts: 2

How to Remove and replace a Data file

 

 Hi

 

Am completely new to SAS.  I am on Windows version.  Just trying to do a simple Linear Regression.  Managed to save my excel file in myfolders.  But unfortunately when I was trying to create the Linear Regression task, I accidentally clicked on 2 sample data (sets) from SAS.  Now I can't seem to remove them and replace with my Excel data.  I have managed to convert my Excel into ctl file.  Is that OK?  Please tell me how to remove the 2 data (sample SAS data files) and replace with my own data and let me know if the ctl file is ok to use.  If not please guide me on how to convert to readable data file.  Thank you.  Any help would be greatly appreciated. 

 

Super User
Posts: 7,431

Re: How to Remove and replace a Data file

First, you need to import the Excel data to a SAS dataset. Then you can use this dataset in any analysis you want to do.

Either import into a WORK dataset (temporary) or to a library you created under myfolders (which would make the data permanent, ie persistent across SAS sessions). No need to remove other files beforehand.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 2

Re: How to Remove and replace a Data file

Hi
Thanks. I managed to import the data properly this time i believe coz the table results show when i run the program. But i dont see the file in the Work folder even though the imported data with sas file extension are in myfolders and subfolder thereof. Clicking the data set does not allow me to select my new imported sas file. Plse help again. Tq
Super User
Posts: 7,431

Re: How to Remove and replace a Data file

[ Edited ]

How did you import the file to a SAS dataset (show the code&log)?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super Contributor
Posts: 396

Re: How to Remove and replace a Data file

Are you using the Linear Regression Custom Task? If you are you simply select the small box to the right of the data set name and choose a new file. If you're a beginner I would strongly recommend using this approach as you can see how SAS builds the code to run the task which will help you enormously when you come to write freehand programs of your own.

 

Oh and @KurtBremser is of course absolutely correct - you need a SAS data set for this to work.

Ask a Question
Discussion stats
  • 4 replies
  • 162 views
  • 0 likes
  • 3 in conversation