I am starting to learn SAS EG and using it for my dissertation. I am not sure if I have to run code or if I can do the following in the computed column interface: THE PROBLEM: I have a table (STATE) that (to simplify) consists of the following columns: StateYRKey, State, Year, ChgYr1, ChgYear5, ChgYear10, GSP (e.g., AK1960, AK, 1960, 1961, 1965, 1970, 123456) I want to create a computed column for various changes in GSP (again simplifying) Yr1GSPChg, Yr5GSPChg, Yr10GSPChg I would like to code something like (or simplier): For i in {AK..WY} Do For j = {1960..2012} Do BEGIN * The key is a concatenation. I want to access values for specific rows to compute the appropriate difference) STATE.(Concatenate i,j).Yr1GSPChg = STATE.(Concatenate i,j)GSP - STATE.(Concatenate i,j -1).GSP STATE.(Concatenate i,j).Yr5GSPChg = STATE.(Concatenate i,j)GSP - STATE.(Concatenate i,j -5).GSP STATE.(Concatenate i,j).Yr10GSPChg = STATE.(Concatenate i,j)GSP - STATE.(Concatenate i,j -10).GSP END In other words, since the key is a concatenation of year and state, I want new columns with with the GSP difference for various years for each state. I then intend to do some further analysis. I have found very little information on how to reference a specific row or do this type of thing in EG Filter/Query. There has to be an easy way, and I may have just looked at this too long. Any help is appreciated.
... View more