DATA Step, Macro, Functions and more

proc report

Reply
Super Contributor
Posts: 647

proc report

Hi all,
I get the output as expected but with a small issue.How to merge the cells of consortia into a single cell?The output is in rtf. the output i get for consortia there should not be blank lines after the first record is show.instead it should be merged as a single cell.i.e consortia should be displayed in a single cell ,but protocol should be displayed in individual cell.
Consortia #Grant Protocol
MCC 59 5901 (PCD >5)
PI: Knowles 5 5902 (Compare)
PM: Pilger 5903 (PCD <5)
5904 (NEED)
SAS Super FREQ
Posts: 8,744

Re: proc report

Hi:
It's hard to envision what you want without seeing the "line up" of the columns. Is this close to what you want????
[pre]
Consortia #Grant Protocol
MCC 59 5901 (PCD >5)
PI: Knowles 5 5902 (Compare)
PM: Pilger 5903 (PCD <5)
5904 (NEED)
[/pre]

Please read this posting about the use of the [PRE] and [/PRE] tags in order to maintain indenting.
http://support.sas.com/forums/thread.jspa?messageID=27609毙

Also, post the PROC REPORT code that you are using. (ALL the PROC REPORT code, including your ODS statements).

I -think- that if you have SAS 9.2, you can use the SPANROWS option to do what you describe, if this is a group or order report, but am not entirely sure what you are describing and it would help to see a properly indented example of the output report and the code that you're using.

cynthia
Super Contributor
Posts: 647

Re: proc report

Consortia # in Grant Protocol
MCC 59 5903 (PCD <5)
PI: Knowles 5 5901 (PCD >5)
PM: Pilger 5902 (Compare)


This is the expected output.
Super Contributor
Posts: 647

Re: proc report

Consortia # in Grant Protocol
MCC 59 5903 (PCD <5)
PI: Knowles 5 5901 (PCD >5)
PM: Pilger 5902 (Compare)


This is the expected output.
SAS Super FREQ
Posts: 8,744

Re: proc report

Hi:
As I said, without seeing the indenting (or seeing some code) it is impossible for me to imagine what you want or are describing for the Consortia column.

For example, where does the number "59" go??? In the # in Grant column?? Where does the number 5 go? In the same column?? Is "PI:" something that goes in the Consortia column??? or is the whole string "PI: Knowles" something that goes in the Consortia column???

What about MCC??? Is that a Consortia? Why doesn't it have a : and a name after it??? Also, most of the lines have ## 590x on them -- for example:
[pre]
59 5903
5 5901
[/pre]

But what about the Pilger line??? there's no number before 5902 -- so should this 5902 line up underneath the 5903 and the 5902 or underneath the 59 and the 5.

This is why I referred you to the forum topic on posting code -- not just so you could indent the report so we could see what you want to do with the Consortia column, but also since you are posting code that has < and > symbols -- sometimes if you have too many of those brackets in your code, the HTML that governs the postings gets confused and so you have to replace all < symbols with &lt; and all > symbols with &gt; for posting purposes. Not a big deal and you can do it with a global search and replace in NOTEPAD just before you post output or code to the forum.

As it explains in this posting:
http://support.sas.com/forums/thread.jspa?messageID=27609毙

Surround code snippets with [pre] and [/pre]
This changes to a typewriter font and retains spaces and
line breaks. So

[pre]
proc print data=sashelp.class;
var name age height;
run;
[/pre]

becomes

[pre]
proc print data=sashelp.class;
var name age height;
run;
[/pre]


(Note how the 2 spaces before the VAR statement are respected in the "pre-formatted" or typewriter font. And I did actually type 2 spaces before the VAR statement in the posting editor window....but the 2 spaces only show in the typewriter font view of the posting.)

If you are unable to post a view of the output with indenting that illustrates how the Consortia column appears now ... so we can visualize the difference between what you have and what you want, then providing code that produces a similar report -- perhaps using SASHELP.SHOES would give folks a concrete way to run REPORT and see what's happening and then figure out how to change the REPORT code to do what you want.

cynthia
Ask a Question
Discussion stats
  • 4 replies
  • 174 views
  • 0 likes
  • 2 in conversation