03-06-2014 05:39 PM
On running the format procedure I get and Error saying : " You are trying to use the numeric format SURVIVED with the character variable Survived in data set TITANIC.TRAIN."
Here is my code :
value survived 1='Survived'
ods graphics on;
proc freq data=titanic.train;
tables survived sex Pclass
format survived survived.;
When I change the "Survived" column to numeric datatype it works. How do I apply the format procedure to a character datatype column.?
03-06-2014 06:10 PM
Thank you for your reply.
I did try this option too but it still gives the same error .
Here is the excerpt from the log :
NOTE: Format $SURVIVED is already on the library WORK.FORMATS.
NOTE: Format $SURVIVED has been output.
NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
30 ods graphics on;
31 proc freq data=titanic.train;
32 tables survived sex Pclass
33 survived*sex survived*pclass/
35 format survived survived.;
ERROR: You are trying to use the numeric format SURVIVED with the character variable Survived in data set TITANIC.TRAIN.
NOTE: The SAS System stopped processing this step because of errors.
Need further help from the community? Please ask a new question.