edit macros 2

105
TSO AND EDIT MACROS: REVISED EDITION August 22, 2000 Dayton Pruitt Decision Support Services Lowe’s Companies, Inc. North Wilkesboro, NC

Upload: ragunathan-nagarajan

Post on 02-Jul-2015

82 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Edit Macros 2

TSO AND EDIT MACROS: REVISED EDITION

August 22, 2000

Dayton Pruitt

Decision Support ServicesLowe’s Companies, Inc.

North Wilkesboro, NC

Page 2: Edit Macros 2

TSO and Edit Macros

Contents

Introduction..................................................................................4

General Use Macros: Summary.......................................8

Easytrieve Macros: Summary.........................................9

ISPF Developer/Other Macros: Summary....................................................................................10

General Use Macros: Syntax Summary....................................................................................11

Easytrieve Macros: Syntax Summary....................................................................................12

ISPF Developer/Other Macros: Syntax Summary....................................................................................13

Macro Details....................................................................................14

GENERAL USE ............................................................................................ 14 CHECK..................................................................................................14CLIP......................................................................................................16CURS....................................................................................................17CUT......................................................................................................18C2X......................................................................................................19DUP......................................................................................................20D2X......................................................................................................22FT.........................................................................................................23LEXICON...............................................................................................24MATH...................................................................................................25PASTE..................................................................................................26PROFX..................................................................................................28PRINTMEM............................................................................................29R..........................................................................................................30RESX....................................................................................................31S..........................................................................................................32

Decision Support Services Page 2

Page 3: Edit Macros 2

TSO and Edit Macros

SHOW..................................................................................................35SHOWALL.............................................................................................37SHOWMEM...........................................................................................38SYSINFO...............................................................................................39TODAY..................................................................................................40UNIQVALS............................................................................................41X2C......................................................................................................42X2D......................................................................................................43

EASYTRIEVE ............................................................................................... 44 CODE...................................................................................................44CODEID................................................................................................45COMM..................................................................................................47DISPGRP...............................................................................................48DISPLAY...............................................................................................52EZCODE...............................................................................................55EZDB2..................................................................................................56EZMULT................................................................................................65EZPROF................................................................................................66EZS......................................................................................................67FORMLIST.............................................................................................69GETCODE.............................................................................................70MOVEPROD..........................................................................................71PLUS....................................................................................................73SHIF.....................................................................................................74

ISPF DEVELOPMENT/OTHER ....................................................................... 75 AVAR....................................................................................................75CVAR....................................................................................................76DL........................................................................................................77DVAR....................................................................................................78FMEM...................................................................................................79FVAR....................................................................................................80PFSAVE................................................................................................81PFSWAP................................................................................................82PFRSTORE............................................................................................83QL........................................................................................................84SHDO...................................................................................................85SLIP......................................................................................................86SLUP....................................................................................................87

Decision Support Services Page 3

Page 4: Edit Macros 2

TSO and Edit Macros

IntroductionTypes of Macros

There are two types of macros: edit macros and TSO macros. Edit macros are commands used on the command line of the ISPF/PDF editor. Edit macros are used just like editor commands such as FIND, CHANGE, CAPS OFF, or SORT. The example below shows an editor session in which the user just has to press the ENTER key to execute EZDB2.

EDIT CICG.DEV.EZ(EZINTF1) - 01.20 Columns 00001 00072 Command ===> %ezdb2 Scroll ===> DATA ****** ***************************** Top of Data ******************************000001 *#RUN 000002 *#DISPLAY

TSO macros can be executed from any command line. Use TSO in front of the macro name. The example below shows an ISPF session in which the user just has to press the ENTER key to execute SYSINFO.

-------------------- ISPF/PDF PRIMARY OPTION MENU (CIC) ---------------------- OPTION ===> tso %sysinfo USERID - CICDJP1 0 ISPF PARMS - Specify terminal and user parameters DATE - 99/07/14 1 BROWSE - Display source data or output listings TIME - 11:49

Some of the macros described in this document are edit macros, some are TSO macros, and others can be both.

How to Read the Macro Syntax Descriptions

Most of the macros permit or require one or more arguments (sometimes call parameters). The syntax in each macro description indicates what arguments may be used and whether or not they are required. Rule one explains the use of parentheses.

Rule 1. Arguments within parentheses are optional. You may use them but are not required to do so. Arguments outside of parentheses are required.

Examine the following command:

%CLIP start-line end-line (start-column end-column)

Start-line and end-line are required arguments because they are outside of parentheses. Start-column and end-column are optional because they are inside

Decision Support Services Page 4

Page 5: Edit Macros 2

TSO and Edit Macros

parentheses. Because start-column and end-column are inside the same set of parentheses, they must be used together; that is, if you specify one, you must specify the other.

Sometimes there is more than one way to specify the same thing. This leads to the next rule.

Rule 2. Arguments separated by a broken bar give a choice. Choose only one of the arguments.

Look at the following command:

%EZPROF (ALL|permid|logonid)

You may choose between any of the three arguments: ALL, permid, or logonid. You may use only one of them. Note that these arguments are optional because they are enclosed within parentheses.

Notice in the command above that ALL is capitalized but permid and logonid are not. This leads to another rule.

Rule 3. Arguments in capital letters are literals. Arguments in small letters are variables.

Examine the same %EZPROF command more closely.

%EZPROF (ALL|permid|logonid)

The EZPROF macro can be used with the word ALL (which is why it is called a literal) or with some value representing permid or logonid. You may have to know something about the macro and its use to understand what kind of variables permid and logonid represent. Note that you may type literals in small letters even though they are capitalized in the syntax rule. Indeed, the entire command may be typed in small letters.

The next rule explains the use of brackets.

Rule 4. Any or all of the arguments enclosed in brackets may be used.

Examine the following command:

%CHECK [DUP SEQ D] start-line end-line (start-col end-col) DUP, SEQ, and D are arguments that may be used in any combination. You may use any one of them, any two of them, or all three of them.

Decision Support Services Page 5

Page 6: Edit Macros 2

TSO and Edit Macros

Members and Datasets

In general, edit macros can be used while editing either a sequential dataset or a member of a library. Only those macros specifically designed to be used with Easytrieve EZ libraries (such as EZS or EZCODE) can be used only with library members. The rest of the macros can be used with any dataset or member.

Use of Line Numbers and Columns

Many of the edit macros contained in this document use one or more line numbers as arguments. These are relative line numbers. Line number 10, for example, means relative line number 10 and refers to the tenth line in the dataset regardless of its physical line number. The easiest way to use macros with relative line numbers is to use the macros with datasets or members having no physical line numbers (i.e., line numbers in columns 73-80). Getting rid of physical line numbers is the same thing as turning off line numbers. Turn off line numbers by executing RENUM from the command line followed by UNNUM. The use of physical line numbers is a carry-over from the days when programs were punched onto cards; they serve no real purpose now.

All of the edit macros described in this document allow you to use an asterisk (*) in place of an ending line number. The asterisk stands for the last line in the dataset. For example, the following two commands are equivalent for a dataset with 200 lines:

%CLIP 1 200%CLIP 1 *

In addition, you may use an asterisk (*) to stand for the last column on a line. For example, given an 80-column dataset with 200 lines, the following two commands are equivalent:

%CLIP 1 200 41 80%CLIP 1 * 41 *

Strictly speaking, the starting column represents the left boundary and the ending column represents the right boundary. Unless you reset them on purpose, however, the left and right boundaries are the first and last position of the member or dataset. The individual macro descriptions omit explanation of line numbers and column numbers because these are the same for all of the macros.

Decision Support Services Page 6

Page 7: Edit Macros 2

TSO and Edit Macros

Online Help

Online help is available for most of the macros. The online help explains the syntax and what each argument does. Invoke online help for a macro by using HELP as an operand. The following commands, for example, invoke online help:

%CLIP HELP%MATH HELP

Some of the macros with one or more required arguments will also invoke online help when executed with no arguments. The following commands, for example, invoke online help:

%PASTE%PASTE HELP%S%S HELP

The surest way of getting online help is, of course, to use HELP as an argument.

Fonts

Proper viewing and printing of this document requires having the Century Schoolbook and the Courier New fonts. If another font is used, then page numbers will not be accurate. Because the Century Schoolbook font is no longer a standard install, you may need to install it yourself.

Revisions

This revision separates general use macros from Easytrieve macros and adds some new macros geared toward the ISPF developer.

Decision Support Services Page 7

Page 8: Edit Macros 2

TSO and Edit Macros

General Use Macros: Summary

CHECK Check a column for duplicate values or values out of sequence.CLIP Copy lines or parts of lines to a buffer and PASTE them later.COMM Turn on or off comments in a line range.CURS Split or join lines (assign to a PF functionkey)CUT Move lines or parts of lines to a buffer and PASTE them later.C2X Convert an EBCDIC character string to a hexadecimal string.DUP Duplicate blocks of lines while changing values.D2X Convert a decimal number into a hexadecimal number.FT Find first occurrence of string starting at top of dataset.LEXICON Cross references lexicon names with ordinary language descriptions.MATH Perform mathematical calculations.PASTE Insert lines from buffer into a line or part of a line.PLUS Turn on or off trailing plus signs in a line range.PRINTMEM Prints the current member being edited.PROFX Display information about current member.R Limit scope of edit commands to a given line range.RESX Reset records and screen display to state before a SHOW command.S Center, delete, insert, overlay, or shift strings.SHOW Show lines containing any of some specified strings or words.SHOWALL Show lines containing all of some specified strings.SHOWMEM Show libraries defined on edit panel.SYSINFO Display information about a TSO and ISP session.TODAY Display different date representations of today.UNIQVALS Display unique values contained within a column range.X2C Convert a hexadecimal string into an EBCDIC character string.X2D Convert an hexadecimal number into a decimal number.

Decision Support Services Page 8

Page 9: Edit Macros 2

TSO and Edit Macros

Easytrieve Macros: Summary

CODE Insert a model code component statement.CODEID Inspect or change job submission profile values.COMM Turn on or off comments in a line range.DISPGRP Control groups of Easytrieve DISPLAY statements.DISPLAY Insert DISPLAY statements based on variable names already on lines.EZCODE Finds and edits code component members referenced in program.EZDB2 Generates an SQL statement.EZMULT Submits a list of Easytrieve programs.EZPROF Edits or views information about job submission profiles.EZS Submits an Easytrieve program from an EZ library.FORMLIST Formats a code component member for SQL or Easytrieve.GETCODE Creates a new code component member based on code in program.MOVEPROD Move program from staging library to production library.PASTE Insert lines from buffer into a line or part of a line.PLUS Turn on or off trailing plus signs in a line range.PROFX Display information about current member.SHIF Show logical structure of a program.

Decision Support Services Page 9

Page 10: Edit Macros 2

TSO and Edit Macros

ISPF Developer/Other Macros: Summary

AVAR Add a variable to the application profile pool.CVAR Change the value of an application profile pool variable.DL Display lengths of two character strings containing dashes.DVAR Delete an application profile or shared pool variable.FMEM Find a member in TSO session datasets.FVAR Display the values of profile or shared pool variable.PFSAVE Store the values of PF1-PF24.PFSWAP Swap the values of PF1-12 with PF13-24.PFRSTORE Restore saved values of PF1-PF24.QL Display length of characters inside a pair of quotes.SLIP Shift a column range down one line.SLUP Shift a column range up one line.SHDO Show block structure of REXX, CLIST, PL/I.

Decision Support Services Page 10

Page 11: Edit Macros 2

TSO and Edit Macros

General Use Macros: Syntax Summary

%CHECK [DUP SEQ D] start-line end-line (start-col end-col)

%CLIP start-line end-line (start-column end-column)

CURS SPLTJOIN column-number

%CUT start-line end-line (start-column end-column)

%C2X character-string

TSO %C2X character-string

%DUP start-line end-line|* original-string new-string-1 ... new-string-n%DUP start-line end-line 1-nn

%D2X decimal-integerTSO %D2X decimal-integer

%FT string

TSO %LEXICON

TSO %MATH(expression)%MATH (expression)

%PASTE (OVER|CLEAR) start-line (start-column)

%PROFX

%PRINTMEM {SET|CHECK} (print-class printer-id)

%R start-line end-line edit-command

%RESX

%S CEN start-line end-line (start-column end-column)%S DEL start-line end-line start-column end-column%S FILL start-line end-line start-column end-column (string)%S INS start-line end-line start-column end-column (string)

%SHOW (WORD) string-1 (string-2…string-3... string-n)

%SHOWALL string-1 (string-2…string-3... string-n)

%SHOWMEM

TSO %SYSINFO

%TODAY

%UNIQVALS start-line end-line start-column end-column

Decision Support Services Page 11

Page 12: Edit Macros 2

TSO and Edit Macros

Easytrieve Macros: Syntax Summary%CODE code-component-name line-number(OPT)(EZ|SQL|#|JCL)

%EZCODE (RESET|[codeid codeloc codeproj dsnid])TSO %EZCODE project (RESET|[codeid codeloc codeproj dsnid])

%COMM (ON|OFF) start-line (end-line|*)

%DISPGRP group ACT(IVATE)|IN(ACTIVATE) | EN(ABLE)|DIS(ABLE)

%DISPLAY (HEX) (variable-pos) start-line end-line

%EZCODE(ASIS|ASRUN)(permid|logonid)(M=name|MEM=name|MEMBER=name|CODE=name)

%EZDB2

TSO %EZMULT dataset|member

%EZPROF (ALL|permid|logonid)TSO %EZPROF project (ALL|permid|logonid)

%EZS (TEST|DEV|STAG|PROD) (ID(xx)) (LOC(nnn)) (D1(xxxx)) D2(xxxx))

TSO %EZS project group member (ID(xx)) (LOC(nnn)) (D1(xxxx)) D2(xxxx))TSO %EZS member project group (ID(xx)) (LOC(nnn)) (D1(xxxx)) D2(xxxx))

%FORMLIST (CHAR|NUM) (start-line) (end-line)

%GETCODE USER|LOC|PROD starting-line (ending-line)

TSO %MOVEPROD project (member)

%PLUS (ON|OFF) start-line end-line

%SHIF

Decision Support Services Page 12

Page 13: Edit Macros 2

TSO and Edit Macros

ISPF Developer/Other Macros: Syntax SummaryTSO %AVAR variable value

TSO %CVAR variable value

%DL start-line

TSO %DVAR variable PROFILE|SHARED

TSO %FMEM member library-type

TSO %FVAR variable

TSO %PFSAVE

TSO %PFSWAP

TSO %PFRSTORE

%QL start-line

%SLIP start-line end-line (start-column end-column)

%SLUP start-line end-line (start-column end-column)

%SHDO

Decision Support Services Page 13

Page 14: Edit Macros 2

TSO and Edit Macros

Macro Details

GENERAL USE

CHECK

Check is an edit macro that checks a range of lines for duplicate strings or strings out of sequence. Lines in error (as determined by macro options) are displayed on the TSO display. CHECK is especially useful for finding errors in Easytrieve internal tables.

Syntax:

%CHECK [DUP SEQ D] start-line end-line (start-col end-col)

Arguments:

DUP: check for duplicate strings. SEQ: check for numeric strings out of sequence. The default is to check the

values in as ascending sequence. Note that equal values are not out of sequence.

D: causes the sequence check to be in descending order.

From one to three of the three arguments just described must be used. At least one must be specified. They may be used in any order.

Examples:

CHECK SEQ DUP 20 40 1 8CHECK SEQ 1 *CHECK SEQ D 1 *

Example one checks columns 1-8 in lines 20 to 40 for any duplicate values or values out of sequence.

Example two checks the entire dataset for any records out of sequence.

Example three checks the entire dataset for any records out of sequence. The records must be in descending order.

Tip: in most cases, you need to specify a column range. If you are checking an Easytrieve table for errors, be sure to specify a column range and to use both the

Decision Support Services Page 14

Page 15: Edit Macros 2

TSO and Edit Macros

SEQ and the DUP options. Take care in interpreting the results whenever you omit a column range, the DUP option, or the SEQ option.

Decision Support Services Page 15

Page 16: Edit Macros 2

TSO and Edit Macros

CLIP

CLIP is an edit macro that stores complete lines or parts of lines in a permanent save buffer so that they can be retrieved at a later time for insertion into another dataset. CLIP is very similar to CUT.

After using CLIP, use the PASTE edit macro to insert lines from the save buffer into a library member or other dataset.

Syntax:

%CLIP start-line end-line (start-column end-column)

Examples:

1. %CLIP 10 1002. %CLIP 10 100 41 803. %CLIP 10 *4. %CLIP 10 * 41 80

Example one copies lines 10 through 100 into the save buffer.

Example two copies lines 10 through 100 but only columns 41-80.

Example three copies all lines from line 10 to the end of the dataset.

Example four also copies all lines from line 10 to the end of the dataset but only columns 41-80.

After you invoke CLIP, any lines stored by a previous invocation of CLIP become unavailable.

You may have a maximum of 1000 lines in the save buffer at any time.

Related Macros:

CUT, PASTE.

Decision Support Services Page 16

Page 17: Edit Macros 2

TSO and Edit Macros

CURS

CURS is an edit macro that splits or join lines and should be assigned to a PF key.

Syntax:

CURS SPLTJOIN column-number

This function operates as follows:

If there are no non-blank characters to the right of the cursor, then the next line is joined to the current line at the cursor position.

If there are non-blank characters to the right of the cursor, then the current line is split into two lines, with the split occurring at the cursor position. A new line in inserted into the dataset to handle the characters to the right of the cursor. The characters in the new line begin at the column-number.

Tips:

For Easytrieve, SAS, CLIST, REXX, or PL/I, use CURS SPLTJOIN 1.

Two successive uses of this function will result in a line exactly like the original.

CURS SPLTJOIN is designed to be executed with a function key. To assign CURS SPLTJOIN to a function key, enter KEYS on the command line. This will bring up a display of your current function key assignments, which you may thereupon modify.

PF23 or PF24 are good function keys to use for CURS SPLTJOIN.

Decision Support Services Page 17

Page 18: Edit Macros 2

TSO and Edit Macros

CUT

CUT is an edit macro that behaves just like CLIP except that it does one more thing: it deletes the copied lines from the dataset. See CLIP for a full explanation of the options.

Syntax:

%CUT start-line end-line (start-column end-column)

All lines defined by the range of start-line to end-line are deleted from the dataset. The lines are deleted whether or not a column range is specified.

Related Macros:

CLIP, PASTE.

Decision Support Services Page 18

Page 19: Edit Macros 2

TSO and Edit Macros

C2X

C2X is an edit macro and TSO macro that translates an EBCDIC character string into its hexadecimal representation.

Edit Syntax:

%C2X character-string

TSO Syntax:

TSO %C2X character-string

Examples:

1. %C2X 2552. TSO D2X D4C1C3D9D6

Example one will display F2F5F5 as the result.

Example two will display MACRO.

Related Macros:

See D2X, X2C, X2D.

Decision Support Services Page 19

Page 20: Edit Macros 2

TSO and Edit Macros

DUP

DUP (short for Duplicate) is an edit macro that duplicates one or more lines multiple times while, at the same time, changing string values in the new lines. The new lines are inserted immediately after the line or lines being duplicated.

There are two types of duplication operations. A Type I duplication changes one string to another string while performing the duplication. A Type II duplication increments numbers while performing the duplication.

Syntax for Type I Duplication: %DUP start-line end-line|* original-string new-string-1 ...

new-string-n

Arguments:

Original-string: the string in the original line that is to be changed.

New-string: what the string is supposed to be changed to on the new lines. Each new-string value causes a new line or block of lines to be created.

Examples:

1. %DUP 10 10 SUMA SUMB SUMC SUMD SUME SUMF2. %DUP 10 12 TOTAL MIN MAX SUM AVG

Example one duplicates line number 10 five times. One the first new line, all strings SUMA are changed to SUMB. On the second new line, all strings SUMA are changed to SUMC. A third, fourth, and fifth new line must be created to process the new strings SUMC, SUMD, and SUMF. The number of new strings determines how many new lines are inserted: one line per new string

Example two duplicates the block of lines from line 10 to line 12 four times. The new lines are inserted immediately after the original lines. On the first set of duplicate lines, all occurrences of the string TOTAL are changed to MIN. On the second set of duplicate lines, all occurrences of the string TOTAL are changed to MAX. A third and fourth block of new lines must be created to process the new strings SUM and AVG. There is no limit to the number of new strings that can be used.

(continued on next page)

Decision Support Services Page 20

Page 21: Edit Macros 2

TSO and Edit Macros

Syntax for Type II Duplication:

%DUP start-line end-line 1-nn

Examples:

1. %DUP 10 10 1-10

2. %DUP 10 12 1-40

The first example above duplicates line number 10 nine times. On the first inserted line, all occurrences of the number 1 are changed to 2. On the second inserted line, all occurrences of the number 1 are changed to 3, and so on.

The second example above duplicates the block of lines from line 10 to line 12 thirty-nine times. On the first block of duplicate lines, all occurrences of the number 1 are changed to 2, and so on.

Decision Support Services Page 21

Page 22: Edit Macros 2

TSO and Edit Macros

D2X

D2X is an edit macro and TSO macro that translates a decimal number into hexadecimal. The decimal number must be a positive integer. The edit macro displays the result in the short message area. The TSO macro displays the result on the TSO display screen.

Edit Syntax:

%D2X decimal-integer

TSO Syntax:

TSO %D2X decimal-integer

Examples:

1. %D2X 2552. TSO D2X 255

Both examples will display FF as the result.

Related Macros:

See C2X, X2C, X2D.

Decision Support Services Page 22

Page 23: Edit Macros 2

TSO and Edit Macros

FT

FT is an edit macro that finds a string starting at the top of the dataset. It is short for the ISPF edit command FIND FIRST.

Syntax:

%FT string

Examples

%FT KSDS

Example one finds the first line containing the strings KSDS.

Decision Support Services Page 23

Page 24: Edit Macros 2

TSO and Edit Macros

LEXICON

LEXICON displays in a work data information about the lexicon abbreviations used for DB2 table and column names.

TSO %LEXICON

Examples

%TSO LEXICON

Example one initiates the program and allows you to enter an English word, a lexicon name, or a lexicon class for translation or enumeration. Follow the instructions at the prompt..

Decision Support Services Page 24

Page 25: Edit Macros 2

TSO and Edit Macros

MATH

MATH allows you to perform a wide range of arithmetical calculations. MATH can be invoked either as an edit macro or as a TSO program. As an edit macro, it allows you to enter a mathematical expression on the command line; the answer is returned in the long message area. As a TSO macro, it displays the answer on the TSO display screen. Used without operands (either as edit or TSO macro), it temporarily changes your session to a TSO display so you can enter repeated mathematical expressions.

Results are accurate to 16 digits.

TSO Syntax:

TSO %MATH (expression)

Edit Syntax:

%MATH (expression)

Examples:

1. TSO %MATH 648*.0752. %MATH (23.12 * 5.6) / (4**3)3. TSO %MATH 1.25E+8 * 24. TSO %MATH5. MATH

Examples one and two calculate and then display the results on the edit screen.

Example three calculates the results and displays it on the TSO screen.

Examples four and five bring up the TSO screen so you can repeatedly enter mathematical expressions. Terminate the program with an x or X (the termination character is explained with every prompt).

The following are valid operators usable in any expression:

+ (addition)- (subtraction)* (multiplication)/ (division)% (integer division)// (remainder from division)** (exponentiation - the exponent must be an integer)

Decision Support Services Page 25

Page 26: Edit Macros 2

TSO and Edit Macros

PASTE

PASTE is an edit macro that retrieves the contents of the save buffer filled from a previous invocation of CLIP or CUT and inserts the contents into the member or dataset being edited. Since PASTE does not remove the lines from the save buffer unless specifically requested, the lines in the save buffer may be pasted more than once.

Syntax:

%PASTE (OVER|CLEAR) start-line (start-column)

Arguments:

OVER: inserts the contents of the save buffer over existing lines. Without OVER, new lines are inserted to hold the contents of the save buffer.

CLEAR: clears the contents of the save buffer only; no changes are made to the member or dataset being edited.

Examples:

1. %PASTE 102. %PASTE 10 213. %PASTE 04. %PASTE OVER 105. %PASTE OVER 10 216. %PASTE CLEAR

Example one inserts the lines from the save buffer into the dataset immediately after line 10 and starting in column one.

Example two inserts the lines from the save buffer into the dataset immediately after line 10 but beginning in column 21.

Example three inserts the lines from the save buffer into the beginning of the dataset.

(continued on next page)

Decision Support Services Page 26

Page 27: Edit Macros 2

TSO and Edit Macros

Example four overlays the lines from the save buffer into the dataset beginning with line 10. The overlaying process changes the contents of the old lines. The number of lines overlaid depends upon the number of lines in the save buffer. Some caution is needed with the OVER option because existing lines in the dataset are changed.

Example five overlays the lines from the save buffer into the data set beginning with line 10 but beginning in column 21.

Example sux clears all lines from the save buffer. CLEAR also reduces the size of the save buffer. Note that the save buffer never becomes smaller through normal use; it always remains large enough to hold the maximum number of lines put into it since the last clear operation. Clearing the save buffer after putting a large number of lines in it will improve TSO/ISPF performance.

Related Macros:

CLIP, CUT.

Decision Support Services Page 27

Page 28: Edit Macros 2

TSO and Edit Macros

PROFX

DL is an edit macro that displays some information about a dataset or member, some of which is not displayed by PROFILE. The information shown is version, level, stats, recovery, and changes (whether the dataset or member has been changed or not).

Syntax:

%PROFX

Decision Support Services Page 28

Page 29: Edit Macros 2

TSO and Edit Macros

PRINTMEM

PRINTMEM is an edit macro that prints the member currently being edited to a designated printer. The printer may be designated when PRINTMEM is executed or it may be stored so that it does not have to be designated at future executions.

Syntax:

%PRINTMEM {SET|CHECK} (print-class printer-id)

Arguments:

SET: saves the print-class and printer-id.

CHECK: displays the current saved print-class and printer-id.

(none): uses the current saved print-class and printer-id.

Examples:

1. %PRINTMEM E U52. %PRINTMEM SET E U33. %PRINTMEM CHECK4. %PRINTMEM5. %PRINTMEM E U5

Example one prints the member to printer U5.

Example two sets U3 as the user’s default printer (E is the print-class for that printer).

Example three displays the user’s default printer (U3 as set above).

Example four prints the member to U3 (the user’s default printer)

Example five prints the member to U5 (overriding the default printer)

Caution: the default printer information is stored by logonid. If you change your logonid, you will need to reset your defaults. If you change locations and your default printer, you will also need to reset your defaults.

Decision Support Services Page 29

Page 30: Edit Macros 2

TSO and Edit Macros

R

R (short for Range) is an edit macro that restricts the range of edit commands.

Syntax:

%R start-line end-line edit-command

Examples:

1. %R 30 50 CHANGE ALL TAB TABLE2. %R 110 * CHANGE ALL TAB TABLE3. %R 20 40 SORT 1 44

Example one changes TAB to TABLE within lines 30 to 50.

Example two changes TAB to TABLE from lines 110 to the end of the data set.

Example three sorts lines 20 through 40.

You may use the following edit commands with R:

CHANGE DELETE EXCLUDE FIND SORT

Decision Support Services Page 30

Page 31: Edit Macros 2

TSO and Edit Macros

RESX

RESX (short for Extended Reset) is an edit macro designed to be used in conjunction with the SHOW command. It performs a RESET but returns the display to the state prior to that before the SHOW command was used. For example, if a user who was editing a dataset with line 400 at the top of the screen execute a SHOW command followed by RESX, he would still be editing a dataset with line 400 at the top (plain RSET would have put line one at the top).

Syntax:

%RESX

Related Macros:

SHOW.

Decision Support Services Page 31

Page 32: Edit Macros 2

TSO and Edit Macros

S

S (short for String) is an edit macro with four sub-functions that allow you to center, delete, insert, overlay, or shift strings within a specified block of lines.

S CEN

%S CEN centers a string within a specified column range (start-column through end-column) for all lines within the range defined by start-line through end-line. If no columns are specified, then the current left and right bounds of the dataset are used (which are usually equal to one and to the record length, respectively).

Syntax:

%S CEN start-line end-line (start-column end-column)

Examples:

1. %S CEN 10 10 20 60

2. %S CEN 1 *

Example one centers the contents of line ten within columns 20-60.

Example two centers the contents of every line with the current left and right boundaries.

S DEL

%S DEL deletes the specified columns (from the start-column through the end-column) for all lines within the range defined by start-line through end-line.

Syntax:

%S DEL start-line end-line start-column end-column

Examples:

1. %S DEL 1 * 40 50

Example one removes the contents of columns 40 through 50 for all lines in the dataset.

(continued on next page)

Decision Support Services Page 32

Page 33: Edit Macros 2

TSO and Edit Macros

S FILL:

%S FILL overlays columns in a dataset with a specified string. If a string is not specified, then it defaults to spaces. If the string is shorter than the number of columns defined by the column range, then the string is padded with spaces. Rep is an alias for FILL so %S REP does the same thing as %S FILL.

Syntax:

%S FILL start-line end-line start-column end-column (string)

Examples:

1. %S FILL 10 40 30 36 –AMOUNT

2. %S FILL 10 40 30 36

3. %S FILL 70 * 60 70 -AMT

Example one puts –AMOUNT into columns 30 through 36 from lines 10 through 40. The previous contents are replaced.

Example two puts spaces into columns 20 through 36 of lines 10 through 40. overlays the string onto the specified columns for the range of lines specified.

Example three puts –AMT into columns 60 through 70 from line 70 through the last line. Since –AMT is shorter than 11 position, it is padded with blanks; columns 64-70 will become blank.

(continued on next page)

Decision Support Services Page 33

Page 34: Edit Macros 2

TSO and Edit Macros

S INS

%S INS inserts a specified string into the dataset. Characters in the dataset are shifted to the right to make room for the inserted string. If the string is shorter than the number of columns defined by the column range, then the string is padded with spaces.

Syntax:

%S INS start-line end-line start-column end-column (string)

Examples:

1. %S INS 10 40 29 31 WS-2. %S INS 10 40 29 313. %S INS 1 * 1 2 *

Example one inserts WS- into columns 29-31 for all lines from line 10 through line 40. The previous contents of the lines starting in column 29 are shifted three places to the right in order to hold the new string.

Example two inserts three spaces into columns 29-31 for all lines from line 10 through line 40. The previous contents of the lines starting in column 29 are shifted three places to the right in order to hold the new string.

Example three inserts an asterisk and a space in columns 1-2 for all lines in the dataset. The previous contents of the lines are shifted two places to the right in order to hold the new string.

Decision Support Services Page 34

Page 35: Edit Macros 2

TSO and Edit Macros

SHOW

SHOW is an edit macro that allows you to display on your edit screen only those lines containing one or more specified strings that you specify. The result will be that the lines meeting the search criteria will be non-excluded and all other lines excluded. If multiple search strings are specified, then lines containing any of the strings will be displayed (unlike SHOWALL, which shows only those lines containing all of the strings). Using WORD as an option restricts string matching to words (as defined by the ISPF editor).

After using SHOW, you may use any of the usual editing functions. RESET (or RES) restores all lines to visibility (non-excluded). RESX (a macro) also restores all lines to visibility but retains the previous lines on the edit screen display.

Syntax:

%SHOW (WORD) string-1 (string-2…string-3... string-n)

Examples: 1. %SHOW 3062. %SHOW -TOTAL OLD-RATE NEW-RATE3. %SHOW 'HOME DEPOT' 'HOME QUARTERS'4. %SHOW WORD RATE TARIFF

Example one displays only lines containing the number 306.

Example two displays only lines containing any of these three strings: -TOTAL, OLD-RATE, or NEW-RATE (note that the dashes are part of the strings).

Example three is similar to example two except that the strings are enclosed inside parentheses because they contain embedded blanks.

Example four displays only lines containing the words RATE or TARIFF.

See the tip on the next page.

(continued on next page)

Decision Support Services Page 35

Page 36: Edit Macros 2

TSO and Edit Macros

Tip: SHOW works by assigning all lines containing any your specified strings a NOT EXCLUDED status, while assigning all other lines an EXCLUDED status. This permits you to use the X and NX options of the CHANGE edit command. Consider, for example, the following sequence of commands:

%SHOW EXTENDED CHANGE ALL X CURRENT PAST-DUE CHANGE ALL NX CURRENT 'DUE NOW'

The SHOW command changes the display so that only lines with the characters EXTENDED are displayed. The ISP editor considers these lines to have a NON-EXCLUDED status; all other lines have a EXCLUDED status.

The first CHANGE command affects only EXCLUDED lines (i.e., lines not displayed). All occurrences of CURRENT in the lines not displayed are changed to "PAST-DUE."

The second CHANGE command affects only NON-EXCLUDED lines (i.e., displayed lines). All occurrences of CURRENT in the displayed lines are changed to DUE NOW.

Related Macros:

RESX, SHOWALL.

Decision Support Services Page 36

Page 37: Edit Macros 2

TSO and Edit Macros

SHOWALL

SHOWALL is an edit macro that allows you to display on your edit screen only those lines containing all search strings that you specify. The result will be that the lines meeting the search criteria will be non-excluded and all other lines excluded. If multiple search strings are specified, then lines will not be displayed unless it contains all of the search strings (unlike SHOW, which displays lines containing any of the search strings).

After using SHOW, you may use any of the usual editing functions. RESET (or RES) restores all lines to visibility (non-excluded). RESX (a macro) also restores all lines to visibility but retains the previous lines on the edit screen display.

Syntax:

%SHOWALL string-1 (string-2…string-3... string-n)

Examples: 1. %SHOWALL * IF2. %SHOWALL -TOTAL OLD-RATE NEW-RATE3. %SHOWALL 'HOME DEPOT' 'HOME QUARTERS'

Example one displays only lines containing both an asterisk (*) and the string PUT.

Example two displays only lines containing all of these three strings: -TOTAL, OLD-RATE, or NEW-RATE (note that the dashes are part of the strings).

Example three is similar to example two except that the strings are enclosed inside quotes because they contain embedded blanks.

See the tip for the SHOW macro for some additional information.

Related Macros:

RESX, SHOW

Decision Support Services Page 37

Page 38: Edit Macros 2

TSO and Edit Macros

SHOWMEM

SHOWMEM is an edit macro that shows which libraries defined on the edit panel contain the member being edited.

Syntax:

%SHOWMEM

Examples:

A sample screen display is shown below.

Library------------------------------------- Member-- Result CICG.DEV.EZ EZINTF1 --- found --- CICG.STAG.EZ EZINTF1 *** not found *** CICG.PROD.EZ EZINTF1 --- found ---

The display shows each library defined on the edit panel, the name of the member currently being edited, and whether or not the member is in the corresponding library. In the example above, EZINTF1 is in both the developer and the production libraries but not in the staging library.

Decision Support Services Page 38

Page 39: Edit Macros 2

TSO and Edit Macros

SYSINFO

SYSINFO is a TSO macro that displays information about your ISPF and TSO session.

Syntax:

TSO %SYSINFO

What Is Shown:

The following values are displayed on the TSO display screen:

TSO User Prefix TSO Logon Procedure ISPF Application ISPF Application Profile Extension ISPF Logical Screen ISPF Version TSO Version Operating System Operating System Environment Gregorian Date Julian Date Time

Decision Support Services Page 39

Page 40: Edit Macros 2

TSO and Edit Macros

TODAY

TODAY is a TSO macro that gives information about the current date.

Edit Syntax:

%TODAY

TSO Syntax:

TSO %TODAY

What is Shown:

days into century days into year USA format European format Julian month day

Decision Support Services Page 40

Page 41: Edit Macros 2

TSO and Edit Macros

UNIQVALS

UNIQVALS is an edit macro that shows the unique values contained within a column range of a specified line range. The unique values are displayed on the TSO display screen.

Syntax:

%UNIQVALS start-line end-line start-column end-column

The lines defined by the range start-line to end-line contain the lines to be searched. The columns defined by start-column to end-column define the values to be compared.

Example: 1. %UNIQVALS 1 * 13 25

Example one first pulls all of the values from columns 13-25 in lines 1 to the end-of-file and compares them. The unique values are displayed.

Decision Support Services Page 41

Page 42: Edit Macros 2

TSO and Edit Macros

X2C

X2C an edit macro and TSO macro that translates a hexadecimal number into an EBCDIC character string. The hexadecimal number must be positive. The edit macro displays the result in the short message area. The TSO macro displays the result on the TSO display screen.

This macro may be particularly helpful in interpreting the values in the first operand address field and the second operand address fields when Easytrieve terminates with an OC7 (data exception).

Edit Syntax:

%X2D hexadecimal-number

TSO Syntax:

TSO %X2D hexadecimal-number

Examples:

1. %X2C F92. TSO %X2C D4C1C3D9D6

Example one will display 9 as the result.

Example two will display MACRO as the result.

Related Macros:

See C2X, D2D, X2D.

Decision Support Services Page 42

Page 43: Edit Macros 2

TSO and Edit Macros

X2D

X2D an edit macro and TSO macro that translates a hexadecimal number into a decimal number. The hexadecimal number must be positive. The edit macro displays the result in the short message area. The TSO macro displays the result on the TSO display screen.

Edit Syntax:

%X2D hexadecimal-number

TSO Syntax:

TSO %X2D hexadecimal-number

Examples:

%X2D FF TSO X2D FF

Each example will display 255 as the result.

Related Macros:

See C2X, D2D, X2C.

Decision Support Services Page 43

Page 44: Edit Macros 2

TSO and Edit Macros

EASYTRIEVE

CODE

This is an edit macro that inserts a model code component statement into a program; the syntax is:

%CODE code-component-name line-number (OPT) (EZ|SQL|#|JCL)

The function of each argument is as follows:

line-number: the code component statement is inserted after this line.

OPT: makes the code component statement use OPT. Without OPT, the code component statement defaults to REQ.

EZ: adds a LIST=EZ option to the code component statement.

SQL: adds a LIST=SQL option to the code component statement.

JCL (or #): makes the code component statement *$CODE# instead of *%CODE.

Decision Support Services Page 44

Page 45: Edit Macros 2

TSO and Edit Macros

CODEID

CODEID is a macro for inspecting or updating the codeid, codeloc, codeproj, or dsnid values in a user’s job submission profile. It may be used either as an edit macro or as an TSO macro.

Edit Syntax:

%EZCODE (RESET|[codeid codeloc codeproj dsnid])

TSO Syntax

TSO %EZCODE project (RESET|[codeid codeloc codeproj dsnid])

Arguments:

(none): displays the current codeid and codeloc values. Also displays the codeproj and dsnid values if they are not commented out (their default state).

project: the project (required for TSO invocation).

RESET: resets the codeid to the permid value, codeloc to the permloc value and comments it out, codeproj to the project value and comments it out, dsnid to the userid value. These are the original values.

codeid: sets the codeid to the value indicated.

codeloc: sets the codeloc to the value indicated.

codeproj: sets the codeproj to the value indicated.

dsnid: sets the dsnid to the value indicated.

With no arguments (other than project), the current values are displayed but not changed. RESET may be used as an argument or any of the other four arguments (codeid, codeloc, codeproj, and dsnid). Any combination of the four arguments may be used and they may appear in any order.

(continued on next page)

Examples:

Decision Support Services Page 45

Page 46: Edit Macros 2

TSO and Edit Macros

1. %CODEID2. %CODEID DP3. %CODEID 973 DP CICDJP14. %CODEID CICDJP1 DP 9735. TSO %CODEID LOGG

Example one displays the current values of codeid, codeloc, codeproj, and dsnid.

Example two changes the codeid to DP.

Example three changes the codeloc to 973, the codeid to DP and the dsnid to CICDJP1.

Example four makes the same changes as example three – the arguments are just in a different order.

Example five displays the current current values of codeid, codeloc, codeproj, and dsnid for project LOGG.

Decision Support Services Page 46

Page 47: Edit Macros 2

TSO and Edit Macros

COMM

COMM is an edit macro for turning a program line into a commented line or turning a commented line back into a program line.

COMM works with Easytrieve, SAS, REXX and CLIST programs. To be recognized as an Easytrieve or SAS program, there must be at least one *# command in the program.

Syntax:

%COMM (ON|OFF) start-line (end-line|*)

Examples:

1. %COMM ON 20 302. %COMM OFF 20 303. %COMM ON 204. %COMM ON 20 *

Example one makes lines 20 through 30 comment lines.

Example two removes the comment indicators from lines 20 through 30.

Example three makes line 20 a comment line.

Example four makes comment lines of all lines from line 20 to the last line of the dataset.

Decision Support Services Page 47

Page 48: Edit Macros 2

TSO and Edit Macros

DISPGRP

DISPGRP is an edit macro that manages a series of DISPLAY statements. The DISPLAY statements may be organized into multiple groups. The lines within a group do not have to occur together and any line of any group may occur anywhere within an Easytrieve program. The DISPGRP macro controls the DISPLAY statements by activating or deactivating them (by adding or deleting comment indicators as required). Each DISPLAY statement in a group has a group code identifying its group. Some examples of DISPLAY statements with group codes are:

DISPLAY ‘ITEM’ ‘W-ITEM:’ W-ITEMDISPLAY ‘SUMOUT:’ ‘S-STORE’ S-STOREDISPLAY ‘1’ IN-ITEM

Each DISPLAY statement in a group must have a group code. The group code must be contained within single quotes and must immediately follow the DISPLAY keyword. Note that the group name prints on the output because it is actually a literal value on the DISPLAY statement. For purposes of printing, the group identifier on the DISPLAY statement may include a trailing colon (:); the colon is not part of the group name (e.g., ‘X1’ and ‘X1:’ both belong to group X1).

Syntax:

%DISPGRP group ACT(IVATE)|IN(ACTIVATE) | EN(ABLE)|DIS(ABLE)

Arguments:

group: the name of a group found on one or more DISPLAY statements. The group name may be any combination of non-blank characters; some valid group names are G, 4, G1, ITEM, ASSORT, XIN, XOUT. The asterisk (*) may also be used as a wildcard character; for example, X4* will activate any group beginning with X4.

ACT: activates a DISPLAY group by removing the comment indicator (a leading asterisk). EN is a synonym for ACT and may be used instead.

IN: deactivates a DISPLAY group by adding the comment indicator (a leading asterisk). DIS is a synonym for INACT and may be used instead.

It does not matter which column the Easytrieve DISPLAY statement begins in. The activate option always places an asterisk in column one and is accounted for when removed later on.

(continued on next page)

Decision Support Services Page 48

Page 49: Edit Macros 2

TSO and Edit Macros

Example: 1. %DISPGRP IT ACT

Example one removes the comments from any DISPLAY statement with a group of IT. The two boxes below show the before and after conditions.

000216 * DISPLAY ‘IT’ IN-ITEM000217 * DISPLAY ‘PG’ IN-PRODUCT-GROUP000218 * DISPLAY ‘AS’ IN-ASSORTMENT000219 IF IN-PRODUCT-GROUP = 0000220 OUT-ITEM = 0 000221 * DISPLAY ‘IT’ IN-ITEM 000222 END-IF000223 * DISPLAY ‘PG’ IN-PRODUCT-GROUP Before

000216 DISPLAY ‘IT’ IN-ITEM000217 * DISPLAY ‘PG’ IN-PRODUCT-GROUP000218 * DISPLAY ‘AS’ IN-ASSORTMENT000219 IF IN-PRODUCT-GROUP = 0000220 OUT-ITEM = 0 000221 DISPLAY ‘IT’ IN-ITEM 000222 END-IF000223 * DISPLAY ‘PG’ IN-PRODUCT-GROUP After (changed lines in bold)

Decision Support Services Page 49

Page 50: Edit Macros 2

TSO and Edit Macros

2. %DISPGRP IT INACT

Example two adds the comments to any DISPLAY statement with a group of IT and reverses the actions of the previous example. The two boxes below show the before and after conditions..

000216 DISPLAY ‘IT:’ IN-ITEM000217 * DISPLAY ‘PG:’ IN-PRODUCT-GROUP000218 * DISPLAY ‘AS:’ IN-ASSORTMENT000219 IF IN-PRODUCT-GROUP = 0000220 OUT-ITEM = 0 000221 DISPLAY ‘IT:’ IN-ITEM 000222 END-IF000223 * DISPLAY ‘PG:’ IN-PRODUCT-GROUP Before

000216 * DISPLAY ‘IT:’ IN-ITEM000217 * DISPLAY ‘PG:’ IN-PRODUCT-GROUP000218 * DISPLAY ‘AS:’ IN-ASSORTMENT000219 IF IN-PRODUCT-GROUP = 0000220 OUT-ITEM = 0 000221 * DISPLAY ‘IT:’ IN-ITEM 000222 END-IF000223 * DISPLAY ‘PG:’ IN-PRODUCT-GROUP After (changed lines in bold)

(continued on next page)

Decision Support Services Page 50

Page 51: Edit Macros 2

TSO and Edit Macros

3. %DISPGRP IN* ACT

Example three removes the comments from any DISPLAY statement with a group beginning with IN. The two boxes below show the before and after conditions.

000216 * DISPLAY ‘INIT’ IN-ITEM000217 * DISPLAY ‘INPG’ IN-PRODUCT-GROUP000218 * DISPLAY ‘INAS’ IN-ASSORTMENT000219 IF IN-PRODUCT-GROUP = 0000220 OUT-ITEM = 0 000221 * DISPLAY ‘MODIT’ IN-ITEM000222 END-IF000223 * DISPLAY ‘MODPG’ IN-PRODUCT-GROUP Before

000216 DISPLAY ‘INIT’ IN-ITEM000217 DISPLAY ‘INPG’ IN-PRODUCT-GROUP000218 DISPLAY ‘INAS’ IN-ASSORTMENT000219 IF IN-PRODUCT-GROUP = 0000220 OUT-ITEM = 0 000221 * DISPLAY ‘MODIT’ IN-ITEM000222 END-IF000223 * DISPLAY ‘MODPG’ IN-PRODUCT-GROUP After (changed lines in bold)

As suggested by the actions in the above examples, it is possible to establish multiple groups of DISPLAY statements and control them even though the statements in each group may be distributed throughout the program. In the above examples, groups were established for displaying items, for assortments, and for product groups. The last example used hierarchical groups to separate input, modification, and output (not shown) group.

Decision Support Services Page 51

Page 52: Edit Macros 2

TSO and Edit Macros

DISPLAY

DISPLAY is an edit macro that generates Easytrieve lines containing DISPLAY statements and inserts them into the dataset. By default, the DISPLAY statements use the first variable name of each line of the specified line as the variable name on the DISPLAY statement; the variable can be changed. One DISPLAY statement is generated per line in the line range. DISPLAY statements display both the name and value of each variable. DISPLAY HEX statements may be generated.

Syntax:

%DISPLAY (HEX) (variable-pos) start-line end-line

Arguments:

HEX: causes DISPLAY HEX statements to be generated. Not using the HEX options causes simple DISPLAY statements to be generated.

variable-pos: determines which variable on each line is used for the display statement.

Note: lines beginning with an asterisk (*), HEADING, MASK, IF, or END-IF are skipped and not displayed.

(continued on next page)

Decision Support Services Page 52

Page 53: Edit Macros 2

TSO and Edit Macros

Example: 1. %DISPLAY 216 220

Example one generates DISPLAY statements for the first variables on lines 216 through 220 and inserts them after line 220. The first variable on the each line is used on the DISPLAY statement. The two boxes below show the before and after conditions.

000216 O-DATE = A-DATE(SUB) 000217 O-STORE = A-STORE(SUB) 000218 O-ITEM = A-ITEM(SUB) 000219 O-TRAN-CODE = A-TRAN-CODE(SUB)000220 O-INVOICE = A-INVOICE(SUB) 000221 O-PROD-GROUP = A-PROD-GROUP 000222 O-HIT = W-ASSEMBLY-HIT 000223 W-SELLING = A-SELLING(SUB) Before

000216 O-DATE = A-DATE(SUB) 000217 O-STORE = A-STORE(SUB) 000218 O-ITEM = A-ITEM(SUB) 000219 O-TRAN-CODE = A-TRAN-CODE(SUB) 000220 O-INVOICE = A-INVOICE(SUB) 000221 DISPLAY 'O-DATE: ' O-DATE 000222 DISPLAY 'O-STORE: ' O-STORE 000223 DISPLAY 'O-ITEM: ' O-ITEM 000224 DISPLAY 'O-TRAN-CODE: ' O-TRAN-CODE 000225 DISPLAY 'O-INVOICE: ' O-INVOICE 000226 O-PROD-GROUP = A-PROD-GROUP 000227 O-HIT = W-ASSEMBLY-HIT 000228 W-SELLING = A-SELLING(SUB) After (generated lines in bold)

(continued on next page)

Decision Support Services Page 53

Page 54: Edit Macros 2

TSO and Edit Macros

2. %DISPLAY 3 216 220

Example two is the same as example one except that it uses generates the third variable on each line in the DISPLAY statements. The box below shows the after condition.

000216 O-DATE = A-DATE(SUB) 000217 O-STORE = A-STORE(SUB) 000218 O-ITEM = A-ITEM(SUB) 000219 O-TRAN-CODE = A-TRAN-CODE(SUB) 000220 O-INVOICE = A-INVOICE(SUB) 000221 DISPLAY 'A-DATE(SUB): ' A-DATE(SUB) 000222 DISPLAY 'A-STORE(SUB): ' A-STORE(SUB) 000223 DISPLAY 'A-ITEM(SUB): ' A-ITEM(SUB) 000224 DISPLAY 'A-TRAN-CODE(SUB): ' A-TRAN-CODE(SUB) 000225 DISPLAY 'A-INVOICE(SUB): ' A-INVOICE(SUB) 000226 O-PROD-GROUP = A-PROD-GROUP 000227 O-HIT = W-ASSEMBLY-HIT 000228 W-SELLING = A-SELLING(SUB) After (generated lines in bold)

3. %DISPLAY HEX 216 220

Example three is the same as example two except that it uses the HEX option on the DISPLAY statement.

000216 O-DATE = A-DATE(SUB) 000217 O-STORE = A-STORE(SUB) 000218 O-ITEM = A-ITEM(SUB) 000219 O-TRAN-CODE = A-TRAN-CODE(SUB) 000220 O-INVOICE = A-INVOICE(SUB) 000221 DISPLAY HEX 'A-DATE(SUB): ' A-DATE(SUB) 000222 DISPLAY HEX 'A-STORE(SUB): ' A-STORE(SUB) 000223 DISPLAY HEX 'A-ITEM(SUB): ' A-ITEM(SUB) 000224 DISPLAY HEX 'A-TRAN-CODE(SUB): ' A-TRAN-CODE(SUB)000225 DISPLAY HEX 'A-INVOICE(SUB): ' A-INVOICE(SUB) 000226 O-PROD-GROUP = A-PROD-GROUP 000227 O-HIT = W-ASSEMBLY-HIT 000228 W-SELLING = A-SELLING(SUB) After (generated lines in bold)

Decision Support Services Page 54

Page 55: Edit Macros 2

TSO and Edit Macros

EZCODE

This is an edit macro that edits a member in a code component library for each code component statement in a program.

Syntax:

%EZCODE (ASIS|ASRUN) (permid|logonid) (M=name|MEM=name|MEMBER=name|CODE=name)

Arguments:

(none): edits a member from the lowest-level library (whether previously existing or not). Uses the permid and permloc from the user’s own job submission profile.

ASIS: searches the specified libraries from left to right and edits the first member found. If no member is found, then a member from the lowest-level library is edited. Uses the permid and permloc from the job submission profile.

ASRUN: uses the codeid and codeloc from the job submission profile. Implies ASIS; that is, it uses the same search sequence and technique as does ASIS.

permid: uses the values in the job submission profile belonging to the user with the specified two-character permid.

logonid: same as as permid except based on the user’s seven-character logonid.

M=name. Uses only the code component name specified. The keyword M may also be specified as MEM, MEMBER, or CODE.

Decision Support Services Page 55

Page 56: Edit Macros 2

TSO and Edit Macros

EZDB2

EZDB2 is an edit macro that allows you to generate a SELECT statement in the correct SQL format for Easytrieve Plus. The macro generates:

The SELECT clause.

The FROM clause.

The INTO clause.

The data fields in a file format required by Easytrieve Plus.

EZDB2 also gives you the optional ability to generate:

A WHERE clause.

An ORDER BY clause.

A GROUP BY clause.

A HAVING clause.

You may join up to four DB2 tables together.

Although EZDB2 is very flexible and generates a wide variety of SELECT statements, it does not generate all possible SELECT statements (such as subqueries or unions). You may, however, generate a SELECT statement similar to the one you need and then modify it.

Note that there is no extensive logic checking. It is quite possible to generate an incorrect SQL statement if you are not sure what you are doing.

Decision Support Services Page 56

Page 57: Edit Macros 2

TSO and Edit Macros

Using EZDB2: Summary

Following is a summary of the steps involved in using EZDB2.

STEP ACTION

1 Include any necessary *$DB2 command in your program. (see below) to define the DB2 tables you need.

2 Edit your program member. 3 Invoke EZDB2 by entering just EZDB2 (nothing else) on the

command line of your member. 4 Fill out the Select screen (the main screen), which allows you

to select fields, select column functions for fields, specify fields for a WHERE clause, specify fields for a GROUP BY clause, and specify fields for a HAVING clause.

5 Fill out a WHERE Clause screen for each field so specified on the main screen. You may compare a field against literal values or values in other fields.

6 Fill out a HAVING clause for each field so specified on the main screen. You may compare the appropriate column functions for the field against literal values.

7 The FILE and SELECT statements are inserted into your program immediately following the appropriate *$DB2 command. Any previous SQL statements generated by EZDB2 will be replaced.

8 Edit the SQL statements if necessary.

Easytrieve Plus field names

At Lowe’s, there is a systematic relationship between Easytrieve Plus field names and DB2 column names. The Easytrieve Plus name is the same as the DB2 column name except that it has the table name added as a prefix. The table below shows some examples.

DB2 Name Easytrieve NameDATE_OPENED MIS008C-DATE-OPENEDITEM_NUMBER INM010U-ITEM-NUMBERLOCATION MIS008C-LOCATION

For your convenience, all EZDB2 screens use field names rather than column names.

Decision Support Services Page 57

Page 58: Edit Macros 2

TSO and Edit Macros

Using *$DB2 commands

Tell EZDB2 which DB2 tables to process by using a *$DB2 command in the file section of your Easytrieve Plus program for each file. The command species the name of the DB2 table. For example, the following command will create a FILE statement for MISC008 that includes your generated SELECT statement.

*$DB2 MIS008CSyntax

Include an *$DB2 command in your program for each Easytrieve Plus file that uses a DB2 table (or tables).

The SELECT Clause screen

------------------------------- SQL GENERATOR -------------------------------- COMMAND ===> SCROLL ===> DATA Action: S=Select W=Select/WHERE clause Distinct ===> (Y/N) X=WHERE nn=Select with SUBSTR TOP O G H A M M S C R P A V I A U TAct Field Name Len Typ Dec D P V G N X M D MIS008C-CORPORATION 2 B 0 MIS008C-AREA-NUM 2 B 0 MIS008C-REGION 2 B 0 MIS008C-LOCATION 2 B 0 MIS008C-ABBREV 4 A MIS008C-CORP-NAME 40 A MIS008C-DBA-NAME 50 A MIS008C-DELIVERY-ADDRESS 32 A MIS008C-DELIVERY-CITY 32 A MIS008C-DELIVERY-STATE 2 A MIS008C-DELIVERY-ZIP 4 B 0 COUNT(*) 4 B 0 MORE.. F1=Help F2=Sort F3=End F4=Top F5=Bottom F7=Up F8=Down F10=Group F12=Cancel

Description of the SELECT Clause screen

The above screen shows one row for each column in the DB2 table, along with the field length, data type, and number of decimals (for numeric data types). After all of these rows comes one additional row called COUNT(*), which represents the COUNT(*) function.

At the left of each field is an action field (abbreviated Act).

Since the rows on the screen are scrollable, scrolling messages appear near the top and bottom right. The two possible top right messages are TOP (when the first field is displayed) and ..MORE (when the first field is not displayed) The two

Decision Support Services Page 58

Page 59: Edit Macros 2

TSO and Edit Macros

possible bottom right messages are BOTTOM (when the last field is displayed) and MORE.. (when there are more fields to be displayed).

Filling out the SELECT Clause screen

Action field.

The action field allows you to place a field in the SELECT clause. It also allows you to place a field in the WHERE clause.

The possible values for the action field are:

W - the field will be used in the WHERE clause and in the SELECT clause.

S - the entire field will be placed in the SELECT clause but not the WHERE clause.

X - the field will be placed in the WHERE clause but not the SELECT clause.

nn (a number) - only the first nn characters of the field will be retrieved by the SELECT clause.

For each field selected with one of the above selection optionss, you will be shown a WHERE Clause screen (see below), where you may specify the conditions in the WHERE clause.

DISTINCT field

The DISTINCT field (in the upper right of the screen) modifies the SELECT statement so that it becomes a SELECT DISTINCT statement.

Function keys on the SELECT screen

The function keys on the SELECT screen are as follows:

F1 (Help) - displays a series of help screens.

F2 (Sort) - sorts the fields in alphabetic order.

F3 (End) - begins building the SELECT statement. If any WHERE Clause or HAVING Clause screens have been requested, they will be shown now.

F4 (Top) - displays the first column at the top of the screen.

F5 (Bottom) - displays the last column at the bottom of the screen.

F7 (Up) - scrolls up one screen. You may scroll up a specified number of fields by putting that number on the command line and hitting F7. The default scroll amount is PAGE (all 12 fields). You may modify this by putting DATA (11 lines) or HALF (six lines) in the Scroll field at the top right of the screen.

F8 (Down) - scrolls down one screen. This works like F7 except that the scroll direction is forward.

Decision Support Services Page 59

Page 60: Edit Macros 2

TSO and Edit Macros

F10 (Cluster) - this puts all fields into one of two groups. One group consists of all fields that have been selected in any way (via the action field, GROUP BY field, HAVING field, or a column function field) The other group consists of all other fields. The group of selected fields are clustered at the beginning of the display and the non-selected fields following. Fields within each group are sorted alphabetically.

F12 (Cancel) - a SELECT clause will not be built for the current file. Any SELECT clause built for a previous file will still remain. You will still be given the opportunity to build the SELECT clause for all remaining *$DB2 files in your program. Given three files, for example, you can build a new SELECT clause for the first file, skip changing the SELECT clause for the second file (by using Cancel), and then build a new SELECT clause for the third file.

The WHERE Clause screen

--------------------------------- WHERE Clause ------------------------------- COMMAND ===>

Field: MIS008C-DELIVERY-STATE Type: A Length: 2

Oper Literal Value Oper Literal Value = NC = = SC = = VA => <...................................................................................

Oper Field Name Oper Field Name = MIS008C-MAILING-STATE

F1=Help F3=End F12=Cancel

The WHERE Clause screen

The WHERE clause screen is divided into two areas that resemble one another very closely. In the above example, the top and bottom parts of the screen are shown separated by a dotted line, although there is no such line really exists.

The top area is the literal value part; here you may specify literal values to be compared against the selected field. The bottom area is the field value part; here you may specify another field (either a DB2 column or a host variable) to be compared against the selected field. Comparing one field to another field is, for example, almost always used to join one table with another table.

Decision Support Services Page 60

Page 61: Edit Macros 2

TSO and Edit Macros

Alongside each literal value or field name field is an operand field (OPER) that allows you to specify the relationship (such as = or =) to be used in the comparison test.

For your convenience, the screen is initialized with a variety of operands. You may change them simply by overtyping them. Operands with no corresponding values are ignored, so you do not need to erase operands you fail to use.

Filling out the WHERE Clause screen

You may specify up to 18 literal values (such as 101 or ‘NC’) in the literal value area. Alphanumeric literal values need not contain surrounding quotes, although they are permitted (for example, either ‘NC’ or NC is okay).

You may specify any of the standard comparison operators in the operand field: =, =, <>, <, <=, >, >, >=, or >. Note that = and <> are just two different ways to represent NOT EQUAL.

In addition, if the comparison involves a literal value, you may use as an operator either BETW (BETWEEN) or BETW (NOT BETWEEN). Since the BETWEEN or NOT BETWEEN operators specify a range, be sure to put the first value in one of the left-hand columns and the second value in the corresponding right-hand column (leave the right-hand operand column blank).

If the literal value comparison involves an alphanumeric value, you may use LIKE or LIKE (NOT LIKE).

Since you are entering comparison values for just one field per screen, the logical connection between the values depends only upon whether the operands are positive (such as =) or negative (such as =). Only one of the positive tests need be true for a DB2 row to be selected (that is, all positive tests are connected by OR). All negative tests need be true for a DB2 row to be selected (that is, all negative tests are connected by AND).

In the sample screen at the top of the previous page, a row will be retrieved from the DB2 table if the state is either North Carolina, South Carolina, or Virginia and the delivery state is different from the mailing state.

Optional Clause Fields

To the right of the field descriptions are three selection fields, which are used to generate optional SQL clauses. Going from left to right, the fields are as follows:

ORD - the ORDER BY selection field.

GRP - the GROUP BY selection field.

HAV - the HAVING selection field.

The ORDER BY (Ord) field allows you to place a field in the ORDER BY clause. Simply type a number in the field that represents the relative position of the

Decision Support Services Page 61

Page 62: Edit Macros 2

TSO and Edit Macros

field in the ORDER BY clause. That is, use 1 for the first field, 2 for the second field, 3 for the third field, and so on. Do not use the same number for more than one field. A field placed in the ORDER BY clause is not necessarily placed in the SELECT clause.

The GROUP BY and HAVING clause selection fields will be discussed below.

Column Function Fields

To the right of the special clause selection fields are five other selection fields. Going from left to right, these fields are as follows:

AVG - the AVG selection field.

MIN - the MIN selection field.

MAX - the MAX selection field.

SUM - the SUM selection field.

CTD - the COUNT DISTINCT selection field.

The AVG, MIN, MAX, SUM, and COUNT DISTINCT (CTD) fields allow you to place the selected column function in the SELECT clause. Select a field by using any non-blank character. For example, selecting all column functions for a column named STORE-SQFT will generate the following items in the SELECT statement:

AVG(STORE-SQFT).MIN(STORE-SQFT).MAX(STORE-SQFT).SUM(STORE-SQFT)COUNT(DISTINCT STORE-SQFT).SELECT Statement fields

Erasing the previous SELECT Clause

If a previous SELECT clause was built by EZDB2, then it will be erased before a new SELECT clause is built. SELECT clauses built by EZDB2 terminate with a line containing *DB2END in the first seven columns; this termination code is necessary for correct replacement to occur.

Caution! Some care needs to be exercised in generating SQL statements. It is possible for illogical SELECT clauses to be generated, especially ones with complex logic.

Decision Support Services Page 62

Page 63: Edit Macros 2

TSO and Edit Macros

Using EZDB2 for Groups

Alongside each field on the main (SELECT) screen are two fields:

GROUP BY field. The GROUP BY (GRP) field allows you to place a field in the GROUP BY clause. Put a number in the field that represents the relative position of the field in the GROUP BY clause. That is, use 1 for the first field, 2 for the second field, 3 for the third field, and so on. Do not use the same number for more than one field. A field placed in the GROUP BY clause is also automatically placed in the SELECT clause.

HAVING field. The HAVING (HAV) field allows you to place a field in a HAVING clause. Select a field by using any non-blank character. For each selected field, you will be shown a HAVING Clause screen (see below) where you may specify conditions in the HAVING clause.

The HAVING Clause screen

-------------------------------- HAVING Clause ------------------------------- COMMAND ===>

Field: MIS008C-SALES-FLR-SQFT Type: B Length: 4 Decimal: 0

---- AND ---- ---- AND ---- ---- AND ----

---- MIN ---- ---- MAX ---- ---- AVG ---- ---- SUM ---- | Op Value Op Value Op Value Op Value | >= 20000 <= 40000 O < 10000 R > 50000 | |

Note: Values in the same row (going across) must ALL be true for a group to be selected. If multiple rows are used, only ONE of the rows must be true for a group to be selected.

F1=Help F3=End F12=Cancel

The HAVING Clause screen

The HAVING clause screen consists of a four rows and either four columns (for numeric fields) or two columns (for alphanumeric fields). The columns are headed MIN, MAX, AVG (numeric fields only), and SUM (numeric fields only). Each column represents the appropriate column function for that field. For example, the MIN column for field MIS008C-SALES-FLR-SQFT represents the MIN(SALES-FLR-SQFT) function.

Each column consists of an operand field (Op) and a literal value field (Value).

Decision Support Services Page 63

Page 64: Edit Macros 2

TSO and Edit Macros

Filling out the HAVING Clause screen

If the field type is numeric, You may put a numeric value in any or all of the literal value fields. If the field type is alphanumeric, you may put an alphanumeric value in any or all of the literal value fields. Alphanumeric literal values need not contain the surrounding quotes (for example, either ‘NC’ or NC is okay).

You may specify any of the standard comparison operators in the operand field: =, =, <>, <, <=, >, >, >=, or >.

All tests contained in the same row must be true for a group to be passed to your program (that is, all tests within the same row are connected with AND). If there are multiple rows, then a group will be passed to your program if any row is true (that is, row tests are connected with OR).

If you use more than one field in a HAVING test, then a group will be passed to your program only if the group passes a row test for all fields (that is, the set of tests for one field are connected to the sets of tests for other fields with AND).

In the sample screen at the top of the page, a group will be retrieved from the DB2 table if the minimum sales floor square footage in the group is greater than or equal to 20000 and also less than or equal to 50000. The group will also retrieved if the average is less than 10000 or greater than 50000.

Using EZDB2 for Joining Multiple Tables

EZDB2 may be ]used to join up to four tables together in an Easytrieve Plus file. To join tables, simply list each table on the *$DB2 command followed by its correlation name. For example:

*$DB2 TCP101 T1 TCP102 T2Example

In this example, TCP101 and TCP102 are the two DB2 tables being joined; T1 is the correlation name for TCP101 and T2 is the correlation name for TCP102.

Decision Support Services Page 64

Page 65: Edit Macros 2

TSO and Edit Macros

EZMULT

EZMULT is a macro for submitting multiple programs. Put a set of TSO commands in a dataset, leaving out the TSO %EZS. The example below shows a dataset containing the command line equivalent for each of four programs to be executed.

cicg prod ezintf2 cicg prod ezintf4 (panel=n cicg prod ezintf5 (panel=n cicg prod ezintf6 id(js) loc(970) (panel=n

Each record contains the project, group, and member name of the program to be submitted. The PANEL=N option to the left of the left parenthesis is optional and suppresses display of the submission panel when the submission program is executed. One or more spaces must separate each field.

Running %EZMULT is similar to executing %EZS for each program in the dataset and can be executed in three different ways:

Executing %EZMULT (as an edit macro) from the dataset containing the program names.

From any command line by giving the fully-qualified name of the dataset containing the program names:

TSO %EZMULT dataset [e.g., tso %ezmult crddjp1.ispf.data(ezprogs) ]

From any command line by giving a member name. The member is assumed to be in the user’s ISPF.DATA dataset:

TSO %EZMULT member [e.g., tso %ezmult ezprogs]

Note: for best results use either an unnumbered member or begin all commands in column one. Otherwise the sequence numbers in columns 73-80 will appear to be parameters and will cause error messages to be generated (which, however, do not affect proper execution).

Related Macros:

EZS.

Decision Support Services Page 65

Page 66: Edit Macros 2

TSO and Edit Macros

EZPROF

This is a macro for editing or viewing information about user job submission profiles. It may be used either as an edit macro or a TSO macro. As an edit macro the syntax is:

Edit Macro Syntax:

%EZPROF (ALL|permid|logonid)

TSO Syntax:

TSO %EZPROF project (ALL|permid|logonid)

Arguments:

(none): edits the user’s profile. Assumes the project is the same as the project of the currently edited member.

ALL: views the registry.

permid: edits profile of the user with the specified permid value.

logonid: same as permid except based on the user’s logonid.

Project: identifies the project containing the profile.

Decision Support Services Page 66

Page 67: Edit Macros 2

TSO and Edit Macros

EZS

EZS is both an edit macro and TSO macro used to submit Easytrieve programs from a library with a type of EZ. It is a replacement for EZ, which works with ISPF.DATA libraries.

Edit Macro Syntax:

%EZS (TEST|DEV|STAG|PROD) (ID(xx)) (LOC(nnn)) (D1(xxxx)) D2(xxxx))

Arguments:

(none): the program submitted is the current member in the current library (however, note that if a personal library is the lowest-level library on the edit panel then the program will always be saved into the personal library and run from there.

(TEST|DEV|STAG|PROD): this causes the member to be submitted from the specified library.

ID(xx): runs with the code components belonging to the user identified by xx, where xx is the user’s codeid. You could achieve the same result by changing the codeid in your job submission profile.

LOC(nnn): runs with the code components in the location code component library identified by nnn, where nnn is a location number. You could achieve the same result by changing the codeloc in your job submission profile

D1(xxxx): puts the value represented by xxxx (where xxxx is any value) into a field associated with the file DATA1. You must code all of the Easytrieve file, field, and input statements yourself. D1 generates a DD SYSIN * statement for DATA1 and puts xxxx on the next line as the data.

D2(xxxx): same as D1 except uses the file DATA2. DATA1 and DATA2 may be used together.

(continued on next page)

Decision Support Services Page 67

Page 68: Edit Macros 2

TSO and Edit Macros

TSO Syntax:

TSO %EZS project group member (ID(xx)) (LOC(nnn)) (D1(xxxx)) D2(xxxx))-or-

TSO %EZS member project group (ID(xx)) (LOC(nnn)) (D1(xxxx)) D2(xxxx))

Additional Arguments:

project: the project of the library containing the member to be submitted.

group: the group of the library containing the member to be submitted.

member: the member to be submitted.

Examples:

1. %EZS2. %EZS LOC(973)3. %EZS ID(JS) D1(50800)4. %EZS PROD5. TSO %EZS CICG PROD CCEX6

Example one submits the current program being edited.

Example two submits the current program and uses the L973 location code component library.

Example three submits the current program and uses the personal code components belonging to the person in the project with a permid of JS. 50800 will also be the value read when the program performs a GET function on DATA1.

Example four submits a program from the PROD library; the member submitted will be the same as the member being currently edited.

Example five submits the program in CICG.PROD.EZ(CCEX6). Since the type is always EZ, there is no need for the type to be specified.

Related Macros:

EZMULT.

Decision Support Services Page 68

Page 69: Edit Macros 2

TSO and Edit Macros

FORMLIST

FORMLIST is an edit macro that formats a code component member for use in an Easytrieve IF-statement list or in a SQL WHERE clause. It separates items by commas and a space, removes trailing plus signs, and splits long lines into two lines; its syntax is:

%FORMLIST (CHAR|NUM) (start-line) (end-line)

Arguments:

CHAR: puts quotes around items in the list.

NUM: does not put quotes around items in the list. NUM is the default and only needs to be specified in start-line and end-line are specified.

Examples:

1. %FORMLIST2. %FORMLIST CHAR3. %FORMLIST NUM 12 16

Example one formats the entire member as a numeric list.

Example two formats the entire members as a character (alphanumeric) list.

Example three formats lines 12-16 as a numeric list.

Decision Support Services Page 69

Page 70: Edit Macros 2

TSO and Edit Macros

GETCODE

GETCODE is an edit macro that creates a new code component member and moves lines from the program into the new member.

%GETCODE USER|LOC|PROD starting-line (ending-line)

Arguments:

USER, LOC, or PROD: creates a member in the specified code component library.

The code component statement must be either on the line identified by the starting line number or on the line immediately above it.

Decision Support Services Page 70

Page 71: Edit Macros 2

TSO and Edit Macros

MOVEPROD

MOVEPROD is a macro that moves a program from the developer or staging library to the production library. It can only replace a like-named program; it cannot add a new program. MOVEPROD can be used only by developers.

MOVEPROD can be executed in one of three ways:

Executing MOVEPROD from the command line of a member in a staging library. The member will be moved to the production library.

Executing the TSO version of MOVEPROD with a project and member; the member is moved to the production library from the staging library or from the developer library (if not on the staging library). This form is executed from any command line with:

TSO %MOVEPROD project member (e.g., tso %moveprod crdg ezintf1)

Executing the TSO version of MOVEPROD with just a project. This displays a selection panel of programs contained in the project developer and staging libraries. This form is executed from any command line with:

TSO %MOVEPROD project

The selection panel looks like the one shown below. The Y in the Move column means the program can be moved (i.e., it exists in the production library). The N in the Move column means that the program cannot be moved (i.e., it does not exist in the production library).

------------------------------- Move to PROD -------------------------------- COMMAND ===> SCROLL ===> DATA Name Lib Move VV.MM Created Changed Size Init ID CCEX4 DEV Y 01.06 99/06/14 99/07/28 13:59 46 46 CICDJP1 CCEX5 DEV Y 01.07 99/08/19 99/08/19 15:08 0 0 CICDJP1 CCEX6 DEV Y 01.03 99/06/16 99/06/16 16:32 80 80 CICDJP1 EZINTF1 DEV Y 01.20 99/06/01 99/06/09 16:03 33 0 CICDJP1 EZINTF8 DEV Y 01.06 96/02/12 99/04/12 14:49 92 91 CICDJP1 JUNK DEV N 01.02 99/07/15 99/07/15 09:33 366 0 CICDJP1 JUNK1 DEV N 01.00 99/08/17 99/08/17 16:04 41 41 CICDJP1

(continued on next page)

Decision Support Services Page 71

Page 72: Edit Macros 2

TSO and Edit Macros

MOVEPROD does not actually perform the move; it merely submits a batch job to perform the move.1 The job output for a successful move should like the output shown on the next page.

* Promotion from Staging Library to Production Library *

I/O Type Library Member RC Message Input CRDG.STAG.EZ EZINTF1 0 Allocated Output CRDG.PROD.EZ EZINTF1 0 Allocated

*** Program Copied

* Deletion from Staging Library * EZINTF1 Deleted

EZINTF1 MEMBER DELETED

It should be noted that the move removes the ISPF statistics from the moved member but that the statistics are restored overnight.

1 This is because developers do not have write access to the production library so cannot make the move themselves.

Decision Support Services Page 72

Page 73: Edit Macros 2

TSO and Edit Macros

PLUS

PLUS is an edit macro that can add a plus sign (+) to a line or remove it. PLUS adds a space and a plus sign after the last character in a line. Plus signs are not added to lines that already end with a plus sign. Plus signs are also not added to comment lines.

A plus sign is only removed if it is the last character in a line. Plus signs are not removed from comment lines.

Syntax:

%PLUS (ON|OFF) start-line end-line

Examples:

1. %PLUS ON 20 302. %PLUS OFF 20 *

Example one adds a plus sign to the end of lines 20 through 30.

Example two removes plus signs from lines 20 through the end-of-file.

Decision Support Services Page 73

Page 74: Edit Macros 2

TSO and Edit Macros

SHIF

SHIF (short for SHOW IF) is an edit macro that allows you to display on your edit screen only those line related to program logic structures. It displays, among other things, all lines containing an IF or END-IF statement. SHIF allows you to more easily see the overall logic of your program.

After using SHIF, you may use any of the usual editing functions. RESET (or RES) restores all lines to visibility (non-excluded).

Syntax:

%SHIF

What Lines Are Shown:

Only lines containing any of the following statements are displayed:

IF ELSE ELSE-IF END-IF CASE WHEN END-CASE DO END-DO PROC END-PROC

Decision Support Services Page 74

Page 75: Edit Macros 2

TSO and Edit Macros

ISPF DEVELOPMENT/OTHER

AVAR

AVAR is a TSO macro that adds a new variable and its value to your ISPF application profile pool.

Syntax:

TSO %AVAR variable value

Examples

TSO %AVAR LASTLIB USER

This example adds the variable to the profile pool with a value of USER.

Related Macros:

See CVAR, DVAR, FVAR.

Decision Support Services Page 75

Page 76: Edit Macros 2

TSO and Edit Macros

CVAR

CVAR is a TSO macro that changes the value of a variable in the ISPF application profile pool and/or the shared pool. The value will be changed in both pools if the variable exists in both pools.

Syntax:

TSO %CVAR variable value

Examples

TSO %CVAR LASTLIB DEV

This example changes the value of variable LASTLIB in the application profile pool and/or the session pool to DEV

Related Macros:

See AVAR, DVAR, FVAR.

Decision Support Services Page 76

Page 77: Edit Macros 2

TSO and Edit Macros

DL

DL is an edit macro that displays the lengths of two pairs of strings containing dashes. The strings must be on the same line. DL is geared to help center a string within a set of dashed lines.

Syntax:

%DL start-line

The line defined by start-line is checked for two strings containing dashes. The strings must be separated by a non-dash character.

Examples

%DL 10

Example one displays the lengths of two strings containing dashes on line 10.

Decision Support Services Page 77

Page 78: Edit Macros 2

TSO and Edit Macros

DVAR

DVAR is a TSO macro that deletes a variable from either the ISPF application profile pool or the shared pool.

Syntax:

TSO %DVAR variable PROFILE|SHARED

Examples

TSO %DVAR LASTLIB PROFILE

This example deletes the variable LASTLIB from the application profile pool.

Related Macros:

See AVAR, CVAR, FVAR.

Decision Support Services Page 78

Page 79: Edit Macros 2

TSO and Edit Macros

FMEM

FMEM is a TSO macro that searches for a specified member among the libraries allocated to your TSO session. It lists the libraries in their concatenated order and shows for each library whether the member is in that library or not. Dynamically allocated libraries are not searched.

Syntax:

TSO %FMEM member library-type

Valid library types and their aliases are:

SYSPROC (CLIST)SYSEXEC (EXEC)ISPMLIB (MLIB, MSG) ISPLLIB (LLIB, LOAD) ISPPLIB (PLIB, PANEL) ISPSLIB (SLIB, SKEL) ISPTLIB (TLIB, TABLE)

Examples:

1. TSO %FMEM ISREDM01 ISPPLIB 2. TSO %FMEM ISREDM01 PLIB3. TSO %FMEM FMEM CLIST

Example one and example two search for a member named ISREDM01 in all of the panel libraries allocated to the user’s TSO session.

Example three searches for a member named FMEM in all of the libraries allocated to the user’s TSO session as SYSPROC.

Decision Support Services Page 79

Page 80: Edit Macros 2

TSO and Edit Macros

FVAR

CVAR is a TSO macro that displays the value of a variable in the ISPF application profile pool and the shared pool. Asterisks will be displayed if the variable does not exist if one or both of the pools.

Syntax:

TSO %FVAR variable

Examples

TSO %FVAR LASTLIB

This example displays the value of variable LASTLIB in the application profile pool and the session pool. The display might, for example, look like:

SHARED POOL --- LASTLIB --- ******* PROFILE POOL --- LASTLIB --- USER

Related Macros:

See AVAR, CVAR, DVAR.

Decision Support Services Page 80

Page 81: Edit Macros 2

TSO and Edit Macros

PFSAVE

PFSAVE is a TSO macro that stores the value of the current function key values PF1-PF24 for later retrieval with PFRSTORE.

Syntax:

TSO %PFSAVE

Examples

TSO %PFSAVE

This example stores the values of PF1-PF24.

Related Macros:

See PFSWAP, PFRSTORE.

Decision Support Services Page 81

Page 82: Edit Macros 2

TSO and Edit Macros

PFSWAP

PFSAVE is a TSO macro that swaps the values of function key PF1-12 for function keys PF13-24.

Syntax:

TSO %PFSWAP

Related Macros:

See PFSSTORE, PFRSTORE.

Decision Support Services Page 82

Page 83: Edit Macros 2

TSO and Edit Macros

PFRSTORE

PFRSTORE is a TSO macro that restores values of the PF1-PF24 previously saved using PFSAVE.

Syntax:

TSO %PFRSTORE

Examples

TSO %PFRSTORE

This example restores the values of PF1-PF24 to those previously saved using PFSAVE.

Related Macros:

See PFSAVE, PFSWAP.

Decision Support Services Page 83

Page 84: Edit Macros 2

TSO and Edit Macros

QL

QL is an edit macro that displays the length of the first string on a line that contains a value within a set of single quotes.

Syntax:

%QL start-line

The line defined by start-line is checked for a value within single quotes.

Examples:

%QL 10

Example one displays the lengths of a value within single quotes on line 10.

Decision Support Services Page 84

Page 85: Edit Macros 2

TSO and Edit Macros

SHDO

SHDO is an edit macro for REXX, CLIST, or PL/I programs that allows you to display only those lines related to program logic structure.

After using SHDO, you may use any of the usual editing functions. RESET redisplays all lines.

Syntax:

%SHDO

What Lines Are Shown:

BEGINDODO UNTILDO WHILEENDENDOEND-DOSELECTWHEN: PROC

Related Macros:

See SHIF.

Decision Support Services Page 85

Page 86: Edit Macros 2

TSO and Edit Macros

SLIP

SLIP is an edit macro that shifts text downward from a column range in one line to the next line. Multiple lines may be processed at one time, with the text from each line in the specified line range being shifted down to the next line. The text from one line overlays the text in the next line.

Syntax:

%SLIP start-line end-line (start-column end-column)

The lines defined by the range start-line to end-line contain the text to be moved. The lines being overlaid are defined by the range start-line+1 to end-line+1. The end-line cannot be the last line of the dataset since end-line+1 would lie outside of the dataset.

Example: 1. %SLIP 20 30 40 50

Example one first puts the text from columns 40-50 in line 30 into columns 40-50 of line 31. Then it puts the text from columns 40-50 in line 29 into columns 40-50 of line 30. Then it puts the text from columns 40-50 in line 28 into columns 40-50 of line 29. This proceeds repeats itself until the text from columns 40-50 in line 20 is put into columns 40-50 of line 21.

Related Macro:

See SLUP.

Decision Support Services Page 86

Page 87: Edit Macros 2

TSO and Edit Macros

SLUP

SLUP is an edit macro that shifts text upward from a column range in one line to the previous line. Multiple lines may be processed at one time, with the text from each line in the specified line range being shifted up to the previous line. The text from one line overlays the text in the previous line.

Syntax:

%SLUP start-line end-line (start-column end-column)

The lines defined by the range start-line to end-line contain the text to be moved. The lines being overlaid are defined by the range start-line-1 to end-line-1. The start-line cannot be the first line of the dataset since end-line-1 would lie outside of the dataset.

Example: 1. %SLUP 20 30 40 50

Example one first puts the text from columns 40-50 in line 20 into columns 40-50 of line 19. Then it puts the text from columns 40-50 in line 21 into columns 40-50 of line 20. Then it puts the text from columns 40-50 in line 22 into columns 40-50 of line 21. This proceeds repeats itself until the text from columns 40-50 in line 30 is put into columns 40-50 of line 29.

Related Macro:

See SLIP.

Decision Support Services Page 87

Page 88: Edit Macros 2

TSO and Edit Macros

Decision Support Services Page 88