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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.