Hi to all,
please, can anyone help me in how to create a permanent dataset with one column?
I want to create a permanent dataset (MyDataset.sas7dbat) with only one column "STATUS", to a given library to a given path.
Can any one help me?
Thanks in advance.
I get the feeling that there's really more to this question, but you haven't provided details.
Nevertheless, here is code
libname perm "c:\users\<username>\documents\myfolder";
/* Note: you must change the above to reference a valid and existing folder */
data perm.mydataset;
status=1;
run;
I get the feeling that there's really more to this question, but you haven't provided details.
Nevertheless, here is code
libname perm "c:\users\<username>\documents\myfolder";
/* Note: you must change the above to reference a valid and existing folder */
data perm.mydataset;
status=1;
run;
Hi @PaigeMiller
Great!
I have created the dataset and I see it in libname directory.
But where I find the basic guide about dataset programming?
For example, I want be able also delete a dataset but also add/delete columns and update data.
Thanks in advance.
@vinpres wrote:
Hi @PaigeMiller
Great!
I have created the dataset and I see it in libname directory.
But where I find the basic guide about dataset programming?
I don't know.
For example, I want be able also delete a dataset but also add/delete columns and update data.
Deleting data sets can be done manually (depending on your user interface) by right-clicking on the data set and selecting Delete or by using PROC DELETE. Adding or deleting columns and updating data can be done in a DATA step or in PROC SQL or by various different SAS PROCs such as PROC STDIZE (and many others). More specific information about what you want to do will lead to more specific answers.
With SAS once you have created the data set you cannot add or delete variables (columns is spreadsheet thinking and will lead you astray eventually). You would need to create a new data set with the added or deleted variables. However for use one a data set exists you can ignore specified variables with data set option DROP and not use specific observations (rows) with either a Where data set option or statement or less frequently options like Firstobs and Obs.
Updating data methods will depend on a number of conditions depending on exactly what you might mean by "update".
Search for the Free SAS Programming tutorials.
Proc DATASETS can modify some properties of data sets and variables but not change values or number of observationsw
"But where I find the basic guide about dataset programming?"- The question gives me the impression you are perhaps in the same situation as me back in FEB2014 when I actually started learning SAS. I would recommend buying the book-
All the best!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.