BookmarkSubscribeRSS Feed
vraj1
Quartz | Level 8

I have a week variable and need to create lowrange and high range i.e duration of that week. Can anyone help me how to do it or hint on what function can be used. the below is a sample of result.

week           Lrange      Hrange

Week 0 1 27
Week 4 28 55
Week 8 56 83
Week 12 84 125
Week 18 126 167
Week 24 168 174
2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Once again, please follow the guidance by the post button.  Post test data in the form of a datastep, show what the output should look like, and explain the logic between them.  How can I can create an output based on data I cannot see?  Probably something like:

select week,min(val) as lrange,max(val) as mrange from have group by week;
ballardw
Super User

Proc means, summary or tabulate will do some form of this.

How ever you are looking for MIN and MAX of some variable within a time frame. Range = Max-min, so "low range" makes no sense in standard terminology.

 

Some thing like:

proc means data=your data min max;

   class week;

    var nameofvartoreport;

run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 791 views
  • 0 likes
  • 3 in conversation