Hey guys, I have to put flags for customers according to their balance for a particular product code. There is categorization on the basis of months as well. As the months increase from M+0 To M+2, upto M+8. Here months M+0 is Current month, M+1 last month and so on.
Is there any other way to do this which does not take so much manual work?
Any suggestions would be appreciated!
DATA PRODWISE_AMB_CHECK;
SET BC_UC_ALL(WHERE=(PRODUCT_CODE NOT IN('20101','20102','20103')));
IF (PRODUCT_CODE IN (20210) AND CORE_URBAN IN ('Urban') AND AMB_OCT_M0<10000 AND MONTH='M+0') OR (PRODUCT_CODE IN (20210) AND CORE_URBAN IN ('Core') AND AMB_OCT_M0<5000 AND MONTH='M+0' ) THEN PROD_BAL=0;
IF (PRODUCT_CODE IN (20210) AND CORE_URBAN IN ('Urban') AND AMB_OCT_M0>=10000 AND MONTH='M+0') OR (PRODUCT_CODE IN (20210) AND CORE_URBAN IN ('Core') AND AMB_OCT_M0>=5000 AND MONTH='M+0' ) THEN PROD_BAL=10;
IF (PRODUCT_CODE IN (20241,20250) AND AMB_OCT_M0<50000 AND MONTH='M+0') THEN PROD_BAL=0;
IF (PRODUCT_CODE IN (20241,20250) AND AMB_OCT_M0>=50000 AND MONTH='M+0') THEN PROD_BAL=10;
IF (PRODUCT_CODE IN (20109,20110) AND AMB_OCT_M0<5000 AND MONTH='M+0') THEN PROD_BAL=0;
IF (PRODUCT_CODE IN (20109,20110) AND AMB_OCT_M0>=5000 AND MONTH='M+0') THEN PROD_BAL=10;
IF (PRODUCT_CODE IN (20249,20139,20140) AND AMB_OCT_M0<500000 AND MONTH='M+0') THEN PROD_BAL=0;
IF (PRODUCT_CODE IN (20249,20139,20140) AND AMB_OCT_M0>=500000 AND MONTH='M+0') THEN PROD_BAL=10;
IF PRODUCT_CODE IN (20135,20255,20154,20155) AND AMB_OCT_M0 <100000 AND MONTH='M+0' THEN PROD_BAL=0;
IF PRODUCT_CODE IN (20135,20255,20154,20155) AND AMB_OCT_M0 >=100000 AND MONTH='M+0' THEN PROD_BAL=10;
IF PRODUCT_CODE IN (20134,20121) AND AMB_OCT_M0 <25000 AND MONTH='M+0' THEN PROD_BAL=0;
IF PRODUCT_CODE IN (20134,20121) AND AMB_OCT_M0 >=25000 AND MONTH='M+0' THEN PROD_BAL=10;
IF (PRODUCT_CODE IN (20204,20201,20202,20203,20205,20206,20207,20211,20212,20213,20214,20215,20216,20217,20218,20219,20220,20221,20222,20223,20224,20225,20226,20227,20228,20229) AND CORE_URBAN IN ('Urban') AND AMB_OCT_M0<10000 AND MONTH='M+0')
OR (PRODUCT_CODE IN (20204,20201,20202,20203,20205,20206,20207,20211,20212,20213,20214,20215,20216,20217,20218,20219,20220,20221,20222,20223,20224,20225,20226,20227,20228,20229) AND CORE_URBAN IN ('Core') AND AMB_OCT_M0<5000 AND MONTH='M+0' ) THEN PROD_BAL=0;
IF (PRODUCT_CODE IN (20204,20201,20202,20203,20205,20206,20207,20211,20212,20213,20214,20215,20216,20217,20218,20219,20220,20221,20222,20223,20224,20225,20226,20227,20228,20229) AND CORE_URBAN IN ('Urban') AND AMB_OCT_M0>=10000 AND MONTH='M+0')
OR (PRODUCT_CODE IN (20204,20201,20202,20203,20205,20206,20207,20211,20212,20213,20214,20215,20216,20217,20218,20219,20220,20221,20222,20223,20224,20225,20226,20227,20228,20229) AND CORE_URBAN IN ('Core') AND AMB_OCT_M0>=5000 AND MONTH='M+0' ) THEN PROD_BAL=10;