Customizing the SAS Windowing Environment : Customizing Cut-and-Paste Operations (2022)

Chapter ContentsPreviousNext

SAS Companion for the OpenVMS Operating Environment

The SAS interfaceto Motif uses the SAS concepts of marks and the paste buffer to provide thenormal X Window System cut-and-paste behavior. The mark defines and highlightsa region of text. The paste buffer retains a collection of text lines. Inthe SAS System, you must associate marks with a paste buffer by issuing acommand such as STORE or CUT. This is different from other X applications,in which marks and paste are generally synonymous with each other.

You can do any of the following tasks with a markedarea of text in many SAS windows:

  • delete the text.
  • delete and retain the text in a pastebuffer.
  • search the text for words or phrases.
  • store the text in a pastebuffer.
  • use the text in an application such as SAS/CALC softwareto define a set of values that are operated on by a specified command.
  • submit the marked textonly.

Usually, a mark defines the text to be operated on bya STORE or CUT command that places the text into a named SAS paste buffer.

The default definitions enable you to cut and pastebetween the SAS interface to Motif and other X window clients or between theSAS interface to Motif and the XPRIMARY buffer in OpenVMS.

The following sections explain the parameters that areassociated with cut-and-paste operations and their default definitions. Youcan use these parameters to customize cut-and-paste operations on your system.

Marking Text

TheSAS System supports the character mark and the block mark. The behavior ofthe character mark resembles text marking in most X Window System terminalemulators. The range of the character mark spans whole interiorlines between the starting point and the ending point of the marked text.Interior lines are those that are between the lines containing the startingpoint and the ending point. By contrast, a block mark is a rectangularregion that includes one corner at the starting point and one corner at theending point of the mark.

The SAS interface to Motif supports two methods of markingtext. One method uses the MARK command. The other method uses the mouse toclick and drag; the marks that are generated by this second method are called drag marks.

Using the MARK Command to Mark Text

TheMARK command establishes a mode in the SAS window that lasts until you issueanother MARK command.

Position the cursor by clicking at the beginning ofthe text that you want to mark. Issue the MARK command. Then, move the cursorto the end of the text that you want to mark and click. Issue the MARK commanda second time. Before you issue the second MARK command, the end point changesas you move the window's text cursor by using the keyboard arrow keys, tabbing,clicking the mouse, or scrolling through the window's contents. Mark highlightingalso changes as you change the cursor position.

You can issue the MARK command from the command line,or you can assign it to a function key. If you want to select a rectangularblock of text instead of a string of text, add the BLOCK argument to the MARKcommand. With the MARK command, you can select more than one area of textin the same window at the same time. To unmark the selected text, issue theUNMARK command.

Using the Mouse to Mark Text

You can alsouse the mouse to select text by clicking and draggingthe left mouse button (MB1) inside the SAS window. You can use keyboard modifiersto change the behavior of the marking. When you end a drag mark by releasingMB1, the SAS System performs an end-of-mark action that may generate a STOREcommand to save the contents of the mark into a SAS paste buffer. This featureis controlled by the SAS.markPasteBufferresource. You can clear marks in a SAS window by clicking MB1 inside the SASwindow or by starting a new drag mark in the SAS window.

The SAS interface to Motif supports the following mousebutton behavior:

MB1 press and move
makes a SAS character mark starting at thepoint where the mouse button is depressed and marks an area with the mouse.The area that you mark is highlighted. Release MB1 to complete the mark.

Note:Any existing marks in the same window are deleted whenyou press MB1.Customizing the SAS Windowing Environment : Customizing Cut-and-Paste Operations (4)

MB1 press and release
frees existing drag marks in the windowexcept those that were created by the MARK command. You can use MB1 to positionthe text cursor inside a SAS mark.
MB2 press
generates a PASTE command at the locationof the click, using the SAS.markPasteBuffervalue as the name of the paste buffer if the resource is defined. If SAS.markPasteBufferis not defined, press MB2 to generate a PASTE command with BUFFER=DEFAULT.

There are threemodifier keys that may be used in conjunctionwith MB1 to produce the following results:

Unmodified
character mark and end-of-mark action
Shift
extend mark and end-of-mark action
CTRL
block mark and end-of-mark action
Mod1
alters end-of-mark action to the oppositeof normal behavior.

The normal end-of-mark action depends on the settingof the SAS.markPasteBufferresource. If this resource is defined, the normal action is to generate aSTORE BUFFER=<name> commandto store the newly created mark to the named paste buffer. If this resourceis not defined, the normal action is to suppress the generation of the STOREcommand; the marked area remains highlighted.

Paste Buffers

SAS paste buffers are named objects that retain a copy of selected text. Eachbufferis identified by a name of up to eight characters; the name is not case sensitive.Most commands operating on a SAS paste buffer support the BUFFER= optionthat enables you to identify the paste buffer. This paste buffer name directsthe SAS interface to Motif to interact with the standard X inter-client dataexchange mechanisms.

Paste buffers that are not associated with an X inter-clientmechanism are called local paste buffers because their contentsare known only within the scope of the SAS session. Paste buffers associatedwith X inter-client data exchange mechanisms are called extended pastebuffers.

The SAS interface to Motif enables you to use X cutbuffers and X selections to exchange information with other X clients. Thepaste buffer name determines whether the buffer has extended semantics inthe context of the X data exchange mechanisms. The following list describespaste buffer names and their associations:

XPRIMARY
is the paste buffer associated with theX primary selection (PRIMARY).
XSCNDARY
is the paste buffer associated with thesecondary selection (SECONDARY).
XCLIPBRD
is the paste buffer associated with theclipboard selection (CLIPBOARD). This paste buffer allows you to use the MITX Consortium xclipboardclientwith the SAS System.
XTERM
is the paste buffer associated with theexchange protocol used by the xterm client. XTERM is the defaultbuffer. DEFAULT is an alias for XTERM. If you copy or cut text into the XTERMbuffer, the text is actually copied or cut into all four of the past buffers.When you paste text from the XTERM buffer, the text is pasted from the XPRIMARYbuffer.
XCUTn
is the paste buffer associated with theX cut buffer n, where the range of n is 0 to 7.

You can use an alias toassociate the DEFAULT pastebuffer to another SAS paste buffer name. In this way, operations that wouldotherwise occur in the context of the local DEFAULT paste buffer can use apaste buffer that is specific to X. This is most useful in the context ofSAS menu operations that generate explicit STORE, CUT, and PASTE commandsthat make use of the DEFAULT paste buffer. Use the SAS.defaultPasteBufferresource to define an alias for the DEFAULT paste buffer.

Resources can be defined to associate SAS paste bufferswith the X11R5 version of xterm, a terminal emulator client based on X. Todefine an alias that associates the SAS DEFAULT paste buffer with the XTERMpaste buffer, declare the following X resource for the SAS application:

SAS.defaultPasteBuffer: XTERM

Defining an alias that associates the DEFAULT pastebuffer with the XTERM paste buffer enables you to copy and paste text betweenxterm windows and SAS windows. You can select the range of text in the xtermwindow with MB1 and use MB2 to paste the text into the SAS window. You canuse MB1 to select a range of text in a SAS window and use MB2 to paste thetext into an xterm window. When marked text in the SAS System is stored toa SAS paste buffer, the mark is released, and the text highlighting clears.This behavior is different from most X clients, in which the highlightingis retained as long as the client continues to own the associated X selection.

When one SAS session communicates with another SAS session,the text and the original text attributes, such as color, are preserved wherepossible when transfers are made via an X selection conversion. For example,if you have associated an XTERM alias with the SAS.markPasteBufferand SAS.defaultPasteBufferresources, and then you copy and paste text between two SAS sessions, thecolor and character attributes are preserved. However, if you copy and pastethe same text into an xterm window while using the vi editor, you will notretain the SAS text color and attribute information. A subsequent paste ofthis selection into a SAS session window will contain text only with a defaulttext color of WHITE and no additional attributes. Extended paste buffers thatuse X selection transfers include XPRIMARY, XSCNDARY, and XTERM. If you changethe definition for SAS.defaultPasteBufferand SAS.markPasteBufferto XCUT0, you will not retain the text and color attributes when copying andpasting text between two SAS sessions.

If you use the XCLIPBRD extended paste buffer, you canuse the MIT xclipboard client with the SAS System for retained-mode cut-and-pasteconversions through the ICCCM CLIPBOARD selection protocol. Define one orboth of these SAS resources as follows:

SAS.defaultPasteBuffer: XCLIPBRDSAS.markPasteBuffer: XCLIPBRD

SAS commands that reference the DEFAULT paste bufferare associated with the X CLIPBOARD selection; mouse-based SAS marks willautomatically be stored in the XCLIPBRD paste buffer.

If you want to use the CLIPBOARD selection only forsome cut-and-paste interactions, you can issue the following KEYS window commandsfor selected windows:

STORE BUFFER=XCLIPBRDPASTE BUFFER=XCLIPBRD

Note:When you use the xclipboard client, SAS text attributesare not preserved in exchanges made between SAS sessions. However, when youuse the SAS XCLIPBRD paste buffer without a clipboard manager such as thexclipboard client, SAS text attributes are preserved in exchanges betweenSAS sessions.Customizing the SAS Windowing Environment : Customizing Cut-and-Paste Operations (5)

Using Paste Buffers to Manipulate Text

If you want SAS to automatically copy selected text into your paste bufferevery time you mark a region of text with the mouse, you should specify yourpaste buffer name in the SAS.markPasteBufferresource. To generate a STORE command every time you mark a region of textwith the mouse, define the following X resource for the SAS application:

SAS.markPasteBuffer: XTERM

Since the DEFAULT paste buffer is aliased to XTERM,you could also make the following declaration for SAS.markPasteBufferto produce the same result:

SAS.markPasteBuffer: DEFAULT
The markPasteBuffer definition causes SAS to automatically issue a STOREcommand whenever you select text.

The STORE command, as well as the CUT and PASTE commands,support a BUFFER= option that specifieswhich buffer to use. When these commands are issued from function keys ormenus whose definitions do not include the BUFFER= option,if the SAS.markPasteBufferresource is not defined, these commands use BUFFER=DEFAULT. Ifthis resource is defined, these commands use BUFFER=buffer-name.

You can customize your normal cut, copy, or paste keysto issue any of these commands with the BUFFER= option.For example, you can define a SAS SAS.keyboardTranslationsbinding for the sas-do-command()action that will be valid for the same set of operations in every SAS windowand override the SAS SAS.keyboardTranslationsdefinition for the osfCopyand osfPastekeys with the following specifications:

SAS.keyboardTranslations: #override<Key>osfCopy: sas-do-command("STORE BUFFER=XCLIPBRD") \n<Key>osfPaste: sas-do-command("PASTE BUFFER=XCLIPBRD")

For more information about customizing keys, seeCustomizing Key Definitions.

When you cutor copy and paste text between SAS session using the XTERM, XPRIMARY, or XSCNDARYpaste buffers, the color and attribute information is preserved. However,if you copy and paste the same text into an xterm window while using the vieditor, the color and attribute information is lost. If you change the definitionfor SAS.defaultPasteBufferand SAS.markPasteBufferto XCUT0, then you will not retain the text and attributes when you copy andpaste text between two SAS sessions.

Note:When you use the xclipboard client, SAS text attributesare not preserved in exchanges made between SAS sessions. However, when youuse the SAS XCLIPBRD paste buffer without a clipboard manager such as thexclipboard client, SAS text attributes are preserved in exchanges betweenSAS sessions.Customizing the SAS Windowing Environment : Customizing Cut-and-Paste Operations (6)

Using Paste Buffers for Information Exchange

Youcan use X Window paste buffers and X selections to exchangeinformation with other X Window clients. The SAS System paste-buffer interfaceallows this interaction for all paste-buffer interaction commands and operations.With the SAS interface to Motif, you can use the following paste buffers:

  • XPRIMARY
  • XSCNDARY
  • XCLIPBRD
  • XTERM
  • XCUTn
Formore information about these paste buffers, see Paste Buffers.

If you are not sure which Xdata exchange protocolsyour other X clients are using, you should use the XTERM paste buffer. Youcan specify your default paste buffer with the SAS.defaultPasteBufferresource:

SAS.defaultPasteBuffer: XTERM

If you know that the X clients in your workstation environmentall use the X PRIMARY selections to exchange data, you should use the XPRIMARYpaste buffer:

SAS.defaultPasteBuffer: XPRIMARY
This specification uses both SAS and X resources more efficiently andprovides for the on-demand transfer of data between clients.

You can also use the SAS XCLIPBRD paste buffer to interactwith Motif clients that use the Motif clipboard mechanism for text exchanges.This clipboard mechanism makes it unnecessary to have a dedicated client suchas xclipboard. For example, you can use XCLIPBRD to exchange text directlywith the Motif xmeditor application when you select the Cut, Copy, or Paste itemsfrom the xmeditor Edit menu.

Chapter ContentsPreviousNextTop of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.

Top Articles

Latest Posts

Article information

Author: Rev. Porsche Oberbrunner

Last Updated: 10/11/2022

Views: 5938

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.