Exploiting XEDIT

Exploiting XEDIT

Copyright Information SHARE Inc. is hereby granted a non-exclusive license to copy, reproduce or republish this presentation in whole or Exploiting XEDIT in part for SHARE activities only, and the further right to permit others to copy, reproduce, or republish this presentation in whole or in part, so long as such permission is consistent with SHARE's By -laws, Canons Phil Smith III of Conduct, and other directives of the SHARE Board of Linuxcare, Inc. Directors SHARE 99 August 2002 Session 9201 Introduction: Why XEDIT? XEDIT Power Tools • Extremely powerful, (almost) infinitely tailorable • Display management • Macros allow subcommand/function extensions • Available on Windows, MS-DOS, OS/2, UNIX • Automated text processing • If you have VM, you have XEDIT – You need to at least be able to use the system editor • Editing extensions • Few users fully exploit XEDIT! • XEDIT on other platforms • Note that editors are theology: I like XEDIT, therefore XEDIT is best! • XEDIT for ISPF users XEDIT Power Tools Line Targets • Line targets • Programmable keys • One ofXEDIT’s most powerful, least understood features • Chained LOCATEs (PF, PA, Enter) • Many subcommands use line targets • Little known subcommands • Macros • Four types: • Column commands • APIs – Absolute • SOS commands • Selective line editing – Relative • Prefix macros – String • Invocation options – Named • SET and QUERY • Display management • Any of these is valid anywhere line a target is used • 327x keys • Text processing 1 Line Targets (continued) Line Targets (continued) Absolute: File line number; begins with colon: • Most subcommands start at current line :18 :197 • LOCATE subcommand means “go to this line target” Relative: Offset (# of lines) relative to current line: – Use 5 rather than DOWN 5 5 +11 -8 – Use -11 rather than UP 11 String: Delimited string; may use “NOT” sign, logical • Named lines are often easier, faster than string targets or operators: counting lines /abc/ -/def/ ¬/<p>/ /x/|/y/ Named: Line name, set via SET POINT or .xxxx prefix subcommand: .a .here Chained LOCATEs “Programming” via Chained LOCATEs • LOCATE subcommands may be chained together • Allow primitive programming without macros: • Subcommand may be specified after a LOCATE /:h1./&/Topics/ 1 c/:h3./:h2./ • If LOCATE succeeds, subcommand is executed • This command: • If LOCATE fails, subcommand is not executed 1. Locates next line containing :h1. and Topics • Reduces terminal I/O (useful on slow lines!) 2. Moves to next line 3. Changes :h3. to :h2. 4.CHANGE is executed only if LOCATE successful Chained LOCATEs and REPEAT Obscure Subcommands • Use chained LOCATEs with REPEAT for complex • XEDIT has almost 100 subcommands operations: /:h1./&/Topics/ 1 c/:h3./:h2./ • Most users only (knowingly) use a handful repeat * • Same as previous, but repeated through rest of file • Even sophisticated users often fail to exploit 2 LPrefix — Logical Prefix COMPress/EXPand — Reformat Columns • Executes prefix subcommand on current line • COMPRESS compresses files at tab stops – Available even in line-mode XEDIT! • EXPAND un-compresses • Faster than moving cursor to current line, then back to • If tab settings change between COMPRESS and prefix area, typing prefix subcommand, pressing Enter EXPAND, columns are reformatted at new tab stops • Example: move data in columns 20, 30, 40 • Example: delete a section from a file: to columns 20, 40, 60: – LOCATE start of section – SET TABS 1 20 30 40 – Set pending DD prefix subcommand with LP DD – COMP * – TOP end of section – LOCATE – SET TABS 1 20 40 60 – Use another LP DDto delete section – EXP * SHIFT — Shift Data Columns REPEat — Re -execute to Target • Moves data left or right • Use with subcommands such as CDELETE which • Data moved, not file view like LEFT, RIGHT, RGTLEFT operate on current line • Deletes/spills data if necessary • Also use with chained LOCATE subcommands • Respects ZONE columns • With no operands, equivalent to NEXT followed by re- typing previous subcommand • REPEAT target performs process until target reached or non-zero return code Merge — Merge Lines RESET — Cancel Prefix Subcommands • Overlays groups of lines at specific column position • Prefix subcommands not yet executed are pending • Two line targets specify what to merge, column position • Use QUERY PENDING to locate operand specifies where • RESET avoids having to locate to cancel • Complex rules govern merging blank/non-blank data • Complicated usage, but more efficient than other techniques • Typically used in macros 3 UPPercase/LOWercase — Convert Text CANCEL — QUIT Unmodified Files • Convert one or more lines to upper/lower case • XEDIT can edit many files at once • Text between ZONE columns is changed • CANCEL quits all unmodified files • Useful after text uppercased by SET CASE UPPER • Changed files remain, QQUIT or FILE individually • Easier than pressing PF3 many times • Safer than typing QQ many times! COUnt — Count String Occurrences LOAD — Load File into Memory • Counts string occurrences • Legal only in PROFILE XEDIT • Use to: • Must be first subcommand (causes error later) – Check quote or parenthesis nesting – Executing other subcommands forces implicit LOAD – Determine scope of change before starting • Prefix any CMS commands issued before LOAD with • String to be counted must match exactly ADDRESS COMMAND – Actually uses CHANGE code under the covers • LOAD specifies fileid to be edited, options not honored (like ) – CASE IGNORE CHANGE • Sophisticated PROFILE can default filetype or entire – KEDIT adds second IGNORE for CHANGE, which fileid, resolve partial fileids, force options KEDIT COUNT honors Column Commands Column Commands • Column pointer points to a column position • CLOCATE sets column pointer to column target • Setting shown at top of screen, on SCALE line • CDELETE deletes columns to column target • Query via QUERY/TRANSFER/EXTRACT COLUMN • SET STREAM ON lets string targets span lines • Column commands set/use column pointer • CFIRST/CLAST set column pointer to first/second – Some use column target operand: ZONE column • Subset of line target varieties: absolute, relative, string • CINSERT, CREPLACE, COVERLAY insert, replace, (including logical NOT) overlay string at column pointer – No logical AND, logical OR, or names – Combine with REPEAT for multi-line operation – Often avoids need for single-purpose macro • CAPPEND macro (sort of) does “column append” 4 SOS Commands SOS Commands • SOS: Screen Operation Simulation • Operands include: • Legacy of EDGAR, early full-screen CMS editor – Field tabs • SOS functions use screen cursor position – Tab to command line (backwards or forwards) • Simulates terminal actions (keystrokes) – Save/restore cursor position – “Press” a PFkey • Designed for use from macros or PF keys – Add/remove trailing nulls on current line – Add, delete file line at cursor position • Cannot “press” PAkeys, Enter key • No SOS TEXT (text insertion) • Limited function, but still useful XEDIT Command Options Invocation Options • WIDTH • NAMETYPE, BFSLINE – Sets maximum LRECL settable by SET LRECL – Byte File System (BFS—Unix file system) support – Required because of static internal buffers – Read BFS documentation to learn concepts – WIDTH, LRECL, TRUNC, and ZONE all interact — – Can also XEDIT files in BFS directly, without first ing BFS directory read about, experiment ACCESS • NOLOCK • MEMBER membername – Avoids acquiring SFS/BFS lock on entry – XEDITsa MACLIB member – Use for Read/Only editing to avoid conflicts – Changed member replaced in MACLIB on FILE/SAVE Options Useful for Applications More Invocation Options • NOMSG • NOSCREEN – Suppresses XEDIT messages – Forces “line-mode” – Avoids SET MSGMODE OFF in applications – Use to test line-mode operation • NOCLEAR • PROFILE profilename or NOPROFILE – From display-management applications, avoids screen – Specifies inital macro filename flash on XEDIT entry – Bypasses PROFILE, avoids surprises – Causes MORE... if in line-mode 5 Update Mode: Create Source Updates Update Mode: Create Source Updates • Allows creating discrete updates to source files • UNTIL updatename applies updates only through • Changes made while editing are automatically saved as updatename, showing code image before a specific updates update • Supports source files up to LRECL 255 • SIDcode string creates Service IDentifier codes in columns 64-71 of updates • CTL ctlfn applies updates using CMS multi-level update scheme (CNTRL and AUX files) • Merge merges all updates into single update • The only way to do product maintenance! • Seq8/NOSeq8 control whether 5- or 8-character sequence numbers are expected on source • Incr n controls minimum update line increment SET and QUERY Customizing the Screen • 80+ SET options provide extensive tailorability • Many SET commands change screen appearance • Some poor defaults (SCALE, STAY, MSGLINE) (CMDLINE, PREFIX, SCALE, etc.) • Things to learn about: • Customize screen to yourtaste – QUERY options which have no matching SET – Experiment with SET PREFIX NULLS, (RING, NBFile, LENGTH, TARGET, LASTLORC) SET NUMBER ON, SET SHADOW OFF – CASE IGNORE • Consider: – Complex synonyms, LINEND option – SET MSGLINE ON 2 23 OVERLAY or – Uses for SET NULLS ON, SET FULLREAD ON – SET MSGLINE ON -1 24 OVERLAY with SET CMDLINE TOP • STATUS macro displays/saves current settings Customizing the Screen 327x Keys • Some screen features (title line, TOF/EOF lines, etc.) • Few users fully exploit 327x architecture cannot be changed directly • If available, use Entry Assist (see GA23-0119)

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us