BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mikersas
Obsidian | Level 7

Something missing?

ods tagsets.ExcelXP file='D:\Admin\CA_NIC.xml' style=printer;

ods tagsets.ExcelXP options(sheet_interval='bygroup' sheet_label='Distrct'

absolute_column_width = '6,10,11,11,25,10,25,6,6,6,30,25,11,11,11,11');

Title 'Current Quarter Assets vs. Previous Quarter';

Proc print data=Admin.Canicmerged noobs label split='*';

by lead_ofc_id;

var id_rssd;       

var    PctDiff    / Style={tagattr='format:0.00;[Red]\(0.00\)'};   

var    &qtr2    ;   

var    &qtr1    ;   

var    idrssd    ;   

var    supr_event_nr    ;

1 ACCEPTED SOLUTION

Accepted Solutions
mikersas
Obsidian | Level 7

The problem was that the field was formatted as NEGPAREN8.2 in the table.

As soon as I changed it to 8.2 and recreated the table - it worked.

Thanks all!

View solution in original post

4 REPLIES 4
data_null__
Jade | Level 19

Sometimes style overrides don't work and you have to create new style elements.

proc template;                                               
  
define style styles.my_journal;                          
     
parent=styles.journal;                                 
     
style angle_header from header / tagattr = 'rotate:45';
     
style red_data from data    / tagattr='format:0.00;[Red]\(0.00\)';
     
end;                                                   
  
run;             

data test;
   do x = -1 ,1,-2,1,-100000;
     
output;
     
end;
  
run;
ods tagsets.excelxp file='~/red.xml' style=my_journal;
proc report nowd list;
  
columns x;
   define x / display style(column)=red_data style(header)=angle_header 'Traffic Light';
  
run;
ods tagsets.excelxp close;

10-22-2014 6-05-54 AM.png  
   
                                                             
mikersas
Obsidian | Level 7

Same result.  Is the number supposed to be stored by excel as text? Maybe I should change the format in the table.

mikersas
Obsidian | Level 7

The problem was that the field was formatted as NEGPAREN8.2 in the table.

As soon as I changed it to 8.2 and recreated the table - it worked.

Thanks all!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2545 views
  • 3 likes
  • 3 in conversation