DATA Step, Macro, Functions and more

Data Step Object Failure Error

Accepted Solution Solved
Reply
Contributor
Posts: 26
Accepted Solution

Data Step Object Failure Error

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 ;
   


Accepted Solutions
Highlighted
Solution
‎09-11-2017 11:56 AM
Frequent Contributor
Posts: 95

Re: Data Step Object Failure Error

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


All Replies
Super User
Posts: 19,171

Re: Data Step Object Failure Error

Post your full log

Highlighted
Solution
‎09-11-2017 11:56 AM
Frequent Contributor
Posts: 95

Re: Data Step Object Failure Error

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 ;

Contributor
Posts: 26

Re: Data Step Object Failure Error

That was it! Thanks!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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