zOS Basics ISPF Editor

53
Hector Rivera Hector Rivera Hector Rivera Hector Rivera / / /Mexico Mexico Mexico Mexico / / /IBM IBM IBM IBM 23/10/2007 12:11 Default custom expiration date of 22/10/2008 To cc bcc Subject R R R& & &D is always trying to improve the Just Enough documents and your feedback is our major input D is always trying to improve the Just Enough documents and your feedback is our major input D is always trying to improve the Just Enough documents and your feedback is our major input D is always trying to improve the Just Enough documents and your feedback is our major input , , , please help us to keep them up to date and useful with please help us to keep them up to date and useful with please help us to keep them up to date and useful with please help us to keep them up to date and useful with your suggestions your suggestions your suggestions your suggestions , , , let us know what you find useful and what could be better let us know what you find useful and what could be better let us know what you find useful and what could be better let us know what you find useful and what could be better . . . THANK YOU THANK YOU THANK YOU THANK YOU ! ! ! Document Owner: Héctor Alonso Rivera Ramírez Version Date Comments 1.0 Reviewed document. Initial 2/08/2007 Initial document. Just enough will indroduce you to the z/OS ISPF editor. It is very important to ask for support, to any of the listed Contacts, in case you require any assistance on this document. z z z/ / /OS Basics ISPF Editor OS Basics ISPF Editor OS Basics ISPF Editor OS Basics ISPF Editor This Document teach you use the z/OS ISPF Editor wich you access through the edit selection (option 2) on the ISPF Primary Option Menu. Requirements Requirements Requirements Requirements : if you do not have tso mainframe Sesion if you do not have tso mainframe Sesion if you do not have tso mainframe Sesion if you do not have tso mainframe Sesion Install SPFPC.zip file attached on Practice section to work in the PC if you have tso mainframe Sesion if you have tso mainframe Sesion if you have tso mainframe Sesion if you have tso mainframe Sesion Get access to IBM Personal Communication/3270 It is necessary that you have read ( Just Enough Document Overview IBM Personal Communication Overview IBM Personal Communication Overview IBM Personal Communication Overview IBM Personal Communication / / /3270 3270 3270 3270 ) Get a TSO Mainframe User Id and valid password. Getting Started In this case we will use host mainframe a session located at Boulder in Denver Colorado. We type TSO User id and valid password in order to Log On.

Transcript of zOS Basics ISPF Editor

Hector RiveraHector RiveraHector RiveraHector Rivera ////MexicoMexicoMexicoMexico////IBMIBMIBMIBM

23/10/2007 12:11

Default custom expiration date of 22/10/2008

To

cc

bcc

Subject

RRRR&&&&D is always trying to improve the Just Enough documents and your feedback is our major inputD is always trying to improve the Just Enough documents and your feedback is our major inputD is always trying to improve the Just Enough documents and your feedback is our major inputD is always trying to improve the Just Enough documents and your feedback is our major input ,,,, please help us to keep them up to date and useful withplease help us to keep them up to date and useful withplease help us to keep them up to date and useful withplease help us to keep them up to date and useful with your suggestionsyour suggestionsyour suggestionsyour suggestions ,,,, let us know what you find useful and what could be betterlet us know what you find useful and what could be betterlet us know what you find useful and what could be betterlet us know what you find useful and what could be better .... THANK YOUTHANK YOUTHANK YOUTHANK YOU!!!!

Document Owner: Héctor Alonso Rivera Ramírez

Version Date Comments

1.0 Reviewed document.

Initial 2/08/2007 Initial document.

Just enough will indroduce you to the z/OS ISPF editor. It is very important to ask for support, to any of the listed Contacts, in case you require any assistance on this document.

zzzz////OS Basics ISPF EditorOS Basics ISPF EditorOS Basics ISPF EditorOS Basics ISPF Editor

This Document teach you use the z/OS ISPF Editor wich you access through the edit selection (option 2) on the ISPF Primary Option Menu.

RequirementsRequirementsRequirementsRequirements : if you do not have tso mainframe Sesionif you do not have tso mainframe Sesionif you do not have tso mainframe Sesionif you do not have tso mainframe Sesion

Install SPFPC.zip file attached on Practice section to work in the PC�

if you have tso mainframe Sesionif you have tso mainframe Sesionif you have tso mainframe Sesionif you have tso mainframe Sesion Get access to IBM Personal Communication/3270 �

It is necessary that you have read ( Just Enough Document Overview IBM Personal CommunicationOverview IBM Personal CommunicationOverview IBM Personal CommunicationOverview IBM Personal Communication ////3270327032703270 ) �

Get a TSO Mainframe User Id and valid password.�

Getting Started

In this case we will use host mainframe a session located at Boulder in Denver Colorado. We type TSO User id and valid password in order to Log On.

After we typed TSO User Id and Password. We are in in the mainly screen of TSO session (((( ISPF Primary Option MenuISPF Primary Option MenuISPF Primary Option MenuISPF Primary Option Menu ))))

Next step is learn how toNext step is learn how toNext step is learn how toNext step is learn how to ::::

Use the Edit Entry Panel and member selection lists to choose a data set and member to edit.�

Recognize the sections of the edit entry panel �

Find the line number section in an ISPF editor session �

We type

OptionOptionOptionOption ============>>>> 2222 ↵↵↵↵2222 Create or change source data

* (* (* (* ( ↵↵↵↵ )))) this symbol represents Key ENTER

(((( ISPF Primary Option MenuISPF Primary Option MenuISPF Primary Option MenuISPF Primary Option Menu ))))

The Edit Entry Panel appears, From this panel you can create, display, and change data stored in ISPF libraries or other partitioned, sequential, or VSAM data sets.

(((( Edit Entry PanelEdit Entry PanelEdit Entry PanelEdit Entry Panel ))))

In the ISPF Library section, Project, Group, and Type refer to the three parts of the standard name for a partitioned data set. Member refers to the member name of a partitioned data set.

If you know the specific member of the data set you want to edit, enter the member name. Otherwise, you can leave the member field blank or type

in a pattern. In either of these cases, the Member Selection List appears when you press Enter.

You can enter a default data set name in the ISPF Library section. This data set name will always be displayed when you access this panel. Use the Other Partitioned, Sequential or VSAM Data Set section to specify a data set name that is different than the default.

For our exercise please type key Enter ↵↵↵↵

For a partitioned data set, the member list appears, and in the upper left corner says EDITEDITEDITEDIT followed by the name of the data set.

This panel lists each data set member along with statistics such as the date the member was created and the date of the last change. If the list exceeds the room available on a single screen, use the F7 and F8 keys to scroll up or down.

To select a member, either position the cursor on the dot next to the member name or type S next to the member name and press Enter.

For our exercise we type S on the dot next to member IEBEGENER ↵↵↵↵

The ISPF edit panel appears shown the data set member (IEBGENER ) for a partitioned data set MX55103.EPRICER.JCLLIB, this member is a JCL.

The first six columns of the lines containing JCL code represent the line command area.If specified in the profile setting, the editor displays the line number in this area.The remaining portion of the lines represents the screen window.

You can use the same scrolling functions used in the View Panel. F11 moves the window right and F10 moves it to the left. F7 moves the window up, and F8 moves it down. Scrolling amount is subject to the scroll function that appears at the end of the command line.

Creating a new member in a partitioned data set You can create a new member in an existing data set by specifying a new member name (one that does not already exist in the data set) on the

Edit Entry Panel. The library -- that is the Project, Group, and Type -- you specify, must already exist. ISPF creates an empty workspace in virtual storage for the new member.

(((( Edit Entry PanelEdit Entry PanelEdit Entry PanelEdit Entry Panel )))) We type

Member . . . iebgeneiebgeneiebgeneiebgene1111 ↵↵↵↵ <<<<------------------------------------ It will be the new member on library MXIt will be the new member on library MXIt will be the new member on library MXIt will be the new member on library MX 55103551035510355103....EPRICEREPRICEREPRICEREPRICER....JCLLIBJCLLIBJCLLIBJCLLIB

The ISPF edit panel appears shown the NEW data set member (IEBGENE1 ) for a partitioned data set MX55103.EPRICER.JCLLIB.

We write something inside the text area in this case the word TEST and finally we type PF KEY PF3 to quit and save our member.ISPF writes the new member onto disk when you exit the edit session.

The Edit Entry Panel appears and in the upper right corner says Member IEBGENEMember IEBGENEMember IEBGENEMember IEBGENE1111 savedsavedsavedsaved

Line numberingLine numberingLine numberingLine numbering The editor assigns a line number to each line of the source member. The six digit line numbers to the left of the edit screen are not stored with the data. However, the editor maintains line numbers within the data, if requested.

Next step is learn how toNext step is learn how toNext step is learn how toNext step is learn how to ::::

Distinguish between ISPF primary commands and line commands �

Insert, delete, copy, move, and repeat lines �

Create and save new members to data sets �

View and change an edit profile �

Customize your editing environment �

In the ISPF editor, there are two places you can enter commands: Line command fields �

The command line �

You enter line commands by typing over the numbers in the line command area. Line commands affect the data on the corresponding individual line or block of lines.

On the command line, you can enter primary edit commands, edit macro commands, and TSO commands. You can enter multiple commandsseparated by semicolons on the command line. This is known as stacking. Edit primary commands apply to the entire source member.

The insert line command

Use the Insert (I) command to insert lines in a file. There are two forms of this command:

IIII Inserts a single line InInInIn Inserts n lines (where n is a number)

Type I in the line number area at the spot where you want to insert a new line and press the Enter key. The I command creates a blank line and shifts the following lines further down in the file

One new line was created

To insert more than one line type In, where n is the number of lines you want to insert.For example, here we have typed I5 in the line number area and pressed the Enter key.

This creates five blank lines and shifts the following lines further down in the file .

The inserted lines contain apostrophes in the line number area until you type in the source data. When you finish typing in the new source data, press the Enter key again.The editor deletes any inserted lines that do not contain data

The delete line command Use the delete line command to delete one or more lines from a data set. There are three forms of this command:

D Delete this line Dn Delete n lines starting with this line

DD Delete the block of lines beginning with the first DD command and ending with the second DD command.

You use D and Dn to delete one or more lines just as you use I and In to add one or more lines.

In this example, we show the use of the block delete command. Typing the DD command in the line number area of the first and last lines of the block you want to delete and pressing the Enter key.

Block of lines were deleted

The repeat line command

Use the Repeat command to repeat a single line or a group of lines one or more times. The R command has several forms: R Repeat this line Rn Repeat this line n times RR Repeat a block of lines

The repeated line falls in immediately after the original line.In this example, typing the R% command in the line number area and pressing the Enter key.

Line has been repeated 5 times directly below the line on which you entered the command.

The copy line command

To copy a block of lines, type CC in the line number area next to the first line in the block and next to the last line in the block. Then move to the place you want to insert the copied lines, type A or B and then press the Enter key.( A ) will copy all that you have copied the line after when you typed the letter A( B ) will copy all that you have copied the line before when you typed the letter B

For example, typing CC next to line 000006 and next to line 000011, and then typing A next to line 000024 and pressing the Enter key.

The block was copied after the destination line as shown here

The move line command Moving lines is similar to copying them, except that moving also deletes the source lines from the original location once the move is complete.The M command has several forms: M Moves one line Mn Moves n lines MM Marks a block of lines for moving

Once you have marked the lines you want to move, you then move to the line where you want the moved lines to appear and type either an A or a

B and press the Enter key.

If you type an A, the source lines are moved after the destination line. If you type a B, they are placed before the destination line. The moved lines no longer appear in their original place

Ending and saving your changes

When you have completed all editing in the ISPF Edit Panel, press the Exit key, F3. ISPF saves your changed member to the primary library and returns you to the Edit Entry Panel. If you press F3 again, ISPF returns to the ISPF Primary Option Panel.

Alternatively, you can enter SAVE at the Command line to save the changed member. If you enter CANCEL on the Command line, any changes you have made will be discarded and you will return to the Edit Entry Panel.

The edit profile

The edit profile controls the editing environment, defining column boundaries, tab settings, line numbering, uppercase mode, and other items.

You can have different edit profiles for different types of data. For example, you could have one edit profile for COBOL programs, another edit profile for memos, and a third edit profile for test data. Your installation determines how many different edit profiles are available to you.

To select a profile for an edit session, enter it in the Profile Name field on the Edit Entry Panel.

Displaying the edit profile You can activate an existing edit profile by typing its name in the PROFILE command.For example, here we show that typing PROFILE on the command line retrieves the profile.

Changes you make to the PROFILE are saved when you exit the edit session.To avoid changes to the profile being saved at the end of the session, use the PROFILE LOCK command.

We type in the command line

Command ===> ProfileProfileProfileProfile ↵↵↵↵

The profile appears in the top of screen .In this example, the settings for NUMBER, HEX, TABS, AUTONUM, AUTOLIST, and PACK are all set to OFF, while RECOVERY, AUTOSAVE, STATS, CAPS, NULLS and NOTE are set to ON. Other settings like PROFILE and IMACRO have different values.

Column boundaries Column boundaries control the width of the area in which source data can be placed, and the range of columns for editing data. The area within the boundaries represent the columns to which editing commands apply. The =BNDS> line illustrates the current settings. To display the column boundaries, type BNDS in the line command area.

The COBOL default is 7 for the left boundary and 72 for the right boundary. For other types, such as an assembler source file (ASM), the standard left margin is 1 and the right margin is 71.

Changing the BOUNDS setting

You can also use the BOUNDS command as a line command.

Type BOUNDS or BNDS in the line command area. The editor responds by displaying =BNDS> line at the place where you entered the command. To set up new boundaries, delete the current boundary marks, move the cursor to the spots on the =BNDS> line where you want to set up new boundaries. Type a less-than sign (<) to mark the new left boundary, and type a greater-than sign (>) to mark a new right boundary.

Tab stops are especially important for editing members that contain source files like COBOL or Assembler, because certain constructs must begin in specific columns.

The ISPF editor supports two types of tab stops, hardware and logical. You move among hardware tab stops by pressing the Tab key on the 3270 terminal or terminal-emulator.With logical tab stops you enter a special tab character like a @ or #. The editor will take the subsequent text and align it to the closest tab stop inserting spaces as necessary to position it.

Tab stops To activate hardware tab stops, type the TABS command in the line command area and press the Enter key. The editor displays =TABS> in the line ommand area where you entered the command. On this line you enter an asterisk (*) immediately to the leftof the desired positions for tab stops. The asterisk defines the position for an attribute byte, a special character recognizable by the 3270 hardware as a tab position.

The attribute byte actually takes up a position and displays as blank. However, you will not be able to type any source data into this position. Source data will fall in starting at the position immediately to the right of the asterisk.

Tab stopsTo activate logical tabbing, type the TAB command at the command line, followed by the character to be used to mark the tab position. From then on, you can type that character in any source line to generate the logical tabbing effect. To turn off logical tabbing, TAB with no character on the command line and press the Enter key.

Using an editing mask

You can use an edit mask to predefine the initial contents of each line you insert. Start by entering the MASK command in the line command area. The editor inserts a blank line containing =MASK> in the line command area.On the =MASK> line, enter the characters you want duplicated on each new line. Each line you insert will start with the contents of the mask line.

In this example,the =MASK> line includes the asterisks used to denote code comments. You can change the characters in the mask line as needed. To remove the current maskline, use the D line command to delete it. Alternatively, you can achieve the effect of a mask line by inserting

one blank line, enter your data, and then repeat it using an R command.

The NUMBER command You can control the line numbering in the ISPF editor with a series of commands. To display line numbers use the NUMBER ON command. You may also use NUMBER STD, NUMBER COBOL, or NUMBER STD COBOL to ensure that the source data has line numbers in standard format, line numbers in COBOL format, or both. With number mode on, the editor automatically maintains line numbers and generates new line numbers for inserted lines. It will even resequence existing lines if necessary.

Next step is learn how toNext step is learn how toNext step is learn how toNext step is learn how to ::::

Use editing modes to customize your editing environment �

Turn various editing modes on and off �

AUTOSAVE mode AUTOSAVE controls whether your changes to the data are saved automatically when you enter END to end an editing session.To change mode to OFF Simply type AUTOSAVE OFF or AUTOSAVE ON in the comand line.

CAPS mode CAPS mode forces all characters typed to automatically appear in uppercase. With this mode turned off, no automatic conversion is applied. CAPS mode is quite useful for COBOL programs and other types of program source code which are generally all entered in uppercase

characters.

The editor automatically sets CAPS mode on if it detects that a member you select to edit contains no lowercase characters. It also sets CAPS mode off if it detects lowercase characters in the member.To change mode to OFF Simply type CAPS OFF or CAPS ON in the comand line.

HEX mode With HEX Mode on, all characters are displayed in hexadecimal format. The editor replaces each actual character with its two-byte hexadecimal equivalent. You can change any character by changing its two-byte code.

The two-byte code is equivalent to PACKED-DECIMAL in COBOL. Therefore, you can use HEX mode to create or modify such data.To change mode to OFF Simply type HEX OFF or HEX ON in the comand line.

RECOVERY mode

With RECOVERY mode on, the ISPF editor maintains a record of all changes you make during an edit session. The editor saves the changes in a special file called the recovery data set.

If the system should crash during an edit session, ISPF leaves the recovery data set open. When you edit the member again, the editor will sense this and give you an opportunity to apply the changes again.

RECOVERY mode also provides an undo capability. You can choose for the UNDO command to run from data in storage rather than from the recovery data set by using the SETUNDO command.To change mode to OFF Simply type RECOVERY OFF or RECOVERY ON in the comand line.

STATS mode

If STATS mode is on, ISPF creates and maintains statistics for partitioned data set members. When a member is retrieved for editing, the editor checks the STATS mode setting and also checks to see if the member has statistics. If the STATS mode is off and the member has statistics, the editor automatically sets STATS to on.

If STATS is set to on and the member does not have statistics, ISPF displays a warning, but does not change the STATS setting. ISPF displays the statistics in the member selection list as shown her

Next step is learn how toNext step is learn how toNext step is learn how toNext step is learn how to ::::

Find data strings in a data set member �

Change one or all occurrences of a data string in a data set member �

Define ranges to limit the scope of the FIND, CHANGE, and EXCLUDE commands �

Exclude and redisplay lines of text in a member�

Type FIND at the command line, followed by the string. If the search string contains blanks or special characters, enclose it in quotes. For example:===> FIND ' EXEC CTMCATFU'

The ISPF editor finds and highlights all occurrences of the target string and moves the cursor the first line that contains the string

The CHANGE command Use the CHANGE command to search for a string and replace it with a second string. The CHANGE command takes two strings. The first string is the target text, and the second is the replacement text. For example, the following command:===> CHANGE CATFLCR CATFCLR1 searches for the first occurrence of the target string CATFLCR and replaces it with the string CATFCLR1

If either the target or replacement string contains spaces or special characters, surround the string with quotes. To replace all occurrences throughout the source member, add the keyword ALL to the end of the command. Changed lines are marked with ==CHG> in the line command area.

Excluding lines from the search To exclude lines from a search, use the EXCLUDE command before you issue the FIND or CHANGE command. For example, the command:===> EXCLUDE DD ALLexcludes all lines within the source that contain the string DD. The editor no longer displays the excluded lines, but replaces them by a single dashed line that indicates how many lines are not displayed

Excluding lines from the search

You may also exclude lines by using the exclude line command (X) in the line command area.

There are three forms of this command: X Excludes this line Xn Excludes n lines starting with this line XX Excludes the block of lines beginning with the first XX command

This example shows using X to exclude a single line and X2 to exclude two lines.

Use the XX form of the exclude line command to exclude a block of lines.

For example, you might want to exclude a lot of lines from one jcl , so you can do that as shown here.

Now in our jcl only are 4 lines displayed and the others 25 lines are hidden

Redisplaying excluded lines

You can also use the following line commands to redisplay specific lines of text: F (show the first line) L (show the last line) S (show lines)

To redisplay the first line of excluded text, type F in the line command area next to where lines were excluded, as shown in this example. To redisplay multiple lines use the command form Fn.

The S line command redisplays lines based on indentation level. If you type S9, the editor displays the nine lines with the left most indentation. This can be useful for lining up IF and ELSE clauses in large blocks of indented code.

Deleting or retaining excluded lines You can use the DELETE primary command to delete either the excluded lines or the non-excluded lines from the member.

To delete the lines that have been excluded from the display, type DELETE ALL followed by X on the command line, as shown in this example.To delete the lines that have not been excluded from the display (and thus retain only the excluded lines), type NX after the DELETE ALL primary command.

Shifting indentation You can also use line level commands to shift or change the indentation of one or more lines. The left parenthesis symbol shifts lines left. The right parenthesis symbol shifts lines right. The format of these commands can be:

( shifts one line two spaces left (n shifts one line n spaces left (( marks the beginning and end of a block to shift two spaces left ((n marks the beginning of a block to shift n spaces left

For example, a single ( shifts the line 2 positions to the left. To shift one line 8 spaces to the right, type )8 in the line command area. To mark a block of text to shift left 7 spaces, type ((7 at the first line of text and (( at the lastline of text.

Everybody that need View, Create , Edit , Change any file on z/OS mainframe use ISPF editor.

During testing you may need to create or modify testing files/programs like JCLs. In order to do that you can use the ISPF Editor. This Just Enough document is linked to the other Just Enough for z/OS environment.

There is a list a Just enough documents related z/OS Mainframe:

Overview IBM Personal Communication/3270 Overview Unload DB2 tables located at Z/OS Mainframe directly to your PC.

Also there is a PDF document

To practice all the commands of ISPF Editor you need to connect to a mainframe sesion but fortunately if you do not have a mainframe conexion, the follow tool can be installed in your pc and you can start to practice the majority of commands that this just enough document offers you.

Have a funny time !!!

NameNameNameName UserUserUserUser

Héctor Alonso Rivera Ramírez [email protected]

Do not hesitate on contacting Cells & Just Enough team members if you can not reach anyone from the list above.

Héctor Alonso Rivera RamírezMVS/VM Epricer, FranceCalz. Legaria #853, Col. Irrigación

C.P.11500 México, D.F.Home: 011 (525) 886-1490 1stfax: 011 (525) 886-1490 pager: 011 (525) 727-7979 PIN 5263567

La brevedad es el alma del ingenio