Improving macro for analysis of credit risk

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Improving macro for analysis of credit risk

Carlos Renato
Dear friends list

    Is there any way to simplify the macro below. To reduce considerably the code? The purpose of this macro is to create tracks in tracks customer score of 5, 10 and so on. Is there a way to tell SPSS it more simply?

/ * FUNCTION: This macro creates tracks of score. (FAIXAESCOREv3.0)
/ * DESCRIPTION: This macro creates a variable that encodes the score in bands.
/ * INPUT:
/ * ARG 1 - Name of the variable that contains the score. DEFAULT score.
/ * 2 ARG - AmpFaixa = Amplitude of the tracks. 1,2,5,10,20,25 and 50 are available. DEFAULT 5.
/ * ARG 3 - VarFaixa = Variable where the tracks are computed score. DEFAULT Range.
/ * OUTPUT: the output is a column with the ranges of scores computed in accordance with the request.
/ * AUTHOR AND DATE OF CREATION: Carlos Renato (renato@neurotech.com.br) 01.06.2006.
/ * Last Modified: 07/06/2006 (adapt the macro to suit the limitations of decimal places in SPSS,
/ * Avoiding integer values ​​are allocated to the wrong score ranges).
/ * EXAMPLE:
/ * Procedure to call the macro. INCLUDE 'address where the macro is in quotes. "
/ * Faixaescore AmpFaixa score = 5 = VarFaixa Range.

DEFINE MacroCriaFaixaEscore (!POSITIONAL !DEFAULT(Escore) !TOKENS(1) / AmpFaixa=!DEFAULT(5) !TOKENS(1) / VarFaixa=!DEFAULT(Faixa) !TOKENS(1))
SET MPRINT=OFF.
STRING !VarFaixa (A6) .
!IF (!AmpFaixa=5) !THEN
RECODE
 !1
 (0 thru 4.9999999999999='00-05')
 (5 thru 9.9999999999999='05-10')
 (10 thru 14.9999999999999='10-15')
 (15 thru 19.9999999999999='15-20')
 (20 thru 24.9999999999999='20-25')
 (25 thru 29.9999999999999='25-30')
 (30 thru 34.9999999999999='30-35')
 (35 thru 39.9999999999999='35-40')
 (40 thru 44.9999999999999='40-45')
 (45 thru 49.9999999999999='45-50')
 (50 thru 54.9999999999999='50-55')
 (55 thru 59.9999999999999='55-60')
 (60 thru 64.9999999999999='60-65')
 (65 thru 69.9999999999999='65-70')
 (70 thru 74.9999999999999='70-75')
 (75 thru 79.9999999999999='75-80')
 (80 thru 84.9999999999999='80-85')
 (85 thru 89.9999999999999='85-90')
 (90 thru 94.9999999999999='90-95')
 (95 thru 100='95-100')
 INTO  !VarFaixa .
EXECUTE .
!ELSE
!IF (!AmpFaixa=1) !THEN
RECODE
 !1
 (0 thru 0.9999999999999='00-01')
 (1 thru 1.9999999999999='01-02')
 (2 thru 2.9999999999999='02-03')
 (3 thru 3.9999999999999='03-04')
 (4 thru 4.9999999999999='04-05')
 (5 thru 5.9999999999999='05-06')
 (6 thru 6.9999999999999='06-07')
 (7 thru 7.9999999999999='07-08')
 (8 thru 8.9999999999999='08-09')
 (9 thru 9.9999999999999='09-10')
 (10 thru 10.9999999999999='10-11')
 (11 thru 11.9999999999999='11-12')
 (12 thru 12.9999999999999='12-13')
 (13 thru 13.9999999999999='13-14')
 (14 thru 14.9999999999999='14-15')
 (15 thru 15.9999999999999='15-16')
 (16 thru 16.9999999999999='16-17')
 (17 thru 17.9999999999999='17-18')
 (18 thru 18.9999999999999='18-19')
 (19 thru 19.9999999999999='19-20')
 (20 thru 20.9999999999999='20-21')
 (21 thru 21.9999999999999='21-22')
 (22 thru 22.9999999999999='22-23')
 (23 thru 23.9999999999999='23-24')
 (24 thru 24.9999999999999='24-25')
 (25 thru 25.9999999999999='25-26')
 (26 thru 26.9999999999999='26-27')
 (27 thru 27.9999999999999='27-28')
 (28 thru 28.9999999999999='28-29')
 (29 thru 29.9999999999999='29-30')
 (30 thru 30.9999999999999='30-31')
 (31 thru 31.9999999999999='31-32')
 (32 thru 32.9999999999999='32-33')
 (33 thru 33.9999999999999='33-34')
 (34 thru 34.9999999999999='34-35')
 (35 thru 35.9999999999999='35-36')
 (36 thru 36.9999999999999='36-37')
 (37 thru 37.9999999999999='37-38')
 (38 thru 38.9999999999999='38-39')
 (39 thru 39.9999999999999='39-40')
 (40 thru 40.9999999999999='40-41')
 (41 thru 41.9999999999999='41-42')
 (42 thru 42.9999999999999='42-43')
 (43 thru 43.9999999999999='43-44')
 (44 thru 44.9999999999999='44-45')
 (45 thru 45.9999999999999='45-46')
 (46 thru 46.9999999999999='46-47')
 (47 thru 47.9999999999999='47-48')
 (48 thru 48.9999999999999='48-49')
 (49 thru 49.9999999999999='49-50')
 (50 thru 50.9999999999999='50-51')
 (51 thru 51.9999999999999='51-52')
 (52 thru 52.9999999999999='52-53')
 (53 thru 53.9999999999999='53-54')
 (54 thru 54.9999999999999='54-55')
 (55 thru 55.9999999999999='55-56')
 (56 thru 56.9999999999999='56-57')
 (57 thru 57.9999999999999='57-58')
 (58 thru 58.9999999999999='58-59')
 (59 thru 59.9999999999999='59-60')
 (60 thru 60.9999999999999='60-61')
 (61 thru 61.9999999999999='61-62')
 (62 thru 62.9999999999999='62-63')
 (63 thru 63.9999999999999='63-64')
 (64 thru 64.9999999999999='64-65')
 (65 thru 65.9999999999999='65-66')
 (66 thru 66.9999999999999='66-67')
 (67 thru 67.9999999999999='67-68')
 (68 thru 68.9999999999999='68-69')
 (69 thru 69.9999999999999='69-70')
 (70 thru 70.9999999999999='70-71')
 (71 thru 71.9999999999999='71-72')
 (72 thru 72.9999999999999='72-73')
 (73 thru 73.9999999999999='73-74')
 (74 thru 74.9999999999999='74-75')
 (75 thru 75.9999999999999='75-76')
 (76 thru 76.9999999999999='76-77')
 (77 thru 77.9999999999999='77-78')
 (78 thru 78.9999999999999='78-79')
 (79 thru 79.9999999999999='79-80')
 (80 thru 80.9999999999999='80-81')
 (81 thru 81.9999999999999='81-82')
 (82 thru 82.9999999999999='82-83')
 (83 thru 83.9999999999999='83-84')
 (84 thru 84.9999999999999='84-85')
 (85 thru 85.9999999999999='85-86')
 (86 thru 86.9999999999999='86-87')
 (87 thru 87.9999999999999='87-88')
 (88 thru 88.9999999999999='88-89')
 (89 thru 89.9999999999999='89-90')
 (90 thru 90.9999999999999='90-91')
 (91 thru 91.9999999999999='91-92')
 (92 thru 92.9999999999999='92-93')
 (93 thru 93.9999999999999='93-94')
 (94 thru 94.9999999999999='94-95')
 (95 thru 95.9999999999999='95-96')
 (96 thru 96.9999999999999='96-97')

 (97 thru 97.9999999999999='97-98')
 (98 thru 98.9999999999999='98-99')
 (99 thru 100='99-100')
 INTO  !VarFaixa .
EXECUTE .
!ELSE
!IF (!AmpFaixa=2) !THEN
RECODE
 !1
 (0 thru 1.9999999999999='00-02')
 (2 thru 3.9999999999999='02-04')
 (4 thru 5.9999999999999='04-06')
 (6 thru 7.9999999999999='06-08')
 (8 thru 9.9999999999999='08-10')
 (10 thru 11.9999999999999='10-12')
 (12 thru 13.9999999999999='12-14')
 (14 thru 15.9999999999999='14-16')
 (16 thru 17.9999999999999='16-18')
 (18 thru 19.9999999999999='18-20')
 (20 thru 21.9999999999999='20-22')
 (22 thru 23.9999999999999='22-24')
 (24 thru 25.9999999999999='24-26')
 (26 thru 27.9999999999999='26-28')
 (28 thru 29.9999999999999='28-30')
 (30 thru 31.9999999999999='30-32')
 (32 thru 33.9999999999999='32-34')
 (34 thru 35.9999999999999='34-36')
 (36 thru 37.9999999999999='36-38')
 (38 thru 39.9999999999999='38-40')
 (40 thru 41.9999999999999='40-42')
 (42 thru 43.9999999999999='42-44')
 (44 thru 45.9999999999999='44-46')
 (46 thru 47.9999999999999='46-48')
 (48 thru 49.9999999999999='48-50')
 (50 thru 51.9999999999999='50-52')
 (52 thru 53.9999999999999='52-54')
 (54 thru 55.9999999999999='54-56')
 (56 thru 57.9999999999999='56-58')
 (58 thru 59.9999999999999='58-60')
 (60 thru 61.9999999999999='60-62')
 (62 thru 63.9999999999999='62-64')
 (64 thru 65.9999999999999='64-66')
 (66 thru 67.9999999999999='66-68')
 (68 thru 69.9999999999999='68-70')
 (70 thru 71.9999999999999='70-72')
 (72 thru 73.9999999999999='72-74')
 (74 thru 75.9999999999999='74-76')
 (76 thru 77.9999999999999='76-78')
 (78 thru 79.9999999999999='78-80')
 (80 thru 81.9999999999999='80-82')
 (82 thru 83.9999999999999='82-84')
 (84 thru 85.9999999999999='84-86')
 (86 thru 87.9999999999999='86-88')
 (88 thru 89.9999999999999='88-90')
 (90 thru 91.9999999999999='90-92')
 (92 thru 93.9999999999999='92-94')
 (94 thru 95.9999999999999='94-96')
 (96 thru 97.9999999999999='96-98')
 (98 thru 100='98-100')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
 INTO  !VarFaixa .
EXECUTE .
!ELSE                  
!IF (!AmpFaixa=10) !THEN    
RECODE                
 !1                    
 (0 thru 9.9999999999999='00-10')  
 (10 thru 19.9999999999999='10-20')  
 (20 thru 29.9999999999999='20-30')  
 (30 thru 39.9999999999999='30-40')  
 (40 thru 49.9999999999999='40-50')  
 (50 thru 59.9999999999999='50-60')
 (60 thru 69.9999999999999='60-70')
 (70 thru 79.9999999999999='70-80')
 (80 thru 89.9999999999999='80-90')
 (90 thru 100='90-100')                                                                          
 INTO  !VarFaixa .          
EXECUTE .
!ELSE                  
!IF (!AmpFaixa=20) !THEN  
RECODE                
 !1                    
 (0 thru 19.9999999999999='00-20')  
 (20 thru 39.9999999999999='20-40')
 (40 thru 59.9999999999999='40-60')
 (60 thru 79.9999999999999='60-80')
 (80 thru 100='80-100')
 INTO  !VarFaixa .          
EXECUTE .
!ELSE                  
!IF (!AmpFaixa=25) !THEN  
RECODE                
 !1                    
 (0 thru 24.9999999999999='00-25')  
 (25 thru 49.9999999999999='25-50')
 (50 thru 74.9999999999999='50-75')
 (75 thru 100='75-100')
 INTO !VarFaixa .          
EXECUTE .
!ELSE                  
!IF (!AmpFaixa=50) !THEN  
RECODE                
 !1                    
 (0 thru 49.9999999999999='00-50')  
 (50 thru 100='50-100')
  INTO !VarFaixa .          
EXECUTE .
!IFEND.
!IFEND.
!IFEND.          
!IFEND.            
!IFEND.                  
!IFEND.                                              
!IFEND.
!ENDDEFINE.

Thanks.

Carlos Renato
Reply | Threaded
Open this post in threaded view
|

Re: Improving macro for analysis of credit risk

David Marso
Administrator
You are doing it the *HARD* way Carlos!!!
----
DEFINE RECRange (INPUT !TOKENS(1) / OUTPUT !TOKENS(1)/INC !TOKENS(1) ).
STRING !OUTPUT (A6).
COMPUTE #TLO=TRUNC(!INPUT/!inc)*!inc.
COMPUTE #THI=#TLO+!inc.
COMPUTE TLO=#TLO.
DO IF #THI < 100.
+  COMPUTE !OUTPUT=CONCAT(STRING(#TLO,N2),"-",STRING(#THI,N2)).
ELSE.
+  COMPUTE !OUTPUT=CONCAT(STRING(#TLO,N2),"-",STRING(#THI,N3)).
END IF.
+  IF RND(!INPUT)=100 !OUTPUT=CONCAT(STRING (100-!inc,N2),"-100").
!ENDDEFINE.
RecRange INPUT Val OUTPUT REC10  INC 10.
EXECUTE.

Carlos Renato wrote
Dear friends list

    Is there any way to simplify the macro below. To reduce considerably the code? The purpose of this macro is to create tracks in tracks customer score of 5, 10 and so on. Is there a way to tell SPSS it more simply?

/ * FUNCTION: This macro creates tracks of score. (FAIXAESCOREv3.0)
/ * DESCRIPTION: This macro creates a variable that encodes the score in bands.
/ * INPUT:
/ * ARG 1 - Name of the variable that contains the score. DEFAULT score.
/ * 2 ARG - AmpFaixa = Amplitude of the tracks. 1,2,5,10,20,25 and 50 are available. DEFAULT 5.
/ * ARG 3 - VarFaixa = Variable where the tracks are computed score. DEFAULT Range.
/ * OUTPUT: the output is a column with the ranges of scores computed in accordance with the request.
/ * AUTHOR AND DATE OF CREATION: Carlos Renato (renato@neurotech.com.br) 01.06.2006.
/ * Last Modified: 07/06/2006 (adapt the macro to suit the limitations of decimal places in SPSS,
/ * Avoiding integer values ​​are allocated to the wrong score ranges).
/ * EXAMPLE:
/ * Procedure to call the macro. INCLUDE 'address where the macro is in quotes. "
/ * Faixaescore AmpFaixa score = 5 = VarFaixa Range.

DEFINE MacroCriaFaixaEscore (!POSITIONAL !DEFAULT(Escore) !TOKENS(1) / AmpFaixa=!DEFAULT(5) !TOKENS(1) / VarFaixa=!DEFAULT(Faixa) !TOKENS(1))
SET MPRINT=OFF.
STRING !VarFaixa (A6) .
!IF (!AmpFaixa=5) !THEN
RECODE
 !1
 (0 thru 4.9999999999999='00-05')
 (5 thru 9.9999999999999='05-10')
 (10 thru 14.9999999999999='10-15')
 (15 thru 19.9999999999999='15-20')
 (20 thru 24.9999999999999='20-25')
 (25 thru 29.9999999999999='25-30')
 (30 thru 34.9999999999999='30-35')
 (35 thru 39.9999999999999='35-40')
 (40 thru 44.9999999999999='40-45')
 (45 thru 49.9999999999999='45-50')
 (50 thru 54.9999999999999='50-55')
 (55 thru 59.9999999999999='55-60')
 (60 thru 64.9999999999999='60-65')
 (65 thru 69.9999999999999='65-70')
 (70 thru 74.9999999999999='70-75')
 (75 thru 79.9999999999999='75-80')
 (80 thru 84.9999999999999='80-85')
 (85 thru 89.9999999999999='85-90')
 (90 thru 94.9999999999999='90-95')
 (95 thru 100='95-100')
 INTO  !VarFaixa .
EXECUTE .
!ELSE
!IF (!AmpFaixa=1) !THEN
RECODE
 !1
 (0 thru 0.9999999999999='00-01')
 (1 thru 1.9999999999999='01-02')
 (2 thru 2.9999999999999='02-03')
 (3 thru 3.9999999999999='03-04')
 (4 thru 4.9999999999999='04-05')
 (5 thru 5.9999999999999='05-06')
 (6 thru 6.9999999999999='06-07')
 (7 thru 7.9999999999999='07-08')
 (8 thru 8.9999999999999='08-09')
 (9 thru 9.9999999999999='09-10')
 (10 thru 10.9999999999999='10-11')
 (11 thru 11.9999999999999='11-12')
 (12 thru 12.9999999999999='12-13')
 (13 thru 13.9999999999999='13-14')
 (14 thru 14.9999999999999='14-15')
 (15 thru 15.9999999999999='15-16')
 (16 thru 16.9999999999999='16-17')
 (17 thru 17.9999999999999='17-18')
 (18 thru 18.9999999999999='18-19')
 (19 thru 19.9999999999999='19-20')
 (20 thru 20.9999999999999='20-21')
 (21 thru 21.9999999999999='21-22')
 (22 thru 22.9999999999999='22-23')
 (23 thru 23.9999999999999='23-24')
 (24 thru 24.9999999999999='24-25')
 (25 thru 25.9999999999999='25-26')
 (26 thru 26.9999999999999='26-27')
 (27 thru 27.9999999999999='27-28')
 (28 thru 28.9999999999999='28-29')
 (29 thru 29.9999999999999='29-30')
 (30 thru 30.9999999999999='30-31')
 (31 thru 31.9999999999999='31-32')
 (32 thru 32.9999999999999='32-33')
 (33 thru 33.9999999999999='33-34')
 (34 thru 34.9999999999999='34-35')
 (35 thru 35.9999999999999='35-36')
 (36 thru 36.9999999999999='36-37')
 (37 thru 37.9999999999999='37-38')
 (38 thru 38.9999999999999='38-39')
 (39 thru 39.9999999999999='39-40')
 (40 thru 40.9999999999999='40-41')
 (41 thru 41.9999999999999='41-42')
 (42 thru 42.9999999999999='42-43')
 (43 thru 43.9999999999999='43-44')
 (44 thru 44.9999999999999='44-45')
 (45 thru 45.9999999999999='45-46')
 (46 thru 46.9999999999999='46-47')
 (47 thru 47.9999999999999='47-48')
 (48 thru 48.9999999999999='48-49')
 (49 thru 49.9999999999999='49-50')
 (50 thru 50.9999999999999='50-51')
 (51 thru 51.9999999999999='51-52')
 (52 thru 52.9999999999999='52-53')
 (53 thru 53.9999999999999='53-54')
 (54 thru 54.9999999999999='54-55')
 (55 thru 55.9999999999999='55-56')
 (56 thru 56.9999999999999='56-57')
 (57 thru 57.9999999999999='57-58')
 (58 thru 58.9999999999999='58-59')
 (59 thru 59.9999999999999='59-60')
 (60 thru 60.9999999999999='60-61')
 (61 thru 61.9999999999999='61-62')
 (62 thru 62.9999999999999='62-63')
 (63 thru 63.9999999999999='63-64')
 (64 thru 64.9999999999999='64-65')
 (65 thru 65.9999999999999='65-66')
 (66 thru 66.9999999999999='66-67')
 (67 thru 67.9999999999999='67-68')
 (68 thru 68.9999999999999='68-69')
 (69 thru 69.9999999999999='69-70')
 (70 thru 70.9999999999999='70-71')
 (71 thru 71.9999999999999='71-72')
 (72 thru 72.9999999999999='72-73')
 (73 thru 73.9999999999999='73-74')
 (74 thru 74.9999999999999='74-75')
 (75 thru 75.9999999999999='75-76')
 (76 thru 76.9999999999999='76-77')
 (77 thru 77.9999999999999='77-78')
 (78 thru 78.9999999999999='78-79')
 (79 thru 79.9999999999999='79-80')
 (80 thru 80.9999999999999='80-81')
 (81 thru 81.9999999999999='81-82')
 (82 thru 82.9999999999999='82-83')
 (83 thru 83.9999999999999='83-84')
 (84 thru 84.9999999999999='84-85')
 (85 thru 85.9999999999999='85-86')
 (86 thru 86.9999999999999='86-87')
 (87 thru 87.9999999999999='87-88')
 (88 thru 88.9999999999999='88-89')
 (89 thru 89.9999999999999='89-90')
 (90 thru 90.9999999999999='90-91')
 (91 thru 91.9999999999999='91-92')
 (92 thru 92.9999999999999='92-93')
 (93 thru 93.9999999999999='93-94')
 (94 thru 94.9999999999999='94-95')
 (95 thru 95.9999999999999='95-96')
 (96 thru 96.9999999999999='96-97')

 (97 thru 97.9999999999999='97-98')
 (98 thru 98.9999999999999='98-99')
 (99 thru 100='99-100')
 INTO  !VarFaixa .
EXECUTE .
!ELSE
!IF (!AmpFaixa=2) !THEN
RECODE
 !1
 (0 thru 1.9999999999999='00-02')
 (2 thru 3.9999999999999='02-04')
 (4 thru 5.9999999999999='04-06')
 (6 thru 7.9999999999999='06-08')
 (8 thru 9.9999999999999='08-10')
 (10 thru 11.9999999999999='10-12')
 (12 thru 13.9999999999999='12-14')
 (14 thru 15.9999999999999='14-16')
 (16 thru 17.9999999999999='16-18')
 (18 thru 19.9999999999999='18-20')
 (20 thru 21.9999999999999='20-22')
 (22 thru 23.9999999999999='22-24')
 (24 thru 25.9999999999999='24-26')
 (26 thru 27.9999999999999='26-28')
 (28 thru 29.9999999999999='28-30')
 (30 thru 31.9999999999999='30-32')
 (32 thru 33.9999999999999='32-34')
 (34 thru 35.9999999999999='34-36')
 (36 thru 37.9999999999999='36-38')
 (38 thru 39.9999999999999='38-40')
 (40 thru 41.9999999999999='40-42')
 (42 thru 43.9999999999999='42-44')
 (44 thru 45.9999999999999='44-46')
 (46 thru 47.9999999999999='46-48')
 (48 thru 49.9999999999999='48-50')
 (50 thru 51.9999999999999='50-52')
 (52 thru 53.9999999999999='52-54')
 (54 thru 55.9999999999999='54-56')
 (56 thru 57.9999999999999='56-58')
 (58 thru 59.9999999999999='58-60')
 (60 thru 61.9999999999999='60-62')
 (62 thru 63.9999999999999='62-64')
 (64 thru 65.9999999999999='64-66')
 (66 thru 67.9999999999999='66-68')
 (68 thru 69.9999999999999='68-70')
 (70 thru 71.9999999999999='70-72')
 (72 thru 73.9999999999999='72-74')
 (74 thru 75.9999999999999='74-76')
 (76 thru 77.9999999999999='76-78')
 (78 thru 79.9999999999999='78-80')
 (80 thru 81.9999999999999='80-82')
 (82 thru 83.9999999999999='82-84')
 (84 thru 85.9999999999999='84-86')
 (86 thru 87.9999999999999='86-88')
 (88 thru 89.9999999999999='88-90')
 (90 thru 91.9999999999999='90-92')
 (92 thru 93.9999999999999='92-94')
 (94 thru 95.9999999999999='94-96')
 (96 thru 97.9999999999999='96-98')
 (98 thru 100='98-100')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
 INTO  !VarFaixa .
EXECUTE .
!ELSE                  
!IF (!AmpFaixa=10) !THEN    
RECODE                
 !1                    
 (0 thru 9.9999999999999='00-10')  
 (10 thru 19.9999999999999='10-20')  
 (20 thru 29.9999999999999='20-30')  
 (30 thru 39.9999999999999='30-40')  
 (40 thru 49.9999999999999='40-50')  
 (50 thru 59.9999999999999='50-60')
 (60 thru 69.9999999999999='60-70')
 (70 thru 79.9999999999999='70-80')
 (80 thru 89.9999999999999='80-90')
 (90 thru 100='90-100')                                                                          
 INTO  !VarFaixa .          
EXECUTE .
!ELSE                  
!IF (!AmpFaixa=20) !THEN  
RECODE                
 !1                    
 (0 thru 19.9999999999999='00-20')  
 (20 thru 39.9999999999999='20-40')
 (40 thru 59.9999999999999='40-60')
 (60 thru 79.9999999999999='60-80')
 (80 thru 100='80-100')
 INTO  !VarFaixa .          
EXECUTE .
!ELSE                  
!IF (!AmpFaixa=25) !THEN  
RECODE                
 !1                    
 (0 thru 24.9999999999999='00-25')  
 (25 thru 49.9999999999999='25-50')
 (50 thru 74.9999999999999='50-75')
 (75 thru 100='75-100')
 INTO !VarFaixa .          
EXECUTE .
!ELSE                  
!IF (!AmpFaixa=50) !THEN  
RECODE                
 !1                    
 (0 thru 49.9999999999999='00-50')  
 (50 thru 100='50-100')
  INTO !VarFaixa .          
EXECUTE .
!IFEND.
!IFEND.
!IFEND.          
!IFEND.            
!IFEND.                  
!IFEND.                                              
!IFEND.
!ENDDEFINE.

Thanks.

Carlos Renato
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"