DATA Step, Macro, Functions and more

how to identify max variable in a list

Accepted Solution Solved
Reply
Occasional Contributor mj5
Occasional Contributor
Posts: 18
Accepted Solution

how to identify max variable in a list

is there a way to identify maximum variable in a list

i have the below variables and i need to identify first and last i.e c_1 and c_5. is there a way to check it?

idno value c_1 c_2 c_3 c_4 c_5


Accepted Solutions
Solution
‎12-05-2017 08:51 AM
Super User
Posts: 9,932

Re: how to identify max variable in a list

For similarly named variables, you can use the of : construct:

maxval = max(of c_:);
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code

View solution in original post


All Replies
Solution
‎12-05-2017 08:51 AM
Super User
Posts: 9,932

Re: how to identify max variable in a list

For similarly named variables, you can use the of : construct:

maxval = max(of c_:);
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 82 views
  • 0 likes
  • 2 in conversation