Monday 6 August 2012

                                                    Introduction to Mainframe programming.

Before that I would like to highlight on two different programming technique that we used in Mainframe.

           1) Batch programming means there is no any human interaction . Here you run your code which will not accept any human values .

          2) Online programming here human interaction is must. The values passed by human will decide the flow of execution of program.



                                                     What is JCL ?

  JCL = Job control language.
  JOB =   It is the execution of one or more related programs in sequence. Each program to be executed by  a job is called a job step.

  JCL is the command language of MVS and consists of a set of control statements that identifies the program to be executed and the data to be read or written. Jobs written in JCL are managed by an operating system (OS) component called the Job Entry Subsystem or JES. For every job that is submitted to OS for execution, we need to tell the OS, the programs it has to execute, the inputs that are required, the location of input and the location for output. These information are provided using statements known as Job Control Statements.

       1) JCL statements are coded in 80 byte records –

            Only 72 of the 80 chars are available to code the JCL. The columns 73-80 is reserved for   sequence number or comment means the compiler will ignore it.

                          2) Each JCL statement is logically divided into five fields. All five fields may not appear on every statement.
  
 3) JCL statements has the following fields
a.      Identifier
b.      Name
c.       Operation
d.      Parameters
e.      Comments

              

 1)      Identifier - Two slashes ( // ) starting in col 1.     Exceptions are
                  For a delimiter statement, /* starting in col 1
                  For a comment statement , //* starting at col 1

2)      Name – It can be from one to eight characters long, consisting of alphanumeric (A-Z and 0-9) and National (@,#,$) characters. Name should start with an alphabet or national ($, #, @) character. It must begin at col 3.

3)      Operation – A valid operation code, such as JOB, EXEC or DD. Must be preceded and followed by a space.
      Parameters – One or more parameters depending on the operation. Individual parameters are separated from one another by commas.


           4) JCL parameters :
             
          a) Positional parameters
  
 are coded first in the parameter field. If you omit a positional parameter and code a following                positional parameter, then code a comma to indicate the omitted parameter. 

      Do not code the replacing comma if:
         The omitted positional parameter is the last positional parameter.
         All following positional parameters are also omitted.
         Only keyword parameters follow.
         All positional parameters are omitted

In the JOB card there are 2 positional parameters 

          1) JOB accounting information.
           2) Programmer name.

Eg. See below job card I have written with positional parameters only.
//Ak47,   Job,  a123,  avinash

1) The JOB which is operation field must started between column 8 to 11.
2) A123 is accounting information.
3) Avinash is programmer name.

If I skipped any positional parameter then give comma.

 b) Keyword parameters -

      A keyword consists of characters that appear in uppercase followed by an equals sign (e.g. NOTIFY=&SYSUID) followed by either characters that must be coded or variable information. Code any of the keyword parameters for a statement in any order in the parameter field after the positional parameters. Because of this positional independence, never code a comma to indicate the absence of a keyword parameter.

                Class, notify, msgclass, msglevel, prty, typrun are the keyword parameter used in JOB card.

        5) Comments:
 comments may follow parameters, preceded by one space and not extending beyond col 71.

                                                How the JOB is processed in mainframe ?

There is JOB entry subsystem which will  handle the execution of JOB. As there are user across the world uses mainframes for their day to day activities. But then also JES manages all these execution process smoothly.




1) Determine the job requirement and characterstics.
2) write JCL
3) Submit the JCL.


After submitting the JCL the user part is over now its turn of JES system which proceed below.






4)  JES receive submitted job and initiate initiator.
5) JCL steps are executing
6) JES collects output.
7) JES prints output.
8) User views output.

No comments:

Post a Comment