BookmarkSubscribeRSS Feed
Chdunst29
Calcite | Level 5
Hi all, I recently started using SAS again. I downloaded data from BRFSS, the format, code, ASCII file and it was converted into SAS dataset . How do I make sure I don’t overwrite this data?

Is this just simply a libname statement or do I create another permanent library?
1 REPLY 1
Tom
Super User Tom
Super User

If you have a text file and a program to read the text file into a dataset then running that should not overwrite the inputs.  And using the generated dataset should pose no risk of overwriting the original data files.

 

Are you asking how to save the resulting SAS dataset permanently?  If so then using a libref that points to a permanent location on the machine where SAS is running and using a two level dataset name will create a permanent dataset.  You probably will also want to create a permanent copy of an formats that the code might define.  Later when you want to re-use the dataset you will need to remember to tell the new SAS session where to find the format catalog you created, otherwise you will only be able to see the raw unformatted values of the variables.

 

If you want reduce the risk of modifying your SAS dataset I would recommend using the ACCESS=READONLY option on the libref you create (obviously only after you have already made the dataset).  Then any coding mistake, like a missing semi-colon, will not be able to modify and dataset using that libref.

 

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
  • 1 reply
  • 1096 views
  • 0 likes
  • 2 in conversation