BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ManitobaMoose
Quartz | Level 8

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 ;
   

1 ACCEPTED SOLUTION

Accepted Solutions
ShiroAmada
Lapis Lazuli | Level 10

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 ;

View solution in original post

3 REPLIES 3
Reeza
Super User

Post your full log

ShiroAmada
Lapis Lazuli | Level 10

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 ;

ManitobaMoose
Quartz | Level 8
That was it! Thanks!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1795 views
  • 4 likes
  • 3 in conversation