Hello,
I agree with @PaigeMiller, a few more details are needed because these details are important. For example, has a library been established for SASDATA before the DATA step is submitted? The assumption is that it has been established, but if not, the first ERROR that you will get is ERROR: Libref SASDATA is not assigned. If a library has been assigned for SASDATA, then the question becomes, is the SET statement supposed to be; SET SASDATA.TWO; (and does that exist) or are there two WORK data sets WORK.SASDATA and WORK.TWO and the SET statement is supposed to be SET SASDATA TWO; thus referencing the two temporary data sets? I can't really tell from the tips that were provided. After that, it depends from that point on whether there are two data sets WORK.SASDATA and WORK.TWO and if so, @ballardw's response is on point!
If you wish to try this for yourself, here is a sample program that I wrote to test out the code. It assumes SASDATA library an be established, it assumes you have access to c:\ (C: drive) on your PC if you are submitting the program code in Windows. If not, replace the location in the LIBNAME statement to point to a location (in quotes) that exist on your computer and that you have write access to. Also, it assumes that the SET statement in the original code is correct to reference two data sets SASDATA and TWO > set sasdata two;
The sample program below creates the SASDATA library, and creates the two temporary data sets SASDATA and TWO before the original program can be submitted.
libname sasdata 'c:\';
data two;
set sashelp.cars;
if _n_=1 then
do x=1 to 5;
output;
end;
run;
data sasdata;
set sashelp.cars(obs=2);
do x=1 to 5;
output;
end;
run;
data sasuser.one two sasdata.three;
set sasdata two;
if x = 5 then output sasuser.one;
else output sasdata two;
run;
Good Luck!