Desktop productivity for business analysts and programmers

Problem generating report through proc report

Reply
N/A
Posts: 0

Problem generating report through proc report

Hi
I am generating reports through proc report and generating output in SAS Report format(.srx).
I am able to generate some accross reports in the above format but there are some accross reports which has two to three levels of hierarchy where EG is not generating the above format and giving me
****************************************************************
Error:Name is not unique.
****************************************************************
But at the same time generating other outputs like HTML,etc
Kindly help me out.
N/A
Posts: 0

Re: Problem generating report through proc report

Need to see some representative code for the Proc Report.
SAS Super FREQ
Posts: 8,814

Re: Problem generating report through proc report

Hi:
One challenge with PROC REPORT and ACROSS variables is that if you have any COMPUTE blocks where you are computing some value for the ACROSS variable, you may need to use absolute column names (_C1_, _C2_, _C3_, etc) instead of the variable name. few examples of using absolute column names can be found on pages 82-84 of this document:
http://support.sas.com/documentation/onlinedoc/v82/techreport_p258.pdf

Also, SAS Report XML format is intended for use with Web Report Studio, primarily -- there's a chance that the PROC REPORT output is incompatible with SASReport XML (.srx) -- for example, if you are using LINE statements -- SASReport XML will not render LINE statement output created by PROC REPORT.

For more help with absolute column names and the ACROSS usage, you might wish to consult the PROC REPORT documentation or study these Tech Support notes:
http://support.sas.com/kb/10/710.html
http://support.sas.com/kb/23/978.html
This last note shows how to programatically figure out the number of absolute columns there would be ACROSS your report. If you have multiple hierarchies, then you would have to know how many possible combinations or nestings were going to result from your data -- so you could get the column names correct.

cynthia
N/A
Posts: 0

Re: Problem generating report through proc report

Thanks for the reply.
I am able to generate SAS report through proc report but in my report I am calculating a row on run time using Rbreak which is wrongly displaying in SAS report but displaying in HTML report.

Piece of code

compute dummy;
if _BREAK_=UPCASE(_RBREAK_) then do;
/*in this i do some calculation by assigning some values.*/
_C5_=_c4_/_c3_;
.........................
end;
endcomp;

Kindly give me some solution for this.
SAS Super FREQ
Posts: 8,814

Re: Problem generating report through proc report

Hi:
_BREAK_ is a character variable. Let's say you are testing whether the BREAK statement was from the variable JobCode, then your IF statement might be:
IF upcase(_BREAK_) = 'JOBCODE';


Similarly, when you test for the RBREAK, you would test
IF _BREAK_ = '_RBREAK_';


As far as I know the string '_RBREAK_ is always uppercase. But since it's a character string, the string must be in quotes in your IF statement.

cynthia
N/A
Posts: 0

Re: Problem generating report through proc report

Sorry I had written wrong syntax in the message but i have written same syntax which you mentioned in the reply then also the calculation which i do through the if _break_ statement, doesnt work while displaying SAS report but works in HTML format.
Any reason behind this or any solution for this.
SAS Super FREQ
Posts: 8,814

Re: Problem generating report through proc report

Hi:
As I said, I am only aware that PROC REPORT programs with LINE statements do not render correctly with SASReport XML -- but will render correctly when generated as HTML, RTF and PDF.

Perhaps you've stumbled on another instance where SASReport XML does not render something that works in other destinations. This is an issue you need to raise with Tech Support.

If you are generating content that is intended to be viewed in SAS Web Report Studio, then Tech Support can work with you and this particular code to find out what the problem is. If you are NOT generating content for Web Report Studio, then perhaps it would be better for you to stick with one of the destinations that works -- such as HTML, RTF or PDF.

cynthia
Ask a Question
Discussion stats
  • 6 replies
  • 162 views
  • 0 likes
  • 2 in conversation