As I have mentioned in the last tutorial , you use edited fields in COBOL to format data fields into human-readable display strings. Let’s start with a numeric field: 01 NUMERIC-FIELD PIC 999999V99. and some COBOL code that set and display the field value: MOVE 1234.5 TO NUMERIC-FIELD. DISPLAY NUMERIC-FIELD: ' NUMERIC-FIELD. As we’ve demonstrated in the previous tutorial, unused digits are padded with ugly zeros: NUMERIC-FIELD: 001234.50 Let me put my C# programmer hat on again (apologies to Java, ruby, python, C/C++, assembly and many other programmers who don’t like C#), when we have to format a variable for display, we often use the string.Format method with a formatting string containing special formatting characters, which is “0,0.00” in the following example: // returns 1,234.50 string.Format("{0:0,0.00}", 1234.5) Now let’s come back to COBOL, an edited field is basically a normal COBOL data field with a formatting string in the pictu
Life hacks & ideas that worked for me