Skip to main content

Introduction

File once allocated are of no use if it doesn't contain any data. The next step after allocation is viewing browsing as well editing data. Not all dataset are edited manually but common data like JCL, Programs and so on are on regularly basis edited/viewed/browsed.

These exercises will help application developers practice list, edit view/browse the datasets previously created. This interaction is very important and if practiced well make your application development journey a smoother

Exercises: Browsing a Dataset

Preparation: Use ISPF Option 3.4, and browse the dataset SYS1.PROCLIB or any other system dataset that exists and is browse-safe.

  1. How do you open SYS1.PROCLIB in browse mode using a line command?
  2. Which command shows the column numbers at the top of the screen?
  3. How do you search for the word JOB in the dataset?
  4. Which command highlights all occurrences of the word EXEC?
  5. How do you toggle HEX mode on or off?
  6. Which command clears highlights and resets the screen?
  7. How do you submit the contents as a job (if the dataset contains JCL)?
  8. What key or command allows you to scroll right to view columns beyond 80?

Exercise: Edit/View a dataset primary command

Preparation: Use ISPF Option 3.4 to Edit or View any PS dataset created earlier. Use E or V line command to enter Edit or View mode respectively.

  1. How do you save changes without exiting the session?
  2. Which key do you press to save and exit the session?
  3. Which key or command exits the session without saving?
  4. How do you view or modify your current session settings like CAPS, HEX, and AUTONUM?
  5. Which command clears all highlights, column rulers, and messages from the screen?
  6. What command do you use to submit the content as a job?
  7. How do you find and highlight the word ALLOC throughout the entire dataset?
  8. How would you replace every occurrence of ABCD with WXYZ?
  9. What command hides all lines containing the word TEMP?
  10. After excluding lines with the string TEMP, how can you flip the display to show only the excluded lines?
  11. How do you jump directly to line number 100 in the file?
  12. What command toggles the display of column numbers at the top?
  13. How do you display the hexadecimal representation of the data
  14. Which command disables automatic line numbering?
  15. How do you copy a set of lines and paste them after a specific line?

Exercise: Edit/View a dataset line command

Preparation: Use ISPF Option 3.4 to Edit or View any PS dataset created earlier. Use E or V line command to enter Edit or View mode respectively.

  1. Insert 3 blank lines after line number 10.
  2. Delete a total of 5 lines starting from line number 15.
  3. Delete a block of lines between line 7 and line 12.
  4. Repeat line 4 exactly 3 times.
  5. Copy lines from line 5 to line 10 and paste them after line 20.
  6. Move lines from line 11 to 15 and place them before line 5.
  7. Exclude 4 lines starting from line 30.
  8. Exclude a block of lines from line 6 to line 9.
  9. Change line 8's text to uppercase.
  10. Convert text in lines 13 to 15 to lowercase.
  11. Shift lines 5 to 7 right by 3 columns.
  12. Shift lines 10 to 12 left by 4 columns.

Exercise: Evaluate the differnce between using ) and > line command

Preparation:

  • Prepare the Dataset
    • Create a sequential file with LRECL = 80.
    • Add 3 lines containing multiple words separated by spaces.
    • Line 1: Words seperated by space. Ex. AAAAA BBBBB CCCCC
    • Line 2: Start the text at column 5 (i.e., insert four leading blanks).
    • Line 3: Do not add any space between word. Just continous characters.

Observe Shifting difference::

  • Perform Shifts
    • Position the cursor on all the 3 line issue the ) command one by one.
    • Reopen the file and on all the 3 line, issue the > command.

Test Truncation:: Modify all the 3 line to contain data till column 79.

  • Issue ) and > on all the 3 lines and observe the difference.

Exercise: Advance Find/Change

Preparation:

  • Open a dataset (PS or PDS member) in Edit or View mode using Option 3.4.
  • Make sure the dataset contains at least 30 lines with enough sample content that includes patterns like words, prefixes, and column-aligned data (you can simulate this by repeating structured lines if needed).
  1. Find the string DATA only within columns 1 to 10.
  2. Find all occurrences of the word MOVE where it appears as a whole word.
  3. Search for any text that starts with COPY.
  4. Search for lines that contain a suffix ending in CODE.
  5. Use CHARS (default behavior) to find all lines that contain JCL.
  6. Change all values of YES to NO only between columns 15 and 30.
  7. Exclude all lines that contain a word starting with ERR.
  8. Exclude lines where a word ends with TEMP.
  9. Find the word ALLOC within column range 10 to 20 and apply WORD option.
  10. Find the string LOAD between column 1 and 72, but only if it is a prefix.

Exercise: Using Locate

Preparation:

  • Open a dataset (PS or PDS member) in Edit or View mode using Option 3.4.
  • Make sure the dataset contains at least 30 lines with enough sample content that includes patterns like words, prefixes, and column-aligned data (you can simulate this by repeating structured lines if needed).
  1. Use a command to jump to the next excluded line in the dataset.
  2. Locate the first line that has a label assigned to it.
  3. Use a command to go to the last changed line in your file.
  4. Navigate to the next message line in the dataset using the appropriate locate command.
  5. Use a command to move to the previous line that has an information message (InfoLine).

Exercise : Label and Ranges

Objective: To understand and practice using the ISPF Editor system labels .ZF (First line), .ZL (Last line), and .ZCSR (Cursor line) and User labels to define ranges for primary commands like REPLACE, FIND, LOCATE and So on.

Preparation:
To proceed with the exercise Create a Dataset with around 20-30 lines all having data as AAAAAAAAAA BBBBBBBBBB CCCCCCCCCC DDDDDDDDDD and Save it. For each query below start fresh with same dataset. Go to Line 10 and mark it label as lbl1 and line 20 as lbl2.

  1. Replace all A characters between the labeled line .LBL1 and the last line of the dataset with a different character.
  2. Find all occurrences of BBB between the first line and the line labeled .LBL2.
  3. Exclude all lines that contain C between .LBL1 and .LBL2.
  4. Try to locate and jump directly to the line labeled .LBL1.
  5. Use a label-based range to count how many times D appears between .LBL1 and .LBL2.
  6. Replace C with another character, but limit it to the lines between .ZF (first line) and .LBL1.
  7. Try to perform a find operation using only one label in the range and observe what happens.
  8. Use .ZCSR (cursor position) as part of a label range and test if the range applies correctly.
  9. Assign a new label to line 15, then move that line elsewhere. Verify if the label moves with it.
  10. Assign the same label to two lines and observe how the editor handles it.
  11. Try removing a label by blanking it out and confirm if it gets cleared.
  12. Create a label .TEST and use it in a command. Then end the session and reopen — check if the label still exists.
  13. Use label-based range to perform a change-all operation between .LBL1 and .LBL2 and validate that it affects only that section.
  14. Use labels in a REPLACE operation while in View mode and validate if the dataset is saved with changes.
  15. Try to use labels with a command that does not support ranges and observe the system response.