Cobol to java modernization Automated

Why Modernization Is Hard – Series 8

COBOL programs often generate reports where field formatting is handled using the 'PICTURE' clause. This clause allows for complex numeric editing and formatting options in these legacy programs. Most modernization efforts underestimate these complexities. We will highlight a few examples that we come across in customer programs.

The following table shows the results from running COBOL programs, where we recorded the output of various 'PICTURE' clauses with examples to illustrate the complexities of editing and formatting.

image-1726563631-1727416133

The currency symbol by default is $ and can be overridden by using COBOL Compiler option 'CURRENCY' or coding 'SPECIAL-NAMES' in the 'CONFIGURATION SECTION' of the COBOL program. An example of overriding currency to be printed as £ is by coding as follows:

image-1726563622-1727416153

This adds complexity to the formatting by printing £ where $ is used in the 'PICTURE' clause. The following table gives examples of output with the above CURRENCY SIGN definition.

image-1726563613-1727416189

We have seen more complexities with COBOL programs that generate reports with multiple currencies. In such scenarios 'SPECIAL-NAMES' are defined for multiple currencies and a customized 'PICTURE' clause symbol is defined. An example of such a definition is shown below.

image-1726563602-1727416241

The following table gives examples of output with COBOL variables defined using the above defined currency signs.

image-1726563585-1727416263

The above complexities are further compounded by the usage of 'SPECIAL-NAMES' definition of 'DECIMAL-POINT IS COMMA'. Many Central European countries switch the usage of Decimal Point and Comma in their amount fields. In these countries decimal separator is 'comma' and thousands separator is 'period'.

There are other formatting aspects where COBOL variables can be defined with clauses viz. 'BLANK WHEN ZERO' to suppress printing number 0 when the value of variable is zero, 'JUSTIFIED RIGHT' to right-justify a string in a 'PICTURE' Clause when default is to 'left-justify' strings, 'SIGN IS LEADING | TRAILING' to influence whether 'Sign overpunch' is on leading or trailing digit when default is 'trailing'.

Conclusion

Modernization projects often underestimate the complexities of these definitions and formatting aspects used by COBOL legacy programs, leading to delays and failures in achieving functional equivalence. CloudFrame's modernization toolkit, combined with AI, has extensive coverage to manage these formatting complexities to provide a seamless migration and transparent execution that guarantees functional equivalence.

Venkat Pillay
Venkat Pillay
Founder and CEO

Venkat is a true technology visionary, serial entrepreneur, strategist, deep generalist, and architect. With over 25 years of experience and a passion for innovation, his expertise ranges from Legacy to emerging technology and company building.

Related Posts

why-modernization-projects-fail-and-how-to-make-it-a-success-series-10

Why Modernization Projects Fail And How To Make It A Success – Series 10

When legacy modernization efforts turn into a battlefield between IT ambitions and business realities, the outcome is almost always the same: reality wins. Unfortunately, by the time reality prevails, ...

Read More Aug 27, 2024
why-modernization-is-hard-series-9

Why Modernization Is Hard – Series 9

Modernization should directly support your company's strategic goals. Whether it's entering new markets, improving customer experience, or enabling faster product development, the decision to moderniz ...

Read More Aug 21, 2024
modernization-challenges-db2-syntaxes

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 wi ...

Read More Aug 06, 2024
why-modernization-is-hard-series-7

Why Modernization Is Hard – Series 7

Migrating mainframe COBOL DB2-based business functions to a cloud-native architecture is a daunting task. In our previous series, we discussed the various complexities involved in ensuring a smooth tr ...

Read More Aug 06, 2024