Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 55

How to Login to TSO

Enter Choice TSO as shown below and hit enter.

Enter IBMUSER and hit enter.

Enter SYS1 as password and hit enter. Better you dont change password. Do not change
any other fields.
After you see ISPF in the bottom, you can hit enter. You can see ISPF Primary option
menu.

You can see ISPF Primary Option Menu as shown below.


How to LOGOFF from TSO
Close all screens that are opened with =X

After closing last screen you can see below screen. Then issue 2 and Enter.

You can see Ready prompt as shown below.

Issue LOGOFF and hit enter you will be logged off.

How to create a new screen

Issue START in the command prompt and hit enter key.


It will take to new screen as shown below.

How to delete an existing screen


Issue =X in the command prompt as shown below and hit enter key.
How to see screens that are opened
Issue SWAP LIST in the command prompt as shown below and hit enter key.

It will show screen numbers and screen names as shown below. * is current screen and
is previous screen.

How to Create a Source PDS


Issue =3.2 from ISPF primary option and enter

Enter source PDS name in single quotes and issue command A then enter.
Enter below details and press enter. If you leave volume serial as spaces then it takes default
volume serial. In this system you give S7SYS1 as volume serial because it has more free
space. Better you leave block size as spaces. Then it takes best block size for the given record
length. Maximum space that is created for this data set is Primary space + 15 * secondary
space = 10 + 15 * 10 = 160 tracks.

You can see below screen with confirmation.

How to create a Load PDS

Issue =3.2 from ISPF primary option and enter.

Enter source PDS name in single quotes and issue command A hit enter.
Enter below details and press enter. If you leave volume serial as spaces then it takes
default volume serial. In this system you give S7SYS1 as volume serial because it has more free
space. Maximum space that is created for this data set is Primary space + 15 * secondary space
= 10 + 15 * 10 = 160 tracks.Load library should be created with Record format U and Record
length 0 and Block size 27998.

You can see below screen with confirmation.

How to create a PS for the below layout

01 STUDENT-REC.
02 STUDENT-NUM PIC 9(4).
02 NAME PIC X(10).
02 DOJ PIC 9(8).
02 COURSE PIC X(10).
02 FEE PIC 9(5)V99.
02 FEE-PAID-DATE PIC 9(8).

Length of the above layout is 47.


Issue =3.2 from ISPF primary option and enter
Enter source PDS name in single quotes and issue command A then enter.

Enter below details and hit enter. If you leave volume serial as spaces then it takes default
volume serial.
In this system you give ZASYS1 as volume serial because it has more free space.
Maximum space that is created for this data set is Primary space + 15 * secondary space = 2 +
15 * 1 = 17 tracks
Always create less space for PS files. Length of the file is 47.

You can see confirmation as shown below.


How to edit data into PS file in a given layout

Issue =3.4 from ISPF Primary Option menu

Enter dataset name without quotes as shown below and hit enter.

Issue line command E and press enter twice.

Enter the data according to the given Layout. Then save and exit.

How to see file data with its copybook using file manager
See the below file STUDENT.FILE with its copybook JOHN.SRCLIB(COPY1)
Go to file manager from ISPF by issuing M.13 from ISPF primary option menu.

Select 1 from primary option menu of File Manager

Supply file name, PDS and its member name and option 1 as shown below and hit enter.

You can see the file data in the given layout as shown below.
How to create a member in a PDS

Issue =3.4 from ISPF Primary Option menu.

Enter dataset name without quotes as shown below.

Issue Line command E and supply member name within braces after PDS then hit enter.

Enter once again.

Edit any sample data and SAVE.


How to copy a member of a PDS to another PDS
Issue a line command C in front of member of a PDS and enter.

Supply destination PDS name as shown below and enter.

You can see the confirmation as shown below.

How to delete a PDS or PS

Issue a line command D in front of PDS or PS in 3.4 and hit enter key.
It will ask for confirmation as shown below. Hit enter key once again.

How to rename a PDS or PS


Issue R as line command and hit enter key.

Supply new dataset name as shown below and hit enter key.

You can see the renamed dataset as shown below.


How to see information of PDS
Issue I as line command at PDS and hit enter key.

You can see dataset information as shown below. Organization PO indicates a PDS.

How to see information of a PS

Issue I as line command at PS and hit enter key.

You can see dataset information as shown below. Organization PS indicates a PS.
Line command used in Member of PDS or PS
How to insert a new line
Issue line command i and hit enter
Before After

How to insert 3 new lines


Issue line command i3 and hit enter
Before After

How to repeat existing line


Issue a line command r and hit enter
Before After

How to repeat existing line n times


Issue a line command R2 to repeat two lines and hit enter
Before After
How to repeat block of lines
Issue a line command RR on from line and to line then hit enter
Before After

How to copy a line Before/After another line


Issue a line command C on a line and issue B/A on another line and hit enter.
Before After

Note: You can also use Cn/CC to copy n lines or group of lines.

How to delete a line


Issue a line command D on a line you want to delete and hit enter.
Before After

Note: You can also use Dn/DD to delete n lines or group of lines.

How to move a line Before/After another line


Issue a line command M on a line and issue B/A on another line then hit enter.
Before After

Note: You can also use Mn/MM to move n lines or group of lines.
How to change a line from Upper case to Lower case
Issue a line command LC on a line and hit enter.
Before After

Note: You can also use LCn/LCC to change n lines or group of lines from upper case to
lower case.
How to change a line from Lower case to Upper case
Issue a line command UC on a line and hit enter.
Before After

Note: You can also use UCn/UCC to change n lines or group of lines from lower case to
upper case.
How to move a line 3 columns right
Issue a line command ) 3 on a line and hit enter.
Before After

Note: You can also use )) n to move group of lines n columns right.

How to move a line 3 columns right


Issue a line command ) 3 on a line and hit enter.
Before After

Note: You can also use ))n to move group of lines n columns left.
How to overlap a line on another line
Issue a line o on a line and c on another line and hit enter.
Before After

How to overlap a line on multiple lines


Issue a line o on a line and block command cc on from line and to line then hit enter.
Before After

How to copy a PS to another PS

Issue =3.3 from ISPF primary option menu and hit enter key.

Supply FROM dataset name and issue C in the command prompt and hit enter key.
Supply TO dataset name and hit enter key.

Select option 1 and hit enter key. It will create TO dataset and copies data. If you select option 2 then
you have to specify allocation attributes of TO dataset. Better always go with option 1.

You can see the confirmation as shown below.

How to release excess space allocated to PS or PDS


Here two tracks are allocated but 1 track is utilized before issuing Free command.
Issue line command F in 3.4 and hit enter key.

After freeing excess space you can see confirmation as shown below.

Dataset information after Free command. Here one track is released that is allocated but
not utilized.

How to Compress a PDS


Dataset information before Compress.

Issue line command Z in 3.4 and hit enter key. When a member is deleted from a PDS its
memory will not be released until you compress. When you get space ABEND SE37
compress dataset using option Z.
You can see confirmation after compression as shown below.

Dataset information after Compress. Used tracks are reduced from 10 to 9.

How to Receive PS/PDS member from mainframes to PC

Issue option 6 from ISPF primary option menu and hit enter.

Click on Transfer and then click on Receive from Host.

You will see the below screen.


Supply Mainframe file with quotes and select PC file path and file name with .txt then
click on Receive.

You can see that program in desktop.

How to Send a notepad from PC to PS/PDS member of Mainframes

Issue option 6 from ISPF primary option menu and hit enter.

Click on Transfer and then click on Send to Host.

Browse and Select PC file left side and mainframe PS/PDS Member on right side and click on SEND.
How to Check JCL errors from the SPOOL for file not cataloged

I am submitting a JCL by taking FILE2 as input with DISP=SHR. But FILE2 is not cataloged.

I got a notification with JCL error as shown below.

To find reason to the JCL error, go to ST of SPOOL and issue line command ? on the
Job with same jobid as shown below and hit enter.

Issue line command S on JESYSMSG and hit enter.

You can see the error message as shown below.


How to Check JCL errors from the SPOOL for file already cataloged
I am submitting a JCL by taking FILE3 as output with DISP= (NEW, CATLG, DELETE). But FILE3 is
cataloged.

I got a notification with JCL error as shown below.

You can see error information in the SPOOL as shown below.

How to Check JCL syntactical errors from the SPOOL


I am submitting a JCL without giving a COMMA for a continuation of operands in DD
operation.

I got a notification with JCL error as shown below.


Go to the spool job and issue S in the JESYSMSG as shown below.

You can see error statements in the JESYSMSG in the SPOOL.

Go to JESJCL to see the error statements.

Comma omitted on statement 6 and DD is ended here. With this reason statements 7, 8, 9
and 10 are errored.

How to purge a completed job


Go to spool and issue line command P and hit enter.
It will ask confirmation, now issue 1 and hit enter key.

Command executed and job deleted. Issue ST in command prompt and hit enter key.

You can see that the job is log is deleted.

How to Cancel a running job


Issue a line command C in front of the jcl that is running and hit enter.

Issue 1 and hit enter key.


JOB is cancelled. Hit enter once again.

You can see that the job is cancelled.

How to execute a query in SPUFI


Issue M in the command prompt of ISPF primary option menu and hit enter.

Issue 15 in the command prompt and hit enter. It will take you to DB2I Primary Option
Menu.

Issue 1 in DB2I and hit enter.


Supply Input dataset name where you write SQL query and Output dataset where you see
the result. And Hit Enter. Input can be either PDS member or PS but output should
always be PS. You can give an existing member that has SQL query or a new member.

It is Current SPUFI defaults panel. Better you dont change these defaults. Simply Hit
enter in this Panel.

Write SQL that you want to execute.

Here I am executing two sql queries. Both the queries are ended with scope terminator ;.
Hit Function key F3 to come back.
Now hit enter to execute these queries.

You can see results in DB2.DATA after execution.

How to execute a query in QMF

Issue M in the command of ISPF Primary option menu and hit enter.

Issue 17 and hit enter.


You are into QMF Home Panel. Hit Function key F6.

You can write query in the below panel.

Execute SQL query by hitting function key F2.

It shows result after executing the query as shown below.


How to execute query in QMF if the table columns are not known
Hit function key F6 in the QMF Home Panel.

Hit function key F6 once again.

You can see the below screen.

Now enter table name as shown below and hit enter key.
It will show a query with all columns as shown below. You can execute the same or you
can also remove some Columns as shown in the next screen.

Execute the query by hitting function key F2.

You can see result as shown below.


Compilation
How to write and Compile my first COBOL program

Create 3 PDS before you write a COBOL program in the Source PDS.
Note: Load PDS should be created with Record format as U, Lrecl as 0 and block size as 27998.

Then create a member in the Source Library and write a COBOL program as shown below.

To compile the above program, copy the compile jcl XCOB from DEMO.COMPILE to your Source
Library.
Note: Change the below screen to DEMO.COMPILE

You can see the XCOB in JOHN.SRCLIB

Customize the copied compile JCL by changing the values on symbolic parameters to
your values.
Change AAA.BBB.CCC to your Source Library.
Change DDD.EEE.FFF to your Copy Library. If you dont have copy library then give source library
name here.
Change GGG.HHH.III to your Load Library.
Change XYZ to your Program Name.
You can submit the compile JCL After changing the libraries and program name.

How to check Compile Errors


I coded a program with some errors as shown below. Now I compile and show you how to
see errors in spool.

Here I am submitting the compile JCL to compile the above program.

My compile jcl is failed with MAXCC=12.


Go to spool and issue line command ? and hit enter.

Issue S on SYSPRINT (it is called compile listing) and hit enter.

Go to the bottom of the compile listing and you can see errors as shown below. Here 3
errors are reported in Which 2 are errors and 1 is severe error. It will also give error line
number.

How to compile and execute my first COBOL DB2 program


Do the following steps to write and execute your first COBOL DB2 program.

Step1. Create your libraries with the attributes as shown below.


Library name Recfm Lrecl Blksize
JOHN.COPYLIB FB 80 27920
JOHN.DBRMLIB FB 80 27920
JOHN.LOADLIB U 0 27998
JOHN.SRCLIB FB 80 27920
Step2. Create a DCLGEN copybook for the table you are using in the program.
Step3. Write a COBOL program with Embedded SQL statements.
Step4. Compile your program with XCOBDB2 and then XPLAN by copying these from
DEMO.COMPILE.
Step5. Copy a sample COBOL DB2 run jcl from DEMO.COMPILE and customize then run.
Step1. Create your libraries with the attributes as shown below.
I created all the below libraries. Note: Loadlib should be created with RECFM=U,
LRECL=0 and BLKSIZE=27998

Step2. Create a DCLGEN copybook for the table you are using in the program.
Issue M.15 from ISPF primary option menu and hit enter key to go to DB2I.

Issue 2 in the command prompt and hit enter key to go to DCLGEN.

You can see the below panel.


Supply Table name, copy library with copybook name and meaningful structure name.
Then hit enter key.

Execution completed and member is created with DCEMP in copy library JOHN.COPYLIB

You can see that created member in the PDS.

If you view the dclgen copy book, you can see declare table syntax and Host variable declaration.
Step3. Write a COBOL program with Embedded SQL statements.
Write a COBOL DB2 program with embedded SQL.

Step4. Compile your program with XCOBDB2 and then XPLAN by copying
these from DEMO.COMPILE.
Copy compile jcl XCOBDB2 and Bind jcl XPLAN from DEMO.COMPILE to your
source library and customize.

Then customize the XCOBDB2 to change it your libraries.


Change the above libraries as shown below and submit. This JCL contains Precompile,
compile and link edit Steps.

It is successfully completed with MAXCC=0

Edit XPLAN to change DBRM Library, Plan name and Member name.

Submit this BIND jcl After changing dbrm library, plan name and member name
(program name)

Bind is successfully executed with MAXCC=0.


Step5. Copy a sample COBOL DB2 run jcl XDB2RUNJ from DEMO.COMPILE and
customize then run.

Custmize below JCL to change the program name, Plan name and Load Library name.

Submit the run jcl after changing the program name, Plan name and Load Library name.

COBOL DB2 program PGM1 is successfully executed with MAXCC=0


How to LOGON CICS
Issue L CICS from login screen and hit enter.

You are logged on as shown below. Hit ESC key to clear this screen before you enter any
transaction.(Make sure the ESC key is mapped to CLEAR key.)

You can see below screen after clear. Now you can execute any registered transaction.

How to LOGOFF CICS


Issue CESF GOOD in the left corner of the screen and hit enter. You will be logged off.
How to compile my first BMS map
Step1. Create a source library and a copy library.
Step2. Create a member in the source library and write a BMS map in assembler macros.
Step3. Copy Compile JCL XBMSMAP from DEMO.COMPILE to your source library
and compile it after customization.

Step1. Create a source library and a copy library.

Step2. Create a member in the source library and write a BMS map in assembler macros.
Note: Entire BMS coding is not shown here, because my intention is to show how compile
and execute BMS map but not coding rules and syntax.

Step3. Copy Compile JCL XBMSMAP from DEMO.COMPILE to your source library
and compile it after customization.
Copy compile jcl XBMSMAP from DEMO.COMPILE to your source library.

Edit Compile JCL XBMSMAP to change the below libraries and program.
Submit XBMSMAP after customization. After successful compilation, it creates a
symbolic map in copy library and Physical map in load library.

You can see Symbolic map (copy book) in copy library after successful compilation.

You can see Physical map (load module) in load library after successful compilation.

How to Define and Install BMS Mapset in CICS

Define Mapset with CEDA as shown below. You change CAL1M1S to your mapset name
and hit enter.
Note: Better always give group as XYZ otherwise you need to install every time boot z/OS.

You can see the below screen with DEFINE Successful. Now hit F3 to come back to
previous screen.
Install Mapset with CEDA as shown below. You change CAL1M1S to your mapset name
and hit enter.

You can see the below screen with INSTALL Successful.

How to execute send map with CECI command


Issue CECI to send map as shown in the below screen and hit enter. You can execute any
CICS command with CECI (Command interpreter).

Simply Hit enter once again.

You can see the screen as shown below.


How to compile and execute my first COBOL CICS program
Write a COBOL CICS program in Source PDS after compilation of BMS map that will be
used in COBOL program.

BMS map is compiled and a symbolic map is created in JOHN.COPYLIB

Copy the compile JCL XCOBCICS from DEMO.COMPILE to your source library. In
my case it is JOHN.SRCLIB.

Supply your source library and hit enter.

Edit compile jcl that is copied into your source library to change library names before you
compile.
Change the libraries and program name and then submit.

Submit compile jcl after changing the libraries and program name as shown below.

Program is successfully compiled as shown below.

How to Define and Install a Program in CICS


Define a Program with CEDA as shown below. You change program name and hit enter.

You can see the below screen with DEFINE Successful. Now hit F3 to come back to
previous screen.

Install program with CEDA as shown below. You change program name and hit enter.
You can see the below screen with INSTALL Successful.

How to Define and Install a Transaction in CICS


Define a transaction id to the program as shown below. You change trans id and program
name and hit enter.

You can see below screen with Define Successful. Hit F3 to come back to previous
screen.

Install transaction id with CEDA as shown below. No need to give program name at
Install. You change Transaction id and hit enter.
You can see the below screen with INSTALL Successful.

How to Execute a Transaction in CICS

Issue transaction id in the left corner of screen and hit enter.

Program CAL1P assigned to CAL1 is executed as shown below.

How to debug a CICS program

Issue CEDF and hit enter key as shown below.

You can see message as shown below. Now clear screen.


Now issue transaction id you want to debug and hit enter. Now the transaction will be
executed in debug mode.

It will show you panel with program name and EIB fields. Keep hitting enter key, it will
execute command by Command. You can see only CICS code but not COBOL code.

Before SEND MAP command

SEND MAP command executed.


How to compile and execute COBOL CICS DB2 program

Step1.Create your libraries with the attributes as shown below.

Step2. Create DCLGEN copybook for table that is used in COBOL+CICS+DB2 program.
Note: Creation of DCLGEN copybook is not shown here because it is already covered in COBOL DB2
program.

Step3. Create a BMS Map and compile it.


Note: Create and compile BMS Map is not shown here because it is already covered in COBOL CICS
program.

Step4. Write a COBOL+CICS+DB2 program in the source library.

Step5. Copy the compile jcls XCOBCIDB and XPLAN from DEMO.COMPILE.
Step6. Customize XCOBCIDB by changing libraries and program name then compile.

Change it as shown below and submit.

Step7. Customize XPLAN by changing DBRM library, program and plan name then bind.

Change as shown below and submit.


Step8. Define and install BMS Mapset, Program and Transaction id. No need to define
and install Plan because Plan name and program name is same.
Note: Define and install is already shown in COBOL CICS program.

Step9.Clear screen and execute transaction id DB21.

Program DB21P is executed as shown below.

How to Define and Install a File in CICS


Define a logical file as shown below. You change logical file name and hit enter.

You may see Define Successful but you have to supply the physical file name at DSNAme.
Supply the physical file name as shown below and hit enter key. Then Hit F3 to come back
to previous screen.

Install file as shown below. Change logical file name and hit enter.

You can see the below screen with INSTALL Successful.

How to change File Modes in CICS


You can change the file modes with CEMT as shown in the below screen. Hit enter.

By default the file will be closed and enable with read access mode. Now place cursor on
physical file name and hit enter to change to update, add and delete access modes.
Change open to close and enabled to disable and hit enter key.

File is now disabled. Then change No update to update, No addable to addable, No browse
to browse and No delete to delete and hit enter.

Now the modes are changed. Now change disabled to enable and hit enter.

Now the file is enabled. Hit F3 to come back. Now you can use this file to read, write,
update, delete and browse.
If you want see the changed modes, you can execute CEMT once again as shown below .

Here updated modes are shown.

You might also like