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

I'm so close. 

With tagset.excelxp, I have a multisheet workbook with a summary worksheet that links to other worksheets, via style(data)={url=$linkcreated earlier} on a var statement with PROC PRINT.  The problem is that this variable is a character with a leading zero.  It's almost like I need to be able to use style(data)={tagattr="format:@"} along with the other style statement.

My mocked up code is attached.  I tweaked the class data set to mimic my current situation.

Thanks so much for any hints,

Kim LeBouton

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

Hi:

  I think you're right...in the statement where you use the format for URL, I think you also need TAGATTR. Something like:

var char_gender/ style(data)={url=$genderlink. tagattr="format:@"} ;

  Otherwise, Excel gets the 01 and 02 and, even though you have it as a character variable in SAS, when Excel sees it, it decides that you must, of course, mean for the 01 to be displayed as 1 and the 02 as 2. The purpose of the TAGATTR format is to send a MICROSOFT format instruction to Excel for how the column should be treated by Excel. Annoying, but understandable.

cynthia

View solution in original post

4 REPLIES 4
Cynthia_sas
Diamond | Level 26

Hi:

  I think you're right...in the statement where you use the format for URL, I think you also need TAGATTR. Something like:

var char_gender/ style(data)={url=$genderlink. tagattr="format:@"} ;

  Otherwise, Excel gets the 01 and 02 and, even though you have it as a character variable in SAS, when Excel sees it, it decides that you must, of course, mean for the 01 to be displayed as 1 and the 02 as 2. The purpose of the TAGATTR format is to send a MICROSOFT format instruction to Excel for how the column should be treated by Excel. Annoying, but understandable.

cynthia

KimLeBouton
Quartz | Level 8

Thanks Cynthia.

Prior to sending the note, I had tried the url after the tagattr.  It didn't work.

Kim

art297
Opal | Level 21

Kim,

Does that mean that you have now solved the problem with Cynthia's suggested code or is it still an issue?

Art

KimLeBouton
Quartz | Level 8

It's resolved,

Kim

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1641 views
  • 0 likes
  • 3 in conversation