BookmarkSubscribeRSS Feed
novinosrin
Tourmaline | Level 20

Hello Folks, 

 

How to copy paste code with colors and format Cntrl+I in university edition?Everytime I pasted the code, I seem to lose the color. Also what's the short cut to format the code like an equivalent to Cntrl+I in Enterprise guide. Any ideas please?

8 REPLIES 8
Tom
Super User Tom
Super User

I don't think there is any way. One of the prices of building an application to run inside a browser.

 

 

SuzanneDorinski
Lapis Lazuli | Level 10

SAS University Edition does have a button to format code.  It's to the left of the button to maximize view.  The screen shot below shows the location. 

 

Format code button is at the top of the program window in SAS University EditionFormat code button is at the top of the program window in SAS University Edition

Teema
Calcite | Level 5

but what does it do? 

I'm facing the same problem

SuzanneDorinski
Lapis Lazuli | Level 10

The "format code" button can make a program easier to read.  

 

@ChrisHemedinger wrote a blog post about how you can do this in Enterprise Guide.  

 

In the screen shot below, I typed a bunch of SAS statements.  While you can write programs this way, it can be difficult for others to read them and understand them quickly.  

 

Example of messy SAS codeExample of messy SAS codeAfter I press that "format code" button, the program looks like the screen shot below.  Statements are placed on separate lines, some statements are automatically indented, and blank lines are inserted between PROCs, data steps, and comments.  

 

Nicely formatted SAS codeNicely formatted SAS code

FNY
Calcite | Level 5 FNY
Calcite | Level 5

Hi I'm not sure how useful this will be to you since this post like a few years old but hopefully it helps someone else. 

There's a button to copy the SAS Studio code shown in screenshot (where cursor is) and when copied and pasted that way, the color remains.

 

Siarhei_B
Calcite | Level 5
Wow, it works! Thank you very much, kind sir. Somehow Copy + Paste doesn't work, but pressing the button "copy code" keeps the format and colors!
Emma_at_SAS
Lapis Lazuli | Level 10
Thank you, FNY! It took me some time to find the cursor, but I found it! After selecting a section of code the "cut code" and "copy code" options become active!
RichaTemple
Calcite | Level 5

Thank you so much! I was copying code into Google Docs and worrying how much time it would take to format the colors. All I had to do was highlight my code, click the Copy Code button in SAS Studio and paste regularly (Ctrl+V or Cmd+V). Hope this helps others with lots to format!

sas-innovate-2024.png

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.

 

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
  • 8 replies
  • 5824 views
  • 10 likes
  • 8 in conversation