Monday, January 8, 2024

Difference between EXIT PROGRAM, GOBACK, STOP RUN in COBOL

Let us assume we have a Batch JOB step which executes MAIN-PGM. 
Let us assume job step has below call chain. 

MAIN-PGM --> SUB-PGM1 --> SUB-PGM2 --> SUB-PGM3

That is MAIN-PGM calls SUB-PGM1
SUB-PGM1 program inturn calls SUB-PGM2
SUB-PGM2 program inturn calls SUB-PGM3

A run unit is a running set of one or more programs that communicate with each other by COBOL static or dynamic CALL statements. So, the above entire flow is called "run unit"

EXIT PROGRAM or GOBACK in sub programs(called programs) returns the control to the calling program.

For example, if we code EXIT PROGRAM or GOBACK in SUB-PGM3, then control returns to the point in the SUB-PGM2 immediately following the CALL statement that invoked SUB-PGM3

GOBACK in main program MAIN-PGM passes the control to the operating system program that invoked it.

EXIT PROGRAM in main program does NOT do anything, control goes to the next statement that immediately follows EXIT PROGRAM.
So, EXIT PROGRAM works only in sub programs (called programs).

If we code STOP RUN in SUB-PGM3 (or any other program in the calling chain), it will directly pass the control to the operating system program that invoked main program MAIN-PGM. That is STOP RUN ends the execution of entire "run unit".

Friday, January 5, 2024

Initialize FILLER data item

INITIALIZE statement wont initialize FILLER data items. If you want to initialize FILLER items as well, then include "WITH FILLER" in the INITIALIZE statement.

If you include "ALL VALUE" clause in the INITIALIZE statement, then it will initialize ONLY the data items that are defined with VALUE clause to the value specified in the VALUE clause.

Below is the sample code to explain the usage of FILLER and VALUE clauses in the INITIALIZE statement.

WORKING-STORAGE SECTION.
01 WS-X.
   05 WS-A    PIC X(16).
   05 WS-A1   PIC X(16) VALUE '1234567890A.CDEF'.
   05 WS-B    PIC X(5).
   05 WS-C    PIC 9(5).
   05 FILLER  PIC 9(5).
PROCEDURE DIVISION.
   MOVE ALL '*'    TO WS-X
   DISPLAY WS-X
   INITIALIZE WS-X WITH FILLER
   DISPLAY WS-X
   MOVE ALL '*'    TO WS-X
   INITIALIZE WS-X ALL VALUE
   DISPLAY WS-X
   STOP RUN.

Output of the above program

***********************************************    
                                     0000000000    
****************1234567890A.CDEF***************    

Wednesday, December 27, 2023

Changing the order of GDG concatenation

GDGORDER keyword specifies the order in which the individual generation data sets (GDSs) will be concatenated.

 

The values of Parameter are USECATLG, LIFO and FIFO.

 

USECATLG - The GDS concatenation is ordered as specified in the GDG data set catalog entry. When the GDGORDER keyword is not specified, the concatenation order from the catalog definition of the GDG data set is used. However, the default setting in the catalog entry for a GDG base data set definition is LIFO, to match the setting for releases prior to z/OS V2.1.

 

LIFO - The GDS concatenation is ordered with the newest GDS defined first and the oldest GDS last.

 

FIFO - The GDS concatenation is ordered with the oldest GDS defined first and the newest GDS last.

 

Let us explore this with an example. Suppose USERID.GDG has three generations as shown below.

 

 BROWSE    USERID.GDG.G0001V00                      Line 0000000000 Col 001 080

 Command ===>                                                  Scroll ===> CSR 

********************************* Top of Data **********************************

GDG1                                                                          

******************************** Bottom of Data ********************************

 

 BROWSE    USERID.GDG.G0002V00                      Line 0000000000 Col 001 080

 Command ===>                                                  Scroll ===> CSR 

********************************* Top of Data **********************************

GDG2                                                                          

******************************** Bottom of Data ********************************

 

 BROWSE    USERID.GDG.G0003V00                      Line 0000000000 Col 001 080

 Command ===>                                                  Scroll ===> CSR 

********************************* Top of Data **********************************

GDG3                                                                          

******************************** Bottom of Data ********************************

 

 

Case 1: When the GDGORDER keyword is not specified

 

The below step copies all the generations of GDG to SORTOUT.

 

//STEP1    EXEC PGM=SORT                             

//SORTIN   DD DISP=SHR,DSN=USERID.GDG                 

//SORTOUT  DD SYSOUT=*                               

//SYSOUT   DD SYSOUT=*                                 

//SYSIN    DD *                                         

 OPTION COPY                                         

//*                

 

Below is the output of the above step. The effect is LIFO

 

 BROWSE - SORTOUT           STEP1    - Page  1      Line  1        Cols 1-80   

 COMMAND ===>                                                SCROLL ===> CURSOR

******************************** Top of Data ***********************************

GDG3                                                                           

GDG2                                                                           

GDG1                                                                           

 ******************************* Bottom of Data ********************************

            

Case 2: When GDGORDER=FIFO

 

The below step copies all the generations of GDG to SORTOUT.

            

//STEP2    EXEC PGM=SORT                             

//SORTIN   DD DISP=SHR,DSN=USERID.GDG,GDGORDER=FIFO   

//SORTOUT  DD SYSOUT=*                               

//SYSOUT   DD SYSOUT=*                                 

//SYSIN    DD *                                         

 OPTION COPY                                         

//*                                                  

 

Below is the output of the above step.

 

 BROWSE - SORTOUT           STEP2    - Page  1      Line  1        Cols 1-80   

 COMMAND ===>                                                SCROLL ===> CURSOR

******************************** Top of Data ***********************************

GDG1                                                                           

GDG2                                                                           

GDG3                                                                           

 ******************************* Bottom of Data ********************************                                        

Wednesday, November 1, 2023

Complete Video tutorials for a Mainframe Developer

A typical mainframe Developer needs expertise in TSO/ISPF, JCL, VSAM, COBOL, DB2, CICS, Debugger such as Xpeditor, IBM debugger, REXX, MQ, SCM tools such as Endevor and Changeman,   Job schedulers such Control-M, OPC, ESP

Below are videos from various youtube channels which will help anyone to become Mainframe developer.

Mainframe Basics

What is a Mainframe

https://www.youtube.com/watch?v=ZEaFjkaIfWE&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=1&pp=iAQB

Mainframe A server OS perspective

https://www.youtube.com/watch?v=SIMKOgAjaL0&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=2&pp=iAQB

Mainfame Usage Scenarios

https://www.youtube.com/watch?v=caT0fJ31D4E&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=4&pp=iAQB

Mainframe virtualization

https://www.youtube.com/watch?v=zXE2kjxyWqo&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=5&pp=iAQB

Mainframe virtualization with zVM

https://www.youtube.com/watch?v=a_yQtpzI5ho&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=6&pp=iAQB

Clustering and Parallel sysplex

https://www.youtube.com/watch?v=0CooCQ73PDY&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=7&pp=iAQB

Mainframe CPU architecture

https://www.youtube.com/watch?v=zXSQpFcG05c&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=8&pp=iAQB

Mainframe I/O subsystem

https://www.youtube.com/watch?v=n7uGtOkEb8U&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=9&pp=iAQB

Mainframe Z Hardware part 1

https://www.youtube.com/watch?v=Rj7Sg-JyA-s&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=10&pp=iAQB

Mainframe Z Hardware part 2

https://www.youtube.com/watch?v=wqxLz6Xi8uw

Introduction to Z/OS part 1

https://www.youtube.com/watch?v=HISM5intBoU&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=19&pp=iAQB

Introduction to Z/OS part 2

https://www.youtube.com/watch?v=VZ4NnswOPzc

Z/OS components

https://www.youtube.com/watch?v=H0YJRi96iiE&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=20&pp=iAQB

Z/OS datasets

https://www.youtube.com/watch?v=wWqZzNjtHKc&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=21&pp=iAQB

Job Management and JES

https://www.youtube.com/watch?v=M48zi3TdH0A&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=22&pp=iAQB

JES Job Entry Subsystem

https://www.youtube.com/watch?v=2PGyIiUNokM

DataManagment

https://www.youtube.com/watch?v=eLF2fL-mz_E&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=23&pp=iAQB

TN3270

https://www.youtube.com/watch?v=fFVL0uCjpuI

TSO part 1

https://www.youtube.com/watch?v=0hS_Kia6DRg&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=24&pp=iAQB

TSO part 2

https://www.youtube.com/watch?v=6_UhnP26dhQ

TSO demo

https://www.youtube.com/watch?v=4SD6MVXDQZA&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=25&pp=iAQB

ISPF part 1

https://www.youtube.com/watch?v=pcpc53zy1Rc&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=26&pp=iAQB

ISPF part 2

https://www.youtube.com/watch?v=h-z_TeUs6ow

ISPF demo

https://www.youtube.com/watch?v=IWVD2yM3tsY&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=27&pp=iAQB

ISPF Editor

https://www.youtube.com/watch?v=DQzWgmNww2c

SDSF

https://www.youtube.com/watch?v=LRcq0O5SGhY

Dataset names and types

https://www.youtube.com/watch?v=7RY9EiJwm4E

Sequential Datasets

https://www.youtube.com/watch?v=wKhqo8iwCKc

Partitioned Datasets

https://www.youtube.com/watch?v=3p0IL3DcAug

Disk Storage, Volume Labels, VTOC, Extents

https://www.youtube.com/watch?v=bmpuh8fvE7M

VSAM Virtual Storage Access Method

https://www.youtube.com/watch?v=9McZNgGy62E

Unix System Services

https://www.youtube.com/watch?v=_lKo72JdQ4E

System Catalog

https://www.youtube.com/watch?v=mq79KGpCjW0

JCL Job Control Language

https://www.youtube.com/watch?v=fMQNRrNx4DM

Virtual Storage and Address Spaces

https://www.youtube.com/watch?v=_0u6_UHa0rI

Key Controlled Protection for Address Spaces

https://www.youtube.com/watch?v=_XuBW6tWZso

System and User Address Space Management

https://www.youtube.com/watch?v=PDUVPtGosXM

Components, Messages, and System Log

https://www.youtube.com/watch?v=T7jr80t412c

Security, RACF

https://www.youtube.com/watch?v=XT_x-pPPJgg

Mainframe security

https://www.youtube.com/watch?v=8dBIgYTDSQs&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=49&pp=iAQB

Z/OS security

https://www.youtube.com/watch?v=eI3ZmPNYX0E&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=51&pp=iAQB

RACF demo

https://www.youtube.com/watch?v=MTDwpbNCABQ&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=52&pp=iAQB

Communications Server

https://www.youtube.com/watch?v=XTBwQjTWUYM

zOS Operator Commands

https://www.youtube.com/watch?v=0V7UpsVOT9E

zOS Initial Load Program Process

https://www.youtube.com/watch?v=FUmHD_ZbamU

Databases, IMS and Db2 Part 1

https://www.youtube.com/watch?v=YHCM7OnZwDg&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=30&pp=iAQB

Databases, IMS and Db2 Part 2

https://www.youtube.com/watch?v=kEZiLDtAUVo&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=31&pp=iAQB

Introduction to COBOL

https://www.youtube.com/watch?v=8qTswQReYH8&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=32&pp=iAQB

Data models in Mainframe

https://www.youtube.com/watch?v=P8_PGQ1fAFo&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=35&pp=iAQB

Hierarchical model and IMS

https://www.youtube.com/watch?v=1-X2hQZHaq0&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=36&pp=iAQB

Relational Data model

https://www.youtube.com/watch?v=xn1Pc3v7e2I&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=37&pp=iAQB

Introduction to DB2

https://www.youtube.com/watch?v=99NwdyNtbVk&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=38&pp=iAQB

Db2 SPUFI

https://www.youtube.com/watch?v=itAk-MYw5e8&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=39&pp=iAQB

Transaction processing - part 1

https://www.youtube.com/watch?v=J_NAjEDpILA&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=40&pp=iAQB

Transaction processing - part 2

https://www.youtube.com/watch?v=wZCvvnvUzEc&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=41&pp=iAQB

Introduction to CICS

https://www.youtube.com/watch?v=DXRuOpvOUW0&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=43&pp=iAQB

Message queuing

https://www.youtube.com/watch?v=vMMJRkmxKK0&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=47&pp=iAQB

IBM MQ

https://www.youtube.com/watch?v=NSjQRd38nQY&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=48&pp=iAQB

Storage Management

https://www.youtube.com/watch?v=b7YsFbo7r4k&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=53&pp=iAQB

Hierarchical storage manager

https://www.youtube.com/watch?v=rYJr5VdIXPc&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=54&pp=iAQB

SMS and ACS

https://www.youtube.com/watch?v=KRatNLzv0Ys&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=55&pp=iAQB

ISMF demo

https://www.youtube.com/watch?v=As3RNIDgTfI&list=PLoOmvuyo5UAe7Sa7YptNmGuDlMiKXJIlB&index=56&pp=iAQB

Mainframe basics

https://www.youtube.com/watch?v=qjsahHeuf10&list=PLPtOfwBr96-VxhI43WtV-Lac7-O62lN6V

Mainframe basics

https://www.youtube.com/watch?v=0N2mkcDWNs0&list=PLPtOfwBr96-VvmjZl-Huz_2oZCwALXljD

EBDICC character set

https://www.youtube.com/watch?v=CmodM6hl650&list=PLQ8K2gs34D-kdrdPB7orrspdGhqHDG31V&index=1

 

TSO/ISPF

 TSO/ISPF basics

https://www.youtube.com/watch?v=0N2mkcDWNs0&list=PLPtOfwBr96-VvmjZl-Huz_2oZCwALXljD

Mainframe - TSO/ISPF Basics & ADV

https://www.youtube.com/playlist?list=PLLcYGaQ7eeuTbGPLiApXSwmOhDofjaPni

TSO ISPF videos

https://www.youtube.com/playlist?list=PLQ8K2gs34D-mAZKGmnf18HU5HUhVqJMSv

 

JCL

 

JCL tutorial from KUMAR IT channel

https://www.youtube.com/playlist?list=PLLcYGaQ7eeuTQGWRJ_B04qPowNWuHHfaz

JCL tutorial from Tutorial point

https://www.youtube.com/playlist?list=PLWPirh4EWFpE7g8BsOIkPy78wxKgvnFq0

JCL Tutorials - Topictrick Channel

https://www.youtube.com/watch?v=QJPyelZSyD0

JCL Tutorials

https://www.youtube.com/watch?v=XOvrxt9sg9I&list=PLPtOfwBr96-VeXlG5OrjK33u3gu21D2Ls&index=1

JCL SORTs

https://www.youtube.com/playlist?list=PLQ8K2gs34D-kQda1bOqFtMtqmih32GZxI

 

VSAM

VSAM basics from Tutorial point

https://www.youtube.com/playlist?list=PLWPirh4EWFpFqphoRl18CTOn3tNDVFrjd

VSAM tutorials from Youtube - KumarITChannel

https://www.youtube.com/playlist?list=PLLcYGaQ7eeuQr-AlEgf4GG-FzS3eimdlm

VSAM basics

https://www.youtube.com/watch?v=UhHpRZfDJgQ&list=PLPtOfwBr96-Vl35uVNfz-lgWzCyhSr7CE&index=1

 

COBOL

Mainframe COBOL - Kumar IT channel

https://www.youtube.com/playlist?list=PLLcYGaQ7eeuQ84KfRFJF-Oh34g8CzuMzz

COBOL training from Tutorial point

https://www.youtube.com/watch?v=uZUkSV__SdY&list=PLWPirh4EWFpEwRypgRSofF7Ui91yeCeMi

COBOL Programming Tutorial: From Basics to Advanced

https://www.youtube.com/watch?v=DTlQENQ5jlk&list=PLfg9ycqfY2SX19hFRfuALDcpe6OdNVobX&index=2

 

 DB2

Mainframe DB2 tutorials - From Kumar IT channel

https://www.youtube.com/playlist?list=PLLcYGaQ7eeuQNnKKTrz5s-bgMqEny83Oe

COBOL DB2 programming

https://www.youtube.com/playlist?list=PLQ8K2gs34D-n5wxM76muLpPirh6CwQO3v

Mainframe DB2 refresher

https://www.youtube.com/playlist?list=PLLcYGaQ7eeuTzXta9jpO6kbo7HlPXutiv


CICS

Mainframe CICS tutorial - From Kumar IT channel

https://www.youtube.com/playlist?list=PLLcYGaQ7eeuRzZzMLfUdH0-X0dR-bafpC

 

REXX

REXX programming

https://www.youtube.com/playlist?list=PLBPY9SrB2aUYgXJihh-PvvBmqztX1nGGc

REXX programming

https://www.youtube.com/playlist?list=PLLcYGaQ7eeuR_e4lTL80vRhvq8qkvoTxz

REXX FILE HANDLING

https://www.youtube.com/watch?v=LlXKEB6bY3E

 

 Xpeditor

Debugger in Mainframe

https://www.youtube.com/watch?v=nnp64AVki34

Xpeditor session 1

https://www.youtube.com/watch?v=DGW-C85sTZU

Xpeditor session 2

https://www.youtube.com/watch?v=DGW-C85sTZU

 

 MQ

MQ basics

https://www.youtube.com/watch?v=XpcJBgzbWq4

 

 Endevor/Changman

Mainframe Endevor tool ( source code management and release management tool) Session 1

https://www.youtube.com/watch?v=kdo2y2K-bZE&list=PLPtOfwBr96-Xxgb9CEphG984rXAHdGmZL&index=2

Endevor Session 2

https://www.youtube.com/watch?v=CJJhb6LI11I&list=PLPtOfwBr96-Xxgb9CEphG984rXAHdGmZL&index=4

Changeman tool - part 1

https://www.youtube.com/watch?v=njvOtvOSFP0&list=PLPtOfwBr96-Xxgb9CEphG984rXAHdGmZL&index=6

Changeman tool - part 2

https://www.youtube.com/watch?v=bSKbVEkabSI

Changeman tool - part 3

https://www.youtube.com/watch?v=Ghw6I0ZHpvU

Changeman tool - part 4

https://www.youtube.com/watch?v=XmjYeKlHITA

Changeman tool - part 5

https://www.youtube.com/watch?v=yy4Go6JFgnc

 

 Job Schedulers

Mainframe CONTROL-M

https://www.youtube.com/watch?v=NLzOtT9o2JM&list=PLPtOfwBr96-Xxgb9CEphG984rXAHdGmZL&index=3

Mainframe OPC Scheduler tool

https://www.youtube.com/watch?v=COvPeeLYwY0&list=PLPtOfwBr96-Xxgb9CEphG984rXAHdGmZL&index=2

CA7 Overview

https://www.youtube.com/watch?v=QkJNQw7iVMA&list=PLLcYGaQ7eeuTSAyZh9b-1x93livf9XQhK&index=16