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?
sheet=" AUTOBOND2 RAW$"n ;
OR Try libname statement , my favorite .
Xia Keshan
sheet=" AUTOBOND2 RAW$"n ;
OR Try libname statement , my favorite .
Xia Keshan
sheet=" AUTOBOND2 RAW$"n ;
Does not work, same error message
Try libname statement , my favorite .
This works. Thanks!
You can open that libname to see what exactly table name it is .
Maybe it like " AUTOBOND2 RAW $"n
No, it shows as " AUTOBOND2 RAW$" with no trailing spaces.
Nevertheless, I think the problem has been solved by usingthe libname statement.
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.
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.