a simple cobol example – ispf vs rdz enterprise systems1

27
A Simple Cobol Example – ISPF vs RDz Enterprise Systems 1

Upload: austen-ball

Post on 27-Dec-2015

270 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

A Simple Cobol Example – ISPF vs RDz

Enterprise Systems 1

Page 2: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Traditional ISPF ISPF document

Job stream would include Cobol Program wrapped with JCL

Likely in PDS named accountid.work.compiles as extension was not critical

Job would be submitted

Would look for output in JES

TSO SDSF ST

Owner accountID to reduce list to your jobs

Put ? by appropriate entry

Put s by file(s) to review for errors

If error, then back to file, correct and repeat process–(see ISPF Document)

2Enterprise Systems

Page 3: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example Program reads a record from a file, selects specific fields from the record and writes the line.

JCL matches system setup at the University of Arkansas

Good example to illustrate application JCL references to system resources like the Cobol compiler and to data files

3Enterprise Systems

Page 4: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

4Enterprise Systems

Page 5: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

5Enterprise Systems

Page 6: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

ALL JCL statements must be in Upper Case

Three JCL statementsJOB – information related to the job to be run

EXEC – executes a program or a procedure

DD – data definition points to data and files

Example//COBJOB JOB (COBOLPROG),'ACCTID',NOTIFY=ACCTID,

// CLASS=A,MSGLEVEL=(1,1),TIME=1,MSGCLASS=A

//STEP1 EXEC PROC=IGYWCLG

//COBOL.SYSIN DD *…

Cobol Program with references to input (READER) and output (DISKFL1)…

//GO.DISKFL1 DD DSN=ACCTID.WORK.OUT(COBOUT),DISP=SHR//GO.READER DD *

…. Data

//

6Enterprise Systems

Page 7: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

EXEC statement//STEP1 EXEC PROC=IGYWCLG

Executes a procedure name IGYWCLG

This procedure has all the programs needed to compile, link needed files to create an object module and go—run the program. The CLG ending is CompileLinkGo

7Enterprise Systems

Page 8: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

DD statements

//STEP1 EXEC PROC=IGYWCLG

//COBOL.SYSIN DD *

IDENTIFICATION DIVISION.

…..Rest of Cobol program

8Enterprise Systems

Page 9: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

DD statementsThe DD statement below allows the Cobol program to

abstract the name used in the program. The READER points to a DD statement to be used for input

SELECT CARD-IN ASSIGN TO UT-S-READER.

 //*//GO.READER DD *ANDERSON ESSABIA ANNIECE XXXXXXXXX ISYS4283 002 …....

.../*//

9Enterprise Systems

Page 10: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

DD statementsThe DD statement below allows the Cobol program to

abstract the name used in the program. The DISKFL1 points to a DD statement to be used for output

SELECT DISK-FILE1 ASSIGN TO UT-S-DISKFL1......

//GO.DISKFL1 DD DSN=ACCTID.WORK.OUT(COBOUT),DISP=SHR,// VOL=SER=DB1469,SPACE=(CYL,(1,1,1)),UNIT=SYSDA,// DCB=(RECFM=FB,LRECL=80,BLKSIZE=6400,DSORG=PO)

10Enterprise Systems

Page 11: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

DD statementsThe DD statement below allows the Cobol program to

abstract the name used in the program. The DISKFL1 points to a DD statement to be used for output

SELECT DISK-FILE1 ASSIGN TO UT-S-DISKFL1......

//GO.DISKFL1 DD DSN=ACCTID.WORK.OUT(COBOUT),DISP=SHR,// VOL=SER=DB1469,SPACE=(CYL,(1,1,1)),UNIT=SYSDA,// DCB=(RECFM=FB,LRECL=80,BLKSIZE=6400,DSORG=PO)

11Enterprise Systems

Page 12: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

12Enterprise Systems

DD Parameter Meaning

DISP(MOD,KEEP) DISP Disposition. Relates what is to be done with the PDS. In this case, it is modify and keep. There are many possibilities but can you guess what NEW, CATLG and OLD, DELETE do?

VOL=SER=DB1469 VOL Volume, SER SERIAL. This is analogous to a letter for a disk drive on your PC. TEMP91 is The name of the disk.

SPACE=(CYL,(1,1,1)) Defines space for the file in terms of cylinders—you could also use tracks

UNIT=SYSDA SYSDA Systems Direct Access and means a disk

DCB=(RECFM=FB.. DCB Data Control Block, LRECL Logical Record Length BLKSIZEBlock Size and should be multiple of the record length DSORGDataset Organization – Partitioned Organization

The DD Parameter

Page 13: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

Submit Job

TSO SDSF ST

OWNER acctid

13Enterprise Systems

Page 14: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

Review JESYSMS

Place letter “s” to left of JESYSMS

14Enterprise Systems

Page 15: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

Find COND CODEs—hopefully, all zero

15Enterprise Systems

Page 16: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

Locate error

If error is in compile, then review Cobol

Correction requires moving around to the correct file to make the corrections and then resubmittig

16Enterprise Systems

Page 17: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1
Page 18: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

RDz This same job stream can be submitted within RDz in tack if placed in a PDS with x.x.JCL

However, take advantage of RDz color coded syntax checking by putting Cobol, JCL, etc. into appropriate PDS,s recognized by the RDz editors

Suggested PDSs

ACCTID.WORK.COBOL

ACCTID.WORK.JCL

ACCTID.WORK.Data

Submitted job and JES output in same area

If error, can correct with RDz editor—rerun

No navigation to other interfaces required18Enterprise Systems

Page 19: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Rational Developer for System z (covered later)

Programmer can simultaneously: Debug a COBOL Program Create a data table in DB2 Browse local files and PDS Run SQL against DB2 Check their JES output

Rational Developer usesViews and Perspectives toOrganize Development Work

Page 20: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (JES)

20Enterprise Systems

Page 21: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (JES)(Error)

MOE instead of MOVE— open SYSPRINT file

Find error in editor000055 MOE CRD-PWD TO CRD-OUT-PWD.

==000055==> IGYPS2072-S "MOE" was invalid. Skipped to the next verb

21Enterprise Systems

Page 22: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (Using PDSs to Advantage)

• JCL goes into ACCTID.WORK.JCL• COBOL goes into ACCTID.WORK.COBOL• Input data goes into ACCTID.WORK.DATA• RDz editors sense type of file and

provides color-coded syntax checking• Right-click, select submit on the JCL to

execute job• Job will be in JES for viewing

22Enterprise Systems

Page 23: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (JCL)

23Enterprise Systems

//COBJOB JOB (COBOLPROG),'DOUGLAS',NOTIFY=DOUGLAS, // CLASS=A,MSGLEVEL=(1,1),TIME=1,MSGCLASS=A //STEP1 EXEC PROC=IGYWCLG //COBOL.SYSIN DD DSN=DOUGLAS.WORK.COBOL(SIMPLEC),DISP=SHR //GO.DISKFL1 DD DSN=DOUGLAS.WORK.OUT(COBOUT),DISP=SHR //GO.READER DD DSN=DOUGLAS.WORK.DATA(SMPLDATA),DISP=(OLD,KEEP)

Page 24: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (Data)

24Enterprise Systems

Page 25: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (Output)

25Enterprise Systems

Page 26: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Rational Developer for z

Integrated Development Environment (IDE)

GUI based

Multiple views and perspectives for multitasking

Immediate feedback on syntax

Helps students understand inter-relationships in the z environment

26

Page 27: A Simple Cobol Example – ISPF vs RDz Enterprise Systems1

Cobol Example (single job stream)

ALL JCL statements must be in Upper Case

Three JCL statementsJOB – information related to the job to be run

EXEC – executes a program or a procedure

DD – data definition points to data and files

Example//COBJOB JOB (COBOLPROG),'ACCTID',NOTIFY=ACCTID,

// CLASS=A,MSGLEVEL=(1,1),TIME=1,MSGCLASS=A

//STEP1 EXEC PROC=IGYWCLG

//COBOL.SYSIN DD *…

Cobol Program with references to input (READER) and output (DISKFL1)…

//GO.DISKFL1 DD DSN=ACCTID.WORK.OUT(COBOUT),DISP=SHR//GO.READER DD *

…. Data

//

27Enterprise Systems