MANASYS Jazz_logo_02_314x117


MANASYS Jazz Build 15.3.191

DB2 Phase 2:  DB2 support Proven for CICS and Web Services

Build 190 introduced DB2 support to Jazz for batch programming.   Build 191 extends this to both classical CICS and to CICS Web services. Now with just a few clicks you can create DB2 enquiry and update web service and classical CICS programs, just as you can for VSAM.  See below for an example.

SQL-Style Conditions Available in General Logic

MANASYS Jazz has a mission: to make programming as simple and consistent as possible.  You shouldn’t have to remember lots of special rules. 

 

Jazz supports the special SQL-style conditions with DB2: -

            PROCESS EMPLOYEE WHERE EMPLOYEE.LASTNAME LIKE 'BARNES%';

There’s no good reason why our languages allow this ONLY for SQL, so we’ve simplified Jazz by removing a rule.  Now SQL-style LIKE, BETWEEN, and IN conditions can also be used in normal IF and FOR statements, and WHERE conditions for VSAM.

IF EMPLOYEE.WORKDEPT IN ('D12', 'D13') THEN;

See SQL-Style Conditions below for more detail

FREEKEY Option

GETCREATE can now include FREEKEY, meaning “next available key value”.

GET EMPLOYUP FREEKEY CREATE;

This simplifies Add logic, and works with alphabetic keys as well as numbers.

Free Software Licenses

We’re extending our previous offer of free MANASYS Jazz licenses to users who help us develop Jazz by providing feedback.  See below for details of this offer.

What Next?  Planning for the Next Release

We’re never short of ideas, but the important ideas are yours.  What would you like us to do next?   Some of our ideas are below, but every release is an opportunity to rethink and reset, so there’s never a better time to suggest enhancements.

 

Thank you for reading this far.  If you want more detail, keep reading.

Robert Barnes,

CEO, Jazz Software Ltd.

Detail

Example: a DB2 SOAP Web Service

You can create a SOAP web service updating the DB2 EMPLOYEE table from this form: -

 

[Finish] creates the web service message formats and a Jazz program to update EMPLOYEE records.  At this stage the only difference between DB2 and VSAM access are that the PROGRAM statement contains options “DATABASE sample DB2” and the only difference between a SOAP (WSDL) or REST (JSON) message is WSDL or JSON.

 

*# Last Updated by JazzUser at 11/03/2019 10:04:28 PM

PROGRAM WSPGEU WEBSERVICE MySvce CONTAINER DFHWS-DATA DATABASE sample DB2 WSDL;

*  Single Table Update

ACCEPT (IWSPGEU.Function) MESSAGE OWSPGEU.ERROR;

#052 W Item IWSPGEU.Function will be validated, but not moved from the input record

CASE (IWSPGEU.Function);

    WHEN (Enquiry);

        ACCEPT (EMPLOYUP.EMPNO = IWSPGEU.EMPNO OR EMPLOYUP.LASTNAME = IWSPGEU.LASTNAME OR EMPLOYUP.WORKDEPT = IWSPGEU.WORKDEPT) MESSAGE OWSPGEU.ERROR;

        GET EMPLOYUP KEY(EMPLOYUP.EMPNO OR EMPLOYUP.LASTNAME OR EMPLOYUP.WORKDEPT) SAVESUM OWSPGEU.CheckSum-EMPLOYUP;

            #628 W GENERIC assumed for LASTNAME

            #628 W GENERIC assumed for WORKDEPT

        END GET EMPLOYUP RESPOND OWSPGEU;

    WHEN (Update);

        ACCEPT (EMPLOYUP.EMPNO=IWSPGEU.EMPNO) MESSAGE OWSPGEU.ERROR;

        GET EMPLOYUP KEY(EMPLOYUP.EMPNO) UPDATE CHECKSUM IWSPGEU.CheckSum-EMPLOYUP;

            COPY JZSMth;

            ACCEPT (IWSPGEU.JZ-EMPLOYUP.*) EXCEPT(EMPLOYUP.EMPNO) TOLIKE MESSAGE OWSPGEU.ERROR;

            #207 I JZ-EMPLOYUP.FIRSTNME,JZ-EMPLOYUP.MIDINIT,JZ-EMPLOYUP.LASTNAME,JZ-EMPLOYUP.WORKDEPT,JZ-EMPLOYUP.PHONENO,JZ-EMPLOYUP.HIREDATE,JZ-EMPLOYUP.JOB,JZ-EMPLOYUP.EDLEVEL,JZ-EMPLOYUP.SEX,JZ-EMPLOYUP.BIRTHDATE,JZ-EMPLOYUP.SALARY,JZ-EMPLOYUP.BONUS,JZ-EMPLOYUP.COMM, included in generic assignment

        END GET EMPLOYUP UPDATE RESPOND OWSPGEU;

    WHEN (Add);

        GET EMPLOYUP FREEKEY CREATE;

            #221 E EMPLOYUP.EMPNO used as key field(s).  It/they will be set to next available value.

            ACCEPT (IWSPGEU.JZ-EMPLOYUP.*) EXCEPT(EMPLOYUP.EMPNO) TOLIKE MESSAGE OWSPGEU.ERROR;

            #207 I JZ-EMPLOYUP.FIRSTNME,JZ-EMPLOYUP.MIDINIT,JZ-EMPLOYUP.LASTNAME,JZ-EMPLOYUP.WORKDEPT,JZ-EMPLOYUP.PHONENO,JZ-EMPLOYUP.HIREDATE,JZ-EMPLOYUP.JOB,JZ-EMPLOYUP.EDLEVEL,JZ-EMPLOYUP.SEX,JZ-EMPLOYUP.BIRTHDATE,JZ-EMPLOYUP.SALARY,JZ-EMPLOYUP.BONUS,JZ-EMPLOYUP.COMM, included in generic assignment

        END GET EMPLOYUP CREATE RESPOND OWSPGEU;

    WHEN (Delete);

        ACCEPT (EMPLOYUP.EMPNO=IWSPGEU.EMPNO) MESSAGE OWSPGEU.ERROR;

        DELETE EMPLOYUP KEY(EMPLOYUP.EMPNO) CHECKSUM IWSPGEU.CheckSum-EMPLOYUP;

END CASE;

REPLY;

 

Classical CICS programs manage update conflicts by:

·         On enquiry: a copy of the record read is saved in COMMAREA

·         On update: the program reads the record and checks that it’s the same as the saved copy.  If not, the update is rejected with a message.

You can’t do this with web services, so the same result is achieved by including a record digest, or checksum, in the output message. 

·         On enquiry this is written to the output message with
GET EMPLOYUP … SAVESUM OWSPGEU.CheckSum-EMPLOYUP;

·         On update the checksum is recalculated and checked by
GET EMPLOYUP KEY(EMPLOYUP.EMPNO) UPDATE CHECKSUM IWSPGEU.CheckSum-EMPLOYUP;
If the recalculated checksum differs from the value returned in the input record then the update is aborted and a message returned.

 

Click [Process] and Jazz creates a COBOL program (click to see it), and

·         z/OS: submits a job to compile it and create the WSDL and Binding files

·         Micro Focus: passes control to Micro Focus Enterprise Developer to compile the program and create the service interface.

A few more clicks and you’re running your new web service.

SQL-Style Conditions

MANASYS Jazz has a mission: to make programming as simple and consistent as possible, so that you don’t have to remember special rules unless they are essential.  Thus you use basically the same PROCESS, WRITE, and DELETE statements for sequential and VSAM files and DB2 tables, and GET for VSAM and DB2.  Jazz enforces essential rules: you can’t use GET for sequential as this is a direct look-up, and for VSAM a WHERE or KEY condition must name key fields, but for DB2 they can name any fields.   But you don’t have to worry about implementation-level rules, like using OPEN and READ with files but CONNECT and SELECT with DB2.   And for a long time MANASYS Jazz has supported a DATE data type in any kind of definition, not just when supported by a database like DB2.  From the first implementation of SQL support DATE fields have been read into the MANASYS Jazz format, making available the same date validation and formatting options that have been available from the beginning.

 

SQL conditions have a few new options.   As well as all the usual condition forms, in SQL WHERE clauses you can write comparisons with BETWEEN, IN, and LIKE: -

SELECT … WHERE (AMOUNT BETWEEN 10000 AND 20000)

SELECT … WHERE (CODE IN (‘A’, ‘C’, ‘Z’))

SELECT … WHERE (NAME LIKE ‘%BARNES’)

 

In the previous MANASYS Jazz release (Build 190) these conditions were supported in WHERE conditions for SQL, but not for other file types and not in general code.  We decided that this was not an essential rule, so now you can use any of these condition forms in IF and FOR statements and in WHERE clauses for sequential and VSAM files.  For example: -

IF W.Name LIKE '%Rob% THEN;

BETWEEN and IN translate directly into the equivalent COBOL code, and can be used in any type of condition.  LIKE invokes a routine and can be used anywhere except an UNTIL condition.

Offer Extended:  Free MANASYS Jazz Licences

We need users to help us test not only the latest DB2 features but also earlier MANASYS Jazz features.  Are you interested?  We’re offering free personal lifetime licences to such users.  All we ask in return is that you provide feedback from time to time.  What do you like?  What don’t you like?  Does it do what you need it to do?  How can the product be improved?   We’re particularly interested in extending this offer to users of Mainframe DB2, and to Oracle users.   Our own DB2 testing has been with DB2 LUW running on a Windows 10 laptop, but everything developed for DB2 should work without change for ORACLE and z/OS DB2.

 

Your technical risk is low: Jazz itself is written with VB.NET and is installed on your Windows Laptop or PC, where it generates COBOL for the target environment (zOS or Micro Focus).   The generated code is “pure COBOL”, there is no proprietary run-time or run-time licence cost, and only a few support routines for functions such as Date Arithmetic.  Support routines are supplied as COBOL source, so nothing is hidden.

 

If you are interested log on to the Jazz web site with this URL, using a web browser enabled for ClickOnce (probably Edge or Internet Explorer).

            http://www.jazzsoftware.co.nz/?Promo=190116R

When the Jazz home page opens, click “Get Jazz” then click the button [New User] and follow the Setup instructions at

            http://www.jazzsoftware.co.nz/Docs/JazzSetup.htm

When you download MANASYS Jazz you’ll get an initial 3-month license.  To convert this to a permanent license email your feedback and one or more sample Jazz programs to us at robert@Jazzsoftware.co.nz and we’ll convert your time-limited evaluation licence to a permanent licence.

 

This is a personal offer: you must register with a personal, not corporate, email to qualify.  But you are free to use your downloaded Jazz software within your employment, indeed we hope you do, and that your colleagues are so impressed with your productivity benefits that your employer will purchase a corporate licence for their other employees and contractors.   We expect this offer to be particularly attractive to freelance contractors, and to ambitious COBOL support programmers who see benefit in learning ways to be more productive and introducing these to their employer.

 

As before, this offer will expire after some time or when we have enough such users.

Planned for the Next Release

A few things missed the cut, and are planned for “DB2 Phase 3”.  We’ll prioritise user feedback, but our ideas include: -

PIC variables in SQL definitions

Although SQL doesn’t permit it, there’s no essential reason why a Jazz definition of a SQL table couldn’t define CHAR fields with PIC.  For example, the IBM Sample DB2 Database has a CHAR field EMPLOYEE.EMPNO with values like ‘000150’.  If this were defined in Jazz as

            EMPNO PIC '999999'

Instead of

EMPNO CHAR(6),

Then Jazz would automatically validate the field with its ACCEPT statement: -

ACCEPT (EMPLOYUP.EMPNO=IWSPGEU.EMPNO)

and supply missing zeros so that a service request using either

<wsp:EMPNO>150</wsp:EMPNO>

or         <wsp:EMPNO>000150</wsp:EMPNO>

would find the record with EMPNO = ‘000150’.

NOCASE comparisons

In Web Service testing we found that our GET statements were not retrieving that we knew were there.  The reason: the record had Name = “BARNES”, we’d asked for “Barnes”.  In classical CICS programs where BMS converts everything to upper case, and SQL Server retrievals which are similarly case-insensitive, this would have found the record.  We’re going to implement a NOCASE option in CHAR and VARCHAR comparisons (IF, WHERE, etc) to provide this behaviour.

HAVING

This option is planned for PROCESS statements retrieving SQL data.  It cannot be implemented for other file types.

 

Robert Barnes

CEO, Jazz Software Ltd

phone  +64-9-418 4415

mobile +64-27-459 2702

Skype: Robert.Barnes3

LinkedIn   linkedin.com/in/robert-barnes-5b833a

www.jazzsoftware.co.nz   

IBM PartnerWorld member