BookmarkSubscribeRSS Feed
Nasser_DRMCP
Lapis Lazuli | Level 10

 Hello,

I export a report (via proc report) into excel and I would like to keep a specifiq numerci format.

When I launch this code below, it works. I mean, in excel the number is kept into numeric format

define MNT_MOIS_AMO_AVT_SORTIE / '' style(column)={tagattr='format:000 000 000.00'};

 

but I create this format named "frmt_num_spac_comma" via proc format .

so I try this

define MNT_MOIS_AMO_AVT_SORTIE / '' style(column)={tagattr=frmt_num_spac_comma.};

but it does not work.

how could I specify the created format ? thanks a lot for your in advance.

Nasser

3 REPLIES 3
Nasser_DRMCP
Lapis Lazuli | Level 10

for exmple the value 225353,74382 I would like to get in excel, a number (and not text)  like 225 353,74382 (with space thousand and ',' separator).

but with this below, I get the correct displayed but it is a text

define MNT_MOIS_AMO_AVT_SORTIE / '' f = frmt_num_spac_comma.

 

And with this below, I get a number but the display is not correct 000 225 353,74000

define MNT_MOIS_AMO_AVT_SORTIE / '' style(column)={tagattr='format:000 000 000.00000'} ;

 

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

You can only use formats which are in Excel.  Basically Excel takes the text you create and interprets it internally before rendering it, so if it doesn't recognise a format then it doesn't use it.  Have a look at the formats in Excel, there are many of them.  If that doesn't cover it then you need to create a custom format in Excel and store to normal.dot.  Outside the scope of this forum though.

https://support.office.com/en-us/article/Create-or-delete-a-custom-number-format-78f2a361-936b-4c03-...

Nasser_DRMCP
Lapis Lazuli | Level 10

thank you very much.

so I started to create a format within, excel like # ##0,00000'

and then in proc report I do this :

define MNT_MOIS_AMO_AVT_SORTIE / '' style(column)={tagattr='format:# ##0,00000'}

I get a number but I only get 2 decimales instaed of 5

 

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 744 views
  • 0 likes
  • 2 in conversation