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.
- How do you open
SYS1.PROCLIB
in browse mode using a line command? - Which command shows the column numbers at the top of the screen?
- How do you search for the word
JOB
in the dataset? - Which command highlights all occurrences of the word
EXEC
? - How do you toggle HEX mode on or off?
- Which command clears highlights and resets the screen?
- How do you submit the contents as a job (if the dataset contains JCL)?
- 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.
- How do you save changes without exiting the session?
- Which key do you press to save and exit the session?
- Which key or command exits the session without saving?
- How do you view or modify your current session settings like CAPS, HEX, and AUTONUM?
- Which command clears all highlights, column rulers, and messages from the screen?
- What command do you use to submit the content as a job?
- How do you find and highlight the word
ALLOC
throughout the entire dataset? - How would you replace every occurrence of
ABCD
withWXYZ
? - What command hides all lines containing the word
TEMP
? - After excluding lines with the string
TEMP
, how can you flip the display to show only the excluded lines? - How do you jump directly to line number 100 in the file?
- What command toggles the display of column numbers at the top?
- How do you display the hexadecimal representation of the data
- Which command disables automatic line numbering?
- 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.
- Insert 3 blank lines after line number 10.
- Delete a total of 5 lines starting from line number 15.
- Delete a block of lines between line 7 and line 12.
- Repeat line 4 exactly 3 times.
- Copy lines from line 5 to line 10 and paste them after line 20.
- Move lines from line 11 to 15 and place them before line 5.
- Exclude 4 lines starting from line 30.
- Exclude a block of lines from line 6 to line 9.
- Change line 8's text to uppercase.
- Convert text in lines 13 to 15 to lowercase.
- Shift lines 5 to 7 right by 3 columns.
- 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.
- Position the cursor on all the 3 line issue the
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).
- Find the string
DATA
only within columns 1 to 10. - Find all occurrences of the word
MOVE
where it appears as a whole word. - Search for any text that starts with
COPY
. - Search for lines that contain a suffix ending in
CODE
. - Use
CHARS
(default behavior) to find all lines that containJCL
. - Change all values of
YES
toNO
only between columns 15 and 30. - Exclude all lines that contain a word starting with
ERR
. - Exclude lines where a word ends with
TEMP
. - Find the word
ALLOC
within column range 10 to 20 and applyWORD
option. - 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).
- Use a command to jump to the next excluded line in the dataset.
- Locate the first line that has a label assigned to it.
- Use a command to go to the last changed line in your file.
- Navigate to the next message line in the dataset using the appropriate locate command.
- 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
.
- Replace all
A
characters between the labeled line.LBL1
and the last line of the dataset with a different character. - Find all occurrences of
BBB
between the first line and the line labeled.LBL2
. - Exclude all lines that contain
C
between.LBL1
and.LBL2
. - Try to locate and jump directly to the line labeled
.LBL1
. - Use a label-based range to count how many times
D
appears between.LBL1
and.LBL2
. - Replace
C
with another character, but limit it to the lines between.ZF
(first line) and.LBL1
. - Try to perform a find operation using only one label in the range and observe what happens.
- Use
.ZCSR
(cursor position) as part of a label range and test if the range applies correctly. - Assign a new label to line 15, then move that line elsewhere. Verify if the label moves with it.
- Assign the same label to two lines and observe how the editor handles it.
- Try removing a label by blanking it out and confirm if it gets cleared.
- Create a label
.TEST
and use it in a command. Then end the session and reopen — check if the label still exists. - Use label-based range to perform a change-all operation between
.LBL1
and.LBL2
and validate that it affects only that section. - Use labels in a REPLACE operation while in View mode and validate if the dataset is saved with changes.
- Try to use labels with a command that does not support ranges and observe the system response.