Progress0 of 0 lessons

Edit Session Management

Edit session management involves controlling how your editing session ends and what happens to your changes. The ISPF editor provides three primary commands for managing sessions: SAVE (saves changes and exits), CANCEL (discards changes and exits), and RESET (discards changes but stays in editor). Understanding when and how to use each command is essential for effective editing and avoiding accidental loss of work.

Proper session management ensures your changes are handled correctly and helps you avoid losing work or saving unintended modifications. This tutorial covers SAVE, CANCEL, and RESET in detail, explaining their differences, when to use each, and best practices for session management.

Understanding Edit Sessions

An edit session is the period from when you open a file in the editor until you exit.

What is an Edit Session?

An edit session:

  • Begins when you open a file in the editor
  • Includes all changes made during editing
  • Ends when you exit the editor
  • Can be saved, cancelled, or reset

Session States

During an edit session:

  • You can make changes to the file
  • Changes are held in memory until saved
  • The editor tracks whether changes have been made
  • You can save, cancel, or reset the session

SAVE Command

The SAVE command saves all changes and exits the editor.

What SAVE Does

SAVE:

  • Saves all modifications to the dataset
  • Writes changes permanently to disk
  • Exits the editor
  • Returns you to the previous panel or menu
  • Makes changes permanent

Using SAVE

To use SAVE:

  • Type "SAVE" on the command line
  • Press Enter
  • All changes are saved
  • You exit the editor

SAVE Example

Using SAVE:

text
1
Command ===> SAVE

This saves all changes and exits the editor.

When to Use SAVE

Use SAVE when:

  • You want to keep your changes
  • You've completed your editing task
  • You're satisfied with your modifications
  • You want to exit and preserve your work
  • You've finished making changes

SAVE Behavior

When SAVE executes:

  • All modifications are written to the dataset
  • The file is updated on disk
  • A confirmation message may be displayed
  • You exit the editor
  • Changes are now permanent

CANCEL Command

The CANCEL command discards all unsaved changes and exits the editor.

What CANCEL Does

CANCEL:

  • Discards all unsaved modifications
  • Abandons changes made during the session
  • Exits the editor
  • Returns the file to its last saved state
  • Loses all work done in the current session

Using CANCEL

To use CANCEL:

  • Type "CANCEL" on the command line
  • Press Enter
  • All unsaved changes are discarded
  • You exit the editor

CANCEL Example

Using CANCEL:

text
1
Command ===> CANCEL

This discards all changes and exits the editor.

When to Use CANCEL

Use CANCEL when:

  • You've made mistakes and want to start over
  • You want to abandon all changes
  • You opened the wrong file
  • You're experimenting and don't want to keep changes
  • You want to exit without saving

CANCEL Behavior

When CANCEL executes:

  • All unsaved changes are lost
  • The file remains in its last saved state
  • You exit the editor
  • A confirmation may be required (depending on ISPF version)
  • You return to the previous panel or menu

CANCEL Warning

Important considerations:

  • CANCEL permanently discards unsaved changes
  • You cannot recover changes after CANCEL
  • Use CANCEL only when you're certain
  • Consider saving work before experimenting

RESET Command

The RESET command discards changes but keeps you in the editor.

What RESET Does

RESET:

  • Discards all unsaved modifications
  • Returns the file to its last saved state
  • Keeps you in the editor
  • Allows you to start editing fresh
  • Clears the modification state

Using RESET

To use RESET:

  • Type "RESET" on the command line
  • Press Enter
  • All unsaved changes are discarded
  • You remain in the editor

RESET Example

Using RESET:

text
1
Command ===> RESET

This discards changes but keeps you in the editor.

When to Use RESET

Use RESET when:

  • You want to discard changes but continue editing
  • You've made mistakes and want to start over in the same session
  • You want to revert to the last saved state
  • You don't want to exit the editor
  • You want to clear modifications and start fresh

RESET Behavior

When RESET executes:

  • All unsaved changes are discarded
  • The file returns to its last saved state
  • You remain in the editor
  • The modification flag is cleared
  • You can continue editing from the saved state

Comparing SAVE, CANCEL, and RESET

Understanding the differences helps you choose the right command.

SAVE vs CANCEL vs RESET

Comparison:

  • SAVE: Saves changes and exits editor
  • CANCEL: Discards changes and exits editor
  • RESET: Discards changes but stays in editor

Decision Matrix

Use this decision matrix:

  • Want to keep changes and exit? → Use SAVE
  • Want to discard changes and exit? → Use CANCEL
  • Want to discard changes but keep editing? → Use RESET

Exit Prompts

ISPF may prompt you when exiting with unsaved changes.

Unsaved Changes Prompt

If you try to exit with unsaved changes:

  • ISPF may prompt about unsaved changes
  • You'll be asked to save, cancel, or return
  • This prevents accidental loss of work
  • Always respond carefully to prompts

Handling Prompts

When prompted:

  • Choose SAVE if you want to keep changes
  • Choose CANCEL if you want to discard changes
  • Choose RETURN to go back to editing
  • Read prompts carefully before responding

Best Practices

Following best practices helps you manage edit sessions effectively:

  • Save Frequently: Save your work regularly to avoid loss
  • Review Before Saving: Review changes before using SAVE
  • Use CANCEL Carefully: Only use CANCEL when you're certain
  • Use RESET When Appropriate: Use RESET when you want to start over but stay in editor
  • Respond to Prompts: Always respond carefully to exit prompts
  • Understand Consequences: Know what each command does before using it
  • Backup Important Work: Keep backups before making major changes
  • Test Before Saving: Test changes when possible before saving

Common Scenarios

Here are common scenarios for session management.

Successful Editing Session

After making changes you want to keep:

  • Review your changes
  • Use SAVE to save and exit
  • Changes are permanently saved
  • You return to the previous panel

Mistakes Made During Editing

If you've made mistakes:

  • Use RESET to discard changes and continue editing
  • Or use CANCEL to discard changes and exit
  • Choose based on whether you want to continue editing

Experimental Changes

When experimenting:

  • Make experimental changes
  • Use RESET if you don't like the results
  • Use SAVE if you want to keep the results
  • Consider saving a backup first

Explain Like I'm 5: Session Management

Think of session management like finishing your work on a drawing:

  • SAVE is like putting your finished drawing in a safe place and going home. You've done your work, you're happy with it, so you save it and leave. Your drawing is now safely stored!
  • CANCEL is like throwing away your drawing and going home. You decide you don't like what you did, so you throw it away (discard changes) and leave. The drawing is gone, and you start fresh next time!
  • RESET is like erasing your drawing but staying at your desk. You don't like what you did, so you erase it (discard changes), but you stay at your desk ready to draw again. You're still working, just starting over!

So session management is like deciding what to do with your work when you're done—save it and leave, throw it away and leave, or erase it and keep working!

Practice Exercises

Complete these exercises to reinforce your understanding of session management:

Exercise 1: Using SAVE

Practice using SAVE: make changes to a test file, use SAVE to save and exit, verify changes were saved, and understand SAVE behavior. Learn to save your work properly.

Exercise 2: Using CANCEL

Practice using CANCEL: make changes to a test file, use CANCEL to discard and exit, verify changes were not saved, and understand CANCEL consequences. Learn when to use CANCEL.

Exercise 3: Using RESET

Practice using RESET: make changes to a test file, use RESET to discard but stay in editor, verify changes were discarded, continue editing, and understand RESET behavior. Learn RESET usage.

Exercise 4: Exit Prompts

Practice handling prompts: make changes and try to exit, observe exit prompts, practice responding to prompts, and understand prompt options. Learn to handle exit prompts safely.

Exercise 5: Decision Making

Practice decision making: create scenarios requiring SAVE, CANCEL, or RESET, decide which command to use, execute the command, and verify the outcome. Build confidence in session management.

Test Your Knowledge

1. What does SAVE do?

  • Discards changes and exits
  • Saves changes and exits
  • Resets the editor
  • Only saves without exiting

2. What does CANCEL do?

  • Saves changes and exits
  • Discards unsaved changes and exits
  • Resets the editor
  • Only cancels the current line

3. What does RESET do?

  • Saves changes
  • Discards changes and exits
  • Discards changes but stays in editor
  • Only resets display

4. When should you use SAVE?

  • When you want to discard changes
  • When you want to keep your changes
  • When you want to reset
  • Only when prompted

5. Can you undo changes after saving?

  • Yes, automatically
  • No, changes are permanent after saving
  • Only in some ISPF versions
  • Only with special commands

Related Concepts