Hello,
I am attempting to convert this character variable called PriorWeight to a numeric variable called PriorWeight2. I have a range of weight for 292 observations, and am not sure how to include those within the If/Then statements. The range of weights include numbers from 87 to 319, with the last 4 observations having a ? as their PriorWeight, which is why I included the ELSE PriorWeight2 = .;
Here is my code:
/* Convert PriorWeight to a numeric variable */
IF PriorWeight = 87 - 319 THEN PriorWeight2 = INPUT(PriorWeight,3.);
ELSE PriorWeight2 = . ;
RUN;
I have also already tried (87:319), '87' - '319'.
Please let me know what you think!