08-21-2015 04:54 PM
Hi, I had created a new variable (newid) in dataset 'A' by using concatenating 2 or more fields( which I later deleted from the dataset)
This is how dataset A looks:
I need to use the newid in dataset A to merge it with dataset B . It will be merged by variable oldid. This is how dataset B looks:
I need to have a final dataset that looks like this ;
For the merge ,I need only the oldid , sortind and newid from dataset A, so I created a dataset called temp:
data temp (keep=oldid sortind newid);
It gives me a warning saying ...WARNING: The variable newid in the DROP, KEEP, or RENAME list has never been referenced ...and the dataset temp has no variable newid.
Could anyone tell me why its doing that?
Any suggestions would be very helpful.
08-21-2015 05:43 PM
I would double check spelling of the variable. Another possibility is that all values of newid are missing.
A proc sql solution that doesn't require a separate subsetting step.
create table temp as
select b.oldid, a.sortid, a.newid
from b left join a on b.oldid=a.oldid;
08-21-2015 05:58 PM
Thanks @ballardw I will work on your suggestions and use the left join...(The 'sortid/sortind' was a typo error here)