I have been looking at many ways of aggregating data, but none seem to fit on the dataset I have. See below. What I would like to do is aggregate the data based on 1 minute time bars. The time variable is seconds after midnight, so 1:3599.999 second intervals, with the total amount of shares and a average weigth price.

I have looked into the proc expand, and proc sql methods for this, but I can't seem to make it fit my data. Does anyone have a good way of doing this?

Thanks

index, ord, share, price, time, logreturn, price_change

76,C,870,644.5,32400.6,0,0

77,C,82,644.5,32400.6,0,0

78,C,82,644.5,32400.6,0,0

79,E,100,644.5,32458.706,0,0

80,E,32,644.5,32469.069,0,0

81,E,68,644.5,32472.773,0,0

82,E,153,644.5,32472.773,0,0

83,E,63,644.5,32472.773,0,0

84,E,93,644.5,32472.773,0,0

85,E,300,645,32472.773,0.0007754944,0.5

86,E,19,645,32472.773,0,0

87,E,115,645,32472.773,0,0

88,E,1000,645,32472.773,0,0

89,E,18,645,32472.773,0,0

90,E,27,645,32477.073,0,0

91,E,250,645,32477.073,0,0

92,E,209,645,32477.073,0,0

93,E,70,644,32480.178,-0.001551591,-1

94,E,354,644,32572.578,0,0

95,E,27,644.5,32572.702,0.0007760963,0.5

96,E,17,644.5,32584.826,0,0

97,E,23,644.5,32659.177,0,0

98,E,76,644,32666.702,-0.000776096,-0.5

99,E,24,644,32666.702,0,0