Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 3: ISPF Edit


ISPF- ISPF Editor

The ISPF editor (option 2) is where you write and change programs, JCL and data. You edit a member of a partitioned dataset or a whole sequential dataset. Changes are kept in memory until you save, so the editor is forgiving while you work.

Opening a member for edit

Type 2 on the primary option menu. Fill in the dataset name (Project/Group/Type/Member or the full quoted name) and press Enter. If the member does not exist, ISPF creates an empty one.

------------------------------- Edit Entry Panel ----------------------------- Command ===> ISPF Library: Project . . . USER01 Group . . . . PAYROLL (second group, third, fourth optional) Type . . . . COBOL Member . . . TAXCALC (* for member list, blank for selection list) Other Partitioned, Sequential or VSAM Data Set: Data Set Name . . . Volume Serial . . .
  • Use * in the Member field to pick from a member list.
  • View (option 1) looks identical but never saves changes. Browse is read-only too. Use Edit when you intend to change things.

Line commands

Line commands are typed over the 6-digit line numbers on the left, then you press Enter. They act on one line, or on a block when you add a number (D3 deletes 3 lines).

000100 MOVE 100 TO TOTAL. D00100 MOVE 100 TO TOTAL. <-- D deletes this line 000300 ADD TAX TO TOTAL. I000300 ADD TAX TO TOTAL. <-- I opens blank lines after this line 000400 DISPLAY TOTAL. R200400 DISPLAY TOTAL. <-- R2 repeats this line twice
  • I - Insert. Opens new blank lines after the line. In opens n lines.
  • D - Delete. Dn deletes n lines. DD on two lines deletes the whole block between them.
  • R - Repeat. Copies the line below itself. Rn repeats n times.
  • C - Copy. Mark source lines with C (or CC block), then mark the target with A (after) or B (before).
  • M - Move. Same as copy, but the source lines are deleted after the move.
  • O - Overlay. Overlays a copied block onto a target block column by column (blanks in the source do not overwrite).
  • X - Exclude. Hides lines from the display. S shows them again; RESET shows everything.
  • A block example: type CC on the first and last line of the block, A on the target line, press Enter.

Primary commands

Primary commands are typed on the Command ===> line at the top of the edit panel.

Command ===> F 'MOVE 100' find the next occurrence of MOVE 100 Command ===> C 'MOVE 100' 'MOVE 200' ALL change all occurrences Command ===> C 'TAX' 'FEE' 1 5 ALL change TAX to FEE on lines 1-5 only Command ===> SAVE save without leaving the editor Command ===> CANCEL leave without saving anything Command ===> RENUM renumber all lines in steps of 100 Command ===> UNDO undo the last change Command ===> COLS show the column ruler Command ===> HEX ON show the data in hexadecimal
  • FIND (F) searches forward. PF5 (Rfind) repeats the last find. Add PREV to search backward, ALL to list every hit.
  • CHANGE (C) replaces text. Always run with ALL only when you mean it; otherwise change one occurrence at a time and confirm with Rchange (PF6).
  • SAVE writes your changes. PF3 (End) saves and leaves. CANCEL leaves without saving.
  • CAPS ON/OFF controls whether typed lowercase is converted to uppercase. Keep CAPS ON for COBOL and JCL.
  • NUMBER ON/OFF controls the sequence numbers in columns 73-80. Turn NUMBER OFF when editing data that must not have sequence numbers.
  • BOUNDS limits FIND/CHANGE to certain columns, useful for changing only the sequence-number area or only columns 8-72.

A real editing session

Fix a typo in a COBOL program: change every 'CUSTMOER' to 'CUSTOMER', save, and leave.

Command ===> C 'CUSTMOER' 'CUSTOMER' ALL *** 14 occurrences changed, message in top right confirms the count Command ===> SAVE *** Member TAXCALC saved (Press PF3 to end - changes are already saved, so End just leaves)





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant