Hi, I want to insert blank row after every Country in my report. I referred the below sample code wherein it is inserting every 5th row, however, my requirement is to insert rows whenever country changes. Please help me. -- Input Data Country Product Year USA Mobile 2000 USA Laptop 2012 USA Tablet 2013 Germany PC 2010 Germany Laptop 2009 India Hard Disk 2011 India Smart Phone 2008 India Laptop 2007 India PC 2006 India Tablet 2005 --Desired Output Country Product Year USA Mobile 2000 USA Laptop 2012 USA Tablet 2013 Germany PC 2010 Germany Laptop 2009 India Hard Disk 2011 India Smart Phone 2008 India Laptop 2007 India PC 2006 India Tablet 2005 --Sample Code /* Insert blank observation after every 5 observations */ data class_blanks; set sashelp.class; output; /* Output real observation */ if mod(_n_,5)=0; array allnums {*} _numeric_ ; array allchar {*} _character_ ; drop i; do i=1 to dim(allnums); allnums{i}=.; end; do i=1 to dim(allchar); allchar{i}=' '; end; output; /* Output blank observation */ run; options missing=' '; /* Display numeric missing as blank */ proc print data=class_blanks noobs; title 'SASHELP.CLASS with Blank Line After Every 5 Obs'; run;
... View more