Jazz Set Up Support Routines

Jazz Set Up Support Routines. 1

Support Routines. 1

List of Support Routines. 2

Notes. 3

Glossary. 5

Support Routines

When you write a program in Jazz and click [Process] Jazz turns your Jazz program into COBOL.  [Process] should be set up so that when you click it the COBOL is generated and

            z/OS: a job is submitted to compile and link the program, and (if batch) run it.

            Micro Focus: The MFED COBOL project is opened where you compile the program, and (if batch) submit the corresponding JCL to run it.

For CICS and Web Services there is a little extra set up before the program can be tested.

In some situations this COBOL will include statements to invoke pre-compiled routines.  For example, if you write

EMPLOYEE.HIREDATE = EMPLOYEE.BIRTHDATE + 0/0/30;

#578 I DateDiff = 30 years, 0 months, and 0 Days

then the following COBOL results in which the routine JZDTAR is invoked for the DATE arithmetic calculation: -

003950*    EMPLOYEE.HIREDATE = EMPLOYEE.BIRTHDATE + 0/0/30;             SQLCond

003960     MOVE EMP-BIRTHDATE OF EMPLOYEE TO JZ-Date2 OF JZ.            SQLCond

003970     MOVE '+' TO JZ-Op OF JZ.                                     SQLCond

003980     MOVE 30 TO DFYears OF JZ.                                    SQLCond

003990     MOVE 0 TO DFMonths OF JZ.                                    SQLCond

004000     MOVE 0 TO DFDays OF JZ.                                      SQLCond

004010     CALL 'JZDTAR' USING EMP-HIREDATE OF EMPLOYEE JZ-Date2 OF JZ  SQLCond

004020         JZ-DateDiff OF JZ JZ-Op OF JZ.                           SQLCond

If you haven’t already compiled JZDTAR into the appropriate library then it won’t be found by the link-editor.  The COBOL will compile, but errors still occur

            z/OS:   At run time the program will abend when it attempts CALL ‘JZDTAR’

            MFED:Error messages are produced when you click Build

Thus before you can run your Jazz programs you have to make them available.  This is part of the configuration process, and needs to be done with each new project.  From the Configuration form, button [Initialise project] displays a list of all the support routines: they all have names starting with JZ, and type COBOL (except for JZSTXIT which has type JCL and is supplied as a job containing an Assembler routine.   You can be selective about which routines you download and compile, but if you do you will need to be aware of when Jazz uses them to avoid unexpected link errors.  You’ll probably select all the initial objects, and compile all the routines.   This only needs to be done once per project.

These routines are provided when Jazz is installed and configured.  If you click [Initialise Project] on the first configuration screen they are included in the list of initial objects: you can choose to select the ones you need, but as you will often be unaware of whether a Jazz program requires them you’ll probably select all the initial objects and compile all the routines.

List of Support Routines

The following is a list of modules that need to be compiled and linked into object libraries so that they can be linked into Jazz-generated programs.  All modules are provided as COBOL source code except for JZSTXIT which is provided as Assembler.  You can see exactly what they do, and you may even change them although we don’t encourage this.  All modules are named “JZxxxx”, making it easy to distinguish these from your own subprograms, and to avoid future naming conflicts. 

Name

Function

Batch?

CICS?

Note

JZBR14

Useful for CICS debugging

No

Yes

1.

JZDT01

Format today’s date for reports

Yes

No

2.

JZDT02

Return values for $Today and $Now built-in Functions

?

?

3.

JZDTAR

Date Arithmetic

Yes

Yes

4.

JZDTVS

Date Validation

Yes

Yes

5.

JZABNDC

Abend handling, CICS programs

No

Yes

6.

JZMSAD

Add error text to message field

No

Yes

7.

JZNOFM

Return N of M for CICS scrolling

No

Yes

8.

JZSTXIT

Used to trap abends and display JZ-Program-Info

Yes

No

9.

JZLIKE

Used when a LIKE condition is written in normal Jazz, e.g. an IF condition, not in a WHERE clause

Yes

Yes

10.

 

General, z/OS:  CICS subroutines should be compiled and linked into the CICS load library so that they can be linked into CICS programs.  Batch subroutines should be compiled and linked into the batch load library.  Some routines (JZDT02, JZDTVS) should be compiled and linked into both.  Such routines must be compiled without the COBOL parameter PARM.COBOL=CICS

General, MFED:  The CBL routines must be added to the COBOL project.  If the project is enabled for CICS (or CICS Web Services) then for all programs except the CICS-Only routines (JZBR14, JZABNDC, and JZNOFM) set property CICS Directives=None
            Open the COBOL project,
            Right-click the routine, e.g. JZDTAR.CBL, click Properties,
            Click the COBOL tab,
            General section, CICS Directives: Select None from the drop-down.

If the batch or dual-use routines are compiled with CICS directives then they are invoked with DFHEIBLK and DFHCOMMAREA as their first two arguments.  Since they are not expecting this, this will cause errors when they attempt to refer to the parameters passed to them.

Notes

1.    JZBR14 does nothing, but in CICS programs Jazz generates code to invoke it within the program’s Abend exit: -

 JZ-Abend-Exit.

*    BR14 does nothing, but is useful for CEDF/CEDX debugging

     EXEC CICS

         LINK PROGRAM('JZBR14  ') COMMAREA(JZ-Program-Info)

             RESP(JZ-RESPONSE)

     END-EXEC.

            This can be useful if you need to debug your COBOL program with CEDF. 

2.      JZDT01 will be required in all batch programs that include a PRINT statement, which is almost all of them. 

3.      JZDT02 might be used in either CICS or Batch programs.  It will need to be compiled into both CICS and Batch load libraries.

4.      JZDTAR is used in Date Arithmetic statements such as Date1 = Date2 + DateDiff.    Date1 and Date2 are fields with format DATE, DateDiff is a group containing three SMALLINT fields for years, months, and days. 

5.      JZDTVS is used to validate a CHAR value assigned to a DATE field.

6.      If errors are trapped in a CICS program, for example from I/O commands, then JZABNDC will be called to produce error messages that are more relevant to Jazz programmers than COBOL-Level diagnostics.  You may modify this routine to comply with your local standards: if you do so, then ensure that your version is not replaced with later Jazz versions.

7.      Will be used if validation errors are detected by ACCEPT statements in classical CICS programs. The function of JZMSAD is to add error text into the message field following previous error messages, if any, and allow for overflow if there is insufficient room to fit on the line.  The message field is an output field in a 3270 screen.

8.      JZNOFM is used to return “N of M” in classical CICS programs when PF7/8 and PF10/11 are used for Up/Down and Previous/Next scrolling.

9.      JZSTXIT is not used with MFED.  With z/OS, batch programs may (configuration option) include
      CALL ‘JZSTXIT’ USING JZ-Program-Info.

immediately following the line PROCEDURE DIVISION.   JZSTXIT is Assembler code, supplied as JZSTXIT.JCL.  Its purpose is to trap abends and produce diagnostics telling you what is wrong at the level of Jazz so that user’s don’t have to dive into a dump, then relate this back to COBOL, then back to Jazz, to find out what’s wrong.

To make JZSTXIT available edit this JZSTXIT.JCL: -

·         Check that the JOB statement is compatible with your local standards, and

·         In the LKED step, //SYSLMOD DD, replace “Your_Batch_LOADLIB” with the name of your batch load library so that JZSTXIT will be found by LKED to link into your programs.  For example, we used
     //SYSLMOD DD DSN=IBMUSER.MANAJAZZ.LOADLIB(JZSTXIT), …

When you’ve edited the JCL, submit the job

JZSTXIT will trap abends and display the contents of JZ-Program-Info on DD SYSOUT.  If the abend is recoverable, meaning: -

1.      The abend type is one of

a.      A Data Exception

b.      Fixed-point Overflow

c.      Fixed-Point Divide

d.      Decimal Overflow

e.      Decimal Divide

f.        Floating-Point Divide

2.      The abend has occurred in your main program, not in a called subprogram

3.      You have not exceeded your abend limit.  This is set in Jazz configuration, see parameter STXIT limit on the Lang or System tab. 

The abend is NOT recoverable if any one of these three conditions are true.  For non-recoverable abends, Jazz abend diagnostics are followed by the standard COBOL dump.

To illustrate Jazz diagnostics faulty record definition CustFE was prepared by defining Name as CHAR(16) instead of CHAR(15) so that following DECIMAL (=packed) fields are in the wrong position.  SalesYTD =+ 1; now throws a data exception (S0C7), and JZSTXIT produces a display like this: -

JZSTXIT - ABEND FROM JAZZ PROGRAM HANDLED       

-----------------------------------------       

                        

ABEND OCCURRED:                          S0C07 DATA EXCP    

ABEND PSW ADDRESS:                       00007776

ABEND DISPLACEMENT:                      00000770

            

JAZZ PROGRAM INFORMATION

------------------------

 

PROGRAM ID:                              PROGRAM PrCustfe   

WRITTEN BY:                              IBMUSER (Using Jazz, 1.14.1.165)

LAST UPDATED:                            10/03/2017 1:14:24 p.m.        

CURRENT JAZZ STATEMENT:                  000110 CustFE.SalesYTD += 1;   

RESTART POINT:                           JZ-12-PROCESSGroup 

CURRENT RECORD COUNT:                    000000001          

CURRENT RECORD LENGTH:                   00044  

CURRENT KEY LENGTH:                      00006  

CURRENT KEY:           DISPLACEMENT 00000------

                                         000001                         

                                         FFFFFF                         

                                         000001                         

                                                                                     

CURRENT RECORD:        DISPLACEMENT 00000---------|---------|---------|---------|----

                                         000001 %MCNAUGHTON,Vera[1]*[1]2013-06-11 

                                         FFFFFF0006DCDCECCEDD6E898026206050FFFF6FF6FF

                                         0000011C0C4351478365B5591000C442C22013006011

With the STXIT limit set to 5 there were 5 such displays before the program was terminated with

CEE3250C The system or user abend U 100 R=NULL     was issued.                                                                     

          From compile unit BATCH1 at entry point BATCH1 at compile unit offset +00004EC6 at entry offset +00004EC6 at address      

          0000BEC6.                                                                                                                  

and the normal dumps are also produced as if JZSTXIT were not present.  To be able to find the error instruction and data fields you should use PARM=(MAP,LIST) on the IGYWCL (COBOL compile) step.

In the dump: register 2 displacement 4 points to the PSW, register 15 displacement 4 points to the registers at entry to JZSTXIT, register 5 points to the instruction causing the crash.

10.  In SQL you can use LIKE to compare a character string: for example

          PROCESS Employee WHERE EMPLOYEE.LASTNAME LIKE 'SM%';

            JZLIKE is used when this same kind of comparison is used in normal Jazz condition, such as from an IF statement.

Glossary 

IDE

Integrated Development Environment.   For example Visual Studio (Microsoft), Eclipse (Open Source)

JCL

Job Control Language.  A “Language” to control batch job streams, defining jobs, job steps, and files.

MF

Micro Focus

MFED

Micro Focus Enterprise Developer

VS

Visual Studio

z/OS

Z-series Operating System.  The operating system for IBM Enterprise Computers (“Z-Series”)