BookmarkSubscribeRSS Feed
Sou1
Fluorite | Level 6

Hi,

 

I have been working with SAS 9.4 software and now I am working with SAS studio. With SAS 9.4 it was very easy to "copy and paste" the SAS code to a word document because it keeps the format of SAS (colours, etc.) however I wasn't able to do it with SAS studio, is there any trick to do that simple task keeping the SAS format?

 

Many thanks!

 

 

17 REPLIES 17
Reeza
Super User

Are you using Paste Special or Paste?

Had a chance to test that, doesn't work in my two second test. I had to use the right click code, select and paste special. Even when selecting source formatting the colour was lost. 

That's definitely annoying as heck. 

 

One, long, workaround is to paste it into a different editor that does maintain the formatting and then into Word. 

NotePad++ and VisualStudio both have extensions to color code your SAS programs. 

 


@Sou1 wrote:

Hi,

 

I have been working with SAS 9.4 software and now I am working with SAS studio. With SAS 9.4 it was very easy to "copy and paste" the SAS code to a word document because it keeps the format of SAS (colours, etc.) however I wasn't able to do it with SAS studio, is there any trick to do that simple task keeping the SAS format?

 

Many thanks!

 

 


 

Sou1
Fluorite | Level 6
Many thanks! It's really easy to import the results but the code loses all its format! I'll try that.

Thanks!
mkeintz
PROC Star

You can do a two-stage copy/paste as mentioned elsewhere - copy from sas/studio to SAS Universal Viewer (download from here) and from the viewer to word.

 

The viewer will re-institute the formatting (looks the same as pc-sas program formatting), and the subsequent paste to word will preserve colors.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Sou1
Fluorite | Level 6

Will do that!

 

Many thanks to all for your help!

ChrisNZ
Tourmaline | Level 20

@alexal Do you have any say on SAS Studio features to support or add?

alexal
SAS Employee

@ChrisNZ ,


I've never tried to copy anything from the SAS Studio to Word. I've tried to copy SAS code from SAS Studio running on 9.4 M6 and SAS Viya 3.5, both of them didn't keep text style. Also, I've tried to copy the code from EG 7 and 8 and they do keep text style.

ChrisNZ
Tourmaline | Level 20

@alexal I meant: Do you have a way for this shortcoming to appear on the developers' radar?

Reeza
Super User

@ChrisNZ I added it to the list here:

https://communities.sas.com/t5/SASware-Ballot-Ideas/Enhance-copy-and-paste-options-from-SAS-Studio/i...

 

Not as good as the developers already working on it but a start at least.

ChrisNZ
Tourmaline | Level 20
Yes. A clearly marked tombstone in a graveyard allows to at least not forget all these wonderful ideas. ;)Maybe that's a bit harsh.
Reeza
Super User

I'd say it's harsh since that hasn't been the pattern in the past few years. The recent ones are more monitored and they are marking them as planned or not considered and updating when they implement it. 

 

I do think they should blow away anything older than a few years though, otherwise it does become a graveyard for sure. 

ChrisNZ
Tourmaline | Level 20
Newer does not mean better. Like #219458 .Maybe look at the top rated ones first instead? I am sure there are nuggets in that 1100-odd list.Had a look at the 78 implemented and it's almost all VA. The EG ones were mostly "already there" rather than "added". I made dozens of suggestions there and I am not optimistic as you can see.
Kurt_Bremser
Super User

I played around a little. This is an issue in the SAS Studio applet running in the context of the browser, as it does not send the coloring of the code to the clipboard. Other colored text (e.g. the log) is sent with the coloring when doing Copy from the same browser (in my case Safari on a Mac). Only the text in the code tab is copied black-and-white.

BrianGaines
SAS Employee

Hi @Sou1,

 

Which version of SAS Studio and which browser are you using?

 

I am able to copy code from SAS Studio and paste it in Word with the syntax highlighting intact, but only if I use Chrome and only if I copy the code using the "Copy code" icon on the editor's toolbar, which is highlighted in this screenshot:  

 

copyToolbar.png

Here is how it displays after I paste it in Word:

copyWord.png

 

This works for me in both SAS Studio 3.6 and SAS Studio 3.8.  It does not work for me if I use the CTRL+C shortcut or if I right click --> Copy.  It also does not work for me if I use Firefox instead of Chrome.  So the workaround is a little specific, but it at least avoids the need to have an intermediate copy/paste step.

 

Does this work for you?

 

-Brian

sas-innovate-2024.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

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
  • 17 replies
  • 7821 views
  • 5 likes
  • 9 in conversation