Dear all, I'm having a trouble converting Power function and double Decode statement to SAS proc sql. Please help me with 2 issues below: 1/ I would like to get the GROUP_ID to match with another table, but the source data is different from the destination, and I don't understand the previous person program as below: POWER(2,33) * DECODE(IS_NUMBER(SUBSTR( LC.LAB_REFERENCE,1,5)),1,TO_NUMBER(SUBSTR( LC.LAB_REFERENCE,1,5)), NULL) + DECODE( IS_NUMBER(SUBSTR( LC.LAB_REFERENCE,7, LENGTH( LC.LAB_REFERENCE)-6 - (DECODE(INSTR( LC.LAB_REFERENCE,'/R',1),0,0,3)))), 1, TO_NUMBER(SUBSTR( LC.LAB_REFERENCE,7, LENGTH( LC.LAB_REFERENCE)-6 - (DECODE(INSTR( LC.LAB_REFERENCE,'/R',1),0,0,3)))), NULL) AS GROUP_ID 2/ This one has double DECODE function. As I would like to create 2 columns for separate Left Len Cost vs. Right Len Cost. DECODE(DECODE(LC.ITEM_TYPE,'L',NVL(LC.ITEM_EYE,'B')),'L',TOTAL_COST) AS L_LENS_COST, DECODE(DECODE(LC.ITEM_TYPE,'L',NVL(LC.ITEM_EYE,'B')),'R',TOTAL_COST) AS R_LENS_COST Thank you in advance for your help.
... View more