Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. options compress=yes;
  2.  
  3. %let dir=/home/u45088587/sasuser.v94/kat/;
  4. %let dir_projekt=/home/u45088587/sasuser.v94/kat/;
  5.  
  6. libname wej "&dir_projekt" compress=yes;
  7. libname wyj "&dir" compress=yes;
  8.  
  9. %let zb=wyj.vin;
  10. %let tar=vin3;
  11.  
  12. *%let zmienne_int_ord=act_age app_income act_cc;
  13.  
  14.  
  15. %let il_zm=213;
  16.  
  17. data nowabaza(DROP=aid cid product period app_char_branch app_char_cars app_char_cit
  18. app_char_gender app_char_home_status app_char_job_code app_char_marital_status);
  19. SET wyj.production;
  20. RUN;
  21.  
  22. proc contents noprint data=nowabaza out=meta (keep=NAME) ;
  23. run ;
  24. proc print data=meta;
  25. run ;
  26.  
  27. proc sql noprint;
  28. select Name
  29. into :zmienne_int_ord separated by ' '
  30. from meta;
  31.  
  32.  
  33.  
  34. %put ***&il_zm***&zmienne_int_ord;
  35.  
  36.  
  37.  
  38. data vin0;
  39. set wej.transactions;
  40. seniority=intck('month',input(fin_period,yymmn6.),input(period,yymmn6.));
  41. vin3=(due_installments>=3);
  42. output;
  43. if status in ('B','C') and period<='200812' then do;
  44. n_steps=intck('month',input(period,yymmn6.),input('200812',yymmn6.));
  45. do i=1 to n_steps;
  46. period=put(intnx('month',input(period,yymmn6.),1,'end'),yymmn6.);
  47. seniority=intck('month',input(fin_period,yymmn6.),input(period,yymmn6.));
  48. output;
  49. end;
  50. end;
  51. where product='ins';
  52. keep vin3 seniority aid;
  53. run;
  54.  
  55. data vin12_sample(drop=seniority);
  56. set vin0;
  57. where seniority=12 and ranuni(1)<0.5;
  58. run;
  59. proc sort data=vin12_sample nodupkey;
  60. by aid;
  61. run;
  62. proc sort data=wej.Production(keep=aid &zmienne_int_ord) out=prod nodupkey;
  63. by aid;
  64. run;
  65. data &zb;
  66. merge vin12_sample(in=z) prod;
  67. by aid;
  68. if z;
  69. run;
  70.  
  71.  
  72. %let max_il_podz=2;
  73. /*minimalna liczba obs w li�ciu*/
  74. %let min_percent=3;
  75. %include "&dir.tree.sas" / source2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement