Thank you for your reply! Yes, you are right that one cusip is numerical BEST12. format and the other one is character $9. format. For clarification, LinkType= Character; LINKDT=Numerical; Endfyr= Numerical; LINKENDDT=Numerical. After converting the numerical cusip to character type for matching with each other, SAS produced an empty dataset with zero rows. Do you possibly know where got wrong? Many thanks for your help indeed! 1503 proc sql;
1504 create table mydata as select *
1505 from compx2 as a, LinkTable as b
1506 where a.cusip = b.cusip and
1507 b.LINKTYPE in ("LC", "LS", "LU", "LX", "LD", "LN") and
1508 (b.LINKDT <= a.endfyr or b.LINKDT = .B) and (a.endfyr <= b.LINKENDDT or b.LINKENDDT =
1508! .E); /*. letter (a decimal point followed by a letter, for example, .B) means
WARNING: Variable CUSIP already exists on file SIQI_IO.MYDATA.
NOTE: Table SIQI_IO.MYDATA created, with 0 rows and 72 columns.
1508!
1509 /***************************************************************************************
1509! *********************
1510 * The previous condition requires the end of fiscal year to fall within the link range.
1510! *
1511 ***************************************************************************************
1511! *********************/
1512 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.89 seconds
cpu time 0.87 seconds
... View more