2 Easy Steps write your COBOL program efficient way

Always use an odd number of digits in a COMP-3 field 

SQL Tuning Tips and Technincs
SQL Tuning Tips and Technincs

Since the COMP-3 field is stored as a single digit in a nibble (half of the byte), with one nibble consuming the space for the sign, we know that every time we reference an even number digit COMP-3 field, the compile has to generate (scratch pad and instructions) code to strip out the high order digit that we don’t use.

When ever possible, always manipulate Numerics of the same format

If you are adding a COMP field to a COMP-3 then the compiler needs to convert one to the other format before the add can take place. More unnecessary instructions and more scratch pad wasted. So, always use same type of data types while using MOVE statement.

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.