Modernization Challenges – DB2 syntaxes  

A common occurrence in COBOL/DB2 programs is the coding of SQL SET assignment statement. This could be used for assigning Current Timestamp, Current Date/Time and doing various Date/Time arithmetic without coding a real SQL statement or coding complex logic in COBOL.  

Some of the common SET statements we observe in customer programs include:

Some of the more complex SET statements we picked from customer programs include:

Other than the above functional SET assignments, we come across some applications that assign or refer to runtime DB2 Server, Package or Schema related information to influence the logic.  

While modernizing such applications, customers assume that converting Static SQLs in COBOL to a Dynamic SQL in JDBC form will be enough for migration, but this is where the challenges lie. There is no SET statement mapping in JDBC. The above SET statements have to be parsed and converted to a SELECT SQL statement on DB2 SYSIBM.SYSDUMMY1 table. 

will have to be converted as  

Conclusion 

CloudFrame’s modernization toolkit, combined with AI, can identify and seamlessly transform programs with SET assignments. In some simple cases like getting CURRENT DATE | TIME | TIMESTAMP the code generated can map it to local Java language constructs to avoid expensive round-tripping of SQL to get this data. 

23 Jun 2022

Best Practices for zIIP Using COBOL and Db2

Hopefully, you've been reading along in this series of articles on effective…

07 Sep 2021

3 Risk Mitigation Strategies for Mainframe COBOL Compute Cost Projects

Big iron isn’t going away. Regardless of the thousands (or maybe tens…

22 Dec 2022

The Last MSU is the Cheapest

The cost per MSU (or MIPS) is not steady. At least not…