Hello @Sahar775 and welcome to the SAS Support Communities!
Most likely, the error messages are caused by invalid formats (e.g. w.d formats such as 1.2 or 2.2) which are permanently assigned to GHQ12 and other variables in dataset WORK.SAMPSYS. (PROC SQL might have assigned these formats.)
To see which variables are affected, run a PROC CONTENTS step like
proc contents data=work.sampsys;
run;
and look at column "Format."
If all formats there are invalid (such as 2.2) or unnecessary, you can remove all formats with PROC DATASETS:
proc datasets lib=work nolist;
modify sampsys;
format _all_;
quit;
Otherwise, you can specify individual valid formats and drop others as well by replacing format _all_; with a valid format specification in the above step. (Get back to us if you need help with this.)
Once you have changed/removed the assigned formats, check if the following step creates error messages:
data _null_;
set work.sampsys(obs=0);
run;
If the log is clean, you're ready to run your DATA step to create WORK.SAMPSYS1.
... View more