BookmarkSubscribeRSS Feed
obi1-design
Fluorite | Level 6

I have been trying to import an excel file through open grogram means but it keeps encrypting the file and shows like this picture below. help anyone please

Capture.JPG

2 REPLIES 2
Kurt_Bremser
Super User

SAS programs are plain text files, XLSX files are ZIP archives of XML data.

You cannot open Excel files as programs, you need to import them as data.

Since you seem to have a locally installed SAS, you can import the Excel data with PROC IMPORT, which you need to write in a program window.

Tom
Super User Tom
Super User

You cannot open a spreadsheet as if it is a text file. What you are seeing in the program editor are just the binary bytes of the file interpreted as if they were text.

You can import an XLSX file into dataset(s).  There is a GUI tool for that (not the Explorer tool you are using). But it is generally easier to write the code yourself.  For example just create a libref using the XLSX engine pointing to the  file. Then you can read each sheet as a dataset. To copy all of the sheets to dataset you might want to just use PROC COPY.

libname in xlsx '....\Customer_loan_data.xlsx' accress=readonly;
proc copy inlib=in outlib=work;
run;

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 570 views
  • 1 like
  • 3 in conversation