BookmarkSubscribeRSS Feed
maggi2410
Obsidian | Level 7

Hi All,

I am converting an excel file to SAS dataset using xlxp2sas. The reason I am using xlxp2sas is:

My excel file has columns with text more then 250 characters and I am using UNIX(9.2) system, and the sheet name has special characters, and the header names has special characters ..phew!!

the excel libname statement doesnt work on UNIX, and Proc import causes truncation. In short, I have to use xlxp2sas.

Nowwhen I use it on test file(with 1 row, 1 column), even throws error "ERROR: Expected an XML document prolog or element.", even on test file.

I am using the attached map file.

Do anyone has any idea to resolve this pesky error???

My code is :

%xlxp2sas(excelfile=./test.xls,

                   mapfile=./excelxp.map);

2 REPLIES 2
maggi2410
Obsidian | Level 7

This is a simple excel file, 2003, not an xml file

Cynthia_sas
SAS Super FREQ

Hi:

  I believe that program ONLY works on Excel XML as input: http://www2.sas.com/proceedings/sugi30/136-30.pdf and would not work on an Excel 2003 non-XML format file. You might want to check with Tech Support to be absolutely sure, but when I look at the paper that describes the program,I don't see any references to using it on proprietary Excel format files. The paper author includes the steps for how to explicitly save your Excel file as XML in order to use the macro program to read the Excel XML file into SAS.

cynthia

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
  • 2 replies
  • 690 views
  • 0 likes
  • 2 in conversation