Inside COBOL #39
Shawn Gordon
S.M.Gordon & Associates

This month is going to be a short one, and for those of you who made it to IPROF, a redundant one. Basically I have a list from Jeanette Nutsford, the SIGCOBOL Co Chairman talking about the 40, of the 121 major changes to COBOL, that will be of most interest to the HP COBOL II users. The remaining items are mainly enhancements to the Report Writer, which is not available in the HP COBOL and clarifications or options to existing statements.

Some of these items may already be included in the current version of HP COBOL II as HP extensions.

1. ACCEPT Screen – Extention to allow a screen item specified in the Screen section to be used for operator input at a terminal.

2. ACCEPT statement – The capability to access the four digit year is added.

3. BINARY and Floating Point Data – 2 new representatives of numeric data are introduced.

4. Bit/Boolean support – The capability of defining bit strings and setting or testing boolean values is added.

5. Boolean Functions – 2 new functions are added to convert between numeric and boolean items. BOOLEAN-OF and NUMVAL-B.

6. CALL recursively – The capability of calling an active COBOL program has been added.

7. CALL statement – Arithmetric expressions and literals may be used as arguments of the CALL statement.

8. Conversion from 2 digit year to 4 digit year. 3 new functions are added.
DAY-TO-YYYYDDD (Convert YYDDD to YYYYDDD – Julian Dates)

9. COPY statement – The LEADING and TRAILING phrases of the REPLACING phrase in this statement will allow replacement of partial words to give postfixing and prefixing capabilities.

10. DISPLAY screen – Extended to cater for display of a screen item to the operator of a terminal.

11. Dynamic Storage Allocation – ALLOCATE and FREE statements are provided for obtaining storage dynamically. The storage is addressed by data pointers.

12. Dynamic Tables – Tables may be declared with no maximum number of occurrences. The system automatically expands the size of the table when the table is referenced as a receiving item.

13. EXIT statement – The ability to immediately exit an in-line PERFORM has been added.

14. Free-Form reference format – This allows for varying length source lines and permits a program to be written with a minimum of restrictions on the placement of source code on a line.

15. Fixed Point Numeric items – The maximum number of digits has been increased from 18 to 31.

16. GOBACK statement – This has been added to always return control to the calling program or operating system.

17. HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC Functions – Added to provide the ability to manipulate numeric data similar to the use of HIGH-VALUES and LOW-VALUES without the risk of data incompatibilities.

18. In-line Comments – In free form mode a comment may be written on any line. It is preceded by the 2 characters ‘*>’.

19. Initialization of Tables – The elements of a table may be initialized to specified values. The FILLER phrase adds the ability to initialize FILLER data.

20. Internationalization – Support is provided for using local conventions that depend on language and culture. Features supported are collating sequences, date and time formats, monetary and number formats, character case mappings.

21. Intrinsic Functions – 8 new functions are ABS (absolute value), E (Value of natural base e), EXP (e raised to a power), EXP10 (10 raised to a power), FRACTION-PART (fraction part of a number), NUMVAL-F (numeric value of a string
representing a floating-point number), PI (The value of Pi), SIGN (The sign of a number).

22. Object Orientation – Support has been added. This feature will be expanded at a later date.

23. PERFORM statement – The AFTER phrase is allowed in an in-line PERFORM.

24. POINTER Data – A new class of pointer data type is introduced to hold data or program addresses.

25. RECORD KEY and ALTERNATE RECORD KEY – Keys for indexed files may be made up from more than one component.

26. Record locking control has been added.

27. REDEFINES clause – Redefinitions may be specified in any order.

28. Report Writer – The Report Writer facility is now integrated into the specification. ie it is no longer optional.

29. TYPE and TYPEDEF clauses – Identify a type declaration which creates a user defined type. The TYPE clause is used to apply this user-defined type to the description of a data item. No storage is allocated for the type declaration.

30. Screen Section – The Screen section provides a non-procedural means of declaring screen items that are to appear on a terminal, their position and various attributes.

31. SELECT clause – Support for dynamic assignment of a file has been added.

32. SORT statement – This may be used to sort a table.

33. STRING statement – The DELIMITED phrase is now optional. The default will assume DELIMITED BY SIZE.

34. Subscripting with arithmetic expressions – An arithmetric expression may now be used as a subscript.

35. User Defined Functions – The ability has been added to write functions that are activated in a manner similar to intrinsic functions.

36. VALIDATE statement – The new statement VALIDATE has been added to give the ability to perform comprehensive data validation.

37. The VALUE clause is now allowed in external data items and in Linkage and File sections. It will be ignored except in execution of the INITIALIZE statement.

38. VALUE clause – The WHEN SET TO FALSE phrase allows specification of a FALSE condition value. This value is moved to the associated condition variable when the SET TO FALSE statement is executed.

39. Writing Literals to a File – A record can be written from a literal using the WRITE or REWRITE statement.

40. Writing without a Record name – A FILE phrase on the WRITE and REWRITE statements permits writing records from working storage without having a corresponding record description entry in the File Section.

Next month I am going to have a pretty nifty piece of code for letting you easily access the FTP server on the HP 3000 from your programs or job streams.