The SAS Output Delivery System and reporting techniques

Showing leading zeros and using Define in ODS

Reply
Frequent Contributor
Posts: 135

Showing leading zeros and using Define in ODS


data test(keep=ln_no,template);

set test2;

run;

sample output

ln_no                       template

0001444444             sample

0000000444            sample2

How can I display the ln_no to capture the leading zeros and show an actual 10 digit ln_no

DEFINE  ln_no  /Display style(column)={tagattr="format:????????" cellwidth=80pt just=right"Loan Number";

SAS Super FREQ
Posts: 8,814

Re: Showing leading zeros and using Define in ODS

Hi:

 

  The TAGATTR style attribute method will ONLY work if you are using ODS TAGSETS.EXCELXP to create ODS output that can be opened in Excel. If you use HTML-based methods, and you want to open the HTML file with Excel, then you would use the HTMLSTYLE style attribute method. Otherwise, for other destinations, such as ODS HTML with a browser or ODS RTF or ODS PDF, you can simply use the Z10. SAS format to format the number with leading zeroes. The only application that does not respect the SAS Z. format is Excel, when it opens output.

  

  There have been many previous postings on the use of TAGATTR and/or HTMLSTYLE. Have you searched for any previous postings on the subject. Here are a few places to start:

https://communities.sas.com/message/55207#55207

https://communities.sas.com/message/152610#152610

  

cynthia

Ask a Question
Discussion stats
  • 1 reply
  • 352 views
  • 0 likes
  • 2 in conversation