Kindly check below code
data PKMERGE;
set PKDAR;
/*Derivation of age*/
age=intck('year',VSN1D, DOB1D, 'Continuous'); /*Check the age*/
run;After running the above code, following log is appearing
NOTE: Character values have been converted to numeric
values at the places given by: (Line):(Column).
732:18 732:25
NOTE: Invalid numeric data, VSN1D='18APR2006' , at line 732
column 18.
NOTE: Invalid numeric data, DOB1D='08JUL1955' , at line 732
column 25.Kindly assist in solving the problem
The message is quite clear.
Function INTK take numerical arguments (SAS dates) and you provide character arguments.
How was table PDKAR created?
Maybe you wrote
VSN1D='18APR2006';
instead of
VSN1D='18APR2006'd;
Note that to calculate age, this is arguable a better method:
AGE = floor(yrdif(DOB, today(), 'age'));
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.