SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Import Wizard generated code

Reply
Occasional Contributor
Posts: 15

Import Wizard generated code

I am using SAS 9.4 64 bit to read 32 bit Excel files.  This code below works fine:

PROC IMPORT OUT= WORK.mydata

            DATAFILE= "&PTH\myfile.xlsx"

            DBMS=XLSX REPLACE;

      sheet="MyData";

RUN;


Is there a way to get the Import Wizard to generate similar code?  I haven't had any luck with that so far.


Bill Price

Esteemed Advisor
Posts: 7,293

Re: Import Wizard generated code

You get an option to save the commands during the process. It's shown in the following youtube video: Import Wizard SAS Demonstration - YouTube

Occasional Contributor
Posts: 15

Re: Import Wizard generated code

Thanks Arthur.  I should have been more explicit.  This is what I'd like to do, but the wizard stops before I get that chance due to the infamous 64 bit SAS <- 32 bit Office incompatibility problem.  From my understanding, the XLSX menu item in the 64 bit SAS Import Wizard will only work with 64 bit Excel files and I'd like to find a way to use the Wizard to read 32 bit files w/o resorting to the PC Files Server option.  It seems odd that the Wizard could not do what I need as I can manually code a working solution as above.  Admittedly though, although I've worked with SAS for nearly 30 years, I am not well versed in these new fangled aspects of SAS Smiley Happy.  #OldDogHere

Esteemed Advisor
Posts: 7,293

Re: Import Wizard generated code

I'm old school as well (40+ years) and have been disappointed over the years with the system "intelligence" with respect to importing and exporting Excel files.

One alternative, if it is just to remind oneself of the needed code, is to save the code as a SAS abbreviation.  See, e.g., http://support.sas.com/resources/papers/proceedings09/073-2009.pdf

Occasional Contributor
Posts: 15

Re: Import Wizard generated code

Ahh, that's a neat trick.  I'll have to try this.  Like texting auto-complete that actually works Smiley Happy .  Thanks for that tip.

The question and need are really for my clients who will inevitably being trying to use the Wizard and having problems.  It always looks better on my end if I have an answer that works for them :smileysilly:.

Thanks again for the tip on abbreviations. Always something new to learn...

Esteemed Advisor
Posts: 7,293

Re: Import Wizard generated code

And, if that does serve the purpose, any abbreviations you create can be shared with your users. There is a collection of them, and links to how they can be shared, at: Abbreviations/Macros - sasCommunity

Ask a Question
Discussion stats
  • 5 replies
  • 928 views
  • 3 likes
  • 2 in conversation