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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.