All Terrain Thinking

A Compendium of things I think are Important

Earth 5150
"If you teach a man to think he is thinking, he will love you. If you teach a man to think, he will hate you. - Ed McArthur"
 
 

Generally Speaking, Think on this...

 

IBM COBOL Program with embedded JCL
and explanations

// operation
The first three columns of a Job Control Statement must contain // and then a blank space.
// JOB jobname
The JOB statement initiates a job and is always the first statement in a jobstream.
// OPTION option1[,option2,option3...]
The OPTION will specify one or more options to the Job Control Program. Some of the more common options available are LINK, DUMP, DECK, CATAL. Options can be turned off by putting NO in front of the name, i.e. NOLINK.
LINK indicates that the object module is to be processed by the linkage editor program. The object module, which is the output of the compiler, is therefore written to a place on the disk referred to as SYSLINK. // EXEC [PGM=programname]
The EXEC execute statement signals the end of job control information for a jobstep and causes the specified program to be executed. Therefore, all requirements of the program must be specified before the EXEC statement is encountered. This statement will cause the supervisor to locate the phase or procedure(phase in this program)...load the phase or procedure and execute it.
IGYCRCTL is the name of the phase from an area on disk called the CIL (core image library). In this case, it is the name of the COBOL compiler at the DCC campus. // EXEC LNKEDT will execute a phase called LNKEDT(the linkage editor program),from the CIL. The linkage editor program wil link-edit the object module that is located on SYSLINK, and it creates a machne executable program called a phase and places this phase into a temporary area in the CIL. // ASSGN SYS012,SYSIPT connects the logical unit SYS012 to SYSIPT. The ASSGN statement makes the connection between an entry in the LUB(Logical Unit Table) with an entry in the PUB(Physical Unit Table). // EXEC the phase located in the temporary area of the CIL, which is the phase that was just produced by the linkage editor in EXEC LNKEDT. Since no name is specified, the phase just created is executed. /* The end-of-data or end-of-jobstep operation signals the end-of-file condition. In this jobstep it is the end of the data from SALES-FILE. /& The end-of-job statement is a job delimiter and it is placed at the conclusion of each job COBOL makes the connection between the filename (SALES-FILE) supplied in the application program and the corresponding programmer logical unit (SYS012). The connection is completed in the ASSGN statement towards the end of the program.
Program: ADDSALES
// JOB COBOL/MAINFRAME
// OPTION LINK
// EXEC IGYCRCTL
IDENTIFICATION DIVISION.
PROGRAM-ID. ADDSALES.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
  SELECT SALES-FILE ASSIGN TO SYS012.
DATA DIVISION.
FILE SECTION.
FD SALES-FILE
  LABEL RECORDS ARE STANDARD.
01 SALES-REC.
  05 SALES    PIC 9(3).
WORKING-STORAGE SECTION.
01 TOTAL    PIC 9(4).
01 MORE-RECS    PIC X VALUE "Y".
PROCEDURE DIVISION.
100-MAIN-PARAGRAPH.
  OPEN INPUT SALES-FILE.
  READ SALES-FILE AT END MOVE "N" TO MORE-RECS.
  PERFORM 200-ADD-SALES UNTIL MORE-RECORDS = 'NO'.
  CLOSE SALES-FILE.
  STOP RUN.
200-ADD-SALES.
  ADD SALES TO TOTAL
  READ SALES-FILE AT END MOVE "N" TO MORE-RECS.
/*
// EXEC LNKEDT
// ASSGN SYS012, SYSIPT
// EXEC
34
65
55
347
/*
/&






 

Prior | Tell us what you think | Next

 

Valid HTML 4.01 Transitional
 

Add to Your Social Bookmarks: -

Visitors Map
several several several Site Map - Press Room - Privacy Policy - Disclaimer
Copyright © 1998-2012 eMcArthur unless otherwise indicated
Unauthorized duplication or publication of any materials from this Site is expressly prohibited.
    Hosting by IPower!