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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 758 views
  • 0 likes
  • 3 in conversation