Hi I am wanting to access elements from another data set while working with a data set unrelated to the one I want to access.
Here's an example, I want to modify the column report_on if there is an id that is in common to both data sets. If there is an id in common then I want report_on to be labeled "Yes"
I am not thinking of a merge because one of the data sets is a key that has 5 id's, and the data set I am searching through is thousands of observations long.
I am having to do some conditional statement work, the id's have decimal points so I am wanting to do a substr and look at the last 4 digits, if they are all 0000's then report yes, but if the last 4 digits of the id is not all 0's then search for an exact match.
I think my problem is accessing the other data set to compare values, I thought of using a proc sql and a subquery, but I am not sure how to update the report_on column doing that.
data one;
input id age nickname $ Report_on$;
datalines;
13.0000 25 j
2.2562 35 e
3 53 n
7 21 p
11 31 z
;
run;
data two;
input id salary name$;
datalines;
1 2000 jimmy
2.2562 3000 jeff
4 543 leory
13.0000 33 joey
;
run;