BookmarkSubscribeRSS Feed
umesh1
Fluorite | Level 6

Hi All,

 

I have below sample data set and I would like to get the desire result as follows.

data test;

input A B C D;

cards;

10 9 13 10

7 7 9 8

6 7 6 8

2 3 3 4

3 4 6 6

6 7 6 7

8 7 7 7

9 8 11 10

9 9 9 9

;

run;

 

Reslt is as follows

ABCDCount
10913103
77983
67683
23343
34663
67674
87774
9811104
99994
5 REPLIES 5
ballardw
Super User

What are you "counting"?

PGStats
Opal | Level 21

Shouldn't the result be

 

A	B	C	D	Count
10	9	13	10	3
7	7	9	8	3
6	7	6	8	4
2	3	3	4	1
3	4	6	6	3
6	7	6	7	2
8	7	7	7	2
9	8	11	10	4
9	9	9	9	4
PG
LittlesasMaster
Obsidian | Level 7

What is that you want to accomplish?

 

art297
Opal | Level 21

If your 'want' represents a card related scoring table, where a pair of numbers-3, and anything greater than 1 pair (e.g., 2 pairs, 3 of a kind, 4 of a kind or a straight=4), then you might want to simply modify the code offered at https://communities.sas.com/t5/SAS-Procedures/Allocating-Values-to-Poker-Hands/td-p/146459

 

It does all of the above, but was written to evaluate all possible poker hands and rank them according to the rules of poker, but you're only working with 4 cards, don't consider suit, and consider anything greater than a pair to be equal to 4.

 

Art, CEO, AnalystFinder.com

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2075 views
  • 0 likes
  • 6 in conversation