I have two datasets, A and B. Each have overlapping and non-overlapping unique…
- User
I have two datasets, A and B. Each have overlapping and non-overlapping unique subject_ids. Write SAS code to create a new data table that includes all unique subject_id's that are in dataset B but not in dataset A.
Assistant
To create a new data table that includes all unique subject_id's that are in dataset B but not in dataset A, you can use the SAS
setstatement along with theoutputstatement inside adatastep. Thesetstatement is used to read data from more than one data set that have the same variables in the same order. Theoutputstatement is used to control the output of aprocstep.Here's how you can do it:
sasdata want; set dataset_b (in=inb) dataset_a (in=ina); if not inb then output; run;