BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
pmbrown
Quartz | Level 8

has anyone successfully got something like these vim functions to work ie to run your code and scan the log from vim?

http://www-personal.umich.edu/~knassen/vim/sasfns.html#LoadSASLogList

 

i run into many problems, including this:

https://stackoverflow.com/questions/19205572/vim-function-system-invalid-argument

 

i have tinkered with it a lot and gotten nowhere. Things would be a lot easier if i was using linux, but i'm stuck with windows. cheers

1 ACCEPTED SOLUTION

Accepted Solutions
pmbrown
Quartz | Level 8

don't brag, we are all old here 🙂 i have been using sas for decades too

 

is it possible to move this thread from programming/developers to sas programming?

 

in the end i abandoned vim fuctions (for now) and just mapped a shortcut for command, like this: https://jiangtanghu.com/blog/2011/11/13/vim-as-a-sas-ide/ but i needed to tweek it eg https://communities.sas.com/t5/Administration-and-Deployment/sas-is-not-recognized-as-an-internal-or... 

View solution in original post

17 REPLIES 17
AlanC
Barite | Level 11

Windows has Linux embedded easily. Just use the built-in Linux. Better yet, use PowerShell and do whatever you want.

 

One example here (but you can do it in other ways too). Heck, you can also run a VM in Windows (free) and just install your own Linux distro:

 

How to run Linux Commands on Windows 10? - GeeksforGeeks

 

You can also run your phone apps in Windows. 

https://github.com/savian-net
AlanC
Barite | Level 11
You can also install vim directly: https://www.w3schools.io/editor/vim-install/#:~:text=How%20to%20run%20and%20open%20vim%20editor%20fr....

I have analyzed the SAS log extensively. Like a lot. I have pulled out most info from it available. You can see screenshots here: https://www.postsas.com/SaviApp/SaviAppScreenshots

100% did not use vim. You can get what you need using regex. Use whatever language desired. I use C# but you can also use PowerShell and chain commands or just run a PowerShell script. It is very easy to do.
https://github.com/savian-net
pmbrown
Quartz | Level 8

thanks for this. Unfortunately it's a company computer, i can't do the things you describe, if i had that much freedom i would just use linux

 

I have vim installed (to my user folder), the problem is runnig sas code from vim, i don't want to step in and out of vim to run code etc

 

cheers

AlanC
Barite | Level 11

Let's be realistic, vim is old. You need a function that does x,y,z. Don't choose the technology, decide on the business need. If you need to search text, use SAS regex functions or call out to something that can do it like PowerShell or use C# which can do everything vim does (easily). You should also be able to do it in Python or a host of other options.

 

Also, look at PowerShell core which can run w/o installation. PowerShell should be able to do everything vim does except for some edge cases.

 

vim may be comfortable but branch out and what you need can be done w/o worrying about vim. There are much, much better alternatives today than 20-30 years ago. 

https://github.com/savian-net
Tom
Super User Tom
Super User

@pmbrown wrote:

has anyone successfully got something like these vim functions to work ie to run your code and scan the log from vim?

http://www-personal.umich.edu/~knassen/vim/sasfns.html#LoadSASLogList

 

i run into many problems, including this:

https://stackoverflow.com/questions/19205572/vim-function-system-invalid-argument

 

i have tinkered with it a lot and gotten nowhere. Things would be a lot easier if i was using linux, but i'm stuck with windows. cheers


What is the problem you are trying to solve exactly?
Are you running PC SAS, that is do you have a full installation of SAS on your computer?  If so then why not just use the editors that are part SAS Display Manager instead of trying to use ancient VIM editor?

Is SAS running remotely?  Do you have access to SAS/Studio to interface with it?

pmbrown
Quartz | Level 8

" If so then why not just use the editors that are part SAS Display Manager instead of trying to use ancient VIM editor?"

 

i can see it is hard for non vim users to appreciate why someone wants to use vim, but i don't want to get into that, let's just say vim is very powerful etc etc

 

anyway, this looks promising: https://github.com/exaatto/vim-sas

AlanC
Barite | Level 11
BTW, Visual Studio Code has a vim extension with about 4.5M installs. Why not use that? There are also SAS extensions and VSCode installs w/o the need for an admin account so it can run standalone.
https://github.com/savian-net
pmbrown
Quartz | Level 8

the vim extensions are never good. i used the vim extension for sublime for a while, in the end they are always a poor approximation. i wouldn't go near vs code, each to his own

SASKiwi
PROC Star

@pmbrown  "i wouldn't go near vs code" - Well VS Code is the only third-party IDE supported by SAS with SAS-supplied extensions

 

pmbrown
Quartz | Level 8

i realise it's hard for non vim users to understand why some ppl use vim, but here is someone trying to explain it:

"My preference for emacs boils down to the fact that it doesn't force me to use a mouse. A mouse is a pseudoanalog device that suffers from all the control-theory anomalies like overshoot and oscillation, plus lack of haptic confirmation. Using the mouse forces my hands off the home row, forces my eyes off my cursor (to the target of a gesture). The mouse and all its control-theory ephemera are a source of sheer agony. They cause me to hate my computer and to tire quickly from any use of it. Emacs, however, lets me focus my mind, keep my hands in an efficient pose, lets me look at my work, gives me digital feedback (press a physical keyboard button, see a result, no overshoot and oscillation) and enables longer hours in a state of pleasant flow. It's not Emacs specifically, but any computer tool that helps me avoid mousing. Along with mousing goes all those proprietary binary formats for documents: anything but ASCII (or, begrudgingly, UTF-8) must be banned. Long-live Emacs, org-mode, org-table, org-babel, LaTeX, git, and everything that can be represented in plain text. There is a special ring in Dante's inferno for the inventor of the mouse and for the legions of GUI designers that built all the World's software around it.https://old.reddit.com/r/emacs/comments/r1s3k2/lex_fridman_and_neal_stephenson_talking_about/

 

no one is asking anyone to agree, this is just how some people feel

SASKiwi
PROC Star

@pmbrown - I appreciate your opinion and each to their own.

 

Please be aware that SAS 9.4 is now in maintenance mode and in the process of being superceded by SAS Viya. Full support of SAS 9.4 ends in 2025, unless you upgrade to SAS 9.4M8 due out shortly. So your vim - SAS 9.4 interface has a limited lifespan. VS Code works with SAS Viya and I guess other IDEs might be supported in the future, maybe even one where a mouse isn't essential...

pmbrown
Quartz | Level 8

thanks a lot for the info. The vim solution should work with the 9.4 upgrade though? I would move to R to be honest, i love sas and have been using it forever, but i would switch in 2025 if i had to. A lot of the branding sas is doing now is putting me off, 'advanced analytics' etc

SASKiwi
PROC Star

@pmbrown - Correct, the SAS 9.4 M8 upgrade is essentially a maintenance release without major changes and vim should still work with it.

AlanC
Barite | Level 11

The vim extensions are also regularly updated so things may have changed. To outright dismiss VS Code, free and open source, is amazing to me. Even a lot of noMS people use it including a lot of devs outside of the MS ecosystem (python is an example). Powershell is open source, C# is open source, on and on. All run on Linux and Macs.

 

If people don't want the suggestions, they will just have to muddle away. As a SAS consultant for decades, and the former MS consultant at SAS, I have faced a LOT of anti-MS sentiment. Even when proven wrong, again and again, they hate MS like it was the 1990s, not the modern MS. 

 

Good luck with your vim problem. Nothing I can offer. I would probably have more sympathy for ISPF but each to their own.

 

https://github.com/savian-net

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 54840 views
  • 6 likes
  • 4 in conversation