Natural Quick References
Natural Quick References
Natural Quick References
Page 1
Notes:
Page 2
PROGRAMMING OBJECTS .......................................................................................................................... 1 SYSTEM COMMANDS .................................................................................................................................. 2 TERMINAL COMMANDS ............................................................................................................................. 5 Terminal Command ............................................................................................................................... 5 SYSTEM VARIABLES .................................................................................................................................... 5 NATURAL VARIABLES AND DEFINITIONS................................................................................................ 5 THE PROGRAM EDITOR AND IT'S COMMANDS ...................................................................................... 6 EDITOR COMMANDS ...................................................................................................................................... 7 EDITOR LINE COMMANDS ............................................................................................................................. 10 DATA AREA EDITOR AND IT'S COMMANDS .......................................................................................... 11 DEFINING DATA AREA TERMS........................................................................................................................ 11 DATA AREA COMMANDS .............................................................................................................................. 12 DATA AREA LINE COMMANDS ....................................................................................................................... 13 THE MAP EDITOR AND IT'S COMMANDS ............................................................................................... 14 BASIC MAP SETTINGS FOR MAP SCREEN.......................................................................................................... 15 THE MAP EDITOR ......................................................................................................................................... 17 MAP EDITOR PFKEYS .................................................................................................................................... 18 MAP EDITOR LINE COMMANDS ..................................................................................................................... 19 MAP EDITOR FIELD COMMANDS .................................................................................................................... 19 BASIC ADABAS USAGE ............................................................................................................................. 21 CREATE YOUR OWN CHEAT SHEET ......................................................................................................... 24
ADABAS, NATURAL, PREDICT, NATURAL Security are registered trademarks of Software AG Americas and Software AG of Darmstadt, Germany.
Page 1
Notes -
Page 2
Programming Objects
Programming Objects are modules where business processing takes place. Interface Objects are modules which create output for a user to interact with such as screens or report layouts. Data Objects are modules which contain data definitions, both programmer defined and database definitions.
Object Type Program Subprogram Subroutine Copycode Map Local Data Area Parameter Data Area Global Data Area Helproutine
Abbreviatio n P N S C M L A G H
Object Type Programmin g Programmin g Programmin g Programmin g Interface Data Data Data Programmin g
Page 1
System Commands
System Command
CLEAR
Definition
Used to clear edit buffer. This will remove any NATURAL object currently occupying the edit buffer, including programs, maps, or data areas. It is sometimes a good idea to clear the edit buffer prior to running a test of a system. Used to remove NATURAL objects permanently from the library. This command is typically used to remove all traces of an object. You should be very cautious about removing the source and not the object of the program. Also, this command allows you to "wildcard" by placing an "*" where wildcarding should begin. For example, DELETE ABC* deletes all parts of any object starting with "ABC". A list of modules starting with "ABC" will appear to allow selection of individual modules to delete. This is also very powerful and should be used cautiously. Syntax : DELETE <type> <name> <sob> <type> : for a selection list of objects of one type (only applies in conjunction with asterisk notation for <name>). <name> : the name of the object to be deleted. You can specify one or more names. '*' or 'name*' results in a selection list of objects in the current library. <sob> 'S' only source is deleted. 'O' only cataloged object is deleted. 'B' both, source and cataloged object are deleted (default). Examples : 1) DELETE PROG1 B 2) DELETE ABC* 3) DELETE PROG1 S PROG2 S PROG3 4) DELETE M ABC* Invoke a NATURAL editor for the purpose of editing an object Examples : 1) EDIT PROG1 2) E PROG1 Execute a NATURAL object module. Any program currently
DELETE
EDIT EXECUTE
Page 2
LOGOFF MAINMENU ON/OFF PROFILE PURGE READ RENAME RUN SCRATCH SCAN
in the source program work area will not be affected. Simply typing a NATURAL program name at the command line and pressing ENTR also executes the object. Examples : 1) EXECUTE PROG1 2) PROG1 Terminate a NATURAL session (in interactive mode or in batch mode). Invokes GLOBALS session description. Invokes the NATURAL online help facility. All NATURAL syntax is available via the HELP facility, as well as a definition of all error messages and commands. Typing "?" at the command Examples : 1) EXECUTE PROG1 2) PROG1 Display command(s) last executed and execute it (them) again on request. (Parms - l a s t c o mma n de n t e r e d , - o n e c o mma n db a c k , -n c o mma n db a c k nt i me s , * d i s p l a y s list of last nine commands.) Lists object or information requested. Information can include program listing, list of objects, directory information, etc. Certain editor commands can be used by placing their abbreviation next to the module to be operated on. Some of t h e s e c o mma n d s i n c l u d e S T f o r S T O W, E f o r E D I T , D E f o r D E L E T E , L f o r l i s t t h e source. Logs user out of session. Turns NATURAL MAIN MENU on or off as needed. Invokes the Security Profile for the session. Delete one or more source programs from the NATURAL system file. Transfer an object in source form from the NATURAL system file to the source work area. Changes the name of source and/or object. Compiles source code currently in editor and executes. Deletes both object and source from editor. Scan an object for a specified string of characters. (The source work area is used by the SCAN command and will be destroyed) The object may be a single object, all objects beginning with a specified value, or all objects within a library. The SCAN may also be restricted to a specific object type. Store an object (in both source and cataloged object form) in the NATURAL system file. Invokes the debugging facility. ' TEST ON' : Activate test
STOW TEST
Page 3
UPDATE XREF
mode of th ed e b u g g i n gf a c i l i t y . ' T E S T O F F ' : D e a c t i v a t e t e s t mode of the debugging facility. ' TEST' : Main menu of debugging facility will be invoked. E n a b l eo r p r e v e n t d a t ab a s eu p d a t i n g . O N : D a t ab a s e u p d a t i n gw i l l b ep e r f o r me d . O F F : D atabase updating will not occur (STORE, UPDATE, DELETE) Control the usage of the PREDICT active cross reference facility (if Active Cross Reference selectable unit is installed).
As a Programmer, three of the most important commands to you w i l l b e S A V E , C A T A L O G , a n d S T O W . SAVE Stores only source code STOW CATALOG SAVEs the source, does a Does a syntax check, syntax check, compiles compiles the code, then the code, then stores stores compiled object. compiled object. DOES NOT syntax check or DOES NOT save source compile. code.
A l s o , t h ec o mma n d s P U R G E , S C R A T C H , D E L E T E , a n d U N C A T A L O G a r ev e r y important because the let you remove any ad hoc, unused or debugging programs which are not for use in any system.
PURGE SCRATCH UNCATALOG DELETE Removes ONLY the Removes BOTH Removes ONLY the Gives you the source code. source and compiled code. choice of removing compiled code. the source or the compiled code. DOES NOT remove DOES NOT remove Can remove either, compiled code. the source code. leaving either source or compiled.
Page 4
Terminal Commands
Terminal Command %H or %H<destination> %K<key-number> %% Description Send the screen and any additional output to a specified printer. This will simulate the pressing of a PFKey. For example %K3 will be the same as pressing PF3. Stops the execution of the currently running NATURAL program. This is especially useful if you have a bug that will not let you out of your program. If you can type %% the program will stop. Invokes the HELP facility for Terminal Commands.
%?
System Variables
A B C D F I L N P T
Alphanumeric Binary Control Date Floating Point Integer Logical Numeric Packed Time
Default 10
Default 7 Default 7
Description Changes editor to subprogram. Changes editor to program. Changes editor to subroutine. Changes editor to copycode.
Editor Commands
There are a number of commands that are valid in the program and data area editors only. These commands are only issued on the editor command line. Command ADD Description Add window of 9 empty lines on screen (if direction indicator is +, lines are placed after last line, if direction indicator is a minus sign, lines are placed before first line). Lines left blank are deleted when ENTER is pressed. Leaves the editor without saving the source code. Scan for 'scandata' and replace with 'replacedata'. Syntax is: CHANGE 'scandata'replacedata' Clear the edit source work area. Delete X marked line, Y marked line, or a block of lines delimited by X and Y. Delete source lines from top down to (not including) X marked line; from line following Y marked line down to bottom; or all lines excluding block delimited by X and Y. Leave the editor with saving the source code. If the EXIT flag is set in the profile, the EXIT function window appears. You can use exit with or without save or resume in the editor LAST: the last command entered will be placed in the command line. LAST - : the last command entered will be placed in the command l i n e .I f y o ue n t e r L A S T a g a i nt h e next to last command will appear. You can page backwards through the last 20 commands b y r e p e a t e d l y e n t e r i n g L A S T . LAST n n : I f n n =4 , t h e f o u r t h t o l a s t c o mma n dwill appear on the command line.
Page 7
CANCEL CHANGE CLEAR DX, DY, DX-Y EX, EY, EX-Y EXIT LAST, LAST -, LAST nn, LAST *
LAST *: A window displaying the last 9 commands. To reissue a single command, mark the command with any character. To issue several commands, mark them with numbers in the order they are to execute. If entered as first edit command, only edit commands will be e x e c u t e d( l i n ec o mma n d s a n dl i n ec h a n g e s s i n c el a s t E N T R w i l l be ignored). Renumber program currently in source work area. Display current editor profile. Same as edit command CANCEL. O N c a u s e s t h eN A T U R A Ls o u r c ep r o g r a ms t ob er e n u mb e r e d with each SAVE o rC A T A L O Gc o mma n d .( D e f a u l t ) O F F Automatic renumbering is not in effect. Delete X and/or Y line markers, and markers set with .N line command. Split Screen command. Split places the requested module at the bottom half of the editor for viewing. No changes are allowed in the bottom of the split screen. The commands for splitting the screen are: S V = View N = Subprogram P = Program C = Copycode D = Data Area Syntax would look like S V EMPLOYEES Positioning in the split screen is done using the positioning commands (B, T, +/-, +H/-H, +P/-P, +nnn/-nnn) preceeded by the S o f t h e S p l i t command such as S +10 to move forward 10 lines in the split screen.
SCAN 'scanvalue' SCAN = +/SET ABS ON/OFF SET ESCAPE c h a r SET TYPE SHIFT nn/+nn
Page 8
To end Split screen, type S E in the command line. Scan for 'scanvalue'. If no scanning value is entered, the SCAN window appears. The lines in which the scan value is located is marked with "S" to left of the line. Determine the direction of SCAN function, either starting on the current line and going forward (+), or backwards (-). O N S C A Na n dC H A N G E o p e r a t e i n a b s o l u t e mo d e , i . e . t h e v a l u e n e e dn o t b ed e l i mi t e db yb l a n k s o r s p e c i a l c h a r a c t e r s . O F F Operation in non absolute mode, i.e. the value must be delimited by blanks or special characters. (Default) Character that must precede line commands. Default is '.' Change type of object to be edited. Type may be PROGRAM, SUBROUTINE, SUBPROGRAM, HELPROUTINE, or COPYCODE. Shift source lines delimited by X and Y markers nn positions to the
SHIFT --/++ STRUCT STRUCT DISPLAY * *= +P, +, P, +H, H T, or B, ++ +nnnn, nnnn nnnn X, Y POINT
left or right; comment lines are not shifted. Shift source lines delimited by X marked and Y marked lines to leftmost / rightmost (max. 99 ) positions. Comment lines are not shifted. Perform structural indentation of NATURAL source statements and identify structural inconsistencies. The NATURAL source program is displayed in compressed form. (See STRUCT system command) Display edit command most recently entered. Execute last command entered in command line. Same as CANCEL. Position forwards (+) or backwards () one page. Position forwards or backward 1/2 page. Position to top) or bottom (++) of program. Position forwards or backward 'nnnn' lines. Position to line 'nnnn'. Position to page containing line marked with X or Y. Position line in which .N was entered to top of editor screen
Some additional less used commands are: Command SET NUL ON/OFF SET RANGE ON/OFF SET SIZE ON/OFF SET STAY ON/OFF Description O N c a u s e s t h e v a l u e s c a n n e dw i t hS C A Nt ob e d e l e t e d . A f t e r d e l e t i o n t h e N U L v a l u e i s O F F . ( D e f a u l t ) O N c a u s e sS C A Na n dC H A N G Et ooperate only within the range of lines delimited by X and Y line markers. D e f a u l t i s O F F . O N c a u s e st h ep r o g r a ms i z et ob ed i s p l a y e da tt h e b o t t o mo f e d i t o r s c r e e n . D e f a u l t i s O F F . O N c a u s e st h ec u r r e n t screen to remain when the ENTER key is pressed. (Forward/backward positioning is then accomplished with the edit commands only.) O F F c a u s e s t h e e d i t o r t o p o s i t i o n t o t h e n e x t s c r e e n w i t h each ENTER key. (Default)
Page 9
Page 10
DDM - Data Definition Module. This the bridge between NATURAL and the ADABAS file. It points to the file location and record layout and is used by NATURAL to communicate to ADABAS what information is needed by the program. This is also created and maintained by the DBA.
Page 11
VIEW - The subset of field definitions from the DDM that NATURAL will use in the program. Only the information needed by the program should be in the view since that is all that will be returned by NATURAL to the program. Sometimes this term is also applied to an object that is created as part of the file definition. It is sometimes called a database view. In the Understanding Natural Seminars, anytime we say VIEW we mean a program view created by the programmer for the program.
GEN object-name PROFILE name READ data-area SAVE data-area SET STAY ON/OFF ON SET TYPE STOW data-area
Description Check data area definition; causes entries INDEX/INIT... to be ordered in sequence shown on edit screen. Clear edit source area. Collect global variables in objects in current library, and value* place in global data area 'COMMON'. (value* option restricts processing to objects whose name begins with 'value'.) Generate NATURAL copycode containing DEFINE DATA LOCAL statement using definitions currently in source work area. Read/display/save user specific editor profile. Read existing data area definition into edit source area. Save data area currently in edit source area. (Definition is not checked prior to being saved.) Current screen remains when ENTER used (forward/backward positioning with commands). OFF Position to next screen. Set object type to: G (global), L (local), P (parameter). Save and catalog data area definition currently in edit source area; definition is checked prior to being cataloged.
Page 12
Copy line in which command is entered. Copy X-marked line or Y-marked line. Copy block of lines delimited by X and Y. Delete line in which command is entered. If part of a hierarchical structure, whole part will be deleted. .D(nnnn) "nnnn" lines will be deleted. .E Invoke separate screen for definition of initial values and edit masks. If entered for a view field, the EM screen is invoked. .F(file-name) Includes a PREDICT-file. .I Insert lines. Default is 10, 5 in split screen mode. .I(obj) Insert obj. If obj is not a data area, you can choose if all variables and/or parameters are inserted. .I(obj,sss,nnnn) Insert obj, if it is a data area. sss defines the line no. where to start, nnnn defines the number of inserted lines. .L Cause contents of line to remain unchanged. .MX .MY Move X-marked or Y-marked line. .MX-Y Move block of lines delimited by X and Y. .N Mark a line for POINT command. .P Position line in which command is entered to top of screen. .R Redefine an object. .V (view-name) Define view; if view- name not given, current view is included. .X Indicate beginning of block of lines to be processed. .Y Indicate end of block of lines to be processed. .* Generate C* (internal count) variable for multiple value field or field within periodic group number(n,m) . Number of field/group from split screen which is to be inserted; n specifies the number of fields to be inserted; m specifies the level where to be inserted; direction indicator controls insertion location.
Page 13
Creating MAPS
12:41:56 User TSRHODE Code ---D E I H M S T W ? . ***** NATURAL MAP EDITOR ***** - Edit Map Function --------------------------------Field and Variable Definitions Edit Map Initialize new Map Initialize a new Help Map Maintenance of Profiles & Devices Save Map Test Map Stow Map Help Exit 97-04-28 Library DEVINFO
Code .. I
Name .. ________
Profile .. SYSPROF_
Unlike the program and data area editors the map editor has it's own menu with options specific to the map editor Parm D E I H M S T W Code Name Profile Library Description Display name, format, mode, position, and number of processing rules for each field. Invoke Map Editor to create/modify a map or help map. Initialize a map. Initialize a help map. Add/modify/delete map, and device profiles. Save map definition. Test current map definition (including testing of processing rules and help facilities). Stow (catalog and save) map definition. Function (as described above) to be executed. Source member which contains map or help map. Map profile currently in effect (library ID, user ID, SYSDBA, or SYSPROF). NATURAL library ID currently in effect.
Page 14
Creating MAPS...Settings
12:42:06 Delimiters ----------------Cls Att CD Del T D BLANK T I ? A D _ A I ) A N M D & M I : O D + O I ( Define Map Settings for MAP Format --------------------------Page Size ...... 23 Line Size ...... 79 Column Shift ... 0 (0/1) Layout ......... ________ dynamic ....... N (Y/N) Zero Print ..... N (Y/N) Case Default ... UC (UC/LC) Manual Skip .... N (Y/N) Decimal Char ... . Standard Keys .. N (Y/N) Justification .. L (L/R) Print Mode ..... __ Control Var .... ________ 97-04-28 Context -------------------------Device Check .... ________ WRITE Statement _ INPUT Statement X Help ____________________ as field default N (Y/N)
Automatic Rule Rank 1 Profile Name .... SYSPROF Filler Characters -----------------------Optional, Partial .... Required, Partial .... Optional, Complete ... Required, Complete ...
This screen gives you the option of changing the parameters the map will use for presentation and processing. Parameter Delimiters Description These are special characters defined with the output parameters assigned to them. They will be placed in front of text and data fields to control their presentation on the map. The following are default settings. They may be changed or added to as needed. Cls (Field Class) CD (Colors) A input field BL blue RE red M output field (modifiable) GR green TU turquoise O output field (non-modifiable) NE neutral YE yellow T text constant PI pink Att (Attributes) B blinking N non-display C cursive/italic U underlined D default V reversed-video
Page 15
I intensified
Del (delimiter) - This is the special character which will carry the input / output definition assigned to it. Page Size Line Size Col Shift Layout dynamic Zero Print Case Deflt. Manual Skip Dec. Char. Std Keys Number of map lines to be edited (1-250); Number of columns to be edited. To use all columns in a map, specify 'Col Shift = 1'. Name of map source definition containing specified layout. If 'Y', specified layout will only become effective at runtime. Y Field value of all zeros displayed with one zero; N Zero value displayed as blank. UC All input converted to upper case at map execution; LC No lower to upper case conversion. Y Cursor not moved automatically to next field at map execution Character used as decimal notation (can be changed with GLOBALS command only) Y Last two lines of map remain empty for entering function key specifications at map execution; N All lines are used for map.
Page 16
Ob L <lda-name> Ob P <program-name> Ob V <View-name> Characters for field definitions are: "X" Alphanumeric position "9" Numeric position "0" Numeric right justified " . " Decimal notation "S" Sign position (numeric field only) "HH" Hexadecimal (binary)
Page 17
(3 positions, numeric) (3 positions, numeric right justified) (3 positions, numeric with decimal point) (6 positions, signed numeric) (4 positions, hexadecimal) (7 positions, alphanumeric)
You may select fields from user view or data definition from any of the following object types: A Parameter data area L Local data area P Program G Global data area M Map S Subroutine H Helproutine N Subroutine V View
Page 18
Move screen window to bottom. Switch between split screen and full screen mode. Move screen window to left 1/2 page. Move screen window to left nnn columns. Move screen window to left border. Move screen window to right 1/2 page. Move screen window to right nnn columns. Move screen window to right border. Ignore changes made on screen subsequent to last use of ENTER Move screen window to cursor position.
.An .C
.D
.E .J .M
positioned with upper left corner at position where command is entered. Array is redefined by applying '.A' to one of its elements. Define one dimensional array (no spacing, no offsets). Center field between adjoining fields. (Enter '.C' in field to be centered.) Center range of fields between adjoining fields. (Enter '.C' in first and last field to be centered, or position cursor in last field to be centered.) Delete field. (Enter '.D' in field to be deleted.) Delete range of fields. (Enter '.D' in first and last field to be deleted; range may extend beyond single line.) If array element is deleted, entire array will be deleted. Invoke extended editing for field (does not apply to range). Join fields located on consecutive lines. Left boundary corresponds to where the command is entered; right boundary to cursor position. Move field. (Enter '.M' in field to be moved, place cursor at target position.) Move range of fields. (Enter '.M' in first and last field to be moved, place cursor at target position.)
Page 20
is a DBMS
Databases
Elementary Fields MU Fields PE Groups Super Descriptors Sub Descriptors
Views of Files
31
The major components that make up ADABAS are: Component Data Storage Work Associator Description The physical location of the records. A structure used internally by ADABAS for temporary storage and for complex functions. This is actually made up of two parts. The Inverted List and the Address Converter rapidly locate records requested by the program from data storage.
Some terms used with ADABAS are: Term Block Description Physical storage is divided into blocks and ADABAS records are stored in these blocks. Each block is identified by block number and ISN.
Page 21
Internal Sequence Number of each ADABAS record. A table managed by ADABAS which maps each record and it's ISN to the specific block where it can be found. A field which has been defined as a key. This field will have an associated index. There are several kinds of descriptors. D = Elementary Descriptor P = Phonetic descriptor S = Sub or Super descriptor. A sub descriptor is made up of a part of a field. A super descriptor is made of multiple fields and/or parts of fields. H = Hyper descriptor which is based on code provided by your site. N = non descriptor. This is not indexed, but will act like it is. The index for each descriptor which is managed by ADABAS. Only one person or transaction may update any single ADABAS record at one time. When a record is on hold for update, ADABAS will issue and error message or be placed on hold to wait until the record is available.
Page 22
Notes -
Page 23
Page 24