Write and run SAS programs in your web browser

Copy code from Windows Excel or Word document into SAS Stuido

Reply
Highlighted
New Contributor
Posts: 2

Copy code from Windows Excel or Word document into SAS Stuido

In the past, I have used Excel or Word to create SAS recode programs and copied them into a SAS program in SAS EG. I am new to SAS University Studio and am trying to do the same. Can someone help and tell pe how I wpuld copy the code? 

 

I highlight the code in Excel but can't click paste in the SAS Studio program.

 

Thanks

Super User
Super User
Posts: 6,137

Re: Copy code from Windows Excel or Word document into SAS Stuido

Highlight the text.

Copy the text, usually just use Ctril-C.

Make sure that you have focus in an editor window in SAS/Studio.  If unsure if you have focus hit Enter and see if a new line is inserted.

Paste the text. usually just use Ctrl-V.

 

You can probably also try to drag and drop the text, but why?

SAS Employee
Posts: 36

Re: Copy code from Windows Excel or Word document into SAS Stuido

Not being able to use the Copy or Paste icons or context menu is a browser security thing. Only keyboard shortcuts work  It's crazy I know, but if you're interested just google "not pasting into a browser". I did that and this was one of the first hits...  

 

Why you can't copy/paste in a browser?

 

Grand Advisor
Posts: 16,893

Re: Copy code from Windows Excel or Word document into SAS Stuido

It varies from browser to browser it seems. IE is very restrictive, on Safari I find I have to use the menu not the buttons that may be due to the non-mac keyboard issues I have sometimes.

Esteemed Advisor
Posts: 6,275

Re: Copy code from Windows Excel or Word document into SAS Stuido

Just tested it with

SAS 9.4 on AIX, SAS Studio 3.3

Windows 7 Professional

MS Word 2013

PaleMoon browser (fork from Firefox), 27.3.0 (current)

Ctrl-C in Word and Ctrl-V in the browser worked perfectly.

 

Since neither Word (ugh) or Excel (vomit) provide any syntax help, what's the use in writing code there? The SAS enhanced editors are much better for that.

Since SAS code is always plain text, any "simple" text editor like notepad++ or UltraEdit is much better suited for programming work, if you want to use an external editor at all. Some of those can even be trained to do syntax highlighting.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Grand Advisor
Posts: 10,043

Re: Copy code from Windows Excel or Word document into SAS Stuido


KurtBremser wrote:
 

Since neither Word (ugh) or Excel (vomit) provide any syntax help, what's the use in writing code there? The SAS enhanced editors are much better for that.


Perhaps the OP is doing something similar to one of my limited uses of Excel: Turning a layout document with variable name, type, length and description information into Informat, Input and Label statements. Which can go much faster for some of the data sources I get to play with when the documentation is actually well structured (and often 100+ variables). A few formulae in Excel will generate pasteable text for such routine repetitive and tedious tasks. Just on Label statements I've saved hours worth of typing out field descriptions for single datasets.

 

 

 

New Contributor
Posts: 2

Re: Copy code from Windows Excel or Word document into SAS Stuido

Thanks to all responder. Great advice.

Any thoughts on how to copy code, log and listings to a Word document in a cut paste method?
Ask a Question
Discussion stats
  • 6 replies
  • 72 views
  • 2 likes
  • 6 in conversation