Hi, i need help in allocating score bands to the corresponding save_ratio.. i tried the below code but it returns null values 'dot' in the output "Saves_Ratio_Score'
data retentions;
input Save_Ratio user : $20. Band_Indicator $;
datalines;
0.45 ALUPIYA I
0.37 DLOUIS I
0.6 DMORAKE I
0.30 FDANISA O
0.50 FFARAO O
;
proc format;
invalue inbound_ratio_band
low -< 0.35 = 0
0.35 -< 0.43 = 0.08
0.43 -< 0.473 = 0.16
0.473 -< 0.52 = 0.24
0.52 -< 0.59 = 0.32
0.59 - high = 0.4
;
run;
proc format;
invalue outbound_ratio_band
low -< 0.34 = 0
0.34 -< 0.41 = 0.08
0.41 -< 0.45 = 0.16
0.45 -< 0.5 = 0.24
0.5 -< 0.56 = 0.32
0.56 - high = 0.4
;
run;
data fix_bands;
SET retentions;
IF UPCASE(Band_Indicator) = 'I' THEN
Saves_Ratio_Score = INPUT(Save_Ratio,Inbound_ratio_band.);
ELSE
IF UPCASE(Band_Indicator) = 'O' THEN
Saves_Ratio_Score = INPUT(Save_Ratio,Outbound_ratio_band.);
CALL MISSING(Saves_Ratio_Score);
run;
You first assign a value to Saves_Ratio_Score but then before writing the data to the target table you execute always:
CALL MISSING(Saves_Ratio_Score);
This sets the variable always to missing. Just remove this statement and things should work for you as expected.
You first assign a value to Saves_Ratio_Score but then before writing the data to the target table you execute always:
CALL MISSING(Saves_Ratio_Score);
This sets the variable always to missing. Just remove this statement and things should work for you as expected.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.