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 ;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.