Help using Base SAS procedures

proc report define

Accepted Solution Solved
Reply
Regular Contributor
Regular Contributor
Posts: 238
Accepted Solution

proc report define

I have a proc report code that has a ton of code in it but in my define statement I want to say (F/C) or show what columns I am using to divide by. Here is the example of the first part of my code:

proc report nowd data=implant2.finalFI split='/';

columns sys_drg_cd TotalClaims TotalAllowed TotalEPD Total_Claims Total_Allowed Total_EPD perc1 Total_Imp_Claims

Total_Imp_Allowed Total_Imp_EPD perc2 TtlClaims TtlAllowed TtlEPD perc3 Ttl_Claims Ttl_Allowed Ttl_EPD perc4

imp_alloc_allw_amt perc5 imp_epd_calc_allw_amt perc6 perc7;

define sys_drg_cd/group 'DRG Code' missing ;

define totalclaims/group 'Total FI/Claim Frequency/All Claims' center missing;

define totalallowed/group 'Total FI/Allowed Amount/All Claims' format=dollar20.2 center missing;

define Totalepd/group 'Total FI/EPD Amount/All Claims' format=dollar20.2 center missing;

define total_claims/group 'Total FI/Claim Frequency/Implant Claims' center missing;

define total_allowed/group 'Total FI/Allowed Amount/Implant Claims' format=dollar20.2 center missing;

define Total_epd/group 'Total FI/EPD Amount/Implant Claims' format=dollar20.2 center missing;

define perc1/computed format=percent10.2 'FI/Percent of All Claims/(F/C) ' center missing;

compute perc1;

perc1=_c5_/_c2_;

endcomp;

If I put in the () and the / it splits the column because I have defined split. I was trying to figure out how to put in the actual division sign.


Accepted Solutions
Solution
‎05-30-2012 12:32 PM
SAS Super FREQ
Posts: 8,743

Re: proc report define


Hi:

  You can change your split character with split='#' or use some other symbol for the split character. Then your label would be:

define perc1/computed format=percent10.2

      'FI#Percent of All Claims#(F/C)' ;

For the actual division sign (÷), you would either have to cut and paste the symbol into your label and hope that the font for the destination would support that character OR find out what the symbol was in a unicode font and then use the hex code for the symbol with the ESCAPECHAR {UNICODE} function... I think that in a unicode font, the division sign is always unicode 00F7 -- in order to use the {UNICODE} function with a hex value, you must be using SAS 9.2 or higher. And you must use the ODS ESCAPECHAR statement to establish the ESCAPECHAR that you are going to use. If you use this technique, then you should pick a character other than a slash or a # (perhaps a ~ (tilde) or a ^ (caret) ).

All possibly overkill, when just changing the split character would allow you to use the slash to represent division. And, you did not say what your destination of interest was. It is possible that if you cut and pasted the division sign from a document that not all destinations, like LISTING would respect the division sign.

cynthia

View solution in original post


All Replies
Solution
‎05-30-2012 12:32 PM
SAS Super FREQ
Posts: 8,743

Re: proc report define


Hi:

  You can change your split character with split='#' or use some other symbol for the split character. Then your label would be:

define perc1/computed format=percent10.2

      'FI#Percent of All Claims#(F/C)' ;

For the actual division sign (÷), you would either have to cut and paste the symbol into your label and hope that the font for the destination would support that character OR find out what the symbol was in a unicode font and then use the hex code for the symbol with the ESCAPECHAR {UNICODE} function... I think that in a unicode font, the division sign is always unicode 00F7 -- in order to use the {UNICODE} function with a hex value, you must be using SAS 9.2 or higher. And you must use the ODS ESCAPECHAR statement to establish the ESCAPECHAR that you are going to use. If you use this technique, then you should pick a character other than a slash or a # (perhaps a ~ (tilde) or a ^ (caret) ).

All possibly overkill, when just changing the split character would allow you to use the slash to represent division. And, you did not say what your destination of interest was. It is possible that if you cut and pasted the division sign from a document that not all destinations, like LISTING would respect the division sign.

cynthia

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 175 views
  • 0 likes
  • 2 in conversation