Help using Base SAS procedures

invert a sequence column in a dataset

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

invert a sequence column in a dataset

I would want to invert a sequence/order column in a dataset given a max sequence order:

example:

max sequence order=4

col1          seq

A               1

B                2

C               3

D               4

E               2

F               1

change to:

col1          seq

A               4

B               3

C               2

D               1

E               3

F               4

Thanks,


Accepted Solutions
Solution
‎02-24-2015 09:22 PM
Regular Contributor
Posts: 184

Re: invert a sequence column in a dataset

how about

   seq = 5 - seq ;

View solution in original post


All Replies
Solution
‎02-24-2015 09:22 PM
Regular Contributor
Posts: 184

Re: invert a sequence column in a dataset

how about

   seq = 5 - seq ;

Occasional Contributor
Posts: 13

Re: invert a sequence column in a dataset

thanks

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 160 views
  • 0 likes
  • 2 in conversation