SAS DM - Getting Rid of the Results Tab - configuration

I'm looking for a way to get rid of the Results Tab, keeping only the Explorer Tab which can itself display the results. However, WSAVE ALL doesn't "remember" that configuration detail, and even when I manually close it, it keeps showing up again every time I run a procedure which generates results.
Thanks

After struggling for a while for the WSAVE ALL command, which I cannot get to work. I read the second part of your question. Results can be disabled by altering the Output Delivery System (ODS) settings in SAS. ODS is too broad to cover in full here, but the two statements to run are:
ods results off; /* Stops results being generated */
ods listing; /* Turns on the old-style listing so you can see the output */
/* print a sample */
proc print data=sashelp.class;
run;
To automate this for your session, you can add these statements to your autoexec.sas file, or there may be options you can add to the sasv9.cfg files, find the locations for these by running:
%put %sysfunc(getoption(config));
At any point you can reverse the behaviour by running:
ods results;
ods listing off;

I found what seems to be a durable solution. Here are the steps to follow:
Activate the Explorer pane. Go to Options > Tools > Explorer... and under the General tab, make sure Results is checked (by default, it is not).
In your autoexec.sas file, inclure the following line:
dm "odsresults; cancel";
Restart SAS
Et voilĂ !
The Results pane is now gone, and the results will appear as usual in a Results Viewer window with the items listed directly in the Explorer Window (turn on the tree view to easily access both your libraries and the output items. Use WSAVE ALL in the commands window for SAS to remember that configuration).
Note 1: Under Windows, the autoexec.sas file can be saved in the %userprofile% directory.
Note 2: To get rid of the obsolete Output window when using only ODS-style outputs, add this line to autoexec.sas:
dm "Output; winclose";

Related

Can you set an artificial starting point in your code in Octave?

I'm relatively new to using Octave. I'm working on a project that requires me to collect the RGB values of all the pixels in a particular image and compare them to a list of other values. This is a time-consuming process that takes about half a minute to run. As I make edits to my code and test it, I find it annoying that I need to wait for 30 seconds to see if my updates work or not. Is there a way where I can run the code once at first to load the data I need and then set up an artificial starting point so that when I rerun the code (or input something into the command window) it only runs a desired section (the section after the time-consuming part) leaving the untouched data intact?
You may set your variable to save into a global variable,
and then use clear -v instead of clear all.
clear all is a kind of atomic bomb, loved by many users. I have never understood why. Hopefully, it does not close the session: Still some job for quit() ;-)
To illustrate the proposed solution:
>> a = rand(1,3)
a =
0.776777 0.042049 0.221082
>> global a
>> clear -v
>> a
error: 'a' undefined near line 1, column 1
>> global a
>> a
a =
0.776777 0.042049 0.221082
Octave works in an interactive session. If you run your script in a new Octave session each time, you will have to re-compute all your values each time. But you can also start Octave and then run your script at the interactive terminal. At the end of the script, the workspace will contain all the variables your script used. You can type individual statements at the interactive terminal prompt, which use and modify these variables, just like running a script one line at the time.
You can also set breakpoints. You can set a breakpoint at any point in your script, then run your script. The script will run until the breakpoint, then the interactive terminal will become active and you can work with the variables as they are at that point.
If you don't like the interactive stuff, you can also write a script this way:
clear
if 1
% Section 1
% ... do some computations here
save my_data
else
load my_data
end
% Section 2
% ... do some more computations here
When you run the script, Section 1 will be run, and the results saved to file. Now change the 1 to 0, and then run the script again. This time, Section 1 will be skipped, and the previously saved variables will be loaded.

Function to open a file and navigate to a specified line number

I have the output of recursive grep (actually ag) in a buffer, which is of the form filename:linenumber: ... [match] ..., and I want to be able to go to the occurrence (file and line number) currently under the cursor. This told me that I could execute normal-mode movements, so after extracting the file:line portion, I wrote this function:
function OpenFileNewTab(name)
let l:pair=split(a:name, ":")
execute "tabnew" get(l:pair, 0)
execute "normal!" get(l:pair, 1) . "G"
endfunction
It is supposed to open the specified file in a tab and then do <lineno>G, like I am able to do manually, to go to the specified line number. However, the cursor just stays on line 1. What am I doing wrong?
This question, by title alone, would be an exact duplicate, but it talks locating symbols in other files, while I already have the locations at hand.
Edit: My mappings for grep / ag are as follows:
nnoremap <Leader>ag :execute "new \| read !ag --literal -w" "<C-r><C-w>" g:repo \| :set filetype=c<CR>
nnoremap <Leader>gf ^v2t:"zy :execute OpenFileNewTab("<C-r>z")<CR>
To get my grep / ag results, I put the cursor on the word I want to search and enter <leader>ag, then, in the new buffer, I put the cursor on a line and enter <leader>gf - it selects from the start up to the second colon and calls OpenFileNewTab.
Edit 2: I'm on Cygwin, if it is of any importance - I doubt it.
Why don't you set &grepprg to call ag ?
" according to man ag
set grepprg=ag\ --vimgrep\ $*
set grepformat=%f:%l:%c:%m
" And then (not tested)
nnoremap <Leader>ag :grep -w <c-r><c-w><cr>
As others have said in the comments, you are just trying to emulate what the quickfix windows already provides. And, we are lucky vim can call grep, and it has a variation point to let us specify which grep program we wish to use: 'grepprg'.
Use file-line plugin. Pressing Enter on a line in the quicklist will normally open that file; file-line will make any filename of the form file:line:column (and several other formats) to open file and position to line and column.
I only found this (old) thread after I posted the exact same question on vi.stackexchange: https://vi.stackexchange.com/q/39557/44764. To help anyone who comes looking, I post the best answer to my question below as an alternative to the answers already given.
The gF command, like gf, opens the file in a new tab but additionally it also positions the cursor on the line after the colon. (I note the OP defines <leader>gf so maybe vim/neovim didn't auto-define gf or gF at the time this thread was originally created.)

How to set empty file description using AutoItWrapper?

When I add this wrapper directive it changes the description field of my executable. But when I leave it empty (or omit the directive) its value defaults to Aut2Exe.
#AutoIt3Wrapper_Res_Description=
How can I change this behavior? Is there a parameter for AutoIt3Wrapper.exe that leaves it empty? This is the compile command executed by SciTE:
"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /in "C:\...\myscript.au3" /console
Looking at the AutoIt3Wrapper source code, which is provided in the installation, the following line (line 2326 in my installation) reads:
If $INP_Description = "" Then $INP_Description = FileGetVersion($AutoItBin, "FileDescription")
I believe that to be the source of the Aut2Exe description.
How to force the description to be blank is a bit trickier. The quick and easy hack is to have a script that runs after compilation that removes the description, I usually have reshacker somewhere to hand for tasks like this.
Long term, I will put the issue to the developer, as it seems strange to set a description when the user has explicitly left it blank.

Can you delete a range of lines in sublime text2?

Say I want to delete lines 5000 - 9000 in a large data file. Can I delete a range of lines easily?
Check out the LineJumper plugin. It's marked in Package Control as ST3-only, but it should work fine with ST2, only you'll have to git clone the repository into your Packages directory. Once you've done that, open Packages/LineJumper/LineJumper.sublime-settings and edit the "number_of_lines" argument to the number of lines you want to select (in this case, 4000). Save the file, then hit CtrlG and type in 5000 to jump to line 5000. Next, hit AltShift↓ to jump down 4000 lines, selecting them all. Finally, hit Delete and you're all set. The plugin could probably be modified to open a popup to enter the lines to be selected, if you don't want to edit the .sublime-settings file every time you want to select a large block of text, but I'll leave that as an exercise for the reader :)
The manual answer with no plugins.
Cut from the first location (e.g line 5000) to the end of the file
Paste this into another/new window
Find the second location (e.g. line 4000 (=9000-5000))
Cut from here to the start of the file
Cut everything that is left and paste it back in the first file at the end.
This is easier than scrolling from start to finish of large sections you want to remove, and the effort does not depend on the size you want to remove (but it's still not fully satisfying...).

EMACS find-grep command switching windows

I have the following in my .emacs
(defun find-in-workspace(term)
(interactive "sSearchInWorkspace: \n")
(grep-find (concat "grep -rnH --include=\*.{c,cpp,h} --include=-e '" term "' /home/workspaces/*")))
which is just a wrapper around grep-find so that it can search all the files in my workspace.
My problem is with the grep buffer. I would like to keep my cursor in the grep buffer's window when I select items from it so that I can quickly browse through the code, but selecting a line will automatically moves my cursor to the other window, which adds up in keystrokes when I have a list of over 5 items. Is there anyway I can build this functionality into this function, or change a setting for grep-find? I've been searching but haven't found a solution.
See the functions next-error and previous-error. They leave the grep buffer, but they work from anywhere, so, for example, if you bind next-error to a convenient a key then you can keep pressing it and it will iterate over the grep buffer.
There might be some options of grep behavior, that you might find if you dig in the lisp/progmodes/grep.el from the source, but I really think it might be better and easier to have a look of GrepPlus library which bring many enhancement of emacs grep.
Otherwise you could also use occur and see how you could customize it. In occur, when you are in the match buffer, you can it C-o instead of Ret, which will show in the other buffer the match you selected, keeping your cursor in the match buffer. Difference with grep, is that it only works with opened buffer. I'm rather sure grep+ might have the equivalent. You should have a look
There are two functions for doing exactly what you want: previous-error-no-select and next-error-no-select.
Also, you may find useful next-error-follow-minor-mode.