BookmarkSubscribeRSS Feed
rasmuslarsen
Obsidian | Level 7

 

 

How to update/refresh script file?

 

This might be an XY problem: What I really want is to use VIM-keybindings in SAS, but this will probably never be possible (in interactive mode). The next best thing is to  use any other editor than the SAS editor, for example Sublime/Atom/Vim. 

 

The following is a possible workaround: Have the sas-program opened in both the SAS editor and for example the Sublime-editor. Edit the program in Sublime, save file in sublime, go to SAS and refresh/update the file, and then run a selection of the program. 

 

This, however, requires that SAS is able to refresh the program file. Is this possible? Further, I prefer that the cursor position is retained in the refreshed program.

 

Sublime can refresh and thus reload any changes made in SAS, but I don't know how to get SAS to reload any changes made in Sublime. 

 

 

Platform: SAS Base 9.3 on Windows 7.

 

 

13 REPLIES 13
rasmuslarsen
Obsidian | Level 7
Thanks 🙂 I already use keyboard macros, however they are only a small subset the features that Sublime/Vim offer 😕
See these links for info on what vim can do:
http://federicoramirez.name/why-vim-is-awesome/
https://stackoverflow.com/a/1220118/1831980

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yes, the enhanced editor was only enhanced back in V8 days, so it is old and not a good as pretty much any other ide out there.  If you want to use third party editors, depending on your install you could run directly through the editor of your choice, batch mode for instance.  There is no "refresh" in the SAS editor, you would need to re-load the file.  This is probably why most still use the embedded editor.  It would however be great to move out to a more plugin orientated approach, i.e. here is a plugin for your chosen IDE, but I don't see that happening.  As @Kurt_Bremser stated there are keyboard macros, and also something called abbreviations, but even things such as code completion and such like are not present.

Kurt_Bremser
Super User

Any IDE for code writers should take its cues from tools like the venerable Turbo Pascal IDE, that put your cursor on the offending source code when you had a syntax error during compiling or a runtime error. Compared to that, SAS IDE's are really lacking.

BrunoMueller
SAS Super FREQ

If you are using SAS Enterprise Guide and you modify the code outside of SAS, the editor in SAS Enterprise Guide will show you this:

Editor Reload

rasmuslarsen
Obsidian | Level 7
That's nice. It does not work for me however. I'm on SAS EG 5.1, what version are you using?
BrunoMueller
SAS Super FREQ

My SAS Enterprise Guide version: 7.13 HF5 (7.100.3.5486) (32-bit)

 

I do not know with wich version this was introduced.

 

QP
Calcite | Level 5 QP
Calcite | Level 5

Hi. thank you.

 I use the EG 7.1.   

Sometime SAS Enterprise Guide will show this.   But sometime SAS Enterprise Guide will not show this.  Is there any ways to let SAS EG show this everytime when I modify  the code outside of SAS?    Thank you so much.

 

BrunoMueller
SAS Super FREQ

Works for me every single time. My EG Version: 7.15 HF3 (7.100.5.6132) (32-bit).

 

 

Haris
Lapis Lazuli | Level 10

The update does not pop up every time for me either.  Can't tell what internal SAS EG logical rules govern the pop-up.  Seems like the program that receives the external edit needs to be open or needs to be changed internally without a save.  Otherwise, not all linked external SAS programs in an SAS EG project receive pop-up notifications. 

 

Our SAS EG Projects contain hundreds of linked external SAS programs.  They get used in stages: create datasets, run analyses, create reports, etc.  Only a small portion of the linked external SAS Programs get used at any given time depending on the stage of the project.  It makes sense that external edits are not flagged if they are done to the programs that have not been opened in the current SAS EG session.

 

I would like to have a thorough documentation on the logic of the pop-up appearance.  

 

Thanks SAS,

 

tbardet
Calcite | Level 5

I too would love to know if there is a way to configure the behavior of this popup as well as editor refreshing. I'm on EG 7.12 (7.100.2.3350) (64-bit). Can't find any settings through the GUI.

CaseySmith
SAS Employee

The "notification of external file changes" feature was initially added in EG 7.11 and has had some subsequent improvements since then.

 

Note: The feature works slightly differently depending on where your external file is stored, since it relies on the ability to detect a change in the last modified date of the external file.  When the external file is stored on (or in a location accessible by) the client file system, EG normally gets immediate notification of changes to the last modified date (via a file watcher), thus is immediately able to display the "file change notification" to the user.  However, when the external file is stored on a SAS server, EG does not get notified of changes to the last modified date.  Rather, EG has to explicitly re-check the last modified date, which it does when it receives focus and the external file is open in an editor.  This means the user will not get immediate notification if the external file is stored on the SAS server, but they should get notified when they "come back" or perform another operation.  (You will only get notification if the file that changes outside of EG is currently open in an editor inside of EG, which is by design and expected.)

 

Here is a related post (and link to paper) that talks about how you can use an alternative/preferred editor for writing your SAS code, then return to EG for submitting and organizing:

https://communities.sas.com/t5/SASware-Ballot-Ideas/Edit-programs-in-an-external-editor/idc-p/350560...

 

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

kgeter
Calcite | Level 5

I realize this is a very old, perhaps dead thread, but how about just do a one-line %INCLUDE to your .sas code file in the editor and run that? That would let you use whatever IDE you want.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 13 replies
  • 5895 views
  • 8 likes
  • 9 in conversation