@marysmith wrote:
I tried it like this but it didnt work 😞
What did I do wrong? Can you please tell me?
%data2datastep(drugs, drugs_new, uniquedrugs); run;
When something "does not work", always post the log.
The macro accepts up to 4 positional parameters:
dataset name within the library - required
library name - optional (if none given, will default to WORK)
fully qualified filename of file to be created - optional. Default is "create_&lib._&dsn._data.sas" in current working directory.
number of observations - optional
Since you specified no path for the output file, the macro probably tried to write to a location where you don't have write permission.
In case of SAS UE, I'd use a filename like /folders/myfolder/create_dataset.sas. After this is created, you can pick it up from the Windows/Linux/MacOS side with any text editor and copy/paste the contents here.
... View more