BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sathish_jammy
Lapis Lazuli | Level 10

i tried up whith this condition.

But the 89 series are come up as null ... Why?

data cre_epi;
set creatin7;
if epi_1 ge 90 then  
	epi_1_stage =1; 
if epi_1 ge 60 and epi_1 le 89 then 
	epi_1_stage =2; 
if epi_1 ge 30 and epi_1 le 59 then 
	epi_1_stage =3; 
if epi_1 ge 15 and epi_1 le 29 then 
	epi_1_stage =4; 
if epi_1 lt 15 then 
	epi_1_stage =5; 
if epi_1 =. then 
	epi_1_stage =.; 
if epi_5 ge 90 then
	epi_5_stage =1;
if epi_5 ge 60 and epi_5 le 89 then 
	epi_5_stage =2; 
if epi_5 ge 30 and epi_5 le 59 then 
	epi_5_stage =3; 
if epi_5 ge 15 and epi_5 le 29 then 
	epi_5_stage =4; 
if epi_5 lt 15 then 
	epi_5_stage =5; 
if epi_5 =. then 
	epi_5_stage =.; 
run;
mnoepi_1epi_5epi_1_stageepi_5_stage
12443875.38789.8752.
12441282.07182.07122
11295689.944...
1 ACCEPTED SOLUTION
3 REPLIES 3
PaigeMiller
Diamond | Level 26

The value of 89.875 doesn't satisfy any of your conditions. It is not greater than 90. It is not between 60 and 89. etc.

--
Paige Miller
RW9
Diamond | Level 26 RW9
Diamond | Level 26

This looks more like a job for formats anyways. 

proc format;
  value creatin
    1-15=5
    15-30=4
    30-60=3
    60-90=2
    90-high=1
    other=.;
run;

data want;
  set have;
  format epi_1 epi_5 creatin.;
run;
  

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 3 replies
  • 690 views
  • 4 likes
  • 4 in conversation