BookmarkSubscribeRSS Feed
Fluorite | Level 6

I have .CSV file with 2000 columns.Some columns have blank data.Now mr requirement is:

(1)How to import this file into SAS,while importing into SAS i need to drop the columns with blank data?

(2)How to import only column1,column2,column150,column256?

Super User

You ou need to import all and drop the columns you don't want in a second step.

Super User


Use proc import. The procedure will generate a datastep to read the data. You can either Recall the code into the editor (F4 key by default, command Recall, or copy and paste from the log).

Edit the data step to have (keep= <list the names of the variables you want to keep>) data set option .

data want (keep=column1 column2 column150 column256);

<remainder of generated code>

If you can get you data in fixed column then you can read directly by specifying the columns to read.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3 in conversation