@ballardw
Please, below the inputs:
data tabla_clientes_;
infile datalines delimiter=',';
input Periodo:8. NUP:4. FECHA:3. Estado_cliente:1.;
datalines;
201101,17,1,2
201101,225,1,1
201101,911,1,5
201101,2004,1,4
201102,17,2,1
201102,225,2,1
201102,911,2,5
201102,2004,2,4
201103,17,3,1
201103,225,3,1
201103,911,3,5
201103,2004,3,4
201104,17,4,1
201104,225,4,1
201104,911,4,5
201105,17,5,1
201105,225,5,1
201105,911,5,5
201106,17,6,1
201106,225,6,1
201107,17,7,1
201107,225,7,1
201108,17,8,1
201108,225,8,1
201109,17,9,1
201109,225,9,1
201110,17,10,1
201110,225,10,1
201111,17,11,1
201111,225,11,1
201112,17,12,1
201112,225,12,1
201201,17,13,1
201201,225,13,1
201202,17,14,2
201202,225,14,1
201203,17,15,1
201203,225,15,1
201204,17,16,1
201204,225,16,1
201205,17,17,1
201205,225,17,1
201206,17,18,1
201206,225,18,1
201207,17,19,1
201207,225,19,1
201208,17,20,1
201208,225,20,1
201209,17,21,1
201209,225,21,1
201210,17,22,1
201210,225,22,1
201211,17,23,1
201211,225,23,1
201212,17,24,1
201212,225,24,1
201301,17,25,.
201301,225,25,1
201302,17,26,1
201302,225,26,1
201303,17,27,1
201303,225,27,1
201304,17,28,1
201304,225,28,1
201305,17,29,.
201305,225,29,1
201306,17,30,.
201306,225,30,1
201307,17,31,1
201307,225,31,1
201308,17,32,1
201308,225,32,1
201309,17,33,1
201309,225,33,1
201310,17,34,1
201310,225,34,1
201311,17,35,1
201311,225,35,1
201312,17,36,1
201312,225,36,1
201401,17,37,1
201401,225,37,1
201402,17,38,1
201402,225,38,1
201403,17,39,1
201403,225,39,1
201404,17,40,1
201404,225,40,1
201405,17,41,.
201405,225,41,1
201406,17,42,.
201406,225,42,1
201407,17,43,.
201407,225,43,1
201408,17,44,.
201408,225,44,1
201409,17,45,.
201409,225,45,1
201410,17,46,.
201410,225,46,1
201411,17,47,.
201411,225,47,1
201411,2004,47,1
201412,17,48,.
201412,225,48,1
201412,2004,48,1
201501,17,49,.
201501,225,49,1
201501,2004,49,1
201502,17,50,.
201502,225,50,1
201502,2004,50,1
201503,17,51,.
201503,225,51,1
201503,2004,51,1
201504,17,52,.
201504,225,52,1
201504,2004,52,1
201505,17,53,.
201505,225,53,1
201505,2004,53,1
201506,17,54,.
201506,225,54,1
201506,2004,54,1
201507,17,55,.
201507,225,55,1
201507,2004,55,1
201508,17,56,.
201508,225,56,1
201508,2004,56,1
201509,17,57,.
201509,225,57,1
201509,2004,57,1
201510,17,58,.
201510,225,58,1
201510,2004,58,1
201511,17,59,.
201511,225,59,1
201511,2004,59,1
201512,17,60,.
201512,225,60,1
201512,2004,60,1
201601,17,61,.
201601,225,61,1
201601,2004,61,1
201602,17,62,.
201602,225,62,1
201602,2004,62,1
201603,17,63,.
201603,225,63,1
201603,2004,63,1
201604,17,64,.
201604,225,64,1
201604,2004,64,1
201605,17,65,.
201605,225,65,1
201605,2004,65,1
201606,17,66,.
201606,225,66,1
201606,2004,66,1
201607,17,67,.
201607,225,67,1
201607,2004,67,1
201608,17,68,.
201608,225,68,1
201608,2004,68,1
201609,17,69,.
201609,225,69,1
201609,2004,69,1
201610,17,70,.
201610,225,70,1
201610,2004,70,1
201611,17,71,.
201611,225,71,1
201611,2004,71,1
201612,17,72,.
201612,225,72,1
201612,2004,72,1
201701,17,73,.
201701,225,73,1
201701,2004,73,1
201702,17,74,.
201702,225,74,1
201702,2004,74,1
201703,17,75,.
201703,225,75,1
201703,2004,75,1
201704,17,76,.
201704,225,76,1
201704,2004,76,1
201705,17,77,.
201705,225,77,1
201705,2004,77,1
201706,17,78,.
201706,225,78,1
201706,2004,78,1
201707,17,79,.
201707,225,79,1
201707,2004,79,1
201708,17,80,.
201708,225,80,1
201708,911,80,1
201708,2004,80,1
201709,17,81,.
201709,225,81,1
201709,911,81,1
201709,2004,81,1
201710,17,82,.
201710,225,82,1
201710,911,82,1
201710,2004,82,1
201711,17,83,.
201711,225,83,1
201711,911,83,1
201711,2004,83,1
201712,17,84,.
201712,225,84,1
201712,911,84,2
201712,2004,84,1
201801,17,85,.
201801,225,85,1
201801,911,85,2
201801,2004,85,1
201802,17,86,.
201802,225,86,1
201802,911,86,3
201802,2004,86,1
201803,17,87,.
201803,225,87,1
201803,911,87,3
201803,2004,87,1
201804,17,88,.
201804,225,88,1
201804,911,88,3
201804,2004,88,1
201805,17,89,.
201805,225,89,1
201805,911,89,4
201805,2004,89,1
201806,17,90,.
201806,225,90,1
201806,911,90,4
201806,2004,90,1
201807,17,91,.
201807,225,91,1
201807,911,91,4
201807,2004,91,1
201808,17,92,.
201808,225,92,1
201808,911,92,4
201808,2004,92,1
201809,17,93,.
201809,225,93,1
201809,911,93,4
201809,2004,93,1
201810,17,94,.
201810,225,94,1
201810,911,94,4
201810,2004,94,1
201811,17,95,.
201811,225,95,1
201811,2004,95,1
201812,17,96,.
201812,225,96,1
201812,2004,96,1
201901,17,97,.
201901,225,97,1
201901,2004,97,1
201902,17,98,.
201902,225,98,1
201902,2004,98,1
201903,17,99,.
201903,225,99,1
201903,2004,99,1
201904,17,100,.
201904,225,100,1
201904,2004,100,1
201905,17,101,.
201905,225,101,1
201905,2004,101,1
201906,17,102,.
201906,225,102,1
201906,2004,102,1
201907,17,103,.
201907,225,103,1
201907,2004,103,1
201908,17,104,.
201908,225,104,1
201908,2004,104,1
201909,17,105,.
201909,225,105,1
201909,2004,105,1
201910,17,106,.
201910,225,106,1
201910,2004,106,1
201911,17,107,.
201911,225,107,1
201911,2004,107,1
201912,17,108,.
201912,225,108,1
201912,2004,108,1
202001,17,109,.
202001,225,109,1
202001,2004,109,1
202002,17,110,.
202002,225,110,1
202002,2004,110,1
202003,17,111,.
202003,225,111,1
202003,2004,111,1
;;
data default_contratos;
infile datalines delimiter=',';
input NUP:4. t:3. Estado_cliente:1.;
datalines;
911,1,5
2004,1,4
911,2,5
2004,2,4
911,3,5
2004,3,4
911,4,5
911,5,5
911,86,3
911,87,3
911,88,3
911,89,4
911,90,4
911,91,4
911,92,4
911,93,4
911,94,4
;;
The period of date are from 201101 to 202003. The relation between period and (t=fecha) 201101 --> t=1 201401 --> t=37 202003 --> t=111
... View more