@PaigeMiller yes you are right. I gave you excel column names instead of sas column names. clearly I was not thinking. To give you the context, I have a dataset like below. ID First Event Begin Quarter Last Event Begin QTR Last Event End QTR _01__Q3_1996 _02__Q4_1996 _03__Q1_1997 _04__Q2_1997 _05__Q3_1997 _06__Q4_1997 _07__Q1_1998 _08__Q2_1998 _09__Q3_1998 _10__Q4_1998 _11__Q1_1999 _12__Q2_1999 _13__Q3_1999 _14__Q4_1999 _15__Q1_2000 _16__Q2_2000 _17__Q3_2000 _18__Q4_2000 _19__Q1_2001 _20__Q2_2001 _21__Q3_2001 _22__Q4_2001 _23__Q1_2002 _24__Q2_2002 _25__Q3_2002 _26__Q4_2002 _27__Q1_2003 _28__Q2_2003 _29__Q3_2003 _30__Q4_2003 _31__Q1_2004 _32__Q2_2004 _33__Q3_2004 _34__Q4_2004 _35__Q1_2005 _36__Q2_2005 _37__Q3_2005 _38__Q4_2005 _39__Q1_2006 _40__Q2_2006 _41__Q3_2006 _42__Q4_2006 _43__Q1_2007 _44__Q2_2007 _45__Q3_2007 _46__Q4_2007 _47__Q1_2008 _48__Q2_2008 _49__Q3_2008 _50__Q4_2008 _51__Q1_2009 _52__Q2_2009 _53__Q3_2009 _54__Q4_2009 _55__Q1_2010 _56__Q2_2010 _57__Q3_2010 _58__Q4_2010 _59__Q1_2011 _60__Q2_2011 _61__Q3_2011 _62__Q4_2011 _63__Q1_2012 _64__Q2_2012 _65__Q3_2012 _66__Q4_2012 _67__Q1_2013 _68__Q2_2013 _69__Q3_2013 _70__Q4_2013 _71__Q1_2014 _72__Q2_2014 _73__Q3_2014 _74__Q4_2014 _75__Q1_2015 _76__Q2_2015 _77__Q3_2015 _78__Q4_2015 _79__Q1_2016 _80__Q2_2016 _82__Q4_2016 _83__Q1_2017 _84__Q2_2017 _85__Q3_2017 _86__Q4_2017 _87__Q1_2018 _88__Q3_2016 _89__Q2_2018 _90__Q3_2018 _91__Q4_2018 _92__Q1_2019 _93__Q2_2019 1 1998-Q1 2017-Q4 2018-Q2 $0.00 $220.00 $0.00 $0.00 $132.00 $138.00 $0.00 $487.00 $0.00 $0.00 $0.00 $0.00 $0.00 $919.00 $0.00 $0.00 $634.00 $557.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $739.00 $180.00 $0.00 $0.00 $529.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $33.00 $0.00 $5,577.00 $5,577.00 $5,467.00 $3,959.00 $3,698.00 2 2001-Q3 2017-Q4 2018-Q2 $0.00 $67.00 $150.00 $0.00 $0.00 $696.00 $0.00 $0.00 $1,007.00 $1,307.00 $2,824.00 $103.00 $1,918.00 $2,150.00 $1,229.00 $86.00 $0.00 $0.00 $1,179.00 $1,629.00 $2,679.00 $2,659.00 $551.00 $1,550.00 $3,552.00 $909.00 $894.00 $3,099.00 $2,087.00 $3,648.00 $878.00 $1,388.00 $2,450.00 $2,613.00 $694.00 $0.00 $0.00 $1,494.00 $3.00 $300.00 $1,088.00 $2,171.00 $688.00 $4,193.00 $3,856.00 $4,393.00 $4,744.00 $4,271.00 $3,654.00 $4,407.00 $4,468.00 $4,449.00 $1,849.00 $2,746.00 $2,852.00 $2,415.00 $1,956.00 $1,027.00 $0.00 $3,141.00 $3,987.00 $3,775.00 $0.00 $1,619.00 $3,053.00 $3,230.00 $2,009.00 $4,508.00 $6,575.00 $8,747.00 $6,005.00 $4,886.00 $4,382.00 $3,898.00 $3,481.00 $1,636.00 $2,343.00 $5,689.00 $3,519.00 $3,539.00 $4,791.00 $3,635.00 $3,968.00 $3,686.00 $0.00 $6,687.00 $3,877.00 $8,302.00 $8,302.00 $7,478.00 $15.00 $5,605.00 3 1996-Q1 2018-Q1 2018-Q2 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $0.00 $534.00 $1,623.00 $0.00 $0.00 $0.00 $0.00 $121.00 $912.00 $0.00 $0.00 $392.00 $387.00 $0.00 $1,749.00 $312.00 $2,186.00 $2,211.00 $1,503.00 $0.00 $627.00 $2,013.00 $1,582.00 $1,146.00 $974.00 $2,438.00 $1,493.00 $3,083.00 $4,418.00 $2,753.00 $2,652.00 $4,118.00 $3,849.00 $2,573.00 $3,030.00 $3,291.00 $2,925.00 $3,519.00 $2,358.00 $2,340.00 $4,104.00 $3,618.00 $4,212.00 $1,112.00 $3,962.00 $3,031.00 $4,057.00 $361.00 $0.00 $0.00 $957.00 $3,360.00 $1,620.00 $0.00 $2,347.00 $3,332.00 $3,817.00 $553.00 $478.00 $2,929.00 $3,419.00 $2,310.00 $2,671.00 $2,866.00 $3,456.00 $3,224.00 $2,951.00 $2,927.00 $2,566.00 $0.00 $0.00 $3,241.00 $0.00 $2,228.00 $2,956.00 $3,619.00 $3,619.00 $3,788.00 $2,962.00 $4,186.00 I need to add three columns like below where I need to match the quarter with the column quarter and pick that value in that matching column quarter like below. If there is no matching column quarter I need to identify that and so put -$1.00 (no value is actual dataset is negative). I thought I will start with making the column names same but clearly I was not thinking. Amount in First Begin QTR Amount in Last Begin QTR Amount in Last End QTR $0.00 $0.00 $5,577.00 $2,679.00 $0.00 $8,302.00 -$1.00 $2,228.00 $3,619.00 How can I add these three columns? Thank you.
... View more