Create Data File Edit Data Files Delete Data File Save Data File Delete Data File Operation on Data File
ISPF EDIT Tutorial
ISPF edit is used by most people for editing PDS and Flat Files but many people do not know how to use all the commands that are available. The following is a short, but hopefully useful example, which will demonstrate most of the useful commands – including the following.
v Change
v Exclude
v Flip
v Indent
v Bounds
v Overlay
v Blanking
v Upper and lower casing
v Block Commands
v Rippling
v Text input
v Text Split
In the following example, we want to change all the ‘CONMANDS’ to ‘COMMANDS’, so
We type CHA ‘CONMANDS’ ‘COMMANDS’ ALL
Which means change all occurrences of ‘CONMANDS’ to ‘COMMANDS’
|
Command ===> CHA ‘CONMANDS’ ‘COMMANDS’ ALL Scroll ===> CSR ***************************** Top of Data **************************** 000002 THERE ARE LOTS OF USEFUL CONMANDS THAT YOU CAN USE **************************** Bottom of Data ************************** |
And the result is as follows. Now lets say we want to move the red lines to the left by 3 spaces, we can use the CHA command to do that too. If we change all occurrences of ‘ ARE’ to ‘ARE’ this will move the lines to the left. However, line 12 has an ‘ARE’ that we don’t want to move so we can use the EXCLUDE function to omit all the lines we want to play with.
We can use either an X on each line we want to exclude, or else use the block XX command where we put XX on the first line of the block to be excluded and XX on the last line to be excluded.
See below.
|
XXXX#1 TTOS.SMITHGI.JCL(DATASETS) – 01.03 Columns 00001 00072 Command ===> Scroll ===> CSR ***************************** Top of Data ****************************** 000001 HELLO, THIS IS AN ISPF EDIT TUTORIAL. 000002 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN XX0003 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000004 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000005 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000006 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000007 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE XX0008 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET **************************** Bottom of Data **************************** |
When you hit enter, the lines disappear as shown below. They are now excluded. Now you can use the FLIP command to switch to the excluded lines.
|
XXXX#1 TTOS.SMITHGI.JCL(DATASETS) – 01.03 Columns 00001 00072 Command ===> FLIP Scroll ===> CSR ***************************** Top of Data ****************************** 000001 HELLO, THIS IS AN ISPF EDIT TUTORIAL. 000002 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE - - - - - - - - - - - - - - - - - - - 6 Line(s) not Displayed 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET
|
Type FLIP and hit enter. Now you have jumped over to the lines you have excluded and now all the opposite lines are excluded. Now if you type CHA ‘ ARE’ ‘ARE’ NX ALL , this will change all occurrences of ‘ ARE’ to ‘ARE’ that are not excluded. So the ‘ARE’ on line 12 will not be affected.
|
XXXX#1 TTOS.SMITHGI.JCL(DATASETS) – 01.03 Columns 00001 00072 Command ===> CHA ' ARE' 'ARE' NX ALL Scroll ===> CSR ***************************** Top of Data ****************************** - - - - - - - - - - - - - - - - - - - 2 Line(s) not Displayed 000003 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000004 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000005 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000006 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000007 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000008 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE - - - - - - - - - - - - - - - - - - - 4 Line(s) not Displayed **************************** Bottom of Data **************************** |
Hitting Enter will change the lines, which has the effect of moving them 3 spaces to the left. See below.
|
XXXX#1 TTOS.SMITHGI.JCL(DATASETS) - 01.04 CHARS ' ARE' changed Command ===> Scroll ===> CSR ***************************** Top of Data ***************************** - - - - - - - - - - - - - - - - - - - 2 Line(s) not Displayed ==CHG> ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ==CHG> ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ==CHG> ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ==CHG> ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ==CHG> ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ==CHG> ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE - - - - - - - - - - - - - - - - - - - 4 Line(s) not Displayed **************************** Bottom of Data ************************** |
You can use FLIP to jump back and forth between screens as many times as you like and exclude more lines as you see fit. Now type RESET to display all the excluded lines again.
Another great way of using Exclude is to say things line
Use the Exclude command directly on the command line. E.g.
|
X ‘USE’ ALL |
Exclude all lines containing ‘USE’ |
|
X P'#' 25 28 ALL |
Exclude all lines that have a number between column 25 and 28 |
|
X P’-‘ 20 40 ALL |
Exclude all lines that have non-numeric characters between column 20 and 40 |
|
DEL ALL X |
Delete all lines that are excluded |
|
DEL ALL NX |
Delete all lines that are not excluded |
Now lets use the Overlay function to add the missing ‘THERE’ to lines 3 to 8.
|
Command ===> Scroll ===> ****** ***************************** Top of Data ************************* 000001 HELLO, THIS IS AN ISPF EDIT TUTORIAL. C00002 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE OO0003 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000004 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000005 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000006 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000007 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE OO0008 ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET ****** **************************** Bottom of Data ***********************
|
By using ‘C’ and ‘O’, or a block command ‘OO’ as shown above, we can copy a line over the top of another but if characters exist on the line to be overlaid, then they won’t get overwritten.
Hitting enter will do the following
|
XXXX#1 TTOS.SMITHGI.JCL(DATASETS) - 01.04 Columns 00001 00072 Command ===> Scroll ===> CSR ***************************** Top of Data ****************************** 000001 HELLO, THIS IS AN ISPF EDIT TUTORIAL. 000002 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000003 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000004 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000005 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000006 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000007 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000008 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET **************************** Bottom of Data **************************** |
So far we have looked at CHA, FLIP, EXCLUDE, and OVERLAY.
Now lets look at Indenting and Bounds.
Lets pretend that we want to move all lines 5 spaces to the right. We can use the )) function to do this.
You can use a single ) to move one line at a time or a block command )) to move a block , and you can specify how many spaces to move by putting a number afterwards. E.g. )4 to move a line 4 spaces to the right, or (7 to move a line 7 spaces tot the left.
See below.
|
XXXX#1 TTOS.SMITHGI.JCL(DATASETS) - 01.04 Columns 00001 00072 Command ===> Scroll ===> CSR ***************************** Top of Data ****************************** ))5 HELLO, THIS IS AN ISPF EDIT TUTORIAL. 000002 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000003 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000004 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000005 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000006 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000007 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000008 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL )) ARE WE FINISHED YET **************************** Bottom of Data **************************** |
Hit enter and the whole block will jump 5 spaces to the right. See below.
|
XXXX#1 TTOS.SMITHGI.JCL(DATASETS) - 01.04 Columns 00001 00072 Command ===> Scroll ===> CSR ***************************** Top of Data ***************************** 000001 HELLO, THIS IS AN ISPF EDIT TUTORIAL. 000002 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000003 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000004 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000005 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000006 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000007 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000008 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET **************************** Bottom of Data *************************** |
We’ve shown how to affect only certain lines using FLIP and EXCLUDE and block commands, but we can also perform actions on selected columns using either the BNDS command or by specifying which columns we are interested in.
Lets have a look at BNDS first.
Type BNDS on any line in the column on the left hand side and hit enter.
This will bring up a line that has a < and a > at the left and right. You can move these to anywhere on the line that you want , and after that, any line commands that you use will only affect the columns between the < and the >. In the example below, I’ve placed the <> so it includes columns 18 to 38.
n.b I turned on the ruler by typing COLS on any line down the left column.
Now that we have set the BNDS, lets see what happens if we try a block INDENT command using (( to move rows 3 and 4 to the left by 10 spaces.
|
Command ===> Scroll ===> CSR ***************************** Top of Data ***************************** =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7- =BNDS> < > 000001 HELLO, THIS IS AN ISPF EDIT TUTORIAL. 000002 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ((4 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE (( THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000005 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000006 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000007 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000008 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET **************************** Bottom of Data ************************** |
Hitting enter shows that only the columns within the BNDS were affected, and the lines have been moved to the left and have disappeared as if we had cut a hole in the sheet and pulled it from behind.
|
Command ===> Scroll ===> C ****** ***************************** Top of Data ************************** =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+--- =BNDS> < > 000001 HELLO, THIS IS AN ISPF EDIT TUTORIAL. 000002 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000003 THERE LOTS OF USEFUL C OMMANDS THAT YOU CAN USE 000004 THERE LOTS OF USEFUL C OMMANDS THAT YOU CAN USE 000005 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000006 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000007 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000008 THERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET ****** **************************** Bottom of Data ************************ |
N.B To reset the BNDS , type BNDS on the command line. This will move the <> back to the edges of the lines.
The other way of affecting just certain columns is to specify which columns that you want to affect by including the column numbers in the command.
E.G Typing CHA 'TH' 13 'WH' ALL will change all ‘TH’ in column 13 but will not affect any other in different columns. See below.
|
XXXX#1 TTOS.SMITHGI.JCL(DATASETS) - 01.04 CHARS 'TH' cha Command ===> Scroll ===> ****** ***************************** Top of Data ************************* =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+-- ==CHG> HELLO, WHIS IS AN ISPF EDIT TUTORIAL. ==CHG> WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ==CHG> WHERE LOTS OF USEFUL C OMMANDS THAT YOU CAN USE ==CHG> WHERE LOTS OF USEFUL C OMMANDS THAT YOU CAN USE ==CHG> WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ==CHG> WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ==CHG> WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE ==CHG> WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET ****** **************************** Bottom of Data *********************** |
Special characters.
There are some special characters that can help you perform some useful tricks too.
P'=' Any character
P'¬' Any character that is not a blank
P'.' Any character that cannot be displayed
P'#' Any numeric character, 0-9
P'-' Any non-numeric character
P'@' Any alphabetic character, uppercase or lowercase
P'<' Any lowercase alphabetic character
P'>' Any uppercase alphabetic character
P'$' Any special character, neither alphabetic nor numeric.
These are VERY useful
Example – change any character that is not blank between column 45 and 55 to ‘o’ would be as follows cha p'¬' 45 55 'o' all
e.g.
|
Command ===> cha p'¬' 45 55 'o' all Scroll ===> ****** ***************************** Top of Data ************************* 000001 HELLO, WHIS IS AN ISPF EDIT TUTORIAL. 000002 WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000003 WHERE LOTS OF USEFUL C OMMANDS THAT YOU CAN USE 000004 WHERE LOTS OF USEFUL C OMMANDS THAT YOU CAN USE 000005 WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000006 WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000007 WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000008 WHERE ARE LOTS OF USEFUL COMMANDS THAT YOU CAN USE 000009 'THERE IS A QUOTE MISSING ON THE END 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET ****** **************************** Bottom of Data *********************** |
Would give
|
Command ===> Scroll ===> CS ****** ***************************** Top of Data *************************** 000001 HELLO, WHIS IS AN ISPF EDIT TUTORIAL. ==CHG> WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE ==CHG> WHERE LOTS OF USEFUL C OMMANDO OOOO OOO CAN USE ==CHG> WHERE LOTS OF USEFUL C OMMANDO OOOO OOO CAN USE ==CHG> WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE ==CHG> WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE ==CHG> WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE ==CHG> WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE ==CHG> 'THERE IS A QUOTE MISSING ON THO OOO 000010 'AND ON THE END OF THIS TOO 000011 'AND THIS LINE AS WELL 000012 ARE WE FINISHED YET ****** **************************** Bottom of Data ************************* |
Have a play around with the other special characters.
Text Handling
ISPF edit may not be the best way of writing text, but there are a few useful commands for making it easier for you to cope with.
The first is TE, or text entry.
Type TE in the column on the left where you wish to start entering text and hit enter.
A blank space will appear, enabling you to type away and the text will flow onto the next line. You can keep typing and when you hit enter, the text will be fixed.
|
****************************** Top of Data ****************************** 000001 HELLO, WHIS IS AN ISPF EDIT TUTORIAL. 000002 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE 000003 WHERE LOTS OF USEFUL C OMMANDO OOOO OOO CAN USE 000004 WHERE LOTS OF USEFUL C OMMANDO OOOO OOO CAN USE 000005 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE 000006 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE
Once abon a time, there were many people who used ISPF edit every day but were never shown all the useful things that you could do with it in order
|
Hit enter
|
XXXX#1 TTOS.SMITHGI.JCL(DATASETS) - 01.05 Columns 00001 00072 Command ===> Scroll ===> CSR ***************************** Top of Data ****************************** 000001 HELLO, WHIS IS AN ISPF EDIT TUTORIAL. 000002 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE 000003 WHERE LOTS OF USEFUL C OMMANDO OOOO OOO CAN USE 000004 WHERE LOTS OF USEFUL C OMMANDO OOOO OOO CAN USE 000005 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE 000006 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE 000007 TS0008 ONCE ABON A TIME, THERE WERE |MANY PEOPLE ISPF EDIT EVERY DAY BU 000009 NEVER SHOWN ALL THE USEFUL THINGS WITH IT IN ORDER TO 000010 BORING AND MUNDANE TASKS. |
Text Split, allows you to split a line. Type TS in the column that you want to split and then put the cursor at the position that you want to split it and hit enter.
|
000006 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE 000007 000008 ONCE ABON A TIME, THERE WERE 000009 MANY PEOPLE WHO USED ISPF EDIT EVERY DAY BUT WERE 000010 NEVER SHOWN ALL THE USEFUL THINGS THAT YOU COULD DO WITH IT IN ORDER TO 000011 BORING AND MUNDANE TASKS. 000012 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE 000013 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE
|
When you hit enter, the text following the cursor jumps tot he next line!
Another useful text command is UC and LC to convert between upper and lower case. I find it much easier to read lower case writing personally for large pieces of text and this makes it easier to convert.
In the following example, I’ve used a block LC command LCLC on either side of the block of text to be converted. When we hit enter, its all converted to lower case. You can use UCUC to go back to upper case.
|
LCLC08 MANY PEOPLE WHO USED ISPF EDIT EVERY DAY BUT WERE 000009 NEVER SHOWN ALL THE USEFUL THINGS DO WITH IT IN ORDER TO 000010 BORING AND MUNDANE TASKS. 000011 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE 000012 WHERE ARE LOTS OF USEFUL COMMANDO OOOO OOO CAN USE 000013 'THERE IS A QUOTE MISSING ON THO OOO 000014 'AND ON THE END OF THIS TOO 000015 'AND THIS LINE AS WELL LCLC16 ARE WE FINISHED YET
|
Hit enter
|
000008 many people who used ispf edit every day but were 000009 never shown all the useful things that you could do with it in order to 000010 boring and mundane tasks. 000011 where are lots of useful commando oooo ooo can use 000012 where are lots of useful commando oooo ooo can use 000013 'there is a quote missing on tho ooo 000014 'and on the end of this too 000015 'and this line as well 000016 are we finished yet
|
That’s just about all the useful things you can do in EDIT, but the last one is my favourite.
Lets say we had the following list of numbers and wanted to add ‘44444’ to the end of each number. We can use what I call a ‘ripple’ to slide the numbers in from the right hand side.
Start by putting ‘44444’ in a columns to the right of the numbers. Remember you can insert a single line with 44444 on it and use the copy overlay command to copy it to each line.
|
****** ***************************** Top of Data ********** c''''' 44444 oo0001 647476234 000002 1251252352315 000003 235 000004 25235231 000005 2135213621363262362136 000006 2166432222 000007 123666666666666666666666636 oo0008 5435345 ****** **************************** Bottom of Data ********
|
Hit enter
Now delete the inserted line and type the following on the command line.
&C " 44444" "44444" all
Now the magic bit, the & means that the statement is executed, but is left on the command line, so you just hit enter and the same action will be performed.
If you hit enter 15 times or so , the ‘44444’ will fly across the screen and slot into place. Try it and see.
|
Command ===> &C " 44444" "44444" all ****** ***************************** Top of Data ***** ==CHG> 64747623444444 ==CHG> 125125235231544444 ==CHG> 23544444 ==CHG> 2523523144444 ==CHG> 213521362136326236213644444 ==CHG> 216643222244444 ==CHG> 12366666666666666666666663644444 ==CHG> 543534544444 ****** **************************** Bottom of Data ***
|