LPEX Is Your Friend

Total Page:16

File Type:pdf, Size:1020Kb

LPEX Is Your Friend

LPEX is your Friend Features, hints and tips for System z LPEX1 (An Introduction to the System z LPEX Editor) Michael Dedina Last update: 20 Oct 2008

Abstract

Eclipse-based source code editors provide a rich set of features, such as content assistance, outline views, syntax highlighting, and error detection. But for mainframe program development, the editor must be mainframe-aware; otherwise you risk such problems as truncated records, mangled sequence numbers, unheeded ENQs, disregarded code pages, and mutilated double-byte characters.

This session introduces System z LPEX, the mainframe-friendly source code editor included with IBM Rational Application Developer for System z (RDz). LPEX addresses the above-mentioned mainframe-specific issues while integrating with the Eclipse environment. It is optimized for COBOL, PL/I, and Assembler source code, which can reside either in local files or remote data sets.

An overview of LPEX features is demonstrated, with particular attention to features that may not be obvious to new users (e.g. block editing, sequence number handling, and JCL submit).

Notable Features

 Programming-Language Support  Syntax highlighting: COBOL, PL/I, HLASM, JCL (and many others)  Content Assist: COBOL, PL/I, HLASM  Outline View: COBOL, PL/I, PL/X, HLASM, JCL  Language Sensitive Help: COBOL, PL/I, HLASM  TIP: LPEX uses the file extension to determine the content language. For MVS datasets and members, the extension is in turn determined by the dataset mapping (see the z/OS File System Mapping View, and/or right- click on a member and select Properties to see its mapping properties.)  Sequence number handling  Option in Preferences > LPEX > System z LPEX > Sequence Numbers (on by default) – if option is on, sequence number handling is turned on automatically, if and only if LPEX detects that sequence numbers are present.  NUMBER/UNNUMBER commands emulate the ISPF Editor:  Standard sequence numbers in columns 73-80: NUMBER STD  COBOL sequence numbers in columns 1-6: NUMBER COB (only in RDz 7.0.0.1 and later)

1 LPEX stands for Live Parsing eXtensible Editor.  TIP: NUMBER STD COB (i.e. both at the same time) is not supported  File locking (ISPF ENQ/DEQ) is supported as in the ISPF Editor  LPEX is record-length aware  Line length is computed based on the source character encoding. If a line exceeds the record length, you will be warned.  DBCS support  including display of emulated SO/SI control characters for EBCDIC DBCS source character encodings  BIDI support (e.g. right-to-left languages such as Hebrew and Arabic)  Round-trip error detection: LPEX will warn user if the file contains control characters which cannot round-trip between the EBCDIC and ASCII codepages in use, and it will open the file in readonly mode.  TIP: Prior to RDz 7.5, LPEX assumes that any EBCDIC code point below hex 40 is not text and will not round trip. If you have such control characters in your text, and you happen to know that they will round trip, you can turn off readonly mode by entering readonly off in the LPEX command line. (But it would be better to remove these characters from your file).  With RDz 7.5, LPEX no longer indiscriminately treats all EBCDIC code points below hex 40 as read only. It treat files containing such characters as readonly if and only if they will not roundtrip correctly.  Submit JCL from editor (with or without saving changes)  Key/mouse behavior emulation for: Epm, Brief, emacs, vi  Also emulation for ISPF and XEDIT editors -- including many "prefix area" commands and primary commands  We cannot provide complete emulation of these editors but we continue to add important commands.  ISPF emulation was enhanced significantly in RDz 7.1  TIP: In ISPF mode, ctl+enter opens a new line  Block selection: select rectangular blocks of text  block operations: copy; move; overlay; shift; lowercase; uppercase; fill (with character/string).  TIP: To move (or copy, overlay etc) a rectangular block of text:  Move the cursor to the upper left corner, then press Alt+R  Move the cursor to the lower right corner, then press Alt+R. The text will become selected.  Move the cursor to the upper left corner of the new location. Press Alt+M to move the text (or Alt+C to copy, or Alt+O to overlay)  Press Alt+U to deselect the text.  TIP: When you make a rectangular block selection (Alt+R) or a line selection (Alt+L), this is a non-stream selection, so the selection is not tied to the cursor. That is, you can select some text, and then move the cursor, and the text will not become deselected. (This feature allows text to be moved/copied without use of the Windows clipboard (which only handles streams of text, not blocks). But if you are a new user it can be confusing at first because the text does not become deselected when you move the cursor.) Just remember that Alt+U (unselect) will deselect the text.  TIP: To make selecting a block really easy, go to Window -> Preferences -> LPEX Editor -> Block, and set the default selection mode to Rectangle. Now you can make block selections by just dragging the mouse. But note that from now on you must press Alt-U instead of just moving the cursor to deselect text (see previous tip).  TIP: Alt+L selects a line. If you then move the cursor to another line and press Alt+L again, all the lines between the two selected lines will become selected.  TIP: The cursor is always visible. That is, if you scroll up or down, the cursor will move in order to stay in the viewable area of the document. It sometimes surprises users that if they make a stream selection (e.g. select text by dragging the mouse), the selection will be lost when they scroll. This is because the cursor has moved. If this is troublesome you can turn off stream selection in Window -> Preferences -> LPEX Editor -> Block.  Key recording/playback buttons are available on the toolbar, for recording simple macros.  Split the editor window into multiple views. TIP: Ctl+2 to create another view; Ctl+0 to close the current view; Alt+Shift+Right to move between views.  Copy/cut to clipboard in both plain text and rich text format (RTF)  Match to match language constructs in PL/I documents, as well as parentheses, braces, etc. Tip: Ctrl+M  Line hex editing dialog. Tip: Right click -> Source -> Hex Edit Line  Autosave capability (if Windows or RDz crashes, autosaved changes can be recovered).  The LPEX command line (press escape key) can be used to enter LPEX commands and actions.  TIP: commands are case sensitive  TIP: some useful line commands are:  help (or ?) (brings up the LPEX help)  help lpex (brings up the key bindings for the lpex profile mode)  help ispf (brings up the key bindings for the ispf profile mode)  submit (to submit JCL from the editor)  arrow keys can be used in the command line to recall commands  /text Finds the next occurrence of the specified text. Precede with minus sign to search backward (-/text)  'text Finds the next occurrence of the specified text.  lineNumber Locates the specified line.

Customization

 Preferences o Editor or Parser level preferences o Key bindings can be changed . GOTCHA: It might appear that you cannot rebind the shift- number keys (e.g. s-1, s-2). But you can. To redefine these keys, you must rebind the character that results from shifting the numeric key -- that is, you must redefine the exclamation point, not s-1. Furthermore, you can't use the character itself (e.g. "!") to redefine punctuation characters, you must use the identifier that is documented in the documentation for the keyAction parameter. So, set keyAction.exclamationMark backSpace will redefine shift-1.  Users can create their own LPEX commands and actions (written in Java), and their own keybindings and menu items.  See the TestUserProfile class in LPEX documentation for an example user profile (written in Java). Resources

• LPEX documentation (enter help on the LPEX command line) • Internal LPEX web site for the base LPEX plug-in: https://labweb.torolab.ibm.com/reference/vatools/lpex/swtlpex/ • IBM Education Assistant: http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp • Has two online demos of LPEX under Websphere Developer for System z, as well as other RDz demos: http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp? topic=/com.ibm.iea.wdz/wdz/wdz70.html • RDz Welcome Page has an introduction aimed at users familiar with the ISPF Editor • Extending the LPEX Editor in RDz: http://www.ibm.com/developerworks/websphere/library/techarticles/0605_casey/060 5_casey.html • RDz Product Page: http://www.ibm.com/software/awdtools/devzseries/support/

Recommended publications