...I meant to say this, as well. You asked:
Any idea why the titles are printed even though there is no data for the proc.
Another factor is that "page" processing -- the whole process of issuing a "page break" (or not) and writing titles is somewhat independent of a procedure's action on the data. SAS sees a procedure step -- SAS starts an output file based on the ODS statements. The first thing that normally happens is the title processing and page numbering, etc happens at the top of the first page. Then, SAS sees a step boundary; and let's say that there is another procedure. At that point, where SAS sees the step boundary and another procedure, it does 2 things:
1) issues a "page eject" and performs title, date and number placement, based on options, etc.
2) starts the next procedure
Sometimes, the output is written one line at a time to the output file (such as with LISTING); and then, sometimes as with PostScript or PDF, an "image" of each page is built internally in a buffer area and then is written to the ODS output file.
At the point in time when the procedure has started, page processing has already "handled" the titles. This process could be impacted by STARTPAGE -- but the part that would be impacted would be issuing the page break. That's another reason to work with Tech Support.
And, since you're doing all this in a stored process (with the Stored Process Web App? with EG? with the Information Delivery Portal?) that will make the testing a bit more complicated -- although if you can get the page breaks and titles the way you want in Base SAS, the stored process output should not be different (although you may have to be explicit about all the options that need to be in effect for your stored process to execute.
cynthia