The following SAS program is submitted:
libname temp ‘SAS data library’;
data temp.sales;
merge temp.sales
work.receipt;
by names;
run;
The input data files are sorted by the NAMES variable:
Happen to see this question, so is it okay to have same name for SAS data set that is referenced for both read
and write operations??
You can do it, which does not mean you should. If you have an error, you need to recreate the dataset from its original source(s).
PS when you create dataset xxx, SAS writes to a file named xxx.sas7bdat.lck. Once the step has finished, that file is renamed to xxx.sas7bdat. If a file with that name already exists, it is deleted first.
If an error (that SAS detects!) happened, and xxx.sas7bdat already exists, no rename is done, the new file is deleted, and the original kept. But that does not protect you from a logical error that is not detected by SAS.
Yes!
🙂
You can do it, which does not mean you should. If you have an error, you need to recreate the dataset from its original source(s).
PS when you create dataset xxx, SAS writes to a file named xxx.sas7bdat.lck. Once the step has finished, that file is renamed to xxx.sas7bdat. If a file with that name already exists, it is deleted first.
If an error (that SAS detects!) happened, and xxx.sas7bdat already exists, no rename is done, the new file is deleted, and the original kept. But that does not protect you from a logical error that is not detected by SAS.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.