proc format does NOT create a new variable. It only controls how a variable is displayed.
In your case you need to create a new variable to which your new format can be displayed. Assuming that the Danish social security number is a character variable, you can just retrieve the 11th character with the CHAR function, convert it to a numeric value, and then find the remainder after division by 2:
proc format;
value gender
0="Female"
1="Male";
run;
data t;
input ssn $11.;
g=input(char(ssn,11),1.);
g=mod(g,2);
format g gender.;
put (_all_) (=);
datalines;
xxxxxx-xxx7
xxxxxx-xxx4
xxxxxx-xxx3
xxxxxx-xxx2
xxxxxx-xxx1
xxxxxx-xxx8
run;
... View more