Hi everyone, i have this code below and I would like to enhance it. Any suggestion will help me so much. Maybe using hash would be better? If so, how to translate it to. proc sort data=wk.seguros_carona&A4M2. ; by OCTROI ; run; proc sort data=pfat.refcto3m&A4M2m1. ; by OCTROI ; run; proc sort data=wk.pf_pfra_&A4M2. ; by OCTROI ; run; proc sort data=mvt_pfra ; by OCTROI ; run; data wk.pf_filtros&corte._cart&A4M2.; merge wk.pf_&corte._cart&A4M2. (in=a) wk.seguros_carona&A4M2. (in=_seguro ) pfat.refcto3m&A4M2m1. (in=_rfcto3 ) pfat.refctovd&A4M2m1. (in=_refinvd drop=TDPRNFOY TDPRNCONT) wk.pf_pfra_&A4M2. (in=_pfra ) mvt_pfra (in=_mvt ); by OCTROI ; if a; retain publico; if not _refinvd and intck('month',d_cre,&dtbdos) ge 12 and tvdchaine ne &submarino then publico=0; else if not _refinvd then publico=1; else if _rfcto3 then publico=3; else publico=2; if tdprnsoc ne (100) then _filtro=1; else if (talpcposdosa in ("560" "570" "CG1" "CG2" "RET" "DCD" "CTX" "USU") or tdprnagcrcvt in (560 570)) then _filtro=3; else if cposa ne 'ENC' then _filtro=4; else if verrou in (45,55,52) or verrou ge 60 then _filtro=5; else if tdcpcficp in (5) then _filtro=6; else if 0<=todu <100 then _filtro=7; else if todu <7500 then _filtro=8; else if tvdchaine not in &submarino and (tdcpbmontssr12m gt 2 or (tdcpbmontssr12m eq 1 and intck('month',d_dms,&dtbdos) lt 3) or (tdcpbmontssr12m eq 2 and intck('month',d_dms,&dtbdos) lt 6) ) then _filtro=9; else if tvdchaine eq &submarino and (d_dms ne . and intck('month',d_dms,&dtbdos) lt 3) then _filtro=9.1; else if modo_pagamento eq 'P' then _filtro=10; else if DEGRESSIVIDADE ne 997 and (DEGRESSIVIDADE<901 or DEGRESSIVIDADE>950) then _filtro=11; else if tvdchaine eq 9100280 then _filtro=13; else if intck('month',d_pcp,&dtbdos) lt 1 and tvdchaine not in &submarino then _filtro=14; else if _seguro then _filtro=15; else if atpfra ge 1 or _mvt then _filtro=16; else if tvdchaine ne 9106782 and GRENT = "Nao Abordados" then _filtro=17; else if tvdchaine eq 9106782 and publico in (0,1) and NO_SUBA in (201) then _filtro=18; else if tvdchaine eq 9106782 and publico in (2) and NO_SUBA in (103) then _filtro=18; else if tvdchaine eq 9106782 and publico in (3) and NO_SUBA in (103,146,201) then _filtro=18; else _filtro=99; run; Thanks so much.
... View more