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

The name of the worksheet I would like to import into Excel begins with a space, it actually has two spaces, the name is

' AUTOBOND2 RAW' but there are no quotes in the name, I just put them there so you can see the initial space. But when I try

proc import datafile="myfile.xlsx" out=AUTOBOND2 dbms=excel replace;

  sheet=" AUTOBOND2 RAW";

  run;

Produces the error in the LOG

ERROR: Prepare: Invalid bracketing of name ' AUTOBOND2 RAW$'.

SQL statement: SELECT * FROM ` AUTOBOND2 RAW$`

ERROR: Import unsuccessful.  See SAS Log for details.

How do I read this worksheet?

--
Paige Miller
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

sheet=" AUTOBOND2 RAW$"n ;


OR Try libname statement , my favorite .





Xia Keshan

View solution in original post

4 REPLIES 4
Ksharp
Super User

sheet=" AUTOBOND2 RAW$"n ;


OR Try libname statement , my favorite .





Xia Keshan

PaigeMiller
Diamond | Level 26

sheet=" AUTOBOND2 RAW$"n ;

Does not work, same error message

Try libname statement , my favorite .

This works. Thanks!

--
Paige Miller
Ksharp
Super User

You can open that libname to see what exactly table name it is .

Maybe it like " AUTOBOND2 RAW                            $"n

PaigeMiller
Diamond | Level 26

No, it shows as " AUTOBOND2 RAW$" with no trailing spaces.

Nevertheless, I think the problem has been solved by usingthe libname statement.

--
Paige Miller

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
  • 4 replies
  • 3250 views
  • 1 like
  • 2 in conversation