I need to convert numbers to characters as I have quest1 values equal 1 or 2 or 3, or
4, or 5.
I need quest1 field whch is numeric (length 8) into char Y or NO depending on criteria.
However I failed to do it. Moreover log tells me:
NOTE: Character values have been converted to numeric values at the places given by:
(Line)Column).
6:9 7:7 8:14 9:15 10:9 11:10 13:12 13:29 14:14 16:10
17:10
17:25 18:12 20:17 20:39 21:19 23:18 24:18 25:18 25:41 26:20
28:12
29:12 29:30 30:14 32:13 33:13 33:32 34:15
NOTE: Invalid numeric data, 'Y' , at line 13 column 29.
NOTE: Invalid numeric data, 'N' , at line 18 column 12.
NOTE: Invalid numeric data, 'N' , at line 21 column 19.
NOTE: Invalid numeric data, 'N' , at line 26 column 20.
NOTE: Invalid numeric data, 'Y' , at line 29 column 30.
NOTE: Invalid numeric data, 'Y' , at line 33 column 32.
This is my code:
______________________________________________________________________
data Qrename;
quest1=put(quest1,z1.);
if quest1='1' OR
quest1='2' THEN quest1='Y';
else quest1='N';
RUN;
__________________________________________________________________________
Why it says me that Character values have been converted to numeric values while I am
doing an oposite operation?
What am I doing wrong?
Thank you in advance,
Rina
4, or 5.
I need quest1 field whch is numeric (length 8) into char Y or NO depending on criteria.
However I failed to do it. Moreover log tells me:
NOTE: Character values have been converted to numeric values at the places given by:
(Line)Column).
6:9 7:7 8:14 9:15 10:9 11:10 13:12 13:29 14:14 16:10
17:10
17:25 18:12 20:17 20:39 21:19 23:18 24:18 25:18 25:41 26:20
28:12
29:12 29:30 30:14 32:13 33:13 33:32 34:15
NOTE: Invalid numeric data, 'Y' , at line 13 column 29.
NOTE: Invalid numeric data, 'N' , at line 18 column 12.
NOTE: Invalid numeric data, 'N' , at line 21 column 19.
NOTE: Invalid numeric data, 'N' , at line 26 column 20.
NOTE: Invalid numeric data, 'Y' , at line 29 column 30.
NOTE: Invalid numeric data, 'Y' , at line 33 column 32.
This is my code:
______________________________________________________________________
data Qrename;
quest1=put(quest1,z1.);
if quest1='1' OR
quest1='2' THEN quest1='Y';
else quest1='N';
RUN;
__________________________________________________________________________
Why it says me that Character values have been converted to numeric values while I am
doing an oposite operation?
What am I doing wrong?
Thank you in advance,
Rina