The SAS/C Editor (se)

se is the source-level editor that ships with the SAS/C Development System v6.58. It is a full-screen, multi-window, macro-extensible editor with an integrated AREXX interface. The NDK 3.2 examples and most third-party SAS/C code were developed in se. Source: Vol 1 Ch.4–7.

Starting the editor

se is invoked from the Shell or Workbench:

se [filename ...]                # open one or more files in windows
se +N filename                    # start with cursor on line N
se -a filename                    # load all lines into memory (no virtual paging)

Without arguments, se opens with an empty "Untitled" buffer. With multiple filenames, each gets its own window. Up to 16 windows can be open at once.

Status line

The bottom status line shows window state:

[name] [Ln N/M] [Col N] [W nn] [   * N]  [INS]  [MAC]
  • name — current buffer name (or * if modified)
  • Ln N/M — cursor line / total lines
  • Col N — cursor column
  • W nn — window ID
  • * N — marked block of N lines (if any)
  • INS / OVR — insert/overstrike mode
  • MAC — keystroke macro recording

Movement and editing

Standard movement keys work: arrow keys, Page Up/Page Down, Home/End, Ctrl+Home/Ctrl+End (top/bottom of file). Ctrl+L redraws the screen. Ctrl+G jumps to a specific line number.

Text entry follows the current mode (INS or OVR). Backspace/Delete remove characters; Ctrl+Y deletes the current line.

Marked blocks

Position the cursor, hold the left mouse button, drag to the end of the block, release. The marked block is shown in reverse video. Only one block can be marked at a time.

Operation Effect
Block → Delete Erase the block
Block → Copy Copy to cursor (file destination)
Block → Move Move to cursor (source cleared)
Block → Write Write to a file you name
Block → Print Print to PRT:
Block → Indent Shift block right
Block → Unindent Shift block left

Search and replace

Ctrl+F opens a search prompt. Ctrl+H does search-and-replace. The search string can be a literal or a wildcard pattern (#? matches any number of characters, ? matches a single character, [abc] matches any of a/b/c).

Multiple windows

se supports up to 16 windows. Each has its own buffer, cursor, and undo history. Window → Next cycles; Window → Pick opens a list to choose by number. Cutting or copying in one window and pasting in another moves text between buffers.

Buffers not associated with files (Untitled-N) must be saved explicitly or they are lost on exit.

Customizing the editor

Vol 1 Ch.6 covers the configuration system. Configuration is loaded from S:se.config (or the file named by the SE_CONFIG environment variable). The config file controls:

  • Key bindings (function keys, ARexx macros, accelerator keys)
  • Menu settings (custom pull-down entries)
  • Default modes (autoindent, word wrap, tab stops)
  • Load-time macros

se is normally configured by editing S:se.config directly. The format is KEY=COMMAND lines plus block-style menu definitions.

Useful config snippets

; Set tab stops to 8
TABS=8

; Bind Ctrl-S to save
^S=Save

; Autoindent on by default
AUTOINDENT=TRUE

; Word wrap at column 80
WORDWRAP=80

AREXX interface to se

Vol 1 Ch.7 documents the AREXX port. se registers an AREXX port named SE (the Workbench also uses SE for Shell, so the SAS/C port is sometimes REXX_SE or uniquely named in multi-port setups).

Opening the port

When se starts, it opens its AREXX port. External programs can address the editor by sending AREXX commands:

/* In an external AREXX script */
ADDRESS SE
'GETCOMMAND name="myfile.c" line=42'
'NEWWINDOW file="extra.c"'
'SAVECHANGED'

Built-in AREXX commands

A subset (full list in Vol 1 Ch.7):

Command Purpose
NEWWINDOW Open a new editor window on a file
CLOSEWINDOW Close the current window (prompts if modified)
GETCOMMAND Get the command name at a given file/line
GETLINE Read a line of source from the buffer
PUTLINE Write a line to the buffer
GETFILENAME Get the file associated with the current window
SAVECHANGED Save all modified buffers
COMPILE Run the compile command on the current file
RUNPROGRAM Execute an external program
GOTOLINE Move the cursor to a specific line
MARK Set the marked block
INSERT Insert text at cursor
DELETE Delete characters or a marked block

Compiler integration

The standard se.config defines ARexx macros that let you press a key to compile the current file and capture errors back into the editor — se parses the compiler output and positions the cursor on each error. This is the original "build-and-go" loop in the Amiga IDE tradition.

Key bindings summary

Key Action
Arrow keys Move cursor
Page Up/Down Scroll page
Home/End Start/end of line
Ctrl+Home/End Top/bottom of file
Ctrl+F Find
Ctrl+H Find and replace
Ctrl+Y Delete line
Ctrl+S Save (default config)
Ctrl+Z Undo
Ctrl+A Select / mark all (window content)
F1–F10 User-definable macros (default: empty)
Alt+F1–Alt+F10 User-definable macros (commonly used)
Esc Cancel current operation

Limitations

  • No syntax highlighting (added in MorphOS / third-party se forks, not in stock SAS/C 6.58).
  • No project-aware indexing — se knows individual files, not the build graph.
  • Macro language is keystroke-based, not a full programming language. AREXX is the recommended way to extend.
  • Buffer size limited by available memory (no virtual paging in default mode). Use -a to force full-file load for very large files.

See Also


Sources: SAS Institute Inc., "SAS/C Development System User's Guide, Volume 1" Ch.4–7, Version 6.50 (1993), pp. 41–82. Raw: raw/sasc/sasc-editor-extract.md Updated: 2026-10-02