Hello,
I am merging SAS dataset A with SAS dataset C by the variable SP1. A comes from an input file. C comes from the result of a query. I want to write SP1 from A and SP2 from C to the merged SAS dataset D. However, SP2 from C is blank when it's written out. I checked the result of the query and SP2 is not blank. Can anyone tell me what i m doing wrong? Here is what i have:
DATA A;
INFILE IN1;
INPUT @01 SP1 $CHAR10.
@11 SPCD1 $CHAR03.;
proc sort, by sp1;
PROC DB2EXT OUT = C UNIQUE;
SELECT A.ENTITYID AS SP1,
B.ENTITYID AS SP2
FROM ADUADS01.ADVTB912 A,
ADUADS01.ADVTB912 B,
WHERE A.ENTITYID = B.ENTITYID
FOR READ ONLY;
RUN;
PROC SORT; BY SP1;
DATA D;
MERGE A (IN=IN_A)
C (IN=IN_C);
BY SP1;
IF IN_A AND IN_C THEN DO;
PUT @1 SP1
@11 SP2;
END;
Thank you so much for your help!!!
Kevin