BookmarkSubscribeRSS Feed
ybz12003
Rhodochrosite | Level 12

Hello,

 

I use proc dataset to format my SAS dataset.    I would like to save my new SAS dataset into a new file, please advise how to do it.  Thanks.

 

proc datasets library=work; 
				 modify test;
				format  ID   $9.   
.
.
.
.
.
.
run;
5 REPLIES 5
andreas_lds
Jade | Level 19

You will have to copy the dataset before adding the formats. The modify-statement has no option to store the dataset with a new name.

ybz12003
Rhodochrosite | Level 12

Of course using DATA step could approach this format purpose.   However, I have hundreds of statement (format, rename and label) to modify this dataset.   I read use proc dataset could reduce the processing time, comparing with simple data step.   That is why I use Proc Dataset.   Correct me if I am wrong.

andreas_lds
Jade | Level 19

@ybz12003 wrote:

Of course using DATA step could approach this format purpose.   However, I have hundreds of statement (format, rename and label) to modify this dataset.   I read use proc dataset could reduce the processing time, comparing with simple data step.   That is why I use Proc Dataset.   Correct me if I am wrong.


That is correct as long as you don't need the modifications applied to a clone of the dataset.

Kurt_Bremser
Super User

@ybz12003 wrote:

Of course using DATA step could approach this format purpose.   However, I have hundreds of statement (format, rename and label) to modify this dataset.   I read use proc dataset could reduce the processing time, comparing with simple data step.   That is why I use Proc Dataset.   Correct me if I am wrong.


Quote from your otriginal post:

"I would like to save my new SAS dataset into a new file"

Since you read and write the dataset anyway, the advantages of using proc datasets won't come into play.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 1319 views
  • 2 likes
  • 3 in conversation