Tom thanks for the detailed code. That was very high quality stuff. I got it right all the code except for the SQL part which is throwing error... how can i eliminate the error in PROC SQL step. In the SQL there is issue on invoking it. 264 %put %datelist; ,"31JAN2017"n ,"28FEB2017"n ,"31MAR2017"n ,"30APR2017"n ,"31MAY2017"n ,"30JUN2017"n 265 Proc SQL; --- 13 266 Select age, ------ 180 ERROR 13-12: Unrecognized SAS option name, SQL. ERROR 180-322: Statement is not valid or it is used out of proper order. 267 %datelist() 268 from sashelp.class; 269 quit; 270 Proc SQL; 271 Select age, 272 %datelist() NOTE 137-205: Line generated by the invoked macro "DATELIST". 1 ,"&date"n - 22 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, *, BTRIM, INPUT, LOWER, PUT, SUBSTRING, UPPER, USER. 273 from sashelp.class; 274 quit; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 0.01 seconds cpu time 0.00 seconds
... View more