how to convert the Character decimal value to numeric decimal values?
Hello,
I have an issue with this!
I am trying to convert text field (Type Text, informat $8.) into a decimal field so I use the format best32.
Here is my code:
DATA anc;
set lab_hem_s;
where LBTEST = 'Absolute neutrophil count (ANC)';
ANC = input (LBTEST, best32.);
/* informat ANC best.;*/
run;
The run generates error and I get missing values as shown below
NOTE: Invalid argument to function INPUT at line 362 column 11.
SUBJID=BLR-001-001 VISITT=Cycle 11 VISITD=11 LBTYPE=Haematology LBPRES=1 LBPREST=Yes LBREAS= DLBD=7 DLBM=9
DLBY=2020 LBTEST=Absolute neutrophil count (ANC) LBTESTND=. LBVAL=2.86 LBUNIT=10^9/L LBLLN=2.04 LBULN=5.8
LBRANGE=1 LBRANGET=Yes LBCS=. LBCST= LBCOM= HEMPART=Part 2 LBDAT=07SEP2020 ANC=. _ERROR_=1 _N_=19
NOTE: Invalid argument to function INPUT at line 362 column 11.
WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.
SUBJID=BLR-001-001 VISITT=End of treatment VISITD=20 LBTYPE=Haematology LBPRES=1 LBPREST=Yes LBREAS= DLBD=28
DLBM=9 DLBY=2020 LBTEST=Absolute neutrophil count (ANC) LBTESTND=. LBVAL=5.50 LBUNIT=10^9/L LBLLN=2.04
LBULN=5.8 LBRANGE=1 LBRANGET=Yes LBCS=. LBCST= LBCOM= HEMPART=Part 2 LBDAT=28SEP2020 ANC=. _ERROR_=1 _N_=20
NOTE: Mathematical operations could not be performed at the following places. The results of the operations
have been set to missing values.
Each place is given by: (Number of times) at (Line):(Column).
3061 at 362:11
Can someone help?
Thanks a lot for your quick response! Indeed it was not the right variable to convert!
And I keep note to create a new post in the future 🙂
KRs
Justine
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.