NATURAL

Natural is an English-like fourth-generation programming language from Software AG (SAG). It is largely used to access and maintain data in SAG's database management system (DBMS), ADABAS. Natural can also access and maintain data in other DBMS's like DB2, and VSAM.
History
The first version of Natural was Natural 1, a query language for ADABAS.
With the implementation of Version 2, Natural is a structured, COBOL-like, programming language.
As of mid-2015, Version 8 is the latest release of Natural.
Language Features
* Hello World in NATURAL
WRITE 'Hello World!'
END
Natural has been implemented on mainframes, Linux, Unix, and Windows.
Natural is English-like in that the statements (instructions) are defined using English words, rather than symbols.
For example: <code>MOVE #A TO #B</code>
This line of Natural code sets the variable #B to the value of the variable, #A.
Module Types
The primary module in Natural is a program, which is the only module type that can be directly executed.
Natural subprograms must be invoked using the Natural statement CALLNAT or through a remote call from outside the Natural environment.
Natural also has three external data definitions modules, which are not executable modules. They are similar to COBOL copybooks.
LDA - local data definition module
PDA - parameter data definition module
GDA - global data definition module
Control flow Statements
* IF THEN ELSE- Conditional statement
* DECIDE ON VALUE OF variable - Case or switch statement based on the value of a variable
* DECIDE FOR CONDITION - Case or switch statement based on conditions
* PERFORM subroutine (internal or external)
* REPEAT - Loop statement without iterator
* FOR - Iterator loop
* ESCAPE BOTTOM (label.) - terminates the innermost containing loop, similar to other languages' exit or break statement, unless the ESCAPE BOTTOM statement includes reference to a label or line number. A label or line number closes the loop, to which the label refers or the line at which the loop begins.
* ESCAPE TOP - Similar to the continue statement of other languages, continues execution at the next iteration of the innermost loop containing the ESCAPE TOP.
* ESCAPE ROUTINE - Exits the subroutine, or if not in subroutine, exit module.
* ESCAPE PROGRAM - Exit module.
While Natural has no GOTO statement and is generally structured, there are statements that can act as GOTO statements. For example, the various ESCAPE statements.
I/O Statements
Natural has numerous statements, which facilitate retrieving data from and storing data to database files and tables, and sequential files.
* READ WORK file - Reads sequential "flat" file.
* READ BY descriptor (Database index) - Also known as a READ logical, reads a database file in the sequence of the descriptor.
* READ physical - Reads records from a database file in the sequence in which they reside in physical storage.
* FIND matching descriptor (Database index) - Retrieves a record or records whose descriptor value matches the target value. Some times called a random retrieval.
* HISTOGRAM descriptor (Database index) - Retrieves the list of values stored in the descriptor's inverted (index) list.
 
< Prev   Next >