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 ;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.