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

Hi,

i want create a xml file with this code:

ODS TAGSETS.EXCELXP file="C:\Users\ui43925\Desktop\PROVA\&FILE." 
				style=printer
				OPTIONS ( Center_Horizontal = 'yes'
				Embedded_Titles = 'yes'
				Embedded_Footnotes = 'no' 
				Sheet_Name = 'Elenco terminali'
				/* Absolute_Column_Width = 'NONE' */
				Center_Horizontal = 'yes'
				Autofit_Height = 'yes'
				/*Frozen_Headers = '6' */
				width_fudge='2.2'
				/* default_column_width='3' */
				Autofilter = 'yes'
				absolute_column_width= '5,4,3,7,7,5,3,3,7,7,2,7,2,3,4' 
				);
				options missing=' ';
				TITLE1 font=calibri h=5 "TERMINALI IN DOTAZIONE ALL'AGENZIA";
				/*TITLE2 '(Richieste totali pervenute - Interazioni con operatore)'; */

				proc report nowd data=WORKUSI.OUT_TEMP1;
				COLUMN 
				REGION KEYATM COD_AG AGENZIA DESCRIZIONE_PRESSO TIPO_UBICAZIONE TIPOLOGIA_TERMINALE MODELLO_TERMINALE INDIRIZZO   
				COMUNE PRO REGIONE CAP BARCODE_SI_NO DATA_ATTIVAZIONE_BARCODE;
				define DATA_ATTIVAZIONE_BARCODE / FORMAT=DDMMYY10.;
				define KEYATM / FORMAT=$15.; 
				run;
				ODS TAGSETS.EXCELXP CLOSE;

The problem is the column KEYATM:

define KEYATM / FORMAT=$15.;

in the file xml i have a number format and not text

errore.JPG

 

What is the problem ? I need text 020082230007073 ....

Thanks!!!!

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

What you are generating is XML, Excel is then interpreting this XML upon opening an rendering it as it sees fit - as no format is specified in the XML, Excel says look a number, let me be helpfull and display as a number.  To get round this you need to supply the XML with the Excel format for that column.  Here is a document which comes up first on the search and explains it:

http://support.sas.com/resources/papers/proceedings13/316-2013.pdf

View solution in original post

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

What you are generating is XML, Excel is then interpreting this XML upon opening an rendering it as it sees fit - as no format is specified in the XML, Excel says look a number, let me be helpfull and display as a number.  To get round this you need to supply the XML with the Excel format for that column.  Here is a document which comes up first on the search and explains it:

http://support.sas.com/resources/papers/proceedings13/316-2013.pdf

Cello23
Quartz | Level 8
Thanks

define KEYATM / STYLE( column )= { TAGATTR='format:text'};
Cello23
Quartz | Level 8
can I not see this message at every export ?

DOWLOAD.JPG 
RW9
Diamond | Level 26 RW9
Diamond | Level 26

I can't see where you are running that so I can only guess here.  There is an option:

options noresults;

 

Or

 

options results;

 

The first will turn off the feature which automatically opens any output your program creates - so put that in your program before you create the file. 

Cynthia_sas
SAS Super FREQ
Try going to Tools-->Options --> Preferences and turn OFF the box for "View results as they are generated" that may prevent the File Download window from popping open.

If you are running SAS on a server, there may not be a way to avoid the File Download messages because if you were, for example running SAS on Unix (which doesn't have Excel) then it makes sense that you would have to download the file from the Unix server to your Windows machine to be opened. But at least with the Tools-->Options --> Preferences setting, you can keep the window from continually popping up as each file gets created.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 1081 views
  • 1 like
  • 3 in conversation