BookmarkSubscribeRSS Feed
Nietzsche
Lapis Lazuli | Level 10

Is there a way to copy codes from SAS Studio without losing formatting? I am able to do that in other IDE such as Pycharm.

 

This is important for me because I make Anki flash cards and I prefer to have the formatting (especially font colour) so I can see the keywords in the syntax.

 

Nietzsche_0-1670018840922.png

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
17 REPLIES 17
SASKiwi
PROC Star

AFAIK, the colour coding in the SAS editor uses proprietary functionality provided by SAS. Having said that a SAS IDE using VS Code is now available and that may be a path to retaining the colour formatting. Unfortunately only SAS Viya is currently supported but that might change in the future.

 

BTW screenshots are a common way of retaining an exact look of the original application as you have demonstrated in your post.

Nietzsche
Lapis Lazuli | Level 10

yes I know screenshot will work but I need to the code to exist in Anki so I can easy copy the code back into sas studio if I need it.

 

plus screenshot will make my anki collection file size unnecessarily large.

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Tom
Super User Tom
Super User

Why do you need the color?  Remember the coloring is just SAS Studio's GUESS as to what the code is.  SAS itself might interpret the code differently than the coloring that the SAS Studio editor attached.  Especially if the code is using an macro logic.

Nietzsche
Lapis Lazuli | Level 10

just makes it easier to read.

 

If you're reviewing 100+ cards a day in anki, trust me, the colour in the codes help a lot then a lines of black text

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
SASKiwi
PROC Star

When I copy SAS code from EG's SAS editor to MS Word or Outlook colour coding is retained. I'm thinking this is RTF formatting. Try copying to MS Word and then to Anki. Not sure if SAS Studio works the same.

Tom
Super User Tom
Super User

I think the color formatting in the "Enhanced" Editor in Display Manager running on Windows does copy.  At least when pasted into WORD.

 

Tom_1-1670025054642.png

 

Tom_0-1670025038049.png

 

Nietzsche
Lapis Lazuli | Level 10

To use EG, I need to be on work computer since it is prohibitively expensive for almost everyone to use at home. My only option right now is SAS Studio.

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Tom
Super User Tom
Super User

You can just install Visual Studio Code (open source editor) and install one of the SAS extensions.

 

Tom_0-1670041095602.png

Tom_1-1670041145920.png

 

 

Nietzsche
Lapis Lazuli | Level 10

nice. 

 

Which extension did you install? There are a few versions.

Nietzsche_0-1670042298806.png

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Nietzsche
Lapis Lazuli | Level 10

Just installed one of the extension, I still need the SAS engine to use SAS tho.

 

Don't you need the underlying SAS Engine installed to use VS Code?

 

If I haven't made it clear before, I don't have SAS or SAS viya installed on my computer because it is very expensive for an individual like me to use at home. Which is why I am using SAS studio for free on SAS OnDemand.

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
SASKiwi
PROC Star

To run the code, yes. No if you are just editing. If you want to run it, just copy it over to SAS Studio.

Nietzsche
Lapis Lazuli | Level 10

To run the code, yes. No if you are just editing. If you want to run it, just copy it over to SAS Studio.

 

Are you able to use SAS theme in VS Code without SAS engine? Have you actually tried it or you're just guessing?

 

Because after I installed the extension for SAS in VS Code, the first thing I need to do is to change to SAS engine before you can select theme as instructed.

Nietzsche_0-1670053588487.png

 

I have tried the other extension, but this extension SAS-Syntax has the most downloads and rating.

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Tom
Super User Tom
Super User

Yes.  It is using the highlighting and I cannot use the execution engine since it only supports Viya (why???)

Nietzsche
Lapis Lazuli | Level 10

@Tom 

I have tried the official extension by SAS institute, one by Venkata Paruchuri and the one by 77qingliu.

None of them worked.

I think I def need the underlying SAS engine installed and working before syntax highlighting will work in vs code.

 

If you got syntax highlight working without SAS engine in VS code, can you tell me which exact extension you used? 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 17 replies
  • 3641 views
  • 4 likes
  • 4 in conversation