I used the PROC FORMAT to create a new format called sexf:
PROC FORMAT;
VALUE $sexf
'F' = 'Female'
'M' = 'Male'
;
RUN;
I then tried to use this format to format the exsting variable (sex) in a file called file01. The variable has two values: 'M', 'F'. However, this variable still retails the values as 'M' and 'F' in the new dataset file02, but the new variable sex1 works OK with values as 'Female' and 'Male'.
DATA work.file02;
SET work.file01;
LENGTH sex $8; /*to change the length from 1 to 8*/
sex=PUT(sex,$sexf.);
sex1=PUT(sex,$sexf.);
RUN;
Can you please tell what is the problem? Thanks in advance.