Let me clarify a little bit further, the true issue is in port data, 33 belongs to both port_id and bench_id. But the rule is: look at bench data, if we find the data in bench_id, we prefix it as "b_", all others are named "p_" Because 33 in bench data appeared in bench_id, we name it "b_33", rather than p_33, but 10 is not appearing in bench_id, so it is prefixed as p_10. At the same time dimensions for port data is 10k rows over 50 vars, while bench has less than 30 rows and 10 vars, I need a efficient way to prefix this variable. data port; input port_id @@; cards; 10 10 10 33 33 ; data bench; input port_id bench_id; cards; 10 33 33 44 ; /*result i want: p_10 P_10 p_10 b_33 b_33 */
... View more