Hi @Cynthia_sas ,
I'm struggling to get the final row summarization right,
data PUBLIC.FREK_ALL;
infile datalines dsd truncover;
input ipo_window:32. ipo_drawn:32. QNUMMESE:F4. count:32. PERCENT:32. SUMA:32. x1:32. x2:32. y2:32. _percent:32.;
datalines4;
-35,-35,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-35,-28,60,2,1.3539651838,7,-35,-35,5,0.0135396518
-35,-27,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-35,-22,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-35,-15,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-35,-13,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-34,-20,60,1,0.1934235977,1,-35,-35,5,0.001934236
-32,-26,60,1,0.1934235977,1,-35,-35,5,0.001934236
-31,-22,60,1,0.3868471954,2,-35,-35,5,0.003868472
-31,-7,60,1,0.3868471954,2,-35,-35,5,0.003868472
-30,-26,60,1,0.3868471954,2,-35,-35,5,0.003868472
-30,-14,60,1,0.3868471954,2,-35,-35,5,0.003868472
-29,-17,60,1,0.1934235977,1,-35,-35,5,0.001934236
-28,-20,60,1,0.580270793,3,-35,-35,5,0.0058027079
-28,-18,60,1,0.580270793,3,-35,-35,5,0.0058027079
-28,-14,60,1,0.580270793,3,-35,-35,5,0.0058027079
-27,-27,60,2,1.1605415861,6,-35,-35,5,0.0116054159
-27,-26,60,1,1.1605415861,6,-35,-35,5,0.0116054159
-27,-15,60,2,1.1605415861,6,-35,-35,5,0.0116054159
-27,-5,60,1,1.1605415861,6,-35,-35,5,0.0116054159
-26,-26,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-26,-20,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-26,-17,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-26,-16,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-26,-6,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-25,-24,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-23,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-22,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-21,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-20,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-19,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-15,60,3,2.7079303675,14,-35,-35,5,0.0270793037
-25,-7,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-6,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-4,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-3,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-25,-2,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-24,-23,60,1,3.0947775629,16,-35,-35,5,0.0309477756
-24,-22,60,1,3.0947775629,16,-35,-35,5,0.0309477756
-24,-21,60,2,3.0947775629,16,-35,-35,5,0.0309477756
-24,-20,60,1,3.0947775629,16,-35,-35,5,0.0309477756
-24,-19,60,2,3.0947775629,16,-35,-35,5,0.0309477756
-24,-18,60,2,3.0947775629,16,-35,-35,5,0.0309477756
-24,-17,60,1,3.0947775629,16,-35,-35,5,0.0309477756
-24,-16,60,2,3.0947775629,16,-35,-35,5,0.0309477756
-24,-14,60,1,3.0947775629,16,-35,-35,5,0.0309477756
-24,-12,60,1,3.0947775629,16,-35,-35,5,0.0309477756
-24,-2,60,2,3.0947775629,16,-35,-35,5,0.0309477756
-23,-23,60,7,40.03868472,207,-35,-35,5,0.4003868472
-23,-22,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-22,60,6,40.03868472,207,-35,-35,5,0.4003868472
-23,-21,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-21,60,6,40.03868472,207,-35,-35,5,0.4003868472
-23,-20,60,4,40.03868472,207,-35,-35,5,0.4003868472
-23,-19,60,8,40.03868472,207,-35,-35,5,0.4003868472
-23,-18,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-18,60,10,40.03868472,207,-35,-35,5,0.4003868472
-23,-17,60,8,40.03868472,207,-35,-35,5,0.4003868472
-23,-16,60,6,40.03868472,207,-35,-35,5,0.4003868472
-23,-15,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-15,60,11,40.03868472,207,-35,-35,5,0.4003868472
-23,-14,48,2,2.2049286641,17,-35,-35,5,0.0220492866
-23,-14,60,12,40.03868472,207,-35,-35,5,0.4003868472
-23,-13,60,10,40.03868472,207,-35,-35,5,0.4003868472
-23,-12,48,2,2.2049286641,17,-35,-35,5,0.0220492866
-23,-12,60,5,40.03868472,207,-35,-35,5,0.4003868472
-23,-11,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-11,60,6,40.03868472,207,-35,-35,5,0.4003868472
-23,-10,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-10,60,9,40.03868472,207,-35,-35,5,0.4003868472
-23,-9,60,2,40.03868472,207,-35,-35,5,0.4003868472
-23,-8,60,6,40.03868472,207,-35,-35,5,0.4003868472
-23,-7,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-7,60,4,40.03868472,207,-35,-35,5,0.4003868472
-23,-6,48,3,2.2049286641,17,-35,-35,5,0.0220492866
-23,-6,60,10,40.03868472,207,-35,-35,5,0.4003868472
-23,-5,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-5,60,11,40.03868472,207,-35,-35,5,0.4003868472
-23,-4,60,15,40.03868472,207,-35,-35,5,0.4003868472
-23,-3,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-3,60,13,40.03868472,207,-35,-35,5,0.4003868472
-23,-2,48,1,2.2049286641,17,-35,-35,5,0.0220492866
-23,-2,60,21,40.03868472,207,-35,-35,5,0.4003868472
-23,-1,60,17,40.03868472,207,-35,-35,5,0.4003868472
-22,-22,60,3,6.5764023211,34,-35,-35,5,0.0657640232
-22,-21,60,3,6.5764023211,34,-35,-35,5,0.0657640232
-22,-19,60,3,6.5764023211,34,-35,-35,5,0.0657640232
-22,-18,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-22,-17,60,3,6.5764023211,34,-35,-35,5,0.0657640232
-22,-16,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-22,-15,60,4,6.5764023211,34,-35,-35,5,0.0657640232
-22,-14,60,5,6.5764023211,34,-35,-35,5,0.0657640232
-22,-13,60,5,6.5764023211,34,-35,-35,5,0.0657640232
-22,-12,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-22,-9,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-22,-7,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-22,-6,60,2,6.5764023211,34,-35,-35,5,0.0657640232
-22,-2,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-21,-21,60,2,6.9632495164,36,-35,-35,5,0.0696324952
-21,-18,60,2,6.9632495164,36,-35,-35,5,0.0696324952
-21,-17,60,5,6.9632495164,36,-35,-35,5,0.0696324952
-21,-16,60,1,6.9632495164,36,-35,-35,5,0.0696324952
-21,-15,60,3,6.9632495164,36,-35,-35,5,0.0696324952
-21,-14,60,4,6.9632495164,36,-35,-35,5,0.0696324952
-21,-13,60,3,6.9632495164,36,-35,-35,5,0.0696324952
-21,-12,60,3,6.9632495164,36,-35,-35,5,0.0696324952
-21,-11,60,1,6.9632495164,36,-35,-35,5,0.0696324952
-21,-10,60,1,6.9632495164,36,-35,-35,5,0.0696324952
-21,-9,60,2,6.9632495164,36,-35,-35,5,0.0696324952
-21,-8,60,1,6.9632495164,36,-35,-35,5,0.0696324952
-21,-7,60,2,6.9632495164,36,-35,-35,5,0.0696324952
-21,-6,60,1,6.9632495164,36,-35,-35,5,0.0696324952
-21,-5,60,1,6.9632495164,36,-35,-35,5,0.0696324952
-21,-4,60,3,6.9632495164,36,-35,-35,5,0.0696324952
-21,-3,60,1,6.9632495164,36,-35,-35,5,0.0696324952
-21,-1,48,1,0.1297016861,1,-35,-35,5,0.0012970169
-20,-20,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-20,-19,60,2,6.5764023211,34,-35,-35,5,0.0657640232
-20,-18,60,3,6.5764023211,34,-35,-35,5,0.0657640232
-20,-17,60,5,6.5764023211,34,-35,-35,5,0.0657640232
-20,-16,60,2,6.5764023211,34,-35,-35,5,0.0657640232
-20,-15,60,2,6.5764023211,34,-35,-35,5,0.0657640232
-20,-14,60,4,6.5764023211,34,-35,-35,5,0.0657640232
-20,-13,60,4,6.5764023211,34,-35,-35,5,0.0657640232
-20,-12,60,2,6.5764023211,34,-35,-35,5,0.0657640232
-20,-11,60,2,6.5764023211,34,-35,-35,5,0.0657640232
-20,-10,60,2,6.5764023211,34,-35,-35,5,0.0657640232
-20,-8,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-20,-7,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-20,-6,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-20,-3,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-20,-1,60,1,6.5764023211,34,-35,-35,5,0.0657640232
-19,-19,60,2,6.7698259188,35,-35,-35,5,0.0676982592
-19,-18,60,2,6.7698259188,35,-35,-35,5,0.0676982592
-19,-17,60,4,6.7698259188,35,-35,-35,5,0.0676982592
-19,-16,60,2,6.7698259188,35,-35,-35,5,0.0676982592
-19,-15,60,3,6.7698259188,35,-35,-35,5,0.0676982592
-19,-14,60,1,6.7698259188,35,-35,-35,5,0.0676982592
-19,-13,60,8,6.7698259188,35,-35,-35,5,0.0676982592
-19,-12,60,5,6.7698259188,35,-35,-35,5,0.0676982592
-19,-11,60,2,6.7698259188,35,-35,-35,5,0.0676982592
-19,-10,60,1,6.7698259188,35,-35,-35,5,0.0676982592
-19,-9,60,1,6.7698259188,35,-35,-35,5,0.0676982592
-19,-8,60,1,6.7698259188,35,-35,-35,5,0.0676982592
-19,-6,60,1,6.7698259188,35,-35,-35,5,0.0676982592
-19,-5,60,1,6.7698259188,35,-35,-35,5,0.0676982592
-19,-4,48,1,0.1297016861,1,-35,-35,5,0.0012970169
-19,-3,60,1,6.7698259188,35,-35,-35,5,0.0676982592
-18,-18,60,6,7.1566731141,37,-35,-35,5,0.0715667311
-18,-17,60,2,7.1566731141,37,-35,-35,5,0.0715667311
-18,-16,60,4,7.1566731141,37,-35,-35,5,0.0715667311
-18,-15,60,7,7.1566731141,37,-35,-35,5,0.0715667311
-18,-13,60,6,7.1566731141,37,-35,-35,5,0.0715667311
-18,-12,60,2,7.1566731141,37,-35,-35,5,0.0715667311
-18,-11,60,1,7.1566731141,37,-35,-35,5,0.0715667311
-18,-10,48,1,0.9079118029,7,-35,-35,5,0.009079118
-18,-10,60,1,7.1566731141,37,-35,-35,5,0.0715667311
-18,-8,60,1,7.1566731141,37,-35,-35,5,0.0715667311
-18,-6,48,1,0.9079118029,7,-35,-35,5,0.009079118
-18,-6,60,2,7.1566731141,37,-35,-35,5,0.0715667311
-18,-5,60,1,7.1566731141,37,-35,-35,5,0.0715667311
-18,-4,48,2,0.9079118029,7,-35,-35,5,0.009079118
-18,-3,48,2,0.9079118029,7,-35,-35,5,0.009079118
-18,-3,60,2,7.1566731141,37,-35,-35,5,0.0715667311
-18,-2,48,1,0.9079118029,7,-35,-35,5,0.009079118
-18,-2,60,1,7.1566731141,37,-35,-35,5,0.0715667311
-18,-1,60,1,7.1566731141,37,-35,-35,5,0.0715667311
-17,-17,60,4,5.6092843327,29,-35,-35,5,0.0560928433
-17,-16,60,4,5.6092843327,29,-35,-35,5,0.0560928433
-17,-15,60,2,5.6092843327,29,-35,-35,5,0.0560928433
-17,-14,60,5,5.6092843327,29,-35,-35,5,0.0560928433
-17,-13,48,1,1.8158236057,14,-35,-35,5,0.0181582361
-17,-13,60,6,5.6092843327,29,-35,-35,5,0.0560928433
-17,-12,48,1,1.8158236057,14,-35,-35,5,0.0181582361
-17,-12,60,2,5.6092843327,29,-35,-35,5,0.0560928433
-17,-10,48,1,1.8158236057,14,-35,-35,5,0.0181582361
-17,-10,60,2,5.6092843327,29,-35,-35,5,0.0560928433
-17,-8,48,1,1.8158236057,14,-35,-35,5,0.0181582361
-17,-8,60,1,5.6092843327,29,-35,-35,5,0.0560928433
-17,-7,48,2,1.8158236057,14,-35,-35,5,0.0181582361
-17,-7,60,1,5.6092843327,29,-35,-35,5,0.0560928433
-17,-6,48,1,1.8158236057,14,-35,-35,5,0.0181582361
-17,-6,60,1,5.6092843327,29,-35,-35,5,0.0560928433
-17,-5,48,1,1.8158236057,14,-35,-35,5,0.0181582361
-17,-5,60,1,5.6092843327,29,-35,-35,5,0.0560928433
-17,-4,48,2,1.8158236057,14,-35,-35,5,0.0181582361
-17,-3,48,2,1.8158236057,14,-35,-35,5,0.0181582361
-17,-2,48,1,1.8158236057,14,-35,-35,5,0.0181582361
-17,-1,48,1,1.8158236057,14,-35,-35,5,0.0181582361
-16,-16,48,2,4.4098573281,34,-35,-35,5,0.0440985733
-16,-16,60,3,2.7079303675,14,-35,-35,5,0.0270793037
-16,-15,48,2,4.4098573281,34,-35,-35,5,0.0440985733
-16,-15,60,3,2.7079303675,14,-35,-35,5,0.0270793037
-16,-14,48,1,4.4098573281,34,-35,-35,5,0.0440985733
-16,-13,48,3,4.4098573281,34,-35,-35,5,0.0440985733
-16,-13,60,2,2.7079303675,14,-35,-35,5,0.0270793037
-16,-12,48,1,4.4098573281,34,-35,-35,5,0.0440985733
-16,-12,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-16,-11,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-16,-10,48,1,4.4098573281,34,-35,-35,5,0.0440985733
-16,-10,60,2,2.7079303675,14,-35,-35,5,0.0270793037
-16,-9,48,2,4.4098573281,34,-35,-35,5,0.0440985733
-16,-7,48,2,4.4098573281,34,-35,-35,5,0.0440985733
-16,-6,48,1,4.4098573281,34,-35,-35,5,0.0440985733
-16,-6,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-16,-5,48,2,4.4098573281,34,-35,-35,5,0.0440985733
-16,-4,48,4,4.4098573281,34,-35,-35,5,0.0440985733
-16,-4,60,1,2.7079303675,14,-35,-35,5,0.0270793037
-16,-3,48,7,4.4098573281,34,-35,-35,5,0.0440985733
-16,-2,48,2,4.4098573281,34,-35,-35,5,0.0440985733
-16,-1,48,4,4.4098573281,34,-35,-35,5,0.0440985733
-15,-15,48,2,3.8910505837,30,-35,-35,5,0.0389105058
-15,-15,60,1,1.9342359768,10,-35,-35,5,0.0193423598
-15,-14,60,2,1.9342359768,10,-35,-35,5,0.0193423598
-15,-13,48,3,3.8910505837,30,-35,-35,5,0.0389105058
-15,-13,60,2,1.9342359768,10,-35,-35,5,0.0193423598
-15,-12,48,3,3.8910505837,30,-35,-35,5,0.0389105058
-15,-12,60,1,1.9342359768,10,-35,-35,5,0.0193423598
-15,-11,48,1,3.8910505837,30,-35,-35,5,0.0389105058
-15,-10,48,1,3.8910505837,30,-35,-35,5,0.0389105058
-15,-10,60,1,1.9342359768,10,-35,-35,5,0.0193423598
-15,-9,48,2,3.8910505837,30,-35,-35,5,0.0389105058
-15,-8,60,2,1.9342359768,10,-35,-35,5,0.0193423598
-15,-7,48,1,3.8910505837,30,-35,-35,5,0.0389105058
-15,-6,48,1,3.8910505837,30,-35,-35,5,0.0389105058
-15,-6,60,1,1.9342359768,10,-35,-35,5,0.0193423598
-15,-5,48,3,3.8910505837,30,-35,-35,5,0.0389105058
-15,-4,48,2,3.8910505837,30,-35,-35,5,0.0389105058
-15,-3,48,2,3.8910505837,30,-35,-35,5,0.0389105058
-15,-2,48,6,3.8910505837,30,-35,-35,5,0.0389105058
-15,-1,48,3,3.8910505837,30,-35,-35,5,0.0389105058
-14,-14,60,2,1.7408123791,9,-35,-35,5,0.0174081238
-14,-13,48,2,6.8741893645,53,-35,-35,5,0.0687418936
-14,-13,60,2,1.7408123791,9,-35,-35,5,0.0174081238
-14,-12,48,2,6.8741893645,53,-35,-35,5,0.0687418936
-14,-12,60,1,1.7408123791,9,-35,-35,5,0.0174081238
-14,-11,48,3,6.8741893645,53,-35,-35,5,0.0687418936
-14,-11,60,1,1.7408123791,9,-35,-35,5,0.0174081238
-14,-10,48,2,6.8741893645,53,-35,-35,5,0.0687418936
-14,-10,60,1,1.7408123791,9,-35,-35,5,0.0174081238
-14,-9,48,2,6.8741893645,53,-35,-35,5,0.0687418936
-14,-9,60,1,1.7408123791,9,-35,-35,5,0.0174081238
-14,-8,48,2,6.8741893645,53,-35,-35,5,0.0687418936
-14,-7,48,3,6.8741893645,53,-35,-35,5,0.0687418936
-14,-6,48,9,6.8741893645,53,-35,-35,5,0.0687418936
-14,-5,48,2,6.8741893645,53,-35,-35,5,0.0687418936
-14,-5,60,1,1.7408123791,9,-35,-35,5,0.0174081238
-14,-4,48,8,6.8741893645,53,-35,-35,5,0.0687418936
-14,-3,48,4,6.8741893645,53,-35,-35,5,0.0687418936
-14,-2,48,10,6.8741893645,53,-35,-35,5,0.0687418936
-14,-1,48,4,6.8741893645,53,-35,-35,5,0.0687418936
-13,-13,48,1,7.7821011673,60,-35,-35,5,0.0778210117
-13,-13,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-13,-12,48,2,7.7821011673,60,-35,-35,5,0.0778210117
-13,-12,60,2,1.3539651838,7,-35,-35,5,0.0135396518
-13,-11,48,1,7.7821011673,60,-35,-35,5,0.0778210117
-13,-11,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-13,-10,48,2,7.7821011673,60,-35,-35,5,0.0778210117
-13,-10,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-13,-9,48,2,7.7821011673,60,-35,-35,5,0.0778210117
-13,-8,48,4,7.7821011673,60,-35,-35,5,0.0778210117
-13,-7,48,4,7.7821011673,60,-35,-35,5,0.0778210117
-13,-6,48,5,7.7821011673,60,-35,-35,5,0.0778210117
-13,-6,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-13,-5,48,6,7.7821011673,60,-35,-35,5,0.0778210117
-13,-4,48,10,7.7821011673,60,-35,-35,5,0.0778210117
-13,-4,60,1,1.3539651838,7,-35,-35,5,0.0135396518
-13,-3,48,7,7.7821011673,60,-35,-35,5,0.0778210117
-13,-2,48,9,7.7821011673,60,-35,-35,5,0.0778210117
-13,-1,48,6,7.7821011673,60,-35,-35,5,0.0778210117
-13,0,48,1,7.7821011673,60,-35,-35,5,0.0778210117
-12,-12,48,1,9.0791180285,70,-35,-35,5,0.0907911803
-12,-12,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-12,-11,48,1,9.0791180285,70,-35,-35,5,0.0907911803
-12,-10,48,5,9.0791180285,70,-35,-35,5,0.0907911803
-12,-10,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-12,-9,48,2,9.0791180285,70,-35,-35,5,0.0907911803
-12,-9,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-12,-8,48,3,9.0791180285,70,-35,-35,5,0.0907911803
-12,-7,48,7,9.0791180285,70,-35,-35,5,0.0907911803
-12,-7,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-12,-6,48,8,9.0791180285,70,-35,-35,5,0.0907911803
-12,-5,48,5,9.0791180285,70,-35,-35,5,0.0907911803
-12,-4,48,4,9.0791180285,70,-35,-35,5,0.0907911803
-12,-4,60,1,0.9671179884,5,-35,-35,5,0.0096711799
-12,-3,48,14,9.0791180285,70,-35,-35,5,0.0907911803
-12,-2,48,14,9.0791180285,70,-35,-35,5,0.0907911803
-12,-1,48,5,9.0791180285,70,-35,-35,5,0.0907911803
-12,0,48,1,9.0791180285,70,-35,-35,5,0.0907911803
-11,-11,48,4,19.714656291,152,-35,-35,5,0.1971465629
-11,-11,60,1,0.3868471954,2,-35,-35,5,0.003868472
-11,-10,36,1,3.355704698,10,-35,-35,5,0.033557047
-11,-10,48,6,19.714656291,152,-35,-35,5,0.1971465629
-11,-9,48,8,19.714656291,152,-35,-35,5,0.1971465629
-11,-8,36,1,3.355704698,10,-35,-35,5,0.033557047
-11,-8,48,4,19.714656291,152,-35,-35,5,0.1971465629
-11,-7,36,1,3.355704698,10,-35,-35,5,0.033557047
-11,-7,48,6,19.714656291,152,-35,-35,5,0.1971465629
-11,-7,60,1,0.3868471954,2,-35,-35,5,0.003868472
-11,-6,48,13,19.714656291,152,-35,-35,5,0.1971465629
-11,-5,48,9,19.714656291,152,-35,-35,5,0.1971465629
-11,-4,36,1,3.355704698,10,-35,-35,5,0.033557047
-11,-4,48,10,19.714656291,152,-35,-35,5,0.1971465629
-11,-3,48,20,19.714656291,152,-35,-35,5,0.1971465629
-11,-2,36,3,3.355704698,10,-35,-35,5,0.033557047
-11,-2,48,32,19.714656291,152,-35,-35,5,0.1971465629
-11,-1,36,2,3.355704698,10,-35,-35,5,0.033557047
-11,-1,48,40,19.714656291,152,-35,-35,5,0.1971465629
-11,0,36,1,3.355704698,10,-35,-35,5,0.033557047
-10,-10,48,3,13.878080415,107,-35,-35,5,0.1387808042
-10,-9,36,1,0.6711409396,2,-35,-35,5,0.0067114094
-10,-9,48,6,13.878080415,107,-35,-35,5,0.1387808042
-10,-8,48,5,13.878080415,107,-35,-35,5,0.1387808042
-10,-7,48,13,13.878080415,107,-35,-35,5,0.1387808042
-10,-6,48,15,13.878080415,107,-35,-35,5,0.1387808042
-10,-5,48,8,13.878080415,107,-35,-35,5,0.1387808042
-10,-4,48,11,13.878080415,107,-35,-35,5,0.1387808042
-10,-3,48,12,13.878080415,107,-35,-35,5,0.1387808042
-10,-2,48,20,13.878080415,107,-35,-35,5,0.1387808042
-10,-1,36,1,0.6711409396,2,-35,-35,5,0.0067114094
-10,-1,48,12,13.878080415,107,-35,-35,5,0.1387808042
-10,0,48,2,13.878080415,107,-35,-35,5,0.1387808042
-9,-9,48,3,8.9494163424,69,-35,-35,5,0.0894941634
-9,-8,48,4,8.9494163424,69,-35,-35,5,0.0894941634
-9,-7,48,14,8.9494163424,69,-35,-35,5,0.0894941634
-9,-6,48,6,8.9494163424,69,-35,-35,5,0.0894941634
-9,-5,36,1,0.6711409396,2,-35,-35,5,0.0067114094
-9,-5,48,4,8.9494163424,69,-35,-35,5,0.0894941634
-9,-4,48,6,8.9494163424,69,-35,-35,5,0.0894941634
-9,-3,48,7,8.9494163424,69,-35,-35,5,0.0894941634
-9,-2,36,1,0.6711409396,2,-35,-35,5,0.0067114094
-9,-2,48,13,8.9494163424,69,-35,-35,5,0.0894941634
-9,-1,48,12,8.9494163424,69,-35,-35,5,0.0894941634
-8,-8,36,1,3.355704698,10,-35,-35,5,0.033557047
-8,-8,48,1,6.2256809339,48,-35,-35,5,0.0622568093
-8,-7,48,6,6.2256809339,48,-35,-35,5,0.0622568093
-8,-6,48,4,6.2256809339,48,-35,-35,5,0.0622568093
-8,-5,48,2,6.2256809339,48,-35,-35,5,0.0622568093
-8,-4,48,6,6.2256809339,48,-35,-35,5,0.0622568093
-8,-3,36,3,3.355704698,10,-35,-35,5,0.033557047
-8,-3,48,7,6.2256809339,48,-35,-35,5,0.0622568093
-8,-2,36,4,3.355704698,10,-35,-35,5,0.033557047
-8,-2,48,12,6.2256809339,48,-35,-35,5,0.0622568093
-8,-1,36,2,3.355704698,10,-35,-35,5,0.033557047
-8,-1,48,9,6.2256809339,48,-35,-35,5,0.0622568093
-8,0,48,1,6.2256809339,48,-35,-35,5,0.0622568093
-7,-7,48,4,6.2256809339,48,-35,-35,5,0.0622568093
-7,-6,36,1,6.711409396,20,-35,-35,5,0.067114094
-7,-6,48,7,6.2256809339,48,-35,-35,5,0.0622568093
-7,-5,36,2,6.711409396,20,-35,-35,5,0.067114094
-7,-5,48,9,6.2256809339,48,-35,-35,5,0.0622568093
-7,-4,36,4,6.711409396,20,-35,-35,5,0.067114094
-7,-4,48,7,6.2256809339,48,-35,-35,5,0.0622568093
-7,-3,36,3,6.711409396,20,-35,-35,5,0.067114094
-7,-3,48,7,6.2256809339,48,-35,-35,5,0.0622568093
-7,-2,36,7,6.711409396,20,-35,-35,5,0.067114094
-7,-2,48,8,6.2256809339,48,-35,-35,5,0.0622568093
-7,-1,36,3,6.711409396,20,-35,-35,5,0.067114094
-7,-1,48,6,6.2256809339,48,-35,-35,5,0.0622568093
-6,-6,36,3,13.422818792,40,-35,-35,5,0.1342281879
-6,-6,48,6,3.8910505837,30,-35,-35,5,0.0389105058
-6,-5,36,1,13.422818792,40,-35,-35,5,0.1342281879
-6,-5,48,1,3.8910505837,30,-35,-35,5,0.0389105058
-6,-4,36,6,13.422818792,40,-35,-35,5,0.1342281879
-6,-4,48,7,3.8910505837,30,-35,-35,5,0.0389105058
-6,-3,36,8,13.422818792,40,-35,-35,5,0.1342281879
-6,-3,48,4,3.8910505837,30,-35,-35,5,0.0389105058
-6,-2,36,12,13.422818792,40,-35,-35,5,0.1342281879
-6,-2,48,10,3.8910505837,30,-35,-35,5,0.0389105058
-6,-1,36,10,13.422818792,40,-35,-35,5,0.1342281879
-6,-1,48,2,3.8910505837,30,-35,-35,5,0.0389105058
-5,-5,36,5,14.765100671,44,-35,-35,5,0.1476510067
-5,-5,48,4,1.9455252918,15,-35,-35,5,0.0194552529
-5,-4,36,4,14.765100671,44,-35,-35,5,0.1476510067
-5,-4,48,1,1.9455252918,15,-35,-35,5,0.0194552529
-5,-3,36,4,14.765100671,44,-35,-35,5,0.1476510067
-5,-3,48,3,1.9455252918,15,-35,-35,5,0.0194552529
-5,-2,36,21,14.765100671,44,-35,-35,5,0.1476510067
-5,-2,48,3,1.9455252918,15,-35,-35,5,0.0194552529
-5,-1,36,10,14.765100671,44,-35,-35,5,0.1476510067
-5,-1,48,4,1.9455252918,15,-35,-35,5,0.0194552529
-4,-4,36,13,20.469798658,61,-35,-35,5,0.2046979866
-4,-4,48,4,1.037613489,8,-35,-35,5,0.0103761349
-4,-3,36,11,20.469798658,61,-35,-35,5,0.2046979866
-4,-3,48,2,1.037613489,8,-35,-35,5,0.0103761349
-4,-2,36,14,20.469798658,61,-35,-35,5,0.2046979866
-4,-2,48,2,1.037613489,8,-35,-35,5,0.0103761349
-4,-1,36,23,20.469798658,61,-35,-35,5,0.2046979866
-3,-3,36,9,17.785234899,53,-35,-35,5,0.177852349
-3,-3,48,2,0.9079118029,7,-35,-35,5,0.009079118
-3,-2,36,22,17.785234899,53,-35,-35,5,0.177852349
-3,-2,48,4,0.9079118029,7,-35,-35,5,0.009079118
-3,-1,36,22,17.785234899,53,-35,-35,5,0.177852349
-3,-1,48,1,0.9079118029,7,-35,-35,5,0.009079118
-2,-2,36,20,13.422818792,40,-35,-35,5,0.1342281879
-2,-1,36,19,13.422818792,40,-35,-35,5,0.1342281879
-2,0,36,1,13.422818792,40,-35,-35,5,0.1342281879
-1,-1,36,16,5.3691275168,16,-35,-35,5,0.0536912752
;;;;
proc format;
value fpcta
.='white'
0-<0.05 = 'verylightred'
0.05-<0.1 = 'verylightyellow'
0.1-<0.3='BIG'
0.3-high='lime';
run;
data _null_;
format txt $1000.;
retain txt;
do i=1 to 28;
txt=catx(";",strip(txt), "_c"||strip(put(i*2+4,8.))||"_=_c"||strip(put(i*2+3,8.))||"_/suma");
end;
call symputx("oks", txt);
run;
%put "&oks.;";
options missing=0;
proc report data=PUBLIC.frek_all nowd center split="*" out=three ;
by qnummese;
column qnummese ipo_window _percent suma (ipo_drawn, (count mkpi)) ;
define qnummese / group ;
define ipo_window / group ;
define _percent / f=percent9.1 group ;
define suma / group ;
define ipo_drawn / group across 'IPO drawn' left ;
define count / analysis sum '' ;
define mkpi / computed f=percent9.1 'KPI' style(column)={background=fpcta.};
compute mkpi;
_c6_=_c5_/suma;
_c8_=_c7_/suma;
_c10_=_c9_/suma;
_c12_=_c11_/suma;
_c14_=_c13_/suma;
_c16_=_c15_/suma;
_c18_=_c17_/suma;
_c20_=_c19_/suma;
_c22_=_c21_/suma;
_c24_=_c23_/suma;
_c26_=_c25_/suma;
_c28_=_c27_/suma;
_c30_=_c29_/suma;
_c32_=_c31_/suma;
_c34_=_c33_/suma;
_c36_=_c35_/suma;
_c38_=_c37_/suma;
_c40_=_c39_/suma;
_c42_=_c41_/suma;
_c44_=_c43_/suma;
_c46_=_c45_/suma;
_c48_=_c47_/suma;
_c50_=_c49_/suma;
_c52_=_c51_/suma;
_c54_=_c53_/suma;
_c56_=_c55_/suma;
_c58_=_c57_/suma;
_c60_=_c59_/suma;
endcomp;
break after qnummese / summarize;
run;
Hi:
It's not entirely clear to me what you want summarized. I don't see a sort for the QNUMMESE variable so I suspect you're getting an error on the BY statement in PROC REPORT. Also not sure what you're doing with the DATA _NULL_ step. It looks like you're building assignment statements for PROC REPORT, but I don't see your macro variable being used.
I also don't understand why SUMA and _PERCENT are defined as GROUP usage, but if you want SUMA and/or _PERCENT to be summarized --- or just SUMA summarized so that it can be used in the division on the break, then it can't be a usage of GROUP. It has to be a usage of ANALYSIS with a default statistic of SUM. And In running a test (thanks for data and code), but focusing only on QNUMMESE of 36 to illustrate my point compare these 2 partial outputs:
The top report was produced with the original program with all the usages of GROUP. Note that for QNUMMESE=36 and IPO_WINDOW=-2, when you have GROUP usage, the value for _PERCENT is 13.4% and the value for SUMA is 40. However, you have 3 rows for this group where QNUMMESE=36 and IPO_WINDOW=-2 -- note that in the second changed program, I reveal all 3 rows because I changed the usage to ORDER, which does not collapse the rows and you can see that the _PERCENT value is the same on all 3 rows and the SUMA value is the same on all 3 rows. If you add up the numbers on all 3 rows for SUMA, it would be 120...not 40. But my guess is that whatever process created the original data in your program repeated these values for every row where QNUMMESE=36 and IPO_WINDOW=-2. A Usage of GROUP will indeed show you only 1 value for _PERCENT and only 1 value for SUMA, but the GROUP usage also prevents your summary line from getting a total for SUMA. Is your calculation supposed to be performed on the summary line? If so, then you've got to figure out a different way to display SUMA on the report but still have it summarized on the BREAK line. You can do this easily by post-processing your data, so that the SUMA value only appears once for each unique combination of QNUMMESE and IPO_WINDOW, and that would look something like this for the summary:
Again, just isolated the test to QNUMMESE=36, but you can see I did get a summary line and the same values for SUMA that you showed in your original report. However, called the original DATA step file WORK.FAKEDATA and then post-processed that file to create WORK.FAKEDATA2 and used that in a changed PROC REPORT, as shown below (not repeating your original code or data creation).
proc sort data=fakedata;
by qnummese ipo_window;
run;
data fakedata2;
set fakedata;
by qnummese ipo_window;
if first.ipo_window = 0 then suma=.;
run;
title 'Changed Data and Changed Program';
proc report data=fakedata2 nowd center split="*" ;
by qnummese;
where qnummese = 36;
column qnummese ipo_window _percent suma (ipo_drawn, (count mkpi)) ;
define qnummese / group ;
define ipo_window / group ;
define _percent / f=percent9.1 group ;
define suma / analysis ;
define ipo_drawn / order across 'IPO drawn' left ;
define count / analysis sum 'N' ;
define mkpi / computed f=percent9.1 'KPI' style(column)={background=fpcta.};
compute mkpi;
_c6_=_c5_/suma.sum;
_c8_=_c7_/suma.sum;
_c10_=_c9_/suma.sum;
_c12_=_c11_/suma.sum;
_c14_=_c13_/suma.sum;
_c16_=_c15_/suma.sum;
_c18_=_c17_/suma.sum;
_c20_=_c19_/suma.sum;
_c22_=_c21_/suma.sum;
_c24_=_c23_/suma.sum;
_c26_=_c25_/suma.sum;
_c28_=_c27_/suma.sum;
_c30_=_c29_/suma.sum;
_c32_=_c31_/suma.sum;
_c34_=_c33_/suma.sum;
_c36_=_c35_/suma.sum;
_c38_=_c37_/suma.sum;
_c40_=_c39_/suma.sum;
_c42_=_c41_/suma.sum;
_c44_=_c43_/suma.sum;
_c46_=_c45_/suma.sum;
_c48_=_c47_/suma.sum;
_c50_=_c49_/suma.sum;
_c52_=_c51_/suma.sum;
_c54_=_c53_/suma.sum;
_c56_=_c55_/suma.sum;
_c58_=_c57_/suma.sum;
_c60_=_c59_/suma.sum;
endcomp;
break after qnummese / summarize;
run;
I hope that gives you some idea of how to get a summary line. I assume the numbers for SUMA are what you want, but my assumption could have been wrong. I did not cause _PERCENT to be summarized because it seemed more important to focus on SUMA, but if you want _PERCENT to be summarized at the break, you'll have to do the same thing for _PERCENT in the processing step that I did for SUMA.
Cynthia
Hi:
It's not entirely clear to me what you want summarized. I don't see a sort for the QNUMMESE variable so I suspect you're getting an error on the BY statement in PROC REPORT. Also not sure what you're doing with the DATA _NULL_ step. It looks like you're building assignment statements for PROC REPORT, but I don't see your macro variable being used.
I also don't understand why SUMA and _PERCENT are defined as GROUP usage, but if you want SUMA and/or _PERCENT to be summarized --- or just SUMA summarized so that it can be used in the division on the break, then it can't be a usage of GROUP. It has to be a usage of ANALYSIS with a default statistic of SUM. And In running a test (thanks for data and code), but focusing only on QNUMMESE of 36 to illustrate my point compare these 2 partial outputs:
The top report was produced with the original program with all the usages of GROUP. Note that for QNUMMESE=36 and IPO_WINDOW=-2, when you have GROUP usage, the value for _PERCENT is 13.4% and the value for SUMA is 40. However, you have 3 rows for this group where QNUMMESE=36 and IPO_WINDOW=-2 -- note that in the second changed program, I reveal all 3 rows because I changed the usage to ORDER, which does not collapse the rows and you can see that the _PERCENT value is the same on all 3 rows and the SUMA value is the same on all 3 rows. If you add up the numbers on all 3 rows for SUMA, it would be 120...not 40. But my guess is that whatever process created the original data in your program repeated these values for every row where QNUMMESE=36 and IPO_WINDOW=-2. A Usage of GROUP will indeed show you only 1 value for _PERCENT and only 1 value for SUMA, but the GROUP usage also prevents your summary line from getting a total for SUMA. Is your calculation supposed to be performed on the summary line? If so, then you've got to figure out a different way to display SUMA on the report but still have it summarized on the BREAK line. You can do this easily by post-processing your data, so that the SUMA value only appears once for each unique combination of QNUMMESE and IPO_WINDOW, and that would look something like this for the summary:
Again, just isolated the test to QNUMMESE=36, but you can see I did get a summary line and the same values for SUMA that you showed in your original report. However, called the original DATA step file WORK.FAKEDATA and then post-processed that file to create WORK.FAKEDATA2 and used that in a changed PROC REPORT, as shown below (not repeating your original code or data creation).
proc sort data=fakedata;
by qnummese ipo_window;
run;
data fakedata2;
set fakedata;
by qnummese ipo_window;
if first.ipo_window = 0 then suma=.;
run;
title 'Changed Data and Changed Program';
proc report data=fakedata2 nowd center split="*" ;
by qnummese;
where qnummese = 36;
column qnummese ipo_window _percent suma (ipo_drawn, (count mkpi)) ;
define qnummese / group ;
define ipo_window / group ;
define _percent / f=percent9.1 group ;
define suma / analysis ;
define ipo_drawn / order across 'IPO drawn' left ;
define count / analysis sum 'N' ;
define mkpi / computed f=percent9.1 'KPI' style(column)={background=fpcta.};
compute mkpi;
_c6_=_c5_/suma.sum;
_c8_=_c7_/suma.sum;
_c10_=_c9_/suma.sum;
_c12_=_c11_/suma.sum;
_c14_=_c13_/suma.sum;
_c16_=_c15_/suma.sum;
_c18_=_c17_/suma.sum;
_c20_=_c19_/suma.sum;
_c22_=_c21_/suma.sum;
_c24_=_c23_/suma.sum;
_c26_=_c25_/suma.sum;
_c28_=_c27_/suma.sum;
_c30_=_c29_/suma.sum;
_c32_=_c31_/suma.sum;
_c34_=_c33_/suma.sum;
_c36_=_c35_/suma.sum;
_c38_=_c37_/suma.sum;
_c40_=_c39_/suma.sum;
_c42_=_c41_/suma.sum;
_c44_=_c43_/suma.sum;
_c46_=_c45_/suma.sum;
_c48_=_c47_/suma.sum;
_c50_=_c49_/suma.sum;
_c52_=_c51_/suma.sum;
_c54_=_c53_/suma.sum;
_c56_=_c55_/suma.sum;
_c58_=_c57_/suma.sum;
_c60_=_c59_/suma.sum;
endcomp;
break after qnummese / summarize;
run;
I hope that gives you some idea of how to get a summary line. I assume the numbers for SUMA are what you want, but my assumption could have been wrong. I did not cause _PERCENT to be summarized because it seemed more important to focus on SUMA, but if you want _PERCENT to be summarized at the break, you'll have to do the same thing for _PERCENT in the processing step that I did for SUMA.
Cynthia
Excellent @Cynthia_sas
The call missing for suma in the pre-process data step & switching its usage to analysis & and the replacement from suma to suma.sum in the column compute block has brought the solution.
"Also not sure what you're doing with the DATA _NULL_ step. It looks like you're building assignment statements for PROC REPORT, but I don't see your macro variable being used."
Yes, but I paste it after using put statement for the macro variable. This comes in handy for constructing large across sections involving many _cx_...
"I also don't understand why SUMA and _PERCENT are defined as GROUP usage, but if you want SUMA and/or _PERCENT to be summarized --- or just SUMA summarized so that it can be used in the division on the break, then it can't be a usage of GROUP"
The variable names lend themselves to confusion, sorry.
"…but the GROUP usage also prevents your summary line from getting a total for SUMA."
I get the point.
"Is your calculation supposed to be performed on the summary line? If so, then you've got to figure out a different way to display SUMA on the report but still have it summarized on the BREAK line. You can do this easily by post-processing your data, so that the SUMA value only appears once for each unique combination of QNUMMESE and IPO_WINDOW, and that would look something like this for the summary:"
Exactly, that’s what I want.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.