BookmarkSubscribeRSS Feed
rams
Calcite | Level 5

hiii

i have a querry like this

subjecttestvisithigh_rangeactual_value
101A130100
101A23090
101A33080
101A43060
101A53055
101A63065
101A730102
101A83095
101B140130
101B240150
101B34065
101B44085
101B540120
101B640135

i want to flag the consecutive elevations of the actual_values that are >= 3 times the high_range

by each subject test.

i want those obervation for which the actual values are >= 3 times the high_range by subject test

ataset being sorted by subject test visit.

Thanks.

1 REPLY 1
Jagadishkatam
Amethyst | Level 16

Hi Rams,

Hope this is what you wanted.

data have;

    input subject    test $    visit    high_range    actual_value;

cards;

101    A    1    30    100

101    A    2    30    90

101    A    3    30    80

101    A    4    30    60

101    A    5    30    55

101    A    6    30    65

101    A    7    30    102

101    A    8    30    95

101    B    1    40    130

101    B    2    40    150

101    B    3    40    65

101    B    4    40    85

101    B    5    40    120

101    B    6    40    135

;

data want;

    set have;

    if actual_value >= 3*high_range then flag=1;

    else flag=0;

run;

Thanks,

Jag

Thanks,
Jag

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
  • 1 reply
  • 664 views
  • 0 likes
  • 2 in conversation