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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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