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";
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
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!
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.
Ready to level-up your skills? Choose your own adventure.