Connect for the first time
- Run DataStep Studio: Check Setup. It finds Java and Python. If SASPy is missing, click Install SASPy.
- Run DataStep Studio: Add New Connection Profile → SAS OnDemand for Academics.
- Choose your home region (it is in the web address of SAS Studio, e.g.
euw1= Europe 1) and enter your user ID. - Click Connect Now and enter your password. It is asked once and kept in your computer's keychain.
- Open a
.sasfile and press F4.
Switch between SAS OnDemand and the company server
- Add a second profile: Add New Connection Profile → SAS 9.4 server (IOM) → host, port, user.
- Run DataStep Studio: Switch Connection Profile and pick the one you want.
The status bar shows the active profile. The next run connects with it.
Run only the step I am in
- Put the cursor in the step.
- Click Run Step in the title bar (the ▷ menu).
- Pick what to run: a single SQL statement, the whole PROC or DATA step, the macro call or the
%MACROdefinition.
Run everything up to here
Put the cursor on a line and press Ctrl+Alt+Up. Everything from the top down to that line runs; a step that contains the line runs completely.
Stop a program that runs too long
Click Stop SAS in the status bar (it appears while SAS runs). The running code stops, like Ctrl+Break in SAS. Your WORK data sets and macro variables stay.
Find out why the log is not clean
- Open the Suspicious Log tab, next to the SAS Log.
- It lists only the ERRORs, WARNINGs and NOTEs that matter (uninitialized variables, missing values generated, repeats of BY values …), from every run.
- Click a line: the cursor jumps to the statement that caused it.
Flag a NOTE our team does not accept
- Open the settings and search for
datastepStudio.log.suspiciousNotes. - Click Add Item and enter a pattern, for example
Table WORK\.\w+ created, with 0 rows.
A message you know is harmless goes into datastepStudio.log.suspiciousIgnore instead.
Look at the data set I just made
Press F12. Or double-click the data set in Libraries, or press Ctrl+Alt+D with the cursor on its name in your program.
Keep only two treatment arms in the data viewer
- Click a cell with one of the two arms, for example Drug 10 mg, in the treatment column.
- Press Ctrl+Alt+I: that value is ticked already. Tick the second, Drug 20 mg, with Space.
- Press Enter. The WHERE box now holds
trt01p IN ('Drug 10 mg', 'Drug 20 mg').
Ctrl+Alt+E keeps only the value of the cell; Ctrl+Alt+R shows all rows again.
Write a PROC SORT in five seconds
Type sort and press Tab: PROC SORT DATA=have OUT=want; BY usubjid; RUN;. Press Tab to jump from have to
want to usubjid and type over them. (With Professional, proc so + Enter also suggests your own data sets and
keys.)
Type a WHERE value without looking it up
Type WHERE paramcd = ' and the values of PARAMCD in your data appear, the most frequent first. (Professional)
Open the macro my program calls
Right-click the call (for example %derive_vars_dtm(...)) → Open Macro Definition / Included Program. Or
Cmd+click / Ctrl+click it. The file that defines the macro opens at its %MACRO line. On a %INCLUDE "file"
statement the same opens the included program.
Call my macro with all its parameters
Type % and the first letters of your macro (%deri for %derive_vars_dtm) and press Enter. The call is written
with every parameter and its defaults. Press Tab to go from value to value. (Professional)
Clean up a long macro call
Put the cursor in the call and press Ctrl+Shift+O: the parameters at their default disappear. Press it again: the call goes on one line. Ctrl+Shift+E shows every parameter again. (Professional)
Tidy up a messy program
Right-click in the program → Format SAS Program. Keywords go upper case, names lower case, two spaces per level, one statement per line. To format only a part, highlight it and press Ctrl+Shift+F. Changed your mind? Cmd+Z (Ctrl+Z) takes it back.
Comment out a few lines
Highlight the lines and press Ctrl+K (Mac: Cmd+K). Each line gets /* */. Press it again to remove them.
Bring my keyboard macros from SAS
- In the SAS Enhanced Editor: Tools → Keyboard Macros → Macros → Export. You get a
.kmffile. - In VS Code: DataStep Studio: Import Keyboard Macros from SAS (.kmf) and pick the file.
- Type a name in a program and press Tab.
Keep a piece of code I write again and again
- Highlight the code.
- Right-click → Save Selection as Keyboard Macro…
- Give it a name, for example
adslmerge. From now onadslmerge+ Tab writes it.
Run my whole study, program after program
- Name the programs in the order they should run:
01_adsl.sas,02_adae.sas, … - In the Explorer, right-click their folder → Run in Batch.
- Keep working. Each program runs in a fresh SAS session and gets its
.logfile next to it.
Debug a macro loop (Professional)
- Open the program with the macro and click the blue Debug Macro button in the title bar.
- In the call pane above the macro, fill in the parameters.
- Click in the margin of a line inside the loop to set a breakpoint. Right-click it → Edit Breakpoint… →
&i. = 5. - Click Start Debug. F5 runs to the breakpoint; the Variables tab shows the macro variables.
Look inside a macro while it runs (Professional)
- Write
%pry(when=&i. = 3)on its own line inside the macro, where you want to look. - Run the program as always (F4). The run stops there, and the SAS Pry terminal opens.
- Type
lsfor the macro variables,vt work.mydataandfreq sexfor a data set as it is now. - Type
nto go on one line (Enter repeats it),cto go on to the end. - To try code there: type
edit, write the code in the editor that opens (autocomplete works), press F4.
Find the step that breaks a long run (Professional)
- Write
%pry(rescue=Y)on its own line after the part that fails, for example at the end of the macro. - Run as always (F4). The run stops right after the first step with an ERROR, before the next one.
- The SAS Pry terminal shows the ERROR. Type
lsandvtto see the macro variables and the data of that moment. - Fix the program, then type
!!!to end the run, orcto let it go on.
Add warning=Y to stop at the first WARNING too.
Go through a program step by step (Professional)
- Write
%pryon its own line before the step where you want to start, between two steps. - Run as always (F4). Everything before it runs, then the program waits.
- Type
nextto run the next step and wait again; press Enter to do it once more. Look at the data withvtin between. - Type
cto run the rest.
Watch a DATA step work (Professional)
- Put the cursor in the DATA step and click Debug DATA Step in the title bar (or press F5).
- Press F10 to run one statement at a time. The Variables view shows every variable.
- To stop at one observation, give a breakpoint a condition, e.g.
usubjid = "TEST12".
Change LINESIZE (or any system option)
- Open the Options tab and click 🔍.
- Type
linesize, press Enter, type the new value, press Enter.
The row now shows (changed, was 132); ↺ puts the old value back.
Give a command my own key
Press F9 to open Keys. Click + next to the command and press the keys. ↺ puts the default back.
Keep my layout
Arrange the SAS tabs as you like, then type WSAVE ALL in the SAS command box (Ctrl+Alt+C). The same tabs open
the next time SAS connects.
Keep my programs on my computer and run them on SAS OnDemand
Nothing to do: open the folder in VS Code and press F4. Before each run DataStep Studio copies the changed files of
your project to the server and runs the program there, so %INCLUDE and LIBNAME with relative paths work. Use Git
as usual on your computer.
Work directly on files on SAS OnDemand
Run DataStep Studio: Open SAS Server Folder. A window opens on your SAS OnDemand home: open, edit and save server programs as if they were local. To copy a folder there, drag it from Finder or Windows Explorer onto a folder in that window.
Copy programs to the server, or fetch logs and outputs (Professional)
- Run DataStep Studio: Open File Manager: your computer is on the left, the SAS server on the right.
- Go to the folders you need on both sides: arrow keys, Enter to open, Backspace to go up, Tab to change
sides.
Ctrl+L(Cmd+L) lets you type a folder;~is your home folder. - Mark the files with Space (or
Ctrl+A/Cmd+Afor all). - Press F5 to copy them to the other side, or F6 to move them. Enter confirms.
Dragging files to the other side works too. A name that exists there is asked about first.
See which edition I have
Run DataStep Studio: License and Edition. During Early Access it says Community Early Access: all Professional features are free.