BookmarkSubscribeRSS Feed
gsreddy
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?

2 REPLIES 2
Reeza
Super User

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

ballardw
Super User

Easiest:

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 953 views
  • 0 likes
  • 3 in conversation