VBA has a wonderful function Replace for several columns or regions, where the changes are likely to be happened.
Sub Replace() With Columns("B") .Replace "F", "Female" .Replace "M", "Male" End With End Sub
User-defined format by PROC FORMAT is the best way for quick replacements.
proc format; value $sex 'F' = 'Female' 'M' = 'Male' ; run; data want; set sashelp.class; format sex $sex.; run;
For some data management operations such as string/number replacement, it is better way to use the languages' built-in features, instead of the loops and condition statements.