@rsiddh2 wrote: Thank you! As a side note, is it possible to accomplish this using a data step? There are additional things I wish to perform with this new data.
Many times it is easier to break a problem into components, such as the total calculation, using an appropriate tool, like Proc Means and then merging the result together instead of attempting to force everything through a single data step.
And it may not hurt to describe what some of those "additional things" might be. For instance your picture of the data shows two other variables, Export and Balance. If I wanted to get sums of those I would use @Reeza's solution adding Export and Balance to the VAR statement and get the statistics for all 3 variables at one pass.
If you happened to have another variable such as Country the trade was with then you could add a CLASS statement to Proc Means/ or Summary with that variable and you would get the summary by country as well as an overall total.
... View more