Actually, I think the data is correctly displayed...
I suspect you have created the GENDER variable in the input dataset without preassigning to it, the maximum possbible length.
You see, if you do not explicitly define a variable size, SAS will assume one of two things.
If it is a numerical var, it will be defined with the maximum length, being 8 bytes.
If it is a character var, it will be defined with the size of the first value assigned to it during execution.
In your case, I suspect the first value assigned to GENDER was 'male' which is 4 bytes long. From there, all other values where truncated to that size.
For example,
data YOURDATA;
GENDER='male'; output; /* first assignment defines variables size = 4 bytes */
GENDER='female'; output; /* truncated, GENDER='fema' */
GENDER='unknown'; output; /* truncated, GENDER='unkn' */;
run;
to avoid this explicitly define the variable size with the LENGTH statement.
data YOURDATA;
length GENDER $7; /* define GENDER as a 7 byte char variable */
GENDER='male'; output;
GENDER='female'; output;
GENDER='unknown'; output;
run;
Greetings from Portugal.
Daniel Santos at
www.cgd.pt