Natural is a proprietary
fourth-generation programming language. It was not part of the initial (1971) Adabas release. Natural programs can be "run" interpretively or "executed" as compiled objects. Compiled programs can more directly use operating system services, and run faster. Proponents say that Natural has evolved from a competitor of COBOL to "being in competition with Java as language of choice for writing services (
SOA)."
Language features Natural works not only with Adabas files, but also supports
Oracle,
DB2, and others. Sample code: DEFINE DATA LOCAL 01 EMPLOYEES VIEW OF EMPLOYEES 02 SALARY (1) END-DEFINE READ EMPLOYEES BY NAME AT END OF DATA DISPLAY MIN (EMPLOYEES.SALARY(1)) (EM=ZZZ,ZZZ,ZZ9) AVER(EMPLOYEES.SALARY(1)) (EM=ZZZ,ZZZ,ZZ9) MAX (EMPLOYEES.SALARY(1)) (EM=ZZZ,ZZZ,ZZ9) END-ENDDATA END-READ END Output: Page 1 18-08-22 16:42:22 ANNUAL ANNUAL ANNUAL SALARY SALARY SALARY ----------- ----------- ----------- 0 240,976 6,380,000 The language is
strongly-typed, using explicit typing of variables, which may be one of: • Alphanumeric • Numeric
Zoned decimal up to 27 total digits, of which a total of 7 may be to the right of decimal point • Packed Decimal, same limits as "Numeric") • Integer (1, 2 or 4 bytes, ranging from -128 to 127 / -32,768 to 32,767 and -2,147,483,648 to 2,147,483,647) • Date • Time (which includes the date) • Logical (True or False) • Binary • Control variable paralleling CICS map attribute • Floating Point (4 or 8 bytes)
The system file The system file is an Adabas file reserved for use by Natural, which contains, but is not limited to, the following: • All Natural programs, both in source format (programs) and in object format (compiled), grouped in libraries; • File Definition Modules, or Data Definition Modules (DDM), which describe the fields defined within Adabas or other databases supported by Natural as well as userviews, which are fields groupings/subsets; • Natural error messages; • The texts of the Help function. The system file is not limited to Adabas. Natural can also store programs in VSAM on mainframe operating systems. Natural uses the
file system on Windows and various Unix implementations.
Programs Natural objects are identified by names up to 8 characters, the first of which must be alphabetical. The Natural program editor allows source in rows of up to 72 positions. Lines are numbered by 4 digits. This numbering is generated by Natural during program creation. Line numbers used by the compiler and editors, and can have important logical functions in the programs. Comments can be included in two ways: • Full-line comments are identified by a "*" or "**" prefix. • Annotated code lines have a "/*" - everything to its right is a comment. Examples: 0010 * These two lines (0010 and 0020) 0020 ** are comments. 0030 FORMAT LS = 80 /* As well as this part of the line (0030) 0040 * NOTE: The "/*" form has no space between the SLASH and ASTERISK. . . 0200 END "END" or "." indicates the end of a program. A Hello World code example: * Hello World in NATURAL WRITE 'Hello World!' END ==Related products==