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!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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