BookmarkSubscribeRSS Feed
sas_
Fluorite | Level 6

i am having a huge dataset with 200gb and having 100 variable ,now i want to drop 1 variable unused_trans,

i can do by this way

data tran_data(drop=unused_trans);

set tran_data;

run;

is there any other way to drop the variable by using proc datasets or proc sql with out recreating the dataset

6 REPLIES 6
Ksharp
Super User

It looks like you can't do it without recreating a new table ,even SQL.

But If you like view you can create a view for that which is most fast and most saving disk space method.

manojinpec
Obsidian | Level 7

I don;t think there is any other way accept creating a view.

Astounding
PROC Star

It would be slightly faster to do it this way:

data tran_data;

    set tran_data (drop=unused_trans);

run;

LinusH
Tourmaline | Level 20

As already said, SAS offers no support of modifying table structure in place.

If this is a rare operation, I can't see any problem by recreating the table.

if you often need to add/drop columns, and performance is an issue, you might want to look for other storage options.

If you are eager to save disk space, you may want to look at compression (SAS or host based).

If you just want to hide some obsolete columns for your users, using views, information maps or metadata rights could be an alternative.

Data never sleeps
ballardw
Super User

How does it get in the data in the first place? Just about any approach should allow a (drop=variable) from the output when creating the SAS dataset. it from the datastep would be a better approach as you're going to need rought 400gb of disk to process.

Reeza
Super User

Where is your data stored?

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 6 replies
  • 960 views
  • 0 likes
  • 7 in conversation