   									A-1         	I.	INTRODUCTION TO DATATRIEVE  ? 	Today I am going to introduce you to DATATRIEVE.  I will talk  = 	about some of the basic features in DATATRIEVE and hopefully = 	give you a taste of how it works.  Subsequent course modules 1 	will go into more detail on individual commands.      	WHAT IS DATATRIEVE?  @ 	Digital describes DATATRIEVE as an interactive query and report 		writing language.   > 	Users often draw similiarities between it and a file cabinet.  B 	DATATRIEVE can be used by the novice user to interactively STORE,: 		MODIFY, DELETE, and PRINT, in various formats, data that 		is contained in a file.   C 	DATATRIEVE can also be used by experienced programmers to develope 8 		sophisticated procedures and to interface with another: 		language such as FORTRAN, COBOL, or BASIC thus combining 		the best features of both.                         > 	DATATRIEVE's report writer allows sophisticated reports to be9 		immediately printed on the terminal, a printer, or in a * 		file that can later be edited if needed.       									A-2       	WHY USE DATATRIEVE?  , 	Easy to get the basics down and get started  	 		*  Help  		*  Documentation 		*  Guide Mode " 		*  Application Design Tool (ADT)    ( 	Interactive use gives immediate results     	Many possibilities    		*  Combined with FMS or TDMS, 		*  Accessed through DCL command procedures% 		*  Combined with the Call Interface # 		*  Adding Functions to DATATRIEVE            	WHY NOT TO USE DATATRIEVE?      	Cost of the Product    " 	Extensive use of System Resources     	Lost of Control over Data    & 	Difficult for Some Programmers to Use       									A-3       	TERMS OF IMPORTANCE             1. PRINT: 	   Causes DATATRIEVE to format and write to your terminal8 	   field names or values of expressions.  Examples A-4.             2. ALPHABETIC = 	   Any combination of characters in the alphabet and spaces. > 	   Alphabetic fields are designated by an "A".  Examples A-4.             3. NUMERIC> 	   Any combination of numbers and optionally a sign (+ or -).: 	   Numeric fields are designated by a "9".  Examples A-4.             4. ALPHANUMERIC ? 	   Any combination of characters including non-printable ones. ? 	   Alphanumeric fields are designated by a "X".  Examples A-4.              5. STRING > 	   A particular sequence of connected characters from zero to? 	   many characters.  "" is a special type of string called the > 	   null string that has nothing in it.  "B" is also a string.* 	   So is "TESTing 1,2,3 ".  Examples A-4.             6. NUMERIC OPERATIONS @ 	   DATATRIEVE can multiply, divide, add, or subtract using your> 	   normal computer symbols (*, /, +, -).  The "()" characters; 	   can help clarify your numeric operation.  Examples A-4.              7. EDIT_STRING> 	   Lets you tell DATATRIEVE how you want the value displayed.             8. HELP ; 	   As with almost all of Digital's products, there is HELP < 	   while in DATATRIEVE.  You can even specify where on the ; 	   screen you want the HELP displayed so that your current 0 	   command lines are not covered.  Example A-5.             9. SHOW < 	   Displays your entire DATATRIEVE dictionary, parts of the? 	   dictionary, or individual dictionary objects.  Example A-6.        									A-4        0              DTR> PRINT 4321100 USING $$,$$$,$$$              $4,321,100       0              DTR> PRINT 4321100 USING ZZ,ZZZ,ZZZ               4,321,100       >              DTR> PRINT "And a 1 and a 2 and a 3.  Wunnerful."1              And a 1 and a 2 and a 3.  Wunnerful.       I              DTR> PRINT "DATATRIEVE DOES NOT KORRECT SPELING" USING T(10)               DATATRIEVE               DOES NOT               KORRECT              SPELING      6              DTR> PRINT 44444 * 1000 USING $$$,$$$,$$$              $44,444,000      " 	     DTR> PRINT ((400 / 40) + 30) 	     40       									A-5                       DTR> HELP       Information available:   A    ABORT      ADT        ALLOCATION Assignment BEGIN_END  Boolean E    CDD_Versions          CHOICE     CLOSE      COMMIT     COMPUTED_BY G    Condition  CONNECT    CROSS      DBMS       DECLARE    DEFAULT_VALUE L    DEFINE     DEFINEP    DELETE     DELETEP    Dictionary DISCONNECT DISPLAYJ    DISPLAY_FORM          DROP       EDIT       EDIT_STRING           ERASEH    ERROR      EXECUTE    EXIT       EXTRACT    FIND       FINISH     FORI    Forms      Functions  Guide      HELP       IF         Invoke     LIST F    MATCH      Missing    MISSING_VALUE         MODIFY     New_FeaturesI    Node       OCCURS     ON         OPEN       Path_name  PICTURE    PLOT I    PRINT      Procedure  PURGE      QUERY_HEADER          QUERY_NAME Quit L    Rdb        READY      RECONNECT  REDEFINE   REDEFINES  REDUCE     RELEASEM    Release_notes         REPEAT     REPORT     Restructure           ROLLBACK J    RSE        SCALE      Search     SELECT     SET        SHOW       SHOWP=    SIGN       SORT       Specify    Startup    STORE      SUM J    SYNCHRONIZED          Synonyms   THEN       USAGE      VALID_IF   Value*    Versions   Video      WHILE      Wombat  	    Topic?          									A-6                          DTR> SHOW ALL    
      Domains: C              ACC1;1          EIGHTY;1        FAMILIES;1      NAME;1 C              SR_CLASS;1      TEMP;1          UAF;1           VOTE;1 5              WHEELS;1        WORDS;1         YACHTS;1   
      Records: G              EIGHTY_REC;1    SRCLAS_REC;1    STUDENT_REC;1   TEMP_REC;1 H              UAF_REC;1       VOTE_REC;1      WHEELS_REC;1    WORDS_REC;2              YACHT;1        Procedures:K              NAME_REPORT;1   NAME_RPT;1      STORE_VOTE;1    STORE_WHEELS;1 9              VOTE_RPT;1      WELCOME;1       WHEELS_RPT;1         Tables:              VALID_ACCT;1         Plots:               HAPPY;1  .      The default directory is CDD$TOP.DT.BRAGG         No established collections.        No ready domains.        No loaded tables.         									A-7       	GETTING INTO DATATRIEVE                  $ DTR  "              VAX Datatrieve T3.2-1(              DEC Query and Report System              Type HELP for help               DTR>         (              Not getting into Datatrieve                  $ DTR  <              %CDD-E-NODNOTFND, directory or object not found<              %CDD-E-NODNOTFND, directory or object not found              $                    $ DTR  0              %DCL-W-IVVERB, unrecognized command                \DTR\                    $ MCR DTR32  :              %DCL-W-ACTIMAGE, error activating image DTR322              -CLI-E-IMAGEFNF, image file not found-                SYS$SYSROOT:[SYSEXE]DTR32.EXE;        									A-8        3 	          The most important concept in Datatrieve     4                          DOMAINS, RECORDS, and FILES      E           A record definition shows the size and type of data that is A           stored in a data file.  It is found in your dictionary.       F           A domain definition associates the data file with the record6           definition.  It is found in your dictionary.      H           A data file is an ordinary file.  It can be INDEXED, RELATIVE,G           or SEQUENTIAL.  It does not have to be created by Datatrieve. (           It is found in your directory.      E           A field is part of the information about a record.  Such as D           ZIP in a record holding department store locations or SSOCE           in a record holding employee information.  Fields are found =           in record definitions which are in your dictionary.        									A-9        3 	           Example of Defining a Datatrieve Record     .              DEFINE RECORD PERSONNEL_REC USING              01 PERSON. 8                 05 SSOC                     PIC IS 9(9).9                 05 EMPLOYEE_STATUS          PIC IS X(11). !                 05 EMPLOYEE_NAME. 9                    10 FIRST_NAME            PIC IS X(10). 9                    10 LAST_NAME             PIC IS X(10). 7                 05 DEPT                     PIC IS XXX. :                 05 START_DATE               USAGE IS DATE.8                 05 SALARY                   PIC IS 9(5).8                 05 ID                       PIC IS 9(5).              ;          :                    Example of Defining a Datatrieve Domain    J              DEFINE DOMAIN PERSONNEL USING PERSONNEL_REC ON PERSONNEL.DAT;            8                    Example of Defining a Datatrieve File    2              DEFINE FILE FOR PERSONNEL KEY = SSOC;      
 									A-10          	READY Command  < 	Gives access to a domain and controls access until the user= 	leaves DATATRIEVE or types FINISH.  READY domain SHARED READt< 	is the default.  READY domain MODIFY allows the information; 	to be modified as well as read.  READY domain WRITE allowso< 	the information to be STOREd or DELETEd as well as modified< 	or read.  SHARED allows other people to access the same do-5 	main.  EXCLUSIVE keeps other people from accessing.        2         Boolean Operators and Relational Operators  ; 	Are used to form expressions that get just certain records  	from a domain.  Example A-11.               SORT Key  @ 	Is a field used as the basis for a sort.  Records can be sorted( 	according to any field.	  Example A-12.      #         Record Selection Expression   ? 	A RSE is a statement that controls the creation of a specified ? 	stream of records.  Every record must meet specific conditions A 	listed in the RSE before they are included in the record stream. 8 	The phrase STOCK WITH QTY LT 10 is an example of a RSE.      
 									A-11       /                             BOOLEAN EXPRESSIONS     C          =                EQUAL TO             PRINT INVENTORY WITH ?          EQ                                    STOCK-NO EQ 1234           EQUAL  C          NE               NOT EQUAL TO         PRINT INVENTORY WITH ?          NOT-EQUAL                             STOCK-NO NE 9999   C          >                GREATER THAN         PRINT INVENTORY WITH C          GT                                    ITEM-NAME GT "PAINT"           GREATER-THAN   C          GE               GREATER THAN OR      PRINT INVENTORY WITH <          GREATER-EQUAL    EQUAL TO             AMOUNT GE 100  C          <                LESS THAN            PRINT INVENTORY WITH ;          LESS-THAN                             AMOUNT <  20   C          LE               LESS THAN OR         PRINT INVENTORY WITH ?          LESS-EQUAL       EQUAL TO             STOCK-NO LE 2000   C          BT               VALUE IS BETWEEN     PRINT INVENTORY WITH @          BETWEEN          x AND y INCLUSIVE    AMOUNT BT 20, 100  C          CONT             VALUE IS CONTAINED   PRINT INVENTORY WITH =          CONTAINING       ANYWHERE WITHIN      ITEM-NAME CONT 4                           FIELD NAME           "RED"  C          STARTING         VALUE IS CONTAINED   PRINT INVENTORY WITH A                           WITHIN AND STARTS    ITEM-NAME STARTING 2                           FIELD NAME           "B"      
 									A-12               :              PRINT ALL  field-1, field-2  OF  domain  WITHC                    record-selection-expression  SORTED BY  sort-key             ;              PRINT ALL ENMLAST, EMPN, PAY OF EMPLOYEES WITH 8                    PAY GREATER-THAN "500" SORTED BY NAME          6              PRINT ALL TYPE, PRICE, LOA OF YACHTS WITH?                    LOA > "35" AND PRICE > "2000" SORTED BY TYPE       
 									A-13        	Collection   < 	A subset of a domain formed with the FIND command.  You can; 	refer to a collection just like a domain until you replace ; 	it with another collection, RELEASE it, FINISH the domain, # 	or EXIT DATATRIEVE.  Example A-14.        	FIND   < 	Establishes a collection of records from a domain or a col-< 	lection.  The collection formed with the FIND command has a( 	special name of CURRENT.  Example A-14.       	CURRENT  @ 	The most recently formed collection.  A new collection replaces& 	an old one as the current collection.               FINISH  @ 	Ends control over domains and any collections formed from that  	domain.       	RELEASE  + 	Ends control over one or more collections.       
 									A-14             5          FIND  collection-name  IN  domain-name  WITH @                 record-selection-expression  SORTED BY  sort-key            E          FIND ACCOUNTANTS IN EMPLOYEES WITH DEPARTMENT = "ACCOUNTS" -                  SORTED BY NAME  7          PRINT ALL NAME, EMPLOYEE-NUMBER OF ACCOUNTANTS           D          FIND BIG-BOATS IN YACHTS WITH LOA > "35" AND BEAM GT "12" -                 SORTED BY LOA   6          PRINT ALL TYPE, PRICE, LOA, BEAM OF BIG-BOATS  