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.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1046 views
  • 0 likes
  • 2 in conversation