BookmarkSubscribeRSS Feed
Tejaswini3
Obsidian | Level 7

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

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

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;

 

ChrisNZ
Tourmaline | Level 20

Note that to calculate age, this is arguable a better method:

AGE = floor(yrdif(DOB, today(), 'age'));

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 280 views
  • 0 likes
  • 2 in conversation