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 ;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.