dear SAS experts, how can I simplify such blocks: - it's a new varaible based on more than 1 variable and using a formula - I have many of these structures in many programs Can I define a format to make it easier and how? /* LAUFZEIT_CLUSTER_HJ */ (CASE WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 6 THEN 6 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 12 THEN 12 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 18 THEN 18 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 24 THEN 24 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 30 THEN 30 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 36 THEN 36 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 42 THEN 42 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 48 THEN 48 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 54 THEN 54 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 60 THEN 60 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 66 THEN 66 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 72 THEN 72 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 78 THEN 78 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 84 THEN 84 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 90 THEN 90 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 96 THEN 96 WHEN FLOOR(DATDIF(t1.VERTRBGN, t1.DTENDFLG, '30/360')/30) <= 120 THEN 120 ELSE 10000 END) FORMAT=BESTX12. AS LAUFZEIT_CLUSTER_HJ, Regards, PY
... View more