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!
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!
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.
Will do that!
Many thanks to all for your help!
@alexal Do you have any say on SAS Studio features to support or add?
@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.
@alexal I meant: Do you have a way for this shortcoming to appear on the developers' radar?
@ChrisNZ I added it to the list here:
Not as good as the developers already working on it but a start at least.
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.
I want to believe I contributed to some of the VA additions
even though the evidence points to the simplest and most useful improvements
https://communities.sas.com/t5/SASware-Ballot-Ideas/Add-a-label-field-in-SAS-VA/idi-p/264042
being rejected.
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.
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:
Here is how it displays after I paste it in Word:
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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.