BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cruise
Ammonite | Level 13

Hi @Reeza and @Tom,

 

1. You're right. As a result of this experiment, I realized that I have old and young folks with a cancer hospitalized between 1995-2013 with age range of 7-107yrs. Code below shows how I tested and variable "test" has only 0,1 values depending whether they were hospitalized before or after their birthday.

2. Suggested formats didn't work but either substr and substrn identically worked out.

3. Critical thinking was required to question, perhaps folks I have here might just be old vs very young (7-107yrs).

 

Can I select two answers for SOLUTIONS? I truly appreciate your help indeed.

 


dy = substrn(left(dob), 1, 4);
dm = substrn(left(dob), 5, 2);
difference=hospitalized_year-dy;
cage=input(AGE,3.);
test=difference-cage;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 15 replies
  • 15931 views
  • 6 likes
  • 5 in conversation