data WORK.HAVE; infile datalines dsd truncover; input RIC:$6. year:BEST4. CGscore:BEST20. eps:BEST10.; format year BEST4. CGscore BEST20. eps BEST10.; datalines; AAM.HM 2013 67.63 141 AAM.HM 2014 70.17 192 AAM.HM 2014 70.17 26 AAM.HM 2015 67.8 30 AAM.HM 2016 67.8 43 ABT.HM 2013 79.15 1331 ABT.HM 2013 79.15 1269 ABT.HM 2014 78.81 1959 ABT.HM 2014 78.81 1787 ABT.HM 2014 78.81 1768 ABT.HM 2015 77.12 1381 ABT.HM 2016 76.61 1083 ACL.HM 2014 72.54 98 ACL.HM 2014 72.54 289 ACL.HM 2016 74.92 264 ACL.HM 2016 74.92 40 ACL.HM 2016 74.92 375 AGF.HM 2013 70.85 607 AGF.HM 2013 70.85 492 AGF.HM 2014 64.41 -516 ;;;; Hello, I have the dataset as above, and want to know how many RIC there are by placing a same tag (number or character) within a group of RIC, created in a new column. Simply I want to add another column counting 1 for all AAM.HM of column RIC, and 2 for all ABT.HM of RIC, 3 for all ACL.HM, and so on. Please help. Thank you.
... View more