zLog

Is mainframe easy to learn?

 

Is mainframe easy to learn?

Learning to program on a mainframe computer can be challenging for several reasons:

However, it is worth noting that the difficulty level of learning to program on a mainframe computer can vary depending on an individual’sIs mainframe easy to learn? background and experience. For example, if you have experience with other types of programming languages and computer systems, you may find it easier to learn a new language and adapt to the mainframe environment.

Additionally, many organizations, universities, and online platforms provide resources and tutorials to help people learn mainframe programming. And many companies also have training programs for mainframe-specific skills.

What basics should I learn first to learn programming with mainframes?

It’s worth noting that it might be beneficial to start learning with a specific platform like IBM z/OS, IBM z/VSE, IBM z/TPF, IBM z/Linux, etc.

Structure of a simple COBOL program and JCL to execute it.

A simple structure of a COBOL program would include the following sections:

Example:

COBOL
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD. 
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT PRINT-FILE ASSIGN TO PRINTER ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD PRINT-FILE. 01 PRINT-RECORD. 88 END-OF-FILE VALUE HIGH-VALUES. 02 PRINT-LINE. 03 PRINT-MESSAGE PIC X(80). PROCEDURE DIVISION. OPEN OUTPUT PRINT-FILE PERFORM UNTIL END-OF-FILE READ PRINT-FILE AT END MOVE "No Records Found" TO PRINT-MESSAGE END-READ WRITE PRINT-RECORD END-PERFORM CLOSE PRINT-FILE STOP RUN.

To execute this COBOL program on a mainframe, you would use a Job Control Language (JCL) script to submit the program to the mainframe’s operating system.

A simple JCL script to execute the above COBOL program would include the following statements:

COBOL
//JOBNAME JOB (ACCTINFO),'JOB DESCRIPTION',
// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//COBOL EXEC PGM=HELLO-WORLD,REGION=4096K
//PRINT DD SYSOUT=*
//*

This is a basic example of how to execute a COBOL program on a mainframe using JCL, there are many other options and parameters that can be set in JCL, also there are many ways to execute a COBOL program that depend on the environment you are working on.

 

Please note: PROGRAM-ID, has to be of 8 characters, HELLO-WORLD is just a symbolic presentation of the program name. 

 

Suggested further readings:

What is COBOL?             : https://www.zmainframes.com/viewtopic.php?t=6

What is TSO and ISPF?  : https://www.zmainframes.com/viewtopic.php?t=21

What REXX is Not!           : https://www.zmainframes.com/viewtopic.php?t=10

Share
Exit mobile version