154 data myprint.conractInformations-Sites; set disctool.conractInformations_Sites; run;
-
22
200
ERROR: File DISCTOOL.conractInformations_Sites.DATA does not exist.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;,
_DATA_, _LAST_, _NULL_.
ERROR 200-322: The symbol is not recognized and will be ignored.
options validmemname=extend ; data myprint.'conractInformations-Sites'n; set .........
SAS names can only contain letters, digits or underlines, and must not start with a digit.
This is likely to work but why change to non-standard names? You'll end up with a lot of extra typing in your programs:
data myprint.'conractInformations-Sites'n; set disctool.conractInformations_Sites; run;
@Dennis_K wrote:
I'm writing a macro to copy the datasets from the source library. The source dataset name contains dashes.
Not in the code/log excerpt you posted.
154 data myprint.conractInformations-Sites; set disctool.conractInformations_Sites; run;
Your source dataset is disctool.conractInformations_Sites, and does not contain a dash. Does it in fact exist?
Because the error message is:
ERROR: File DISCTOOL.conractInformations_Sites.DATA does not exist.
That name does not contain a dash, it contains an underscore.
Your target dataset is myprint.conractInformations-Sites. You should have control over that name, since your code is creating the dataset. Don't use dashes. Problem solved.
options validmemname=extend ; data myprint.'conractInformations-Sites'n; set .........
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.