need some help. in the process of writing a short macro. I have a dataset of about 3,000 records. I need to separate each ID, then do some analysis then create a table. I need to go back and get the next id records and do the same and so on. I have the beginning but i do not know how to count the each record set. I have created a rownum for each set of records. any ideas would be useful. Below is an example. and some Do-loop code. I know i will need to figure how to go down the record listof rownum's. Thank you in adavnce. Dx_Level,Dx_Condition,Dx_level,Count,Countpermonth,allwd pay,allwd expected,Rownum 904,Ischemic heart diseases,51,1715,2366,159617812.6,67463.15,1 904,Ischemic heart diseases,31,18873,41249,177850913.8,4311.64,1 904,Ischemic heart diseases,33,3088,3597,76769181.5,21342.56,1 904,Ischemic heart diseases,52,672,737,63219340.64,85779.3,1 904,Ischemic heart diseases,32,9185,12286,113050036.7,9201.53,1 904,Ischemic heart diseases,42,4264,4949,305570930.4,61743.97,1 904,Ischemic heart diseases,53,1124,1147,301700925,263034.81,1 904,Ischemic heart diseases,43,3366,3629,459381125.8,126586.15,1 904,Ischemic heart diseases,41,8770,14542,421131055.4,28959.64,1 904,Ischemic heart diseases,12,247,260,533137.16,2050.53,1 904,Ischemic heart diseases,13,81,84,164342.09,1956.45,1 904,Ischemic heart diseases,23,247,265,2178525.94,8220.85,1 904,Ischemic heart diseases,21,1819,3739,4042923.97,1081.28,1 904,Ischemic heart diseases,22,333,371,1864851.64,5026.55,1 904,Ischemic heart diseases,0,18859,67472,0,0,1 904,Ischemic heart diseases,11,1396,2434,1367565.15,561.86,1 201,Malignant neoplasm of lip,13,1,1,81202.74,81202.74,2 201,Malignant neoplasm of lip,11,38,54,564851.15,10460.21,2 201,Malignant neoplasm of lip,12,16,18,611165.65,33953.65,2 201,Malignant neoplasm of lip,0,11,38,0,0,2 303,Malignant neoplasm of base of tongue,13,44,49,5139455.73,104886.85,3 303,Malignant neoplasm of base of tongue,0,164,414,0,0,3 303,Malignant neoplasm of base of tongue,12,232,338,8651302.77,25595.57,3 303,Malignant neoplasm of base of tongue,11,498,1059,25156595.02,23755.05,3 data want; set work.HJICLter; count = 1; do while (rownum=count); if rownum = rownum then count + 1; output; end; run; I have more to do. but the above with a counter to go thru separately each rownum and just create one sas table and understand how to move the rownum to the next record would be helpful. Thank you.
... View more