Hi @Ksharp ,
It's a very clever way to handle this request, and your program works nicely for a small dataset, in one page. The program would not work for a large dataset, ODS tagsets.rtf works better for a large dataset, see the code:
proc sort data=sashelp.zipcode out=zipcode(keep=timezone statename countynm city zip);
by timezone statename countynm city zip;
run;
data zipcode; set zipcode;
by timezone statename countynm city zip;
*if _n_ le 400;
if last.city then id=0; else id=1;
run;
ods tagsets.RTF file="~/sasout/RowRemove.RTF";
options nonumber nodate;
proc report data=zipcode spanrows
style(header)=[borderbottomcolor=black borderbottomwidth=2px ]
style(report)=[ rules=cols]
style(Column)=[VJust=C];
columns ID timezone statename countynm city zip;
define timezone / group center;
define statename / group center;
define countynm / group center;
define city / group center;
define zip / display Center;
define ID / display noprint;
compute city;
if id=0 then call define (_row_,'style','style=[borderbottomcolor=black borderbottomwidth=2px ]');
call define ('Timezone','style','style=[borderbottomcolor=black borderbottomwidth=2px ]');
call define ('statename','style','style=[borderbottomcolor=black borderbottomwidth=2px ]');
call define ('countynm','style','style=[borderbottomcolor=black borderbottomwidth=2px ]');
call define ('city','style','style=[borderbottomcolor=black borderbottomwidth=2px ]');
endcomp;
run;
ods tagsets.rtf close;
but it creates a rtf file that is not a Word document. That is, if you select a few rows in the column of City, and change the font size to a large number, say 24 points, then you can't read the city name very well, unless you also adjust the cell height, then that will break your table, in terms of pagination. This is because ODS tagsets.rtf uses an absolute cell height to control the vertical spaces to achieve correct pagination.
By the way, if you run the whole zipcode data, you will have an output of 1100+ pages, there must be a better way to create a zipcode book for about 100 pages. Think of a dictionary and an alternative for SPANROWS.
Many Thanks
Jianmin Long
... View more