Or skip the new variable entirely.
I am guessing that a value of 1 may be female. If different change the vale in proc format code from 1 to the appropriate value.
If you have more values for gender then add additional code values.
proc format library=work;
value mygender
0= 'Male'
1= 'Female'
;
proc print data=amt2.assignment2;
var gender;
format gender mygender.;
run;
Custom formats can be used to display different text for the same variable in different places. For instance you may have a need for a display of single letter for gender, so you make a different named format (the first word after VALUE above) and only have M and F as values, or you want to display something like "** Male **", a different format and use. Groups of codes can also be assigned to single
display value that will be honored by most procedures.
Especially with large data sets creating a new format may be much more time efficient than duplicating a data set just to get a different display.
And you can use formats for character variables in a similar way.
... View more