z/OS ISPF Editor: Mask Line Command
What does the MASK
line command do?
The MASK
line command allows you to specify a specific character or characters to create a mask, and this mask will automagically appear on each new line. So, if you define a mask, and use line commands like Text Entry (TE), Insert (I), Text Split (TS), the mask will appear on each new line. This will continue until you remove the mask because, as Dan Dirske pointed out to me, “The contents of the mask are retained in the current edit profile and are automatically used the next time you edit the same kind of data.”
How do you add a line MASK
?
To add a line mask:
- First, type
MASK
in any line command area, then press Enter. The line changes to=MASK>
and will initially be blank (it’s waiting for you to paint some happy little trees). - Now, type the characters you want to use for your mask on this line. For instance, if you’re making a to-do list, you might enter
[ ]
to create a checkbox for each item. - Next, when you’re done, press Enter to set your mask.
- Finally, to see this in action, type
i
into the line command area, and press Enter. If everything goes as expected, you will something like this example:000000 [ ]
. Now start working on that grocery list 🤣
How do to remove the line MASK
?
You can remove the mask by deleting the characters on =MASK>
line, followed by Enter.
A Real-World Use for MASK
I love writing documentation (in-code and other places), and I recently had the honor of doing a presentation at EMMA’s Tech Talk Tuesdays. That night while going over some other commands like Overlay, I demonstrated how you could use a combination of BOUNDS
, TE
, and MASK
to create documentation blocks in your code. Here is a summary of that portion of the talk:
- First, using the primary command
BOUNDS
, which is like setting the left and right margins in Microsoft Word, I set the boundaries to9
and63
. This gave me some breathing room in my doc block. - Next, I added two lines of asterisks (*) from column 7 (left) to 65 (right).
- Afterward, I typed
MASK
and added one asterisk at column 7 and one at column 65. - Following this, I typed
TE
on the=MASK>
line, and pressed Enter to use power typing mode (think free-form editing with word wrapping). - Finally, I typed a few meaningless comments and pressed Enter once more to exit power typing mode. The end result was a nice looking doc block.
Summary
In this #kilobit, you learned how to use the MASK
line command, and I presented a real-world use case for it. Until next time, may the code be with you.