Hello, I am attempting my first table lookup, but I am not achieving my intended goal after reading several tutorials. I’d really appreciate some guidance. I don’t know SQL yet, but I hear it can be a great tool for merges. This is what my primary dataset looks like: RowId DTE_BIRTH Name Primary Secondary Third 1508634 A0470 B8290 ####### 3895072 A0780 B800 R1970 3895072 A0780 B800 ####### 318053 A0840 B800 ####### My reference table looks like this: CDE_DIAG_andVERSION CDE_DIAG CDE_ICD_VERSION DSC_25 109 A0470 9 CHOLERA DUE TO VIBRIO CHOLERAE I would like to attach the character string (DSC_25) from the reference table which corresponds to the primary diagnosis variable above(Primary in the main dataset, CDE_DIAG in the reference table). Here is the main piece of code I have written. I changed the Primary and DSC_25 variables into a 6-length character string variable named mergevariable (previously one was a numeric, and the other was a character). But my results end up looking like a concatenation, D'oh! proc sort data=sth_icd10; by mergevariable; run; proc sort data=reftable_merge; by mergevariable; run; data all; merge sth_icd10 reftable_merge; by mergevariable; drop mergevariable; run; Appreciate any thoughts or guidance on how I can perform this simple task and how I can grow more as a beginner programmer wanting to do more data merges and table lookups. Thanks.
... View more