Help using Base SAS procedures

Two formats in Proc Report

Accepted Solution Solved
Reply
Super Contributor
Posts: 497
Accepted Solution

Two formats in Proc Report

[ Edited ]

Is there a way to use a custom format to order and a compute block to determine two different display formats e.g. percent and comma?

 

 

 

proc report data=combined;
format displayNum2 courseOfferingformatValue.; /*this line does not take effect*/
column row_label academic_period, displayNum2;
define row_label / group '' order = internal;
define academic_period / across '';
define displayNum2 / analysis '';
compute displayNum2;
if row_label='Percent of Sections Cancelled' 
then call define(_col_,'format','percent8.2');
else call define(_col_, 'format','comma10.');
endcomp;
run;


Accepted Solutions
Solution
‎06-29-2017 03:40 PM
Regular Contributor
Posts: 222

Re: Two formats in Proc Report

Posted in reply to DavidPhillips2

Hi David,

 

One way I have seen this applied, was in this SGF 2013 paper Census Retires Proc Computab

call define(_col_,"style","....") is used as the output is sent to Excel.

 

No sure if this would be applicable to your ODS destination.

 

Ahmed

View solution in original post


All Replies
Solution
‎06-29-2017 03:40 PM
Regular Contributor
Posts: 222

Re: Two formats in Proc Report

Posted in reply to DavidPhillips2

Hi David,

 

One way I have seen this applied, was in this SGF 2013 paper Census Retires Proc Computab

call define(_col_,"style","....") is used as the output is sent to Excel.

 

No sure if this would be applicable to your ODS destination.

 

Ahmed

☑ This topic is solved.

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

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