Hi.
I am not sure what the problem is. I am merging two data sets. Both have character variables, in which one is called 'Subj' and the other 'ID'. The data sets exist and are in the SasData library. I am not sure why I am getting the Data Setp Object Failure Error saying that
the variable SASdata is not an object. Any help would be appreciated. Thanks!
-------------------------------
libname sasdata '/folders/myfolders/SASData' ;
proc sort data=sasdata.survey ;
by subj ;
run ;
proc sort data=sasdata.demographicsmy ;
by ID ;
run ;
Options mergenoby = error ;
data MergeDemoSurvey ;
Merge sasdata.survey (rename =(subj=ID)) ;
sasdata.demographicsmy ;
by ID ;
run ;
Title 'Merge Demographics and Survey 1' ;
proc print data=MergeDemoSurvey noobs ;
run ;
i think you closed your merge statement too soon.
Options mergenoby = error ;
data MergeDemoSurvey ;
Merge sasdata.survey (rename =(subj=ID)) ;
sasdata.demographicsmy ;
by ID ;
run ;
Try like this:
Options mergenoby = error ;
data MergeDemoSurvey ;
Merge sasdata.survey (rename =(subj=ID))
sasdata.demographicsmy ;
by ID ;
run ;
Post your full log
i think you closed your merge statement too soon.
Options mergenoby = error ;
data MergeDemoSurvey ;
Merge sasdata.survey (rename =(subj=ID)) ;
sasdata.demographicsmy ;
by ID ;
run ;
Try like this:
Options mergenoby = error ;
data MergeDemoSurvey ;
Merge sasdata.survey (rename =(subj=ID))
sasdata.demographicsmy ;
by ID ;
run ;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.