RAPGEN

 

Installation Manual

 

 

Part 2.


 


13.          DMS.RAPGEN file definition module.........................................................................................................................................   4

13.1.        Installation of DMS.RAP.DRN...................................................................................................................................................   4

13.2.        General descriptions.....................................................................................................................................................................   5

13.2.1.      Interactive file definition.............................................................................................................................................................   5

13.2.2.      Interactive field definition..........................................................................................................................................................   5

13.2.3.      Complete file definition in one pass..........................................................................................................................................   5

13.2.4.      Extended field format specifications.........................................................................................................................................   6

13.2.5.      Full‑screen editor.........................................................................................................................................................................   6

13.2.6.      File investigator...........................................................................................................................................................................   6

13.2.7.      Batch update mode for transporting files................................................................................................................................   6

13.2.8.      Batch update for parameter‑file defined options....................................................................................................................   6

13.2.9.      Help manual generation..............................................................................................................................................................   6

13.3.        Main functions..............................................................................................................................................................................   7

13.3.1.      Amending an existing definition...............................................................................................................................................   7

13.3.2.      Creating a new file definition.....................................................................................................................................................   7

13.3.3.      Deleting a file definition..............................................................................................................................................................   7

13.3.4.      Printing a file definitions.............................................................................................................................................................   7

13.3.5.      Copying a file definition.............................................................................................................................................................   8

13.3.6.      Copying a file definition from a different system....................................................................................................................   8

13.3.7.      Changing the fileshortname itself.............................................................................................................................................   8

13.3.8.      PUTting and GETting definitions to/from a text­file................................................................................................................   8

13.3.9.      Amending the field definitions..................................................................................................................................................   8

13.3.10.     Amending index and file connection definitions...................................................................................................................   8

13.3.11.     Additional field description for documentation.....................................................................................................................   8

13.3.12.     Generating READ statements...................................................................................................................................................   8

13.3.13.     Investigating files.......................................................................................................................................................................   9

13.3.14.     Help manual generation.............................................................................................................................................................   9

13.4.        The contents of the header fields..............................................................................................................................................   9

13.4.1.      Fileshortname...............................................................................................................................................................................   9

13.4.2.      Filename........................................................................................................................................................................................   9

13.4.2.1.    Filename conversion rules.........................................................................................................................................................   9

13.4.2.2.    Filename file.................................................................................................................................................................................   9

13.4.2.3.    Star,newstar and superstar systems......................................................................................................................................   10

13.4.3.      Text..............................................................................................................................................................................................   10

13.5.        Field definitions..........................................................................................................................................................................   10

13.5.1.      Defining a field...........................................................................................................................................................................   10

13.5.2.      Jumping around in the fields....................................................................................................................................................   10

13.5.3.      Ending the definitions...............................................................................................................................................................   11

13.5.4.      Field format specification.........................................................................................................................................................   11

13.6.        Commands during field‑definitions..........................................................................................................................................   11

13.6.1.      DEL delete a number of fields..................................................................................................................................................   11

13.6.2.      INS insert a number of fields....................................................................................................................................................   11

13.6.3.      MOD changing display mode..................................................................................................................................................   12

13.6.4.      GET Copy field definitions from another file.........................................................................................................................   14

13.6.5.      MAT Specifying MAT READ for field types.......................................................................................................................   14

13.6.6.      ACT Activate/deactivate file in reportgenerator..................................................................................................................   14

13.6.7.      PSW Set password for this file................................................................................................................................................   14

13.6.8.      PRT Print complete file definition............................................................................................................................................   14

13.6.9.      INX Index/file connection definitions....................................................................................................................................   15

13.6.9.1.    Functions in index/file connection definitions.....................................................................................................................   15

13.6.9.2.    Index definitions.......................................................................................................................................................................   15

13.6.9.3.    File connection definition........................................................................................................................................................   15

13.6.10.     Structure of the keyfield definitions......................................................................................................................................   16

13.6.10.1.   Fields.........................................................................................................................................................................................   16

13.6.10.2.   Functions..................................................................................................................................................................................   16

13.6.10.3.   Combinations of fields and functions..................................................................................................................................   16

13.6.10.4.   Examples of key structures.....................................................................................................................................................   16

13.6.11.     KEY Set fieldnumber for key not in record...........................................................................................................................   16

13.6.12.     TXT maintenance of extended field descriptions................................................................................................................   17

13.6.13.     XFO File investigator...............................................................................................................................................................   17

13.6.13.1.   Displaying the file from the start...........................................................................................................................................   18

13.6.13.2.   Displaying next page...............................................................................................................................................................   18

13.6.13.3.   Selecting a key start value......................................................................................................................................................   18

13.6.13.4.   Selecting a specific index from the file..................................................................................................................................   18

13.6.13.5.   Selecting a different file..........................................................................................................................................................   18

13.6.13.6.   Ending the file investigator....................................................................................................................................................   18

13.6.13.7.   MOD selection of display mode............................................................................................................................................   18

13.6.13.8.   Selecting display of specific part of record.........................................................................................................................   18

13.6.14.     CHK Field input validations....................................................................................................................................................   19

13.7.        Precautions when amending file definition.............................................................................................................................   20

13.7.1.      Field sign.....................................................................................................................................................................................   20

13.7.2.      Adding fields to a file................................................................................................................................................................   20

13.7.3.      Changing fields in a file............................................................................................................................................................   20

13.7.4.      Reports with multiple file use...................................................................................................................................................   20

13.7.5.      Changing field types.................................................................................................................................................................   20

13.7.6.      Write statements........................................................................................................................................................................   20

13.7.7.      DATAMASTER files................................................................................................................................................................   20

 

14.           Subfunctions...............................................................................................................................................................................   21

14.1.        Subfunctions and the LOAD command..................................................................................................................................   22

14.1.1.      Loading of a subfunction.........................................................................................................................................................   22

14.1.2.      The subfunction textfiles..........................................................................................................................................................   22

14.1.3.      Structure of the subfunction textfile.......................................................................................................................................   23

14.1.4.      A subfunction example.............................................................................................................................................................   23

14.2.        Subfunctions in complex calculation:......................................................................................................................................   24

14.2.1.      Subfunctions as subroutines...................................................................................................................................................   24

14.2.2.      Subfunctions in selections.......................................................................................................................................................   24

14.2.3.      Subfunction parameters............................................................................................................................................................   24

14.2.4.      Evaluation order.........................................................................................................................................................................   25

14.2.5.      Restrictions.................................................................................................................................................................................   25

14.3.        Subfunctions and the HLP command......................................................................................................................................   26

14.3.1.      Printing the subfunction help..................................................................................................................................................   27

14.3.2.      List of implemented subfunctions...........................................................................................................................................   27

14.3.3.      Detailed description of the subfunctions..............................................................................................................................   27

14.4.        Writing a subfunction................................................................................................................................................................   31

14.4.1.      The master textfile DMS.RAPX...............................................................................................................................................   31

14.4.2.      100 Return variable....................................................................................................................................................................   31

14.4.3.      101‑149 Parameter variables.....................................................................................................................................................   32

14.4.3.1.    Return values in parameter values.........................................................................................................................................   32

14.4.4.      150‑199 Free field definitions...................................................................................................................................................   32

14.4.4.1.    #Dx Start‑data definitions........................................................................................................................................................   32

14.4.5.      200 Initialize entry......................................................................................................................................................................   33

14.4.6.      201‑299 Entry points..................................................................................................................................................................   33

14.4.6.1.    Dummy entry.............................................................................................................................................................................   33

14.4.6.2.    Multiple entry points...............................................................................................................................................................   33

14.4.6.3.    Dummy subfunctions...............................................................................................................................................................   33

14.4.7.      300‑399 Variables used..............................................................................................................................................................   34

14.4.8.      400 Reentrant Y/N......................................................................................................................................................................   34

14.4.9.      401 Renumber from, to, step.....................................................................................................................................................   34

14.4.10.     402 Write access Y/N...............................................................................................................................................................   34

14.4.11.     403 Password Y/N.....................................................................................................................................................................   35

14.4.12.     404 Number of #Dx fields.........................................................................................................................................................   35

14.4.13.     416 FN functions nessesary....................................................................................................................................................   35

14.4.14.     419 Acoounting report active.................................................................................................................................................   35

14.5.        Using files in a subfunction......................................................................................................................................................   35

14.5.1.      File channels...............................................................................................................................................................................   35

14.5.2.      Other file informations..............................................................................................................................................................   35

14.5.3.      File variables...............................................................................................................................................................................   36

14.5.4.      File channels as parameters.....................................................................................................................................................   36

14.6.        Subfunction examples................................................................................................................................................................   37

 

Figures..........................................................................................................................................................................................................   41

 

Keyword index............................................................................................................................................................................................   42

 

13.          DMS.RAPGEN file definition module.

 

   A new file definition module has been developed for the reportgenerator that makes it easier for those users who wish to do so to define existing files without needing assistance.

 

    A special version of the DATAMASTER programs has been used up to now, but DATAMASTER is better suited for defining new files and constructing/reorganizing the files themselves rather than interfacing to existing files.

 

    The new module is named DMS.RAP.DRN and released on 01/01‑1988. Files already defined as fully compatible and the report generator DMS.RAPGEN is not affected. Reports will be identical irrespective of whether new or old file definitions are used.                  

 

14.1.        Installation of DMS.RAP.DRN.

 

   Copy all files with the prefix DMS.RAP.DRN to the customer system on any logical unit.You may use COPYALL with the libr.list DMS.RAP.DRNLIB.

 

Figure 1  Libr list

 

     FILNAVN     BRUGER BLOKKE PART./ APPL. VERS  SPC  DATO    HBA     HASH  

 *                            #REC.  AREA FMVVTM  INF.                TOTAL  

 D  DMS.RAP.DRN      5     37     24   0   0 0 0   1 01.02.88   6264  54852  

 D  DMS.RAP.DRN1     5     28     24   0   0 0 0   1 01.02.88 131513  26864  

 D  DMS.RAP.DRN2     5     11     24   0   0 0 0   1 01.02.88   6207  29529  

 D  DMS.RAP.DRN3     5     21     24   0   0 0 0   1 01.02.88   4745   8933  

 D  DMS.RAP.DRN4     5     27     24   0   0 0 0   1 01.02.88 112523  11236  

 D  DMS.RAP.DRN5     5     22     24   0   0 0 0   1 01.02.88 112523  24778  

 D  DMS.RAP.DRN6     5     11     24   0   0 0 0   1 01.02.88 112523  63643  

 D  DMS.RAP.DRN7     5     10     24   0   0 0 0   1 01.02.88 112523  10691  

 D  DMS.RAP.DRN8     5     19     24   0   0 0 0   1 01.02.88 112523  38985  

 D  DMS.RAP.DRNLIB   5      4      3   0   0 0 0   1 01.02.88 112523  31471  

 C  DMS.RAP.DRNT     5     16      5   0   0 0 0   0 01.02.88   4713  29264  

 C  DMS.RAP.DRNTE    5     16      5   0   0 0 0   0 01.02.88   5125  29264  

 C  DMS.RAP.DRNTY    5     16      5   0   0 0 0   0 01.02.88   4730  29264  

 ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑  

 TOTAL:                   238                                         61099  

 

 

 

 

   The program can now be selected from scope (#) after DMS.RAPGEN has been selected once from this screen.

 

   A TAMOS selector entry can be created if you place DMS.RAP.DRN on the same logical unit as DMS.RAPGEN and update the selector program DMS.R to the new  version. The selector should specify:

 

                         lu/DMS.R,986300

 

  where 98 is this program, 63 the system number.Program number in the selector must be set to zero.

 

    DMS.RAP.DRN consists of 8 basic programs which can be optimized and one contiguous file with lanquage dependent texts occupying around 200 blocks.

 

    NIROS 5.1 rev. 5 or higher is required. (NOTE: The programs are NOT able to run on earlier revisions of NIROS 5.1). 24KB partition size is necessary for normal use.

 

    However, if you want to define files with large recordlength ( > 1600 bytes), a larger partition size may be required if the record is to be displayed interactively during file definition.


14.3.        General descriptions.

 

   The normal function keys from TAMOS/COMET can be used in these programs, i.e.: 

 

                @    to keep this field value.

                ;    to go back one field.

                END  to end this function.

                SPR  to abort this function.

                ?    to display available commands.

 You END the complete program by typing END at the fileshortname prompt, anywhere else, you will just end the current function.

 

    If you use the SPR function please note that updates from the current function will not be done but earlier subfunctions (front page/index def.) will be completed.

 

    CR will work like @, keeping the current contents of the field. The arrows for forwardspace/backspace/insert/delete characters may be used to edit fieldnames etc.

 

14.4.1.      Interactive file definition.

 

   When a filename is entered DMS.RAP.DRN tries to open this file. If this is not possible you will get a warning and it is possible to go back and correct the filename if necessary.

 

    If the file is found, the recordlength and keylength of the file (all in BYTES) is displayed for visual control. On the message line you will see a file status showing the total number of records, and the used and free records.

 

    The second record of the file (search 3 twice) will be read into core for later use. (Recordno. 1 for relative file).

 

14.4.3.      Interactive field definition.

 

   When you define/amend any field, the storage variable (S$ etc.), field type AND byte displacement will be calculated and shown instantly and all fields which are influenced by this definition will be recalculated/displayed.

 

    The bytenumber and the field type ($,1%,2%,3%,4%) will be displayed on the field line.

 

    If a record from the file is present in core (see above), the field value extracted from this record according to the field definition format will be displayed on the right of the line.

 

    You thus have a visual check that it is possible to read the file in the defined way. If *; etc. show in numeric fields, something must be incorrectly defined. If a record is not present, the field variable is displayed.

 

    You can change the display mode from displaying record contents to variables or formats with the MOD command. The MOD command can also be used to read the NEXT record from the currently opened file.

 

14.4.5.      Complete file definition in one pass.

 

   When you have finished the field definitions, all bytenumbers etc. must be correct if you were able to read the test‑record displayed on the screen.

 

    Read‑statements are now generated automatically and the file is ready for use by DMS.RAPGEN. 


14.4.7.      Extended field format specifications.

 

   A field definition normally consists of two columns only, the field name and the field format.

 

    The format can be specified as usual, for example defines a alphanumeric field of 32 characters, 8,2 defining 8 digits and 2 decimals.

 

    If nothing else is specified, the field will be treated as a simple unpacked field stored in the smallest possible variable type and the byte displacement will be calculated as the next free byte in the file.

 

    If necessary, additional information can be given directly after this field format with one‑letter codes in any combination:

for example, B16 will set the field to start on byte 16, P defines a packed field, T1 forces the field into a type 1% variable.

 

    All options can be connected to a field through the format specification, but for simple files these should not be required.

 

14.4.9.      Full‑screen editor.

 

   A page of fields is always shown and updated instantly on the screen, you no longer have to call up the previous fields one by one.

 

14.4.11.      File investigator.

 

   You have the possibility to investigate any indexed file on the system      during the field definition. The record keys may be displayed together with the record contents in any possible field types (packed/1%/2%/3%/4%//alpha/ text/binary).

 

14.4.13.      Batch update mode for transporting files.

 

   It is possible to generate a textfile containing one or more file definitions from the system and to transport this textfile to a different machine and use this file as input file for the programs.

 

    The textfile will normally be very small (2‑3 sectors per definition) which gives a very fast modem copy.

 

14.4.15.      Batch update for parameter‑file defined options.

 

   You may write a program reading parameter‑files from COMET or any other system and producing an input textfile for DMS.RAP.DRN containing any commands to set byte‑displacements,delete fields or copy a customer file definition from a master file definition.

 

    When DMS.RAP.DRN is linked with J0=1000 as the only variable and channel #8 open as this textfile, all commands will be executed from here.

 

14.4.17.      Help manual generation.

 

   When all file definitions have been completed you may generate a textfile with a complete description of all files and fields. This textfile may be used for the help‑manual system in the EXPERT selector.


14.5.        Main functions.

 

   When DMS.RAP.DRN is selected a front page with an overview of all known files is displayed and the user is placed at the SHORTNAME prompt:

 

Figure 2  Front page, commands in FILESHORTNAME.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

 FILESHORTNAME:     FILENAME:                TEXT:                             

                    DISCNAME:                RECLEN     KEYS:                  

                                                                               

 BU  BUDGETDATEI                                                               

 DB  DEB/KRED BEWEGUNG                                                         

 DK  DEB/KRED STAMDATEI                                                        

 KB  SACHKONTEN‑BEWEGUNG                                                       

 KO  SACHKONTEN‑STAMDATEI                                                      

 L2  ARTIKELSTAM 2/LAWI                                                         

 L3  ARTIKELSTAM 3/LSTAP                                                       

 L4  ARTIKELSTAM 6/ AB/F                                                       

 L5  ARTIKELSTAM ‑ FEROS                                                        

 L6  ARTIKELSTAM COSTING                                                       

 LA  ARTIKEL‑STAMKARTOTEK                                                      

 LO  LAGERORTDATEI                                                              

                                                                               

 MESSAGE:@/;/END/SPR/GET/PRT/PUT/XFO/MAN/                                      

 

 

 

 

 

Figure 3 Front page, commands in FILENAME.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

 FILESHORTNAME:LA   FILENAME:9/LF‑06000abc   TEXT:ARTIKEL‑STAMKARTOTEK         

                    DISCNAME:09/LF‑06000001  RECLEN 656 KEYS:16,12 BYTES       

                                                                               

 BU  BUDGETDATEI                                                               

 DB  DEB/KRED BEWEGUNG                                                          

 DK  DEB/KRED STAMDATEI                                                        

 KB  SACHKONTEN‑BEWEGUNG                                                       

 KO  SACHKONTEN‑STAMDATEI                                                       

 L2  ARTIKELSTAM 2/LAWI                                                        

 L3  ARTIKELSTAM 3/LSTAP                                                       

 L4  ARTIKELSTAM 6/ AB/F                                                       

 L5  ARTIKELSTAM ‑ FEROS                                                       

 L6  ARTIKELSTAM COSTING                                                       

 LA  ARTIKEL‑STAMKARTOTEK                                                      

 LO  LAGERORTDATEI                                                              

                                                                               

 MESSAGE:@/;/END/SPR/DEL/GET/XFO/                                              

 

 

 

14.6.1.      Amending an existing definition.

 

   Enter the shortname of any of the displayed files and the definition will be read and shown on the screen.

 

14.6.3.      Creating a new file definition.

 

   Enter a new 2‑letter shortname. You will then be asked to confirm that you wish to create a new file.

   The next free data definition (DRN) will be reserved automatically by searching all present subsystems (DMDATAFILx).

 

14.6.5.      Deleting a file definition.

 

   Enter the command DEL in FILENAME after a file has been selected. You will be asked to confirm the deletion.

   The complete definition and any READ‑statement textfiles will be deleted and freed. The file itself is of course not affected.  

 

14.6.7.      Printing a file definitions.

 

   Enter the command PRT at the FILESHORTNAME prompt and you will be asked which files should be printed.

   You may enter a single file shortname, several shortnames separated by commas, or a range of files, eg: L1‑LA,BU,DB‑DK

 

    The printer $LPT assigned to the screen by TAMOS is used, lines on form and print width will be adjusted automatically according to this assignment. If you supply a + after the fileshortnames, record contents will be added to the print if possible, eg: DB‑DK+


14.6.9.      Copying a file definition.

 

   Enter the command GET at the FILENAME prompt after you have selected a new or existing fileshortname.

   You will now be asked from which file you want to copy the definitions. When you enter the shortname of an existing file, the complete definition of this (including any textfiles for read‑statements) is copied to this new definition.

 

14.6.11.      Copying a file definition from a different system.

 

   As above, enter the command GET at the FILENAME prompt:

   When prompted for a fileshortname to copy from, you can now enter xxyy where xx is a system number and yy is the fileshortname.

   If you enter 63LA the file definition for the file LA in system 63 will be copied to this definition.

 

14.6.13.      Changing the fileshortname itself.

 

   To do this you have to copy the file definition to a new one with the new fileshortname, and then delete the old definition.

14.6.15.      PUTting and GETting definitions to/from a textfile.

 

   If you enter the command PUT at the fileshortname prompt, you may produce a special print of selected file definitions to a textfile.

   You will be asked for the textfilename, and you may then select the files as described in the print‑function.

   If you enter the command GET at the fileshortname prompt you will be asked for a textfilename. All input to the program will now be taken from this textfile which may contain any PUTted definitions or program generated parameters.

 

14.6.17.      Amending the field definitions.

 

   When you have completed the header information by entering the filename and text, the first 20 fields in the file will be displayed and can be amended in any way (see later).

 

14.6.19.     Amending index and file connection definitions.

 

   Enter the command INX in any field and the index/file connection definitions will be shown and can be amended.

   When you END this definition you will return to the field definitions.

   These definitions can always be added to the file definition, they are not essential for the use of the report generator.

 

14.6.21.

13.3.11.     Additional field description for documentation.

 

   The TXT command can be used to maintain up to 99 lines of text for each field in a file, this text is displayed with the HLP function in the report generator.

   It is not nessesary to make this additional field description, but it may be very useful in a system with many complex code‑fields.

 

14.6.23.     Generating READ statements.

 

   When you END the field definitions you are asked if read statements should be generated (DMREAD.xx).

 

   This is necessary if you have amended any field formats:i.e bytenumbers, field types or alphanumeric field length/packing and of course when you create a new file. If you have special programming in the read‑statements this generation should be omitted as the existing textfile will be overwritten.

 

14.6.25.

13.3.13.     Investigating files.

 

   If you issue the command XFO during the field definition or in the front  page you enter the file investigator.


14.6.27.     Help manual generation.

 

   The command MAN entered in fileshortname will produce a special print of the file descriptions into the textfile x/MANUALxx0001 where x/xx is the prefix for the file x/xxFILES as set up by DMS.RAPGEN.SYS.

 

   This file may be used to create a help manual from the EXPERT selector. The files will be numbered from 1 in alphabetic order, each field will be numbered as filenumber *100+fieldnumber. Program may use this number to set up help text references before input.

 

   The fileshortname and the fieldnumber will be marked as keywords, the user may enter POS XX05 to read the description of file XX field 5 or just POS XX for file XX.

 

   The manual title will be the system name as given in DMS.RAPGEN.SYS fieldnumber 1.

 

14.7.        The contents of the header fields.

 

   You will be asked to enter the following information before you can continue with the detailed field discriptions:

 

14.8.1.      Fileshortname.

 

   This is a two‑letter shortname uniquely identifying the file.The first character should be a capital letter A‑Z.

 

14.8.3.      Filename.

 

   The filename can be the actual disc filename or it may contain replacement characters in order to interface with COMET or other packages:

 

14.8.4.1.    Filename conversion rules.

 

   The base filename in the file definitions must be stated as lu/filename in capital letters. Lower case and special characters will trigger the conversion.

 

    The COMET‑TOP customer file should for example be 1/GF‑03000abc.

 

    Lower case and special characters will be replaced by:

 

           abc = TAMOS selector parameter 1.

           def = TAMOS selector parameter 2.

           ghi = TAMOS program number.

           jk  = Starting port number (screenno.).

           l   = DMS compagni suffix no.

           mn  = Reportgenerator systemno.

           o   = Reportgenerator lanquage suffix.

           pq  = Reserved, alternative DMS program prefix.

           r‑z = Free for use.

           #   = Reportgenerator file suffix.

           @   = Screen number, 1‑9 only at the end of the name.

 

 The logical unit number will be replaced with the corresponding number in the DLU table defined by DMS.RAPGEN.SYS. You are advised to allways set this to 0123456789 to avoid replacement, hence leaving the job to be done by DMS.RAPGEN.LU.

 

14.8.4.3.    Filename file.            

 

   For some systems,fx.NYRUP systems, you may have a contigous file containing the filenames, each file will then be identified by a filenumber.

 

    If you name the report generator system in DMS.RAPGEN.SYS fieldnumber 1 as fx. 0/DS10ASYSTEM it is the name of the filename‑file where the second character must be the slash you will now be able to enter the filename as RRR or RRR,BBB where RRR is the record number for this file where the filename is held and BBB is the byte displacement.


14.8.4.5.    Star, Newstar and Superstar systems.

 

   These conversion rules are activated if the BACKCHAIN program in  DMS.RAPGEN.SYS is set with a prefix of x/ST

 

   The filename must be given as 02LEKA where the first two digits refers to a parameter number in the parameter file, the rest is the filename.

 

    If the system code in DMS.RAPGEN.SYS is 1, the STAR file logical unit and prefix will be taken from the account dependent file SYSTARxx record number 0.

 

    If the system code in DMS.RAPGEN.SYS is 2, the NEWSTAR file logical unit and prefix will be taken from the TAMOS dependent file 0/ST.PARAMabc record number 0 and 13.

 

    If the system code in DMS.RAPGEN.SYS is 3, the SUPERSTAR file logical unit and prefix will be taken from the TAMOS dependent file 0/ST.PARAMabc record number 65 and 13.

 

14.8.5.      Text.

 

   You can enter an explanation text of up to 25 characters here.

 

14.9.        Field definitions.

 

   When you have completed the front page, the first 20 fields of the file are displayed and you are positioned in fieldno. 1.

 

Figure 4  Field definitions showing record contents.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

 FILESHORTNAME:LA  FILENAME:9/LF‑06000abc   TEXT:ARTIKEL‑STAMKARTOTEK          

                   DISCNAME:09/LF‑06000001  RECLEN  656 KEYS:16,12 BYTES       

 NO. NAME                       FORMAT            BYTE;T  RECORD CONTENTS      

  1  ARTIKELNUMMER             !16B4             !   4;$ =100                  

  2  ARTIKELBEZEICHNUNG        !33B21            !  21;$ =FRAKT                

  3  ARTIKELBEZEICHNUNG        !33B55            !  55;$ =                     

  4  MATCHCODE                 !6B89(16)         !  89;$ =FRAKT                

  5  SATZNUMMER ARTIKEL        !6,B96            !  96;2%=     5               

  6  LIEFERANTENUMMER          !8,P              ! 100;3%=       0             

  7  BESTANDS‑KONTONUMMER      !12,PB105         ! 105;4%=        6030         

  8  KZ.ARTIKEL GESPERRT       !1B112            ! 112;$ =0                    

  9  KZ.VERFUEGB.KONTR.        !1                ! 113;$ =6                    

 10  KZ.ARTIKELKONTO           !1                ! 114;$ =1                    

 11  BEWERTUNGSSCHLUESSEL      !1                ! 115;$ =2                    

 12  ABC SCHLUESSEL            !1                ! 116;$ =D                    

 13  BESTELLMENGENSCHLUESSEL   !1                ! 117;$ =0                    

 14  BEZUGSSCHLUESSEL          !1                ! 118;$ =0                    

 15  RESERV.F.KZ.VAR.‑VER      !1                ! 119;$ =0                    

 16  KZ.BESTELLPUNKT           !1                ! 120;$ =0                    

 17  RESERVIERT                !1                ! 121;$ =                      

 18  RESERVIERT                !1                ! 122;$ =                     

 19  BEZUGSKOSTENSCHLUESSEL    !1,               ! 124;1%=0                    

                                                                               

 MESSAGE:00‑99/@/;/END/SPR/DEL/INS/MOD/GET/MAT/ACT/INX/PSW/PRT/KEY/TXT/CHK/XFO/

 

 

 

 

14.10.1.      Defining a field.

 

   To define a field you just enter the fieldname and the format specification. The field byteno. etc. is calculated and displayed to the right and you are now ready to define the next field.

 

14.10.3.      Jumping around in the fields.

 

    ; can be used to go one field backwards.

 

    CR or @ will keep the current value of text or format.

 

    A number (1‑99) entered first in a field text will position you in this fieldnumber. If this is outside the currently displayed page, a new screen will be displayed centered around this field.

 

    Number 0 or ; in the first field will position you just after the last defined field in the file.


14.10.5.      Ending the definitions.

 

    END causes the definition to be written and read‑statements can be generated.

 

    SPR aborts the definition without update of any field changes.

 

14.10.7.      Field format specification.

 

   The following options can be specified in the field format in any (meaningful) combination:

   

             32     32 chars textfield

             3,     Numeric 3 digit field

             3,2    ‑ with 2 decimals

            ‑3,2    ‑ and with sign

            ,8,2    Editing by 1000 and sign

            *8,2    Leading asteriks

            Bxxxx   Field will start on byteno. xxxx

            Tx      Field will be forced into type x

            P       The field will be packed

            P2      Packed field without comma, division by 10E‑Decimals

            S       The last character contains delimiter ($)

            (xx)    xx characters is reserved in record ($)

            W       Workfield not included in record

            Cx      Field input checkcode is set to x (No default totalling will take place)

            K       Unique key                           1,S

            D       Duplicate key                        2,NP,S

            E       Unique key, zero keys omitted        3<>0,3,S

            Z       Duplicate key, zero keys omitted     4<>0,4,NP,S

            V       Duplicate date‑turnaround key (FND)  5D,NP,S

            I       Duplicate invarted key (call 91)     6I,NP,S

            X       Duplicate date‑turned inverted key   7DI,NP,S

   The following options are reserved for future use:

            Px      Field special packing type x

            Wx      Workfield included in other record

 

   Field types automatically calculated:

            1 %     up to 3 digits and no decimals.

            2 %     4 to 6 digits or decimals on fields of 1‑3 digits.

            3 %     7 to 10 digits.

            4 %     more than 10 digits.

14.11.        Commands during field‑definitions.

 

   The following commands are available:

 

14.12.1.      DEL delete a number of fields.

 

   You will be asked how many fields you want to delete starting from the fieldnumber where you issued the command.

 

   Just press cr. if you regret or enter the number of fields to delete.

 

14.12.3.      INS insert a number of fields.

 

   You will be asked how many fields you want to insert BEFORE the current field. Note that the maximum number of fields in a file is 99. If you insert too many fields the surplus fields will disappear.


14.12.5.      MOD changing display mode.

 

   With this command you can change the display mode of the right part of the screen:

 

                  0  = field type and format

                  1  = byte, variable             

                  2  = byte, type, record contents

                  3  = Read NEXT record, as 2

                  4  = No display

                  5  = First line of extended field descriptions.

                  51 = First line of special field texts.

                  6  = Allowed field values.

 

  If you are using a slow telephone modem screen, mode 4 can be used to speed up the display. Latch key R2 will cause mode 4 to be selected as a default, the initial file overview will not be displayed if R2 is ON.

 

  If mode 1,2 or 3 is selected, changing a field will instantly cause all bytenumbers etc. of all fields to be recalculated if changes to field type or other information are done. This can be omitted by choosing mode 1 or 4.

 

  In mode 5 you will automatically switch to a new screen where you may edit the additional field documentation when you have entered the fieldname instead of going to the field format column.The textlines may be displayed using the HLP function in the report generator.

 

  In mode 6 you will automatically switch to a new screen where you may edit the field allowed values when you have entered the fieldname instead of going to the field format column.Note that these values are not used at all by DMS.RAPGEN and will not be displayed with the HLP function. 

 

Figure 5  Field definitions showing format.

 

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

 FILESHORTNAME:LA  FILENAME:9/LF‑06000abc   TEXT:ARTIKEL‑STAMKARTOTEK          

                   DISCNAME:09/LF‑06000001  RECLEN  656 KEYS:16,12 BYTES       

 NO. NAME                       FORMAT          T  FORMAT                      

  1  ARTIKELNUMMER             !16B4           !$  XXXXXXXXXXXXXXXX            

  2  ARTIKELBEZEICHNUNG        !33B21          !$  XXXXXXXXXXXXXXXXXXXXXXXXXXXX

  3  ARTIKELBEZEICHNUNG        !33B55          !$  XXXXXXXXXXXXXXXXXXXXXXXXXXXX

  4  MATCHCODE                 !6B89(16)       !$  XXXXXXXXXXXXXXXX            

  5  SATZNUMMER ARTIKEL        !6,B96          !2% ######                      

  6  LIEFERANTENUMMER          !8,P            !3% ########                    

  7  BESTANDS‑KONTONUMMER      !12,PB105       !4% ############                

  8  KZ.ARTIKEL GESPERRT       !1B112          !$  X                           

  9  KZ.VERFUEGB.KONTR.        !1              !$  X                           

 10  KZ.ARTIKELKONTO           !1              !$  X                           

 11  BEWERTUNGSSCHLUESSEL      !1              !$  X                           

 12  ABC SCHLUESSEL            !1              !$  X                           

 13  BESTELLMENGENSCHLUESSEL   !1              !$  X                           

 14  BEZUGSSCHLUESSEL          !1              !$  X                           

 15  RESERV.F.KZ.VAR.‑VER      !1              !$  X                           

 16  KZ.BESTELLPUNKT           !1              !$  X                           

 17  RESERVIERT                !1              !$  X                           

 18  RESERVIERT                !1              !$  X                           

 19  BEZUGSKOSTENSCHLUESSEL    !1,             !1% #                           

 DISPLAY MODE:0                                                                

 MESSAGE:00‑99/@/;/END/SPR/DEL/INS/MOD/GET/MAT/ACT/INX/PSW/PRT/KEY/TXT/CHK/XFO/

 

 

 

 

 


 

 

Figure 6  Field definitions showing variables.

 

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

 FILESHORTNAME:LA  FILENAME:9/LF‑06000abc   TEXT:ARTIKEL‑STAMKARTOTEK          

                   DISCNAME:09/LF‑06000001  RECLEN  656 KEYS:16,12 BYTES       

 NO. NAME                       FORMAT           BYTE;VARIABLE                 

  1  ARTIKELNUMMER             !16B4            !   4;S$(1,16)                 

  2  ARTIKELBEZEICHNUNG        !33B21           !  21;S$(17,49)                

  3  ARTIKELBEZEICHNUNG        !33B55           !  55;S$(50,82)                

  4  MATCHCODE                 !6B89(16)        !  89;S$(83,98)                

  5  SATZNUMMER ARTIKEL        !6,B96           !  96;S2(1)                    

  6  LIEFERANTENUMMER          !8,P             ! 100;S3(1)                    

  7  BESTANDS‑KONTONUMMER      !12,PB105        ! 105;S4(1)                    

  8  KZ.ARTIKEL GESPERRT       !1B112           ! 112;S$(99,99)                

  9  KZ.VERFUEGB.KONTR.        !1               ! 113;S$(100,100)              

 10  KZ.ARTIKELKONTO           !1               ! 114;S$(101,101)              

 11  BEWERTUNGSSCHLUESSEL      !1               ! 115;S$(102,102)              

 12  ABC SCHLUESSEL            !1               ! 116;S$(103,103)              

 13  BESTELLMENGENSCHLUESSEL   !1               ! 117;S$(104,104)              

 14  BEZUGSSCHLUESSEL          !1               ! 118;S$(105,105)              

 15  RESERV.F.KZ.VAR.‑VER      !1               ! 119;S$(106,106)              

 16  KZ.BESTELLPUNKT           !1               ! 120;S$(107,107)              

 17  RESERVIERT                !1               ! 121;S$(108,108)              

 18  RESERVIERT                !1               ! 122;S$(109,109)              

 19  BEZUGSKOSTENSCHLUESSEL    !1,              ! 124;S1(1)                     

 DISPLAY MODE:1                                                                

 MESSAGE:00‑99/@/;/END/SPR/DEL/INS/MOD/GET/MAT/ACT/INX/PSW/PRT/KEY/TXT/CHK/XFO/

 

 

 

 

 

Figure 7  Extended field descriptions.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

 FILESHORTNAME:LA  FILENAME:9/LF‑06000abc   TEXT:ARTIKEL‑STAMKARTOTEK          

                   DISCNAME:09/LF‑06000001  RECLEN  656 KEYS:16,12 BYTES       

 NO. NAME                       FORMAT          FIELD DESCRIPTION              

  1  ARTIKELNUMMER             !16B4           !MAIN KEY                       

  2  ARTIKELBEZEICHNUNG        !33B21          !                               

  3  ARTIKELBEZEICHNUNG        !33B55          !CAN BE OMITTED                 

  4  MATCHCODE                 !6B89(16)       !SECONDARY SEARCH KEY           

  5  SATZNUMMER ARTIKEL        !6,B96          !POINTER RELATIVE FILE          

  6  LIEFERANTENUMMER          !8,P            !KEY SUPPLIERS FILE             

  7  BESTANDS‑KONTONUMMER      !12,PB105       !                               

  8  KZ.ARTIKEL GESPERRT       !1B112          !START BYTE DEPENDENT ON PARAMS 

  9  KZ.VERFUEGB.KONTR.        !1              !                               

 10  KZ.ARTIKELKONTO           !1              !                               

 11  BEWERTUNGSSCHLUESSEL      !1              !                               

 12  ABC SCHLUESSEL            !1              !                                

 13  BESTELLMENGENSCHLUESSEL   !1              !                               

 14  BEZUGSSCHLUESSEL          !1              !                               

 15  RESERV.F.KZ.VAR.‑VER      !1              !                                

 16  KZ.BESTELLPUNKT           !1              !                               

 17  RESERVIERT                !1              !                               

 18  RESERVIERT                !1              !                                

 19  BEZUGSKOSTENSCHLUESSEL    !1,             !                               

 DISPLAY MODE:5                                                                

 MESSAGE:00‑99/@/;/END/SPR/DEL/INS/MOD/GET/MAT/ACT/INX/PSW/PRT/KEY/TXT/CHK/XFO/

 

 

 

 

 

Figure 8  Allowed field values.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

 FILESHORTNAME:LA  FILENAME:9/LF‑06000abc   TEXT:ARTIKEL‑STAMKARTOTEK          

                   DISCNAME:09/LF‑06000001  RECLEN  656 KEYS:16,12 BYTES       

 NO. NAME                       FORMAT          ALLOWED VALUES                 

  1  ARTIKELNUMMER             !16B4           !                               

  2  ARTIKELBEZEICHNUNG        !33B21          !                               

  3  ARTIKELBEZEICHNUNG        !33B55          !                               

  4  MATCHCODE                 !6B89(16)       !                               

  5  SATZNUMMER ARTIKEL        !6,B96          !                               

  6  LIEFERANTENUMMER          !8,P            !                               

  7  BESTANDS‑KONTONUMMER      !12,PB105       !                               

  8  KZ.ARTIKEL GESPERRT       !1B112          !0,1                            

  9  KZ.VERFUEGB.KONTR.        !1              !0‑9                            

 10  KZ.ARTIKELKONTO           !1              !                               

 11  BEWERTUNGSSCHLUESSEL      !1              !1,2                            

 12  ABC SCHLUESSEL            !1              !0,1,2,3                        

 13  BESTELLMENGENSCHLUESSEL   !1              !                               

 14  BEZUGSSCHLUESSEL          !1              !                                

 15  RESERV.F.KZ.VAR.‑VER      !1              !                               

 16  KZ.BESTELLPUNKT           !1              !                               

 17  RESERVIERT                !1              !                                

 18  RESERVIERT                !1              !                               

 19  BEZUGSKOSTENSCHLUESSEL    !1,             !                               

 DISPLAY MODE:6                                                                 

 MESSAGE:00‑99/@/;/END/SPR/DEL/INS/MOD/GET/MAT/ACT/INX/PSW/PRT/KEY/TXT/CHK/XFO/

 


14.12.7.      GET Copy field definitions from another file.

 

   You will be asked to enter a fileshortname, and from and to fieldnumbers of the source file.

 

    These field‑definitions will be copied into this file definition starting at the current field where the command where issued, any fields defined here will be overwritten.

 

    Use the INSert command first if you want to insert fields.

 

    You can copy fields from a file in a different system by giving the system number in front of the file shortname, e.g. 02LA.

 

14.12.9.      MAT Specifying MAT READ for field types.

 

   You will be asked to enter which fields, MAT READ should be used for, enter e.g. $4 if Mat Read should be used for alphanumeric and 4% fields.

 

    CR returns without change of this option, a space only will delete all previous set Mat Read options.

 

    Numeric variables will be numbered from Sx(0) instead of Sx(1) if mat read is active for variable type x.

 

14.12.11.      ACT Activate/deactivate file in reportgenerator.

 

   When a file is defined it will normally be possible to use the reportgenerator on this.

 

    If you want to keep the file definition on the system but ignore the file in DMS.RAPGEN, for example for late installation of a standard file, the ACT command can be used.

 

    You will be asked whether the file should be active or not (Y/N).

 

14.12.13.      PSW Set password for this file.

 

   You will be asked to enter a password for this file, space only will cancel any previous defined password.

 

    This password must be given whenever a user wants to define a new report on the file, the user can then protect the report itself with a password (username).

 

    Note that the password is NOT required in this file definition module, this program itself should be protected against unautorized use.                

 

14.12.15.      PRT Print complete file definition.

 

   The PRT command will give you a print of the complete file definition and any current record contents on the printer $LPT.


14.12.17.      INX Index/file connection definitions.

 

   This command will give you a new screen:

 

Figure 9  Index and file connection definitions.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

    INDEX NAME        FILE   DIR   KEY DEFINITION                              

  1 ARTIKELNUMMER    !      !01   !1                       !                   

  2 MATCHCODE+RECNO  !      !02   !4,N                     !                   

  3 LAWI             !L2    !     !                        !                   

  4 LSTAP            !L3    !     !                        !                   

  5 AB/F             !L4    !     !                        !                   

  6 FEROS            !L5    !     !                        !                   

  7 COSTING          !L6    !     !                        !                   

  8 LAGERORT         !L0    !01   !NP                      !                   

  9                  !      !     !                        !                   

 10                  !      !     !                        !                   

 11                  !      !     !                        !                   

 12                  !      !     !                        !                   

 13                  !      !     !                        !                   

 14                  !      !     !                        !                   

 15                  !      !     !                        !                   

 16                  !      !     !                        !                   

 17                  !      !     !                        !                   

 18                  !      !     !                        !                   

 19                  !      !     !                        !                   

                                                                               

 MESSAGE:00‑99/@/;/END/SPR/DEL/INS/                                             

 

 

 

where you can define all index/file connections.

 

    It is not necessary to make these definitions in order to allow the reportgenerator to run on the file, but it is recommended for documentation purpose and to make it easier for the user to handle the system.

 

    A report may run on any index of the file by specifying the start key, for example 2: will use Index 2.

 

    The index definition does not have to be present.

 

    Index/file connection definitions can always be added to an existing file without any consequenses.

 

14.12.18.1.    Functions in index/file connection definitions.

 

   Up to 99 definitions can be created, and you can use the commands 0,1‑99,@,; ,END,SPR,DEL and INS as in the field definitions.

 

14.12.18.3.    Index definitions.

 

   Enter the index name (17 chars descriptive text), leave the rest of the line blank. This text is used for display when a report is started.

 

    If you want to complete the definitions anyway: Leave the FILE column blank, specify directory no. (1‑15) and the key definition as described in the installation manual.

 

14.12.18.5.    File connection definition.

 

   Enter the index name as a text describing the connected file, place the file shortname in FILE (this identifys a connection definition), enter DIRectory number in the connected file to be used and a KEY DEFINITION specifying which fields in THIS file should be used to form the key (or first part of the key) to the connected file.

 

    If file connections are defined, the user may issue the command READ(xx) when defining a report on THIS file without any key specification.

 

    If the columns DIR and KEYDEF are left blank, the connection is treated as if to the same record of the same file. Thus logical parts of a large record may be defined as different logical files.


14.12.19.     Structure of the keyfield definitions.

 

   In the following the full syntax for this key definition will be explained.

 

14.12.20.1.

13.6.10.1.   Fields.

 

   Fields are written as fieldnumbers without leading #

 

           10       =  field number 10

           10(5,6)  =  character 5‑6 of field 10

           R        =  record number (exact)

           N        =  record number (relative to first data record)

           "XX"     =  text constants

 

14.12.20.3.

13.6.10.2.   Functions.

 

   Functions are written just after the field as a letter:

   

           D        =  Date turnaround (DDMMYY ==> YYMMDD as FND)

           P        =  Packing

           Z        =  Zero, suppression

           S        =  Space padding

 

14.12.20.5.

page \* arabic1613.6.10.3.   Combinations of fields and functions.

 

   Multiple fields are combined by separating these with comma.

 

    The P function may be used for each field or alone without a field number, in which case you will get packing of all characters previously defined.

 

    The function may only be used at the end or alone.

 

14.12.20.7.

13.6.10.4.   Examples of key structures.

 

        1. 1            Field 1.

        2. 1,2          Field 1 followed by field 2.

        3. 1,2,P        As above, the complete key packed.

        4. 1P,2         Field 1 packed followed by field 2 unpacked.

        5. 1(3,4),2     Characters 3 to 4 of field 1 followed by field 2.

        6. "01",1       The constant 01 followed by field 1.

        7. 1,S          Field 1 padded with spaces to even keylength.

        8. 2,NP,S       Field 2, relativ packed recordnumber, blanks.

 

 The two last key structures are used normally by DATAMASTER, the first for defining a unique key, the second for definition of a key with duplicates allowed.

 

14.12.21.

date \@ "MMMM d, yyyy"januar 10, 200813.6.11.     KEY Set fieldnumber for key not in record.

 

   You will be asked to give the fieldnumber, where the reportgenerator should store the value of the key when reading the file if this cannot be read from the record itself.

 

    This field should be defined as an alphanumeric workfield of appropriate length, e.g. field format 30W.

 

    The contents of this field will of course depend on which index the report is running on and will be packed if the key itself is packed.

 

    The field will be stored temporary during sorting of a file in the record of DMSORTWORK. Hence this file must be created with recordlength 16 words if reports on such files should be sorted. A warning of this is issued when the KEY command is issued.


14.12.23.     TXT maintenance of extended field descriptions.

 

Figure 10  Extended field description.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

    001 ARTIKELNUMMER                                                          

  1 MAIN KEY                                                                   

  2 THIS NUMBER IS USED TO IDENTIFY THE ARTICLE.                               

  3                                                                             

  4 LENGTH IS MAX.16 CHARACTERS, DEPENDING ON THE PARAMETER FILE.              

  5                                                                            

  6                                                                             

  7                                                                            

  8                                                                            

  9                                                                            

 10                                                                            

 11                                                                            

 12                                                                             

 13                                                                            

 14                                                                            

 15                                                                             

 16                                                                            

 17                                                                            

 18                                                                             

 19                                                                            

                                                                              

 MESSAGE:00‑99/000‑199/@/;/END/SPR/DEL/INS/                                     

 

 

            With the TXT command or if you have selected MODe 5 or 51, you will shift to a textpage where the extended field descriptions can be  entered.

 

    END or CR.only entered in the very first line will bring you back to the normal screen with the field definitions.

 

    You may use a number 0‑99 to choose a specific line as in the field definitions and the DEL/INS commands may be used to insert/delete a number of lines. A maximum of 99 lines can be entered per field.

 

    If you enter a 3‑digit number eg. 003 this field will be displayed and may be amended, you dont have to return to the field definition page to get to another field.

 

    The extended field description can be displayed with the HLP function in the report generator.

 

    Each field has two text‑pages connected, the second page is shown in mode 51 or when entering 100 + the fieldnumber.This second page will NOT be shown with the HLP command and is reserved for future use for special field calculation definitions / parameter definitions.

 

14.12.25.

13.6.13.     XFO File investigator.

 

   If you enter the command XFO in any field during the definition (or in the front page fileshortname or filename), you will enter the file investigator system.

 

    When you END from this system you return to the current field and may  continue the definitions.  With this function you can display any keys of this file or any other file on the system and eventually the record contents. 

 

Figure 11 The XFO file investigator.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

 FILESHORT:LO   FILENAME:9/LF‑06001abc     TEXT:LAGERORTDATEI                  

                DISCNAME:09/LF‑06001001    RECLEN    92 KEYS:6 BYTES           

     KEY                    UNPACKED                                           

 01: 123456  RECNO.  RELAT. 123456789.12                                       

  1 ""           56      0 ""                                                  

  2 "....."      75     19 "0000010002"                                        

  3 "....."      58      2 "0000020001"                                        

  4 "....."      61      5 "0000020002"                                        

  5 "....."      62      6 "0000020003"                                        

  6 "....."      63      7 "0000020004"                                        

  7 "....."      59      3 "0000030001"                                        

  8 "....."      64      8 "0000030002"                                        

  9 "....."      65      9 "0000030003"                                        

 10 "....."      66     10 "0000030004"                                        

 11 "....."      60      4 "0000040001"                                        

 12 "....."      67     11 "0000040002"                                        

 13 "....."      68     12 "0000040003"                                        

 14 "..!.."      69     13 "0000100001"                                        

 15 "..!.."      72     16 "0000100002"                                        

 16 "..!.."      73     17 "0000100003"                                        

 17 "..".."      70     14 "0000110001"                                        

 18 "..".."      77     21 "0000110002"                                        

 KEY:                                                                           

 MESSAGE:xx./nn:xxx/nnP:xxx/lu/filename/@/;/END/SPR/MOD/                       

            


   You will be asked to enter a KEY where you can perform the following function: 

 

14.12.26.1.   Displaying the file from the start.

 

   Just press CR. and the first page of keys will be displayed. The display contains the key value, the record number, the relative recordnumber and the unpacked key. If the key is not packed you can ignore this last field.

 

14.12.26.3.   Displaying next page.

 

   Enter CR. once more to display the next page.

 

14.12.26.5.   Selecting a key start value.

 

   Enter the key value from which the display should start. If the key is packed you must preceed this with P: e.g. P:1234.

 

14.12.26.7.   Selecting a specific index from the file.

 

   In you enter 2: index 2 will be selected.

 

    A key start value can be entered after this and if the key is packed you  should enter 2P:1234.

 

14.12.26.9.   Selecting a different file.

 

   Simply enter lu/filename e.g. 5/LF‑06000001 of the file you wants to  investigate. 

 

14.12.26.11.   Ending the file investigator.

 

   The commands @,;,SPR and END will all bring you back to the current field in ther file.

 

    If you enter a line number followed by point or comma, the record displayed on this line will be used for display of the field contents on the right side of the field definition screen.

 

14.12.26.13.   MOD selection of display mode.

 

   You may select different modes of displaying the file record contents by    entering the MOD command in the KEY field. 

            0 = Key only

            1 = Record displayed as text

            2 = Record displayed unpacked

            3 = Record displayed hexadecimal

            4 = All possible variable types

 

14.12.26.15.   Selecting display of specific part of record.

 

   In combination with the display mode you may enter the first and the last bytenumber of the record to be displayed.

 

   Mode 4,60,70 will display bytes 60 to 70 of the record, mode 4,60 will display from byteno.60.


 

Figure 12 XFO mode 2, record displayed unpacked.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03  

 FILESHORT:LO   FILENAME:9/LF‑06001abc     TEXT:LAGERORTDATEI                    

                DISCNAME:09/LF‑06001001    RECLEN    92 KEYS:6 BYTES             

     KEY                    UNPACKED                                             

 01: 123456  RECNO.  RELAT. 123456789.12                                         

  1:"....."      75     19 "0000010002"                                          

 0000: 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 

 ..3+.07 0000010002......74....7+..........71..........710.........73..........71

  2 . . .9.9.9.9.9.9.9.9.9.9.9.9...00..........71..........71..............71....

 ......719.9.9.9.9.9...‑1                                                        

  2 "....."      58      2 "0000020001"                                          

 0000: 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 

 ........0000020001......74....7+..................................7.0.........71

  2 . . 09.9.9.9.9.9.9.9.9.9.9.9.....5.64......77................................

 ........+7+.,5+4+3++....                                                        

  3 "....."      61      5 "0000020002"                                          

 0000: 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 

 ..2‑..4.0000020002......74....7+..........71..........714.........71..........71

  2 . . 09.9.9.9.9.9.9.9.9.9.9.9...0...........71..........71..............714...

 ......71+7+0,2++,4+,...0                                                        

  4 "....."      62      6 "0000020003"                                          

 0000: 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 

 ..2....60000020003......74....7+..........71..........710.........72..........7.

 DISPLAY MODE:                                                                    

 MESSAGE:0=KEY, 1=TEXT, 2=PACK, 3=HEX, 4=ALL TYPES, x,bbbb,bbbb = BYTENOS.       

                  

 

 

 

 

Figure 13 XFO mode 4, display all possible variable types.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

 FILESHORT:LU   FILENAME:9/LF‑06001abc      TEXT:LAGERORTDATEI                 

                DISCNAME:09/LF‑06001001     RECLEN    92 KEYS:6 BYTES          

     UNPACKED                     KEY                                          

 01: 123456789.12  RECNO.  RELAT. 123456                                       

  1 "0000010002"       75     19 "....."                                       

 BYTE HEX  $  PACK    1%         2%              3%                  4% BINARY 

 0000:004C  L ....                                                          76 

 0002:F188 q. .0.0                                                       61835 

 0004:1111 .. 0000  1111      ‑0.00                                       4369 

 0006:1211 .. 0101  1211                                                  4625 

 0008:1300 .  0202  1300                                     130000.00    4864 

 0010:0000    ....     0      ‑0.00                                          0 

 0012:8501 .. 7474  ‑501  850104.00                                      34049 

 0014:048C .. ....                                                        1164 

 0016:0000    ....     0       0.00            0.00               0.00       0 

 0018:0000    ....     0       0.00            0.00               0.00       0 

 0020:0082  . ....    82                                          0.08     130 

 0022:0000    ....     0       0.00            0.00               0.00       0 

 0024:0000    ....     0       0.00            0.00               0.00       0 

 0026:0082  . ....    82                                          0.82     130 

 0028:1000 .  0.0.  1000                      10.00                       4096 

 0030:0000    ....     0       0.00            0.00               0.00       0 

 KEY:                                                                          

 MESSAGE:                                                                      

 

 

 

 

14.12.27.     CHK Field input validations.

 

 

Figure 14 Allowed field values.

 

 FILE DEFINITION      RAPGEN FILE DEF       REPORT GENERATOR # 0 88.02.01/13:03

    008 KZ.ARTIKEL GESPERRT          MINIMUM    MAXIMUM    DISPLAY LENGTH:16   

  1 NORMAL                          !0         !0           !                  

  2 GESPERRT                        !1         !1           !                  

  3                                 !          !            !                  

  4                                 !          !            !                  

  5                                 !          !            !                  

  6                                 !          !            !                  

  7                                 !          !            !                  

  8                                 !          !            !                  

  9                                 !          !            !                  

 10                                 !          !            !                  

 11                                 !          !            !                  

 12                                 !          !            !                  

 13                                 !          !            !                  

 14                                 !          !            !                  

 15                                 !          !            !                  

 16                                 !          !            !                  

 17                                 !          !            !                   

 18                                 !          !            !                  

 19                                 !          !            !                  

                                                                                

 MESSAGE:00‑99/000‑099/@/;/END/SPR/DEL/INS/                                    

 


   This information is not used by the report generator at all at this moment and may be omitted.You may use it for documentation purposes since it will be printed together with the file descriptions.

 

    With the CHK command or if you have selected MODe 6 you will shift to a new page where the allowed field values can be entered.

 

    END or CR.only entered in the very first line will bring you back to the normal screen with the field definitions.

 

    You may use a number 0‑99 to choose a specific line as in the field definitions and the DEL/INS commands may be used to insert/delete a number of lines.A maximum of 99 lines can be entered.

 

    If you enter a 3‑digit number eg.003 this field will be displayed and may be amended, you dont have to return to the field definition page just to get to another field.

 

14.13.        Precautions when amending file definition.

 

   You should note the following before definining/redefining your files:

 

14.14.1.      Field sign.

 

   Remember to specify possible negative fields with sign, eg. ‑8,2 or,8,2, to avoid misleading reports.

 

14.14.3.      Adding fields to a file.

 

   If you add fields to a file the 20 free fields defined by the  reportgenerator will change fieldnumbers. Defined reports using free fields must be redefined.

 

    You can create a new file‑shortname with a copy of the old definition instead and add fields to this.

 

14.14.5.      Changing fields in a file.

 

   If new readstatements are generated due to amendments of fields types/byte displacements these will need to be loaded into all new generated report programs.

 

    Existing reports must be amended before the new read statements are loaded.

 

14.14.7.      Reports with multiple file use.

 

   If a report reads a file using READ(xx) the readstatements are loaded during the calculation definition and not in the generation. These reports have to pass through the calculation module again before the amendment is in effect.

 

14.14.9.      Changing field types.

 

   If the number of 4% variables is changed, the free fields will move down in defined reports.

 

    If free fields are defined as alphanumeric changing of the number of $ characters will also cause these to move down.

 

14.14.11.      Write statements.

 

   Write statements cannot be generated with this module and will not be changed if you amend the file definitions!

 

14.14.13.      DATAMASTER files.

 

   Will of course not be reorganized if you use this program to change the field definitions. 


14.           Subfunctions.

 

   Subfunctions are a combination of the BASIC GOSUB subroutine call and the more easy to use FND function definition.

 

    A BASIC FND function is very restricted as it must be expressed in one statement in the program, it is only able to take one numeric parameter as well as only one numeric value can be returned.

 

    A subfunction can have as many arguments as needed and may return either a numeric or an alphanumeric value. Also the passed parameters may be modifyed by the subfunction, it is many return values may be given.

 

    The subfunction are invoked in the DMS.RAPGEN calculations or selections by a statement like:

 

               #47 = WORKD(#3,#4)

 

 The subfunction WORKD calculates the number of days between the two dates in field 3 and field 4 and returns this value to field 47.

 

    Introduction of the subfunction is done to make it easyer for the user of DMS.RAPGEN to use complex functions as well for the programmer to develop subroutines to suit special purposes in a given installation. 

 

15.1.        Subfunctions and the LOAD command.

 

   The subfunction call  #47 = WORKD(#3,#4)

 

 could be performed on former releases of DMS.RAPGEN by the more BASIC‑like calculations:

 

                LOAD WORKD

                T3=#3

                T3(1)=#4

                GOSUB 4220

                #47=T3

 

 which gives exactly the same result but is of cause much more complex to handle for the average user of DMS.RAPGEN. Some subroutines will even require an initialize GOSUB to be placed in the FIRST calculations to set up parameters.

 

    DMS.RAPGEN will translate the subfunction code to several basic statements containing the nessesary parameter settings, routine calls and return value placement. 

 

15.2.1.      Loading of a subfunction.

 

   DMS.RAPGEN will now scan all calculation lines for command words which are unknown to the normal BASIC statement.

 

    A subfunction call is recognized if any combination of 4 letters (A‑Z only, not digits) succeded by a bracket if found in the translated BASIC statement, and this is not one of the report generator special functions like READ, START etc.

 

    If a subfunction like WORKD ( is found, DMS.RAPGEN will test if the textfile:

 

              x/RAPX.WORKD

 

 is present on the system. x is the lu of the DMS.RAPGEN programs.

 

    If this textfile is present the subfunction will be loaded into the calculations from this, otherwise DMS.RAPGEN will look for the textfile:

 

              x/DMS.RAPX.WORKD

 

 and load the subfunction from here.

 

    The error message NO SUCH SUBFUNCTION will be given if neither of those textfiles are found, the command word will not be translated in this case and may cause basic error if you try to start the report. 

 

15.2.3.      The subfunction textfiles.

 

   The subfunctions placed in DMS.RAPX.xxxxx is the standard subfunction for the report generator.

 

    These may be modifyed or new may be written to solve special requirements and placed in textfiles with the name RAPX.xxxxxxxxx.

 

    Such textfiles will never be distributed from us, it is new releases of DMS.RAPGEN will not overwrite individually customized subfunctions.

 

    The user function RAPXxxxxx has priority over the standard DMS.RAPGEN function DMS.RAPX.xxxxx it is the user function is loaded if this is present and the standard function will be ignored.

 

    Due to the restriction of a file name to 14 characters a user subfunction may be 4‑9 characters, a standard subfunction 4 or 5 characters only. As mentioned letters only (A‑Z) can be used in subfunction names.

 

    A longer subfunction name may be given by the user (eg. NUMBER(...)), this will be shortened to the maximum length, it is NUMBE for the standard subfunction DMS.RAPX.NUMBE

 

15.2.5.      Structure of the subfunction textfile.

 

   This textfile of cause contains the basic subroutine itself. The subroutine must be written as quite normal basic program and must be placed within the line numbers 1000 to 9999.

 

    The statements 100‑999 in this textfile contains REMarks which are used to control the generation of the subfunction in the output report program.

 

    The former used LOAD routines for DMS.RAPGEN may easyly be modifyed to subfunctions just by adding these control REMarks to the present textfile. Of cause the LOAD command can still be used in the calculations.

 

    The line number of the control REMarks (100‑999) determines the parameter type for the translation:

 

             1‑98          Remarks for documentation

             100           Return value

             101‑149       Parameter definitions

             150‑199       Freefield definition

             200           Initial entry point (DIM)

             201‑299       Entry points

             300‑399       Basic variable requirements

             400‑499       Special generator requirements

             500‑999       Reserved for future extension

 

 The control REMark may contain any documentation text succeded by a colon and then the parameter, eg.:

 

             100 REM RETURNS A GOOD VALUE: T3

 

15.2.7.      A subfunction example.

 

   To modify the former LOAD routine for the word‑days calculations only a few control REMarks should be added to tell the report generator which parameters are used and which variable holds the result by the return.

 

    The WORKD routine (or formar ARB) takes from and to date in T3 and T3(1) and returns the number of days in T3.

 

    You could modify the routine by:

 

             LOAD   DMS.RAPS.WORKD

             100      REM RETURNS DAYS: T3

             101      REM PARAMETER FROM DATE (DDMMAA): T3

             102      REM PARAMETER TO   DATE (DDMMAA): T3(1)

             DUMP   DMS.RAPX.WORKD

 

 

 The calculation statement

     

             #47 = WORKD (#3,#4)

 

 will now be translated by DMS.RAPGEN to:

 

             5201 GOSUB  xxxxx

             5202 S3(15)=T3

 

             xxxxx  T3=S2(1)

                    T3(1)=S2(2)

                    GOSUB  yyyyy

 

             yyyyy  The WORKD subroutine itself (renumbered)

 

 The calculation subfunctions will be located in the statements:

             803         gosub 13000 (before users FIRST calculations)

             13000‑13999 Initialize parameter settings / gosub

             14000‑14999 Parameter settings / gosub

             15000‑19999 Subfunction code

 

15.3.        Subfunctions in complex calculation:

 

   The user can place subfunctions in the calculation statements just like other basic functions, eg:

 

             #47 = WORKD (#3,#4)

             IF     WORKD (#3,#4)>3 LET #48=1

             IF     WORKD (#3,#4)+#15<100 READ (KU),#1

             #49 = WORKD (#3,#4) % WORKD(310388,#4)

             #50 = CHEX (#1,"1,2,3,7,4")

             #51 = FUNC (1,FUNCA(2),FUNCB(3,4))

 

15.4.1.      Subfunctions as subroutines.

 

   All subfunctions will return a value and the user may use this or not as desired.

 

    If only the subfunction call is present in a statement or if a subfunction call is preceded by the BASIC keyword GOSUB the subfunction will act as an normal subroutine call:

 

             FUNC (#1,2)

             IF WORKD (#3,#4)>100 GOSUB FUNC (#1,#2)

             ON #47 GOSUB FUNCA(1), FUNCB(2), FUNCC(3)

 

15.4.3.      Subfunctions in selections.

 

   As all the selections parameters

 

             FIELDNO:

             MINIMUM:

             MAXIMUM:

 

 may be given as calculations subfunctions may be used here just as in the calculations.

 

    NOTE: The internal line length in selections is 50 characters only. If you need long subfunctions (eg.FIND("PETER",#2,#3,...) you will have to select on a free field which you have calculated as #47=FIND(...)

 

    Subfunctions using files cannot be used in selections directly, as the file handling and definitions only is included in the calculation module.


    The selection subfunctions will be located in the statements:

 

             802         gosub 10000 (before users FIRST calculations)

             10000‑10999 Initialize parameter settings / gosub

             11000‑11999 Parameter settings / gosub

             12000‑12999 Subfunction code

 If a subfunction is used both in calculations and selections the code for this will be loaded twice as the is a complete separation between the generated code from selections and calculations. 

 

15.4.5.      Subfunction parameters.

 

   The parameters for a subfunction may be any field from any file, numeric constants or alphanumeric constants enclosed in quotes or BASIC variables.

 

    The parameters must be seperated by comma.

 

    The user can specify any number of parameters in a subfunction call, there is no check if the number of parameters is less than or exeeds the number of parameters defined in the routine itself.

 

    However, the programmer can in the subfunction test on the number of parameters, be given the variable T. Any omitted parameters will be set to zero or delimiter before the call.

 

    If the subfunction FUNC requires 3 parameters the following calls are valid: 

 

            FUNC (1,2,3)                 (T=3)

            FUNC ()                      (T=0)

            FUNC (1,2)                   (T=2)

            FUNC (1,2,3,4,5)             (T=3)

            FUNC (,,3)                   (T=3)

            FUNC (,2)                    (T=2)

NOTE: The last parameter for a subfunction may be given as a concatenation of strings.

      This is used for example in the FIND subfunction, which searchs for the first string parameter in the combinations on the following string fields:

 

             FIND ("PETER",#2,#3,#4,#5,#6)

 

15.4.7.      Evaluation order.

 

   DMS.RAPGEN will execute lines with multiple subfunction calls from right to left, it is:

 

            #47 = LAST(SECOND(FIRST(1)))

 

 will evaluate correctly.

 

    However you should take care if you write subfunctions which are dependent of each others execution, as the statement

 

             #47 = LAST(1)+FIRST(1)

 

 will NOT execute correctly if FIRST is dependent of the result from LAST.

 

    Also the subfunction call

 

             IF LAST(1)>100 LET #47 = FIRST(2)

 

 should be noted as FIRST, and is always executed, the IF is used only for the LET statement. In case of a GOSUB call the priority will be as expected:

 

             IF FIRST(1)>100 GOSUB LAST(2)

 

 and the routine executed only if the condition is true.

 

15.4.9.      Restrictions.

 

   Subfunctions can not be called after one of the report generator commands are reorganized in a statement, it is 

 

             IF FUNC(1) READ(KU)     is valid, but

             READ(KU), FUNC(2)       is NOT allowed

 

 NOTE: Multiple calls of the subfunctions on the same calculation line not give the correct result if the return variables for these  subfunctions are not separated.

 

15.5.        Subfunctions and the HLP command

 

   The user can get a list of all avaiable subfunction by the normal HLP function in DMS.RAPGEN and even a detailed description of each of these.

 

    When you install DMS.RAPGEN or if you amend in the subfunctions you should run the program DMS.RAPX.HLP to activate this help function. This program may be placed in the selector by 00/DMS.R,85ss00.

 

    A dummy file defilnition 00 will be created by this program, all subfunctions present on the disc will be scanned and the documentation textes from these in REMarks statement 1‑199 will be placed as extended field documentation for the fields.

 

    The subfunctions are sorted and numbered from 1.. as fields in this dummy  file.By asking for HLP on file 00 a complete list of the subfunctions will be given, by HLP on a specific field in this file, eg. 0005, a detailed  explanation of this subfunction will be shown.

 

 

Figure 15 HLP on file 00 shows list of subfunctions

 
 

 DMS.RAPGEN   23 CURRENCY                    4.....DEFINE CALCULATIONS           

  1 CHECK ("12345")       19 STARN ()                                            

  2 CHEX  ("1234","070201 20 STARP (FROM,TO)                                     

  3 DATED (FROM,TO,360)   21 STARS (A,B,C,D,E,F)                                  

  4 DAYADD(DATE,DAYS,0)   22 UNPACK(#15)                                         

  5 EDIT  (1234,"&&‑&&")  23 VALCH (#7,"AA,BB..")                                

  6 FIND  ("XX",#1,#2,#3) 24 VALID (#7,#DA1)                                      

  7 FN                    25 VALIX (#7,#DA1)                                     

  8 INDEX (1,"1234","5678 26 WEEK  (DATE OR WEEK)                                

  9 LTOT  (1)             27 WORKD (#DD,#PD)                                      

 10 MESS  ("TEXT",0)      28 ZERO  (FROM,TO)                                     

 11 NAME  (#2,#47,#48,#49                                                        

 12 NUMBER("01)248340")                                                           

 13 NUMS  ("1234")                                                               

 14 PACK  ("&&&&",1234)                                                          

 15 PRIO  (1)                                                                     

 16 SPOFF (" 12 ")                                                               

 17 STARD (FROM,TO)                                                              

 18 STARF (A,B,C,D,E,F)                                                          

                                                                                  

                                                                                 

 CALCULATIONS ARE TYPED AS eg: #60=#21+#22 , PERCENT AS  eg. #61=#62%#63         

 #DD=DATE, #PD=AS OF DATE, #D1=DATA, #DA1=ALPHA.DATA , WHEN=WHEN TO CALCULATE    

 CALCULATION:HLP                                                                 

 MESSAGE  :     00  SUBFUNCTIONS               ENTER FILESHORTNAME OR CR:        

 

 

 

 


 

 

Figure 16 HLP on 0005 gives details.

 

 

 DMS.RAPGEN   23 CURRENCY                    4.....DEFINE CALCULATIONS           

  5 EDIT  (1234,"&&‑&&")                                                         

    THE EDIT FUNCTION CAN BE USED FOR EDITING CUSTOMER NUMBERS,                  

    INVOICE NUMBERS ETC.                                                         

    EXAMPLE: EDIT(12345,"&##&&&‑AX##/&") RETURNS "0  012‑AX34/5"                 

             EDIT(15)                    RETURNS "15"                            

             EDIT("123","&&&‑&&&")       RETURNS "000‑123"                       

         RETURNS EDITED STRING                                                   

       1:PARAMETER 1, NUMERIC VALUE                                              

       2:OPTIONAL PARAMETER 2, EDIT FORMAT                                       

  6 FIND  ("XX",#1,#2,#3)                                                        

    THIS ROUTINE SEARCHES FOR A ALPHA STRING IN A NUMBER OF FIELDS               

    EXAMPLE:FIND("BATMAN",#2,#3,#4) WILL SEARCH THE ALPHANUMERIC FIELDS          

                                    2,3,4 FOR THE OCCURENCE OF BATMAN            

                                    RETURNS 0:NOT FOUND, x:FOUND POSITION        

            SELECTION ON FIND(#DA1,#2,#3,#4) MAY BE DONE,                        

            BUT REMEMBER THE LIMITED SELECTION LINE LENGTH.                      

            A CALCULATION LIKE FREE FIELD #47=FIND(#DA1,#2,#3,#4)                

            AND THEN A SELECTION ON       #47  MINIMUM:1                         

                                                                                 

                                                                                 

 CALCULATIONS ARE TYPED AS eg: #60=#21+#22 , PERCENT AS  eg. #61=#62%#63         

 #DD=DATE, #PD=AS OF DATE, #D1=DATA, #DA1=ALPHA.DATA , WHEN=WHEN TO CALCULATE    

 CALCULATION:HLP                                                                 

 MESSAGE  :     00  SUBFUNCTIONS               ENTER FILESHORTNAME OR CR:        

 

 

 

 

 

 

15.6.1.      Printing the subfunction help.

 

   By the file definition module for DMS.RAPGEN (DMS.RAP.DRN) you can obtain a printout of all subfuctions whith the PRT command on this dummyfile 00, as this works just like any normal file with extended descriptions.

 

15.6.3.      List of implemented subfunctions.

 

   The current list of subfunctions printed as descriped above looks like:

 

Figure 17 Print of the fields in file 00

 

 NO.NAME                       FORMAT              BYTE;VARIABLE       T         

  1 CHECK ("12345")            1                      0;S$(1,1)        $         

  2 CHEX  ("1234","07020105")  1                      1;S$(2,2)        $         

  3 DATED (FROM,TO,360)        1                      2;S$(3,3)        $         

  4 DAYADD(DATE,DAYS,0)        1                      3;S$(4,4)        $         

  5 EDIT  (1234,"&&‑&&")       1                      4;S$(5,5)        $         

  6 FIND  ("XX",#1,#2,#3)      1                      5;S$(6,6)        $         

  7 FN                         1                      6;S$(7,7)        $         

  8 INDEX (1,"1234","5678")    1                      7;S$(8,8)        $         

  9 LTOT  (1)                  1                      8;S$(9,9)        $         

 10 MESS  ("TEXT",0)           1                      9;S$(10,10)      $         

 11 NAME  (#2,#47,#48,#49)     1                     10;S$(11,11)      $         

 12 NUMBER("01)248340")        1                     11;S$(12,12)      $         

 13 NUMS  ("1234")             1                     12;S$(13,13)      $         

 14 PACK  ("&&&&",1234)        1                     13;S$(14,14)      $         

 15 PRIO  (1)                  1                     14;S$(15,15)      $         

 16 SPOFF (" 12 ")             1                     15;S$(16,16)      $         

 17 STARD (FROM,TO)            1                     16;S$(17,17)      $         

 18 STARF (A,B,C,D,E,F)        1                     17;S$(18,18)      $         

 19 STARN ()                   1                     18;S$(19,19)      $         

 20 STARP (FROM,TO)            1                     19;S$(20,20)      $         

 21 STARS (A,B,C,D,E,F)        1                     20;S$(21,21)      $         

 22 UNPACK(#15)                1                     21;S$(22,22)      $         

 23 VALCH (#7,"AA,BB..")       1                     22;S$(23,23)      $         

 24 VALID (#7,#DA1)            1                     23;S$(24,24)      $         

 25 VALIX (#7,#DA1)            1                     24;S$(25,25)      $         

 26 WEEK  (DATE OR WEEK)       1                     25;S$(26,26)      $         

 27 WORKD (#DD,#PD)            1                     26;S$(27,27)      $         

 28 ZERO  (FROM,TO)            1                     27;S$(28,28)      $         

 

 

 


15.6.5.      Detailed description of the subfunctions

 

   Following this print comes the detailed description of all functions.

 

   1 CHECK ("12345")

     CALCULATION OF OCR‑CHECKDIGIT MODULUS 10

     THIS ROUTINE CALCULATES THE NORMAL (DANISH) POSTGIRO CHECKDIGIT

     MODULUS 10 WITH THE WEIGTHES 212121...

     EXAMPLE: #47=CHECK(#1)

          RETURNS FIELD WITH CHECKDIGIT

        1:PARAMETER ALFHA FIELD

 

   2 CHEX  ("1234","07020105")

     CALCULATION OF OCR‑CHECKDIGIT MODULUS 11

     THIS ROUTINE MAY BE USED FOR BANKS OR PERSON NUMBER CHECK DIGITS

     EXAMPLE:#17=CHEX("123456","01020304")

          RETURNS FIELD WITH CHECK DIGIT

        1:PARAMETER ALPHA FIELD TO CALCULATE ON

        2:WEIGHTES "xxyy.." 2 CHARS.PR DIGIT

 

   3 DATED (FROM,TO,360)

     CALCULATION OF DAYS BETWEEN TWO DATES

     EXAMPLE: #47=DATED(#15,#PD) GIVES DAYS IN 365/366 MODE

              #47=DATED(#15,#PD,360) GIVES DAYS IN 360 MODE

          RETURNS      NUMBER OF DAYS

        1:PARAMETERS,  FROM DATE (DDMMYY OR YYMMDD)

        2:             TO   DATE (DDMMYY OR YYMMDD)

        3:OPTIONAL MODE 365 OR 360

 

   4 DAYADD(DATE,DAYS,0)

     ADD NUMBER OF DAYS TO A DATE

     EXAMPLE: #47=DAYADD(#15,10) ADDS 10 DAYS TO FIELD 15 (365/366 MODE)

              #47=DAYADD(#15,10,1) ADDS 10 DAYS TO FIELD 15 (360 MODE)

              #47=DAYADD(#15,10,2) ADDS 10 DAYS FROM CURRENT MONTH

          RETURNS CALCULATED DATE DDMMYY

        1:PARAMETER 1, DATE (DDMMYY OR YYMMDD)

        2:PARAMETER 2, NO OF DAYS TO BE ADDED

        3:OPTIONAL MODE 0=365, 1=360, 2=FROM CURRENT MONTH

 

   5 EDIT  (1234,"&&‑&&")

     THE EDIT FUNCTION CAN BE USED FOR EDITING CUSTOMER NUMBERS,

     INVOICE NUMBERS ETC.

     EXAMPLE: EDIT(12345,"&##&&&‑AX##/&") RETURNS "0  012‑AX34/5"

              EDIT(15)                    RETURNS "15"

              EDIT("123","&&&‑&&&")       RETURNS "000‑123"

          RETURNS EDITED STRING

        1:PARAMETER 1, NUMERIC VALUE

        2:OPTIONAL PARAMETER 2, EDIT FORMAT

 

   6 FIND  ("XX",#1,#2,#3)

     THIS ROUTINE SEARCHES FOR A ALPHA STRING IN A NUMBER OF FIELDS

     EXAMPLE:FIND("BATMAN",#2,#3,#4) WILL SEARCH THE ALPHANUMERIC FIELDS

                                     2,3,4 FOR THE OCCURENCE OF BATMAN

                                     RETURNS 0:NOT FOUND, x:FOUND POSITION

             SELECTION ON FIND(#DA1,#2,#3,#4) MAY BE DONE,

             BUT REMEMBER THE LIMITED SELECTION LINE LENGTH.

             A CALCULATION LIKE FREE FIELD #47=FIND(#DA1,#2,#3,#4)

             AND THEN A SELECTION ON       #47  MINIMUM:1

             WILL BE ABLE TO HANDLE MORE FIELDS

          RETURNS POSITION IN STRING

        1:PARAMETER 1, SEARCH FOR STRING

        2:PARAMETER 2, SEARCH IN STRING

 

   7 FN

     THIS SUBFUNCTION IS INCLUDED ONLY FOR DOCUMENTATION OF THE

     FN‑FUNCTIONS WHICH CAN BE USED IN THE REPORTS.

 

     DATE FUNCTIONS

     FNA (DDMMYY)   = DAY NUMBER FROM YEAR 1900 (DATE DIFFERENCES)

     FNB (DAYS)     = DATE FROM A FNA DAY NUMBER (ADD DAYS TO DATE)

     FND (DDMMYY)   = YYMMDD,    FND(YYMMDD)=DDMMYY

     FNE (DDMMYY)   = 12*YY + MM , MAY BE USED FOR MONTH CALCULATIONS

     FNF (DDMMYY)   = DAY NUMBER FROM YEAR 1900 AS FNA, 360 DAYS/MONTH

     FNO (DDMMYY)   = YYMMDD,   FNO(YYMMDD) = YYMMDD,   FIX UNKNOWN DATE

     FNP (DDMMYY)   = DDMMYY,   FNP(YYMMDD) = DDMMYY,   FIX UNKNOWN DATE

     FNU (DDMMYY)   = WEEKDAY, 0=SATURDAY, 6=FRIDAY

     FNV (DDMMYY)   = YYWW, WEEKNUMBER (NOTE:YEAR START = WEEK NO.01)

 

     ROUNDING FUNCTIONS

     FNR (12.567)   = 12.57 ROUNDING FUNCTION

     FNH (12,567)   = 13    ROUNDING FUNCTION

 

 

   8 INDEX (1,"1234","5678")

     FIX INDEXNUMBER (AND START/STOP) OF MAIN FILE

     EXAMPLE: INDEX(3) ==> MAIN FILE INDEX 3 IS USED

     EXAMPLE: INDEX(3,"1234","5678") ==> INDEX 1, START/STOP FIXED

 

        1:INDEXNUMMER

        2:START KEY   (OPTIONAL)

        3:END   KEY   (OPTIONAL)

 

   9 LTOT  (1)

     THIS ROUTINE MAY BE USED TO FIX LOWEST TOTAL LEVEL ON A REPORT

     THE LTOT SUBFUNCTION OVERWRITES THE USER INPUT BY START

     EXAMPLE:LTOT(1) DO NOT PRINT ALL SPECIFICATION LINES

             LTOT(‑1) WILL RETURN THE CURRENT LOWEST TOTAL LEVEL NO.

             LTOT(9) WILL SUPRESS ALL PRINTING

          RETURNS LOWEST TOTAL LEVEL NUMBER

        1:PARAMETER 1, NEW LOWEST TOTAL LEVEL NO.

 

  10 MESS  ("TEXT",0)

     WITH THIS ROUTINE YOU CAN GIVE A MESSAGE TO THE USER, WHO HAS STARTED

     THE REPORT

     EXAMPLE:MESS("SORTING FINISHED ‑ PRINT STARTED.")

             MESS("INVALID START‑DATE, PROGRAM STOPPED.",1)

     THE MESSAGE WILL BE RECORDED IN THE SYSTEM LOGBOOK

        1:PARAMETER 1, MESSAGE TEXT

        2:PARAMETER 2, 1==>ABORT PROGRAM

 

  11 NAME  (#2,#47,#48,#49)

     ISOLATE CHRISTIAN AND LAST NAME FROM A NAME FIELD

     NOTE:THIS ROUTINE SHOULD BE MODIFYED FOR THE SPECIFIC LANGUAGE

          RETURNS   LAST NAME,CHRISTIAN NAME

        1:PARAMETERS                    NAME

        2:MAY ALSO RETURN CHRISTIAN,LASTNAME

        3:                CHRISTIAN NAME

        4:                LAST NAME

 

  12 NUMBER("01)248340")

     THE NUMBER ROUTINE MAY BE USED TO CONVERT PHONENUMBERS OR

     OTHER DIRTY ALPHABETIC NUMBERS TO NUMERIC

     EXAMPLE:NUMBER("01)248340") RETURNS 01248340

             #25=EDIT(NUMBER(#8),"&&)&&&&&&") COULD BE USED FOR CREATING

                                              A NEW PHONENUMBER STANDARD

             NUMBER("31/03‑89") RETURNS 310389

          RETURNS NUMERIC NUMBER

        1:PARAMETER 1, ALPHANUMERIC VALUE

 

  13 NUMS  ("1234")

     THIS ROUTINE MAY BE USED FOR EASY CALCULATIONS ON ALPHA FIELDS

     WHICH UNTIL NOW SHOULD BE SPLITTED INTO SEVERAL STATEMENTS.

     EXAMPLE:NUMS("1234") RETURNS 1234

             #47=#15+NUMS(#16)*10 FOR USE OF ALPHA FIELDS IN CALCULATIONS

     THE NUMS(X) ROUTINE MAY BE USED SEVERAL TIMES IN ONE STATEMENT.

          RETURNS NUMERIC NUMBER

        1:PARAMETER 1, ALPHANUMERIC VALUE

 

  14 PACK  ("&&&&",1234)

     THIS ROUTINE MAY BE USED BY COMPLEX KEY CONSTRUCTIONS

     THE STATUS CODE #OK (R4) MAY BE REQUESTED FOR OPERATION OK.

     EXAMPLE:PACK("&&&&&&",1234) RETURNS THE PACKED STRING OF THIS VALUE

             R$=PACK(R$)    ALPHANUMERIC PACKING IF ONE PARAMETER ONLY

     THE PACK SUBFUNCTION MAY BE USED MULTIPLE TIMES IN A STATEMENT

          RETURNS PACKED VALUE

        1:PARAMETER 2, USING FORMAT/STRING TO PACK

        2:OPTIONAL PARAMETER 2, NUMERIC VALUE

 

  15 PRIO  (1)

     FOR HEAVY REPORTS YOU MAY SET THE PRIORITY OF THE PORT LOW, SO

     THE PRINTING WILL NOT SLOW DOWN OTHER USERS.

     EXAMPLE:PRIO(1) SETS LOWEST PRIORITY

             PRIO(8) SETS HIGHEST PRIORITY

        1:PARAMETER 1, PRIORITY (1‑8)

 

  16 SPOFF (" 12 ")

     SPOFF REMOVES ALL LEADING AND TRAILING SPACES FROM A FIELD

     EXAMPLE:SELECTION ON SPOFF(#8)="A" WORKS EVEN IF #8 CONTAINS SPACES

          RETURNS FIELD WITHOUT SPACES

        1:PARAMETER FIELD WITH LEADING/TRAILING SPACES

 

  17 STARD (FROM,TO)

     DANISH STAR SYSTEM ACCOUNTING REPORTS

     THIS SUBFUNCTION MAY BE USED IN CONNECTION WITH THE STARF

     SUBFUNCTION TO GET THE CURRENT PERIOD

        RETURNS START DATE OF THE YEAR (YYMMDD)

        1.PARAMETER RETURNS START MONTH OF THE PERIOD

        2.PARAMETER RETURNS END   MONTH OF THE PERIOD

     ROUTINE IS LOCATED IN:DMS.RAPX.STARF

 

  18 STARF (A,B,C,D,E,F)

     DANISH STAR SYSTEM ACCOUNTING REPORTS

     THIS SUBFUNCTION MAKES IT EASYER TO MAKE ACCOUNTING REPORTS

     ON STAR SYSTEMS BY COLLECTING FIGURES BASED ON THE YEAR START DATE

     FROM THE GENERAL LEDGER AND THE BUDGET FILES

 

     STARF(PER.BAL, YTD.BAL, PER.LASTYEAR, YTD LY, PER.BUDGET, YTD.BUDGET)

     WILL DEFINE A FREE INPUT DATE FIELD (#Dx) AS PERIOD START

     READ THE ACCOUNTING START OF YEAR FROM THE COMPANY FILE

     AND CALCULATE THE FIGURES FOR THE GIVEN ACCOUNT IN THE PERIOD/YEAR

     IF THE BUDGET PARAMETERS ARE OMITTED, THE BUDGET FILE WILL NOT

     BE READ.

 

          RETURNS NOTHING

        1:RETURNS BALANCE PERIOD

        2:RETURNS BALANCE YEAR TO DATE

        3:RETURNS LAST YEAR PERIOD

        4:RETURNS LAST YEAR YEAR TO DATE

        5:RETURNS BUDGET PERIOD (IF REQUIRED)

        6:RETURNS BUDGET YTD    (IF REQUIRED)

        7:#D PERIODENS START ,6,

 

  19 STARN ()

     DANISH STAR SYSTEM ACCOUNTING REPORTS

     THIS SUBFUNCTION IS FOR USE IN ACCOUNTING REPORTS ONLY

     AND CAN BE USED TO CALCULATE INDEX FIGURES IN A BALANCE SHEET

     THE ROUTINE MAY BE EXTENDED FOR SPECIAL PURPOSES.

 

     WHEN AN ACCOUNT LINE IS DEFINED AS:

          5:1234:*1111:111‑222

     THE ACCOUNTING SYSTEM WILL COLLECT THE FIGURES FROM THE ACCOUNT

     RANGES GIVEN BETWEEN THE COLON MARKS.

 

     THIS SUBFUNCTION WILL THE BE CALLED PASSING THESE VALUES (IN Y8 ARRAY)

     AND WITH THE FUNCTION CODE 5 (THE FIRST SPECIFICATION ON THE LINE)

 

     THE ROUTINE MAY NOW DO ANY CALCULATION ON THESE FIGURES AND

     SHOULD RETURN THE RESULT (IN THE Y4 ARRAY)

 

     THE SUBFUNCTION CALL IS JUST DUMMY TO LOAD THE FUNCTIONS,

     THE ROUTINE HAS NO PARAMETERS AND NOTHING TO RETURN.

 

  20 STARP (FROM,TO)

     DANISH STAR SYSTEM ACCOUNTING REPORTS

     THIS SUBFUNCTION MAY BE USED IN CONNECTION WITH THE STARF

     SUBFUNCTION TO SET THE CURRENT PERIOD

        RETURNS START DATE OF THE YEAR (YYMMDD)

        1.PARAMETER, START DATE, RETURNS START MONTH OF THE PERIOD

        2.PARAMETER, END   DATE, RETURNS END   MONTH OF THE PERIOD

     ROUTINE IS LOCATED IN:DMS.RAPX.STARF

 

  21 STARS (A,B,C,D,E,F)

     DANISH STAR SYSTEM ACCOUNTING REPORTS

     THIS SUBFUNCTION MAY BE USED IN CONNECTION WITH THE STARF

     SUBFUNCTION TO MOVE PERIOD FIGURES IN THE FIELDS

 

     THE PARAMETERS ARE AS FOR STARF (A,B,C,D,E,F) AND THE ROUTINE

     WILL COLLECT THE TOTALS FOR THE PERIOD/YTD AS STARF

        2.PARAMETER, END   DATE, RETURNS END   MONTH OF THE PERIOD

 

     PERIOD 1 IN THE GENERAL LEDGER FILE (FI) AND BUDGET FILE (BU)

     WILL BE AJUSTED TO BE MONTH ONE IN THE GIVEN PERIOD

     THE START BALANCE IN FI WILL BE UPDATED ACCORDING TO THIS

 

     THE REPORT CAN NOW CALCULATED ON FIXED FIELDS FOR THE PERIOD.

     ROUTINE IS LOCATED IN:DMS.RAPX.STARF

 

  22 UNPACK(#15)

     THIS ROUTINE MAY BE USED FOR KEY UNPACKING AND TO SOLVE OTHER

     SPECIAL PROBLEMS.

     EXAMPLE:UNPACK(#15) RETURNS THE UNPACKED VALUE OF THE PACKED FIELD

          RETURNS NUMERIC NUMBER

        1:PARAMETER 1, PACKED VALUE

 

  23 VALCH (#7,"AA,BB..")

     THIS ROUTINE SEARCHES THE 1.STRING FOR OCCURENCE IN THE 2.STRING

     THE VALUES IN THE SECOND STRING MUST BE SEPERATED BY COMMA

     LEADING AND TRAILING SPACES IN THE FIRST STRING ARE IGNORED.

     EXAMPLE: VALCH(#7,"AA,BB,CC")

              RETURNS 0 IF #7 IS ONE OF THE GIVEN VALUES, 1 ELSE.

              VALCH(#7,"‑AA,BB,CC") RETURNS 0 IF #7 IS NOT VALID

              VALCH(#7,#DA1) MAY BE USED IN SELECTIONS (OR SELECTION ON INP

          RETURNS  (0=OK, 1=NOTOK)

        1:VALUE TO BE CHECKED

        2:ALLOWED VALUES

 

  24 VALID (#7,#DA1)

     THIS ROUTINE SEARCHES THE VALUES OR RANGES OF VALUES GIVED AS

     THE 2.PARAMETER FOR THE OCCURENCE OF THE 1.PARAMETER

     EXAMPLE: VALID(#7,"1,3,5,10‑15")

              RETURNS 0 IF #7 IS ONE OF THE GIVEN VALUES, 1 ELSE.

              VALID(#7,"‑1,3,5,10‑15") RETURNS 0 IF #7 IS NOT VALID

              VALID(#7,#DA1) MAY BE USED IN SELECTIONS (OR SELECTION ON INP

          RETURNS  (0=OK, 1=NOTOK)

        1:VALUE TO BE CHECKED

        2:ALLOWED VALUES

 

  25 VALIX (#7,#DA1)

     THIS ROUTINE SEARCHES THE VALUES OR RANGES OF VALUES GIVED AS

     THE 2.PARAMETER FOR THE OCCURENCE OF THE 1.PARAMETER

     EXAMPLE: VALIX(#7,"1,3,5,10‑15")

              RETURNS 0 IF #7 IS ONE OF THE GIVEN VALUES, 1 ELSE.

              VALIX(#7,"‑1,3,5,10‑15") RETURNS 0 IF #7 IS NOT VALID

              VALIX(#7,#DA1) MAY BE USED IN SELECTIONS (OR SELECTION ON INP

     THE ROUTINE WORKS JUST LIKE THE VALID ROUTINE, BUT THE SCAN OF

     THE ALLOWED VALUES IS DONE ONLY BY THE START OF THE REPORT.

     THIS MAKES THE ROUTINE MUCH FASTER THAN THE VALID ROUTINE, BUT:

       1.A MAXIMUM VALUE (DEFAULT 99) MUST BE GIVEN.

       2.  ONE BYTE FOR EACH VALUE IS USED IN CORE FOR THIS.

       3.THE RANGE CAN NOT BE CHANGED DURING THE RUN AS IT IS SET BY START.

     THE ROUTINE IS QUICKER BUT MORE RESTRICTED THAN THE VALID ROUTINE.

          RETURNS  (0=OK, 1=NOTOK)

        1:VALUE TO BE CHECKED

        2:ALLOWED VALUES

        3:OPTIONAL MAX VALUE (DEFAULT IS 99)

 

  26 WEEK  (DATE OR WEEK)

     THE ROUTINE CONVERTS A DATE DDMMYY OR YYMMDD TO YYWW WEEKNUMBER

     OR A WEEK YYWW TO A DATE YYMMDD

     EXAMPLE:WEEK(010189) RETURNS 8853

             WEEK(890101) WILL ALSO RETURN 8853

             WEEK(8853)   WILL RETURN THE START DATE OF THE WEEK 890101

     THE STATUS (#OK) MAY BE REQUESTED AFTER THIS CALL, 0=OK, >0==> ERROR

     NOTE: THE CONVERSION FROM WEEK TO DATE REQUIRES NIROS 7.0.2 !!

          RETURNS WEEK NUMBER OR DATE

        1:PARAMETER 1, DATE DDMMYY OR YYMMDD OR WEEKNO YYWW

 

  27 WORKD (#DD,#PD)

     CALCULATION OF WORK‑DAYS BETWEEN TWO DATES

     EXAMPLE: #47=WORKD(#15,#PD)

     NOTE:THE BUILD IN CALENDAR FOR THIS FUNCTION MAY BE COUNTRY AND/OR

          COMPANY DEPENDENT.

          RETURNS      NUMBER OF DAYS

        1:PARAMETERS,  FROM DATE (DDMMYY)

        2:             TO   DATE (DDMMYY)

 

  28 ZERO  (FROM,TO)

     THIS ROUTINE MAY BE USED AS A SHORT‑FORM OF ZEROING NUMERIC WORKFIELDS

     INSTEAD OF WRITING MULTIPLE LINES WITH #xx=0

     EXAMPLE:ZERO()  ZEROES ALL NUMERIC WORKFIELDS

             ZERO(24,40) ZEROES ALL WORKFIELDS WITH FIELDNOS. 24‑40

        1:OPTIONAL PARAMETER, FROM WORKFIELD NO.

        2:OPTIONAL PARAMETER, TO   WORKFIELD NO.

 

 

 

 

15.7.        Writing a subfunction.

 

   A subfunction is a quite normal basic subroutine located in lineno. 1000-9999.

 

    When the user calls the subfunction first time this is loaded from the textfile RAPX.xxxxxxxxx or DMS.RAPX.xxxxx and renumbered to new linenumbers 10000‑19999 which area now has been reserved for this purpose in the generated report.

 

    The return value of the subfunction is inserted in the calculation line as replacement for the subfunction call, and just before the calculation is done statements to set parameters for the subfunction are generated together with the GOSUB to the renumbered function and eventually statements to return any number of variables from this.

 

    The subfunction may be written using the standard report generator variables (listed in the last chapter of the installation manual). Most commenly used will be T1,T3,T2$ and T9$ which are all free for use as work‑variables.

 

    The subfunction can also use its own variables in which case it must contain its own DIMensioning of these. In the subfunction control REMarks you should then specify which variables are used by the routine.

 

    By loading the subfunction DMS.RAPGEN will during the renumber loop also replace all these variables with free variables (A5,A6,A7,A8,A9,B5,B6,...,08,09) to avoid conflict with the standard variables and variables from other subfunctions.


15.8.1.      The master textfile DMS.RAPX       

 

   When you should write a new subfunction you may load the textfile DMS.RAPX and modify the control REMarks in here. In this way you get an overview of the avaible parameters. 

 

Figure 18 The DMS.RAPX control REMark master textfile

 

 1 REM   DMS.RAPX.xxxxx (.................)                  28/02‑1989 /CH      

 10 REM  DOCUMENTATION .....                                                     

 98 REM  FUNCTION TEXT            EXAMPLE         :PARAMETER                     

 99 REM  TAKE THIS FUNCTION FROM                  :                              

 100 REM RETURNS                  (T3)            :                              

 101 REM NORMAL PARAMETER         (T2$)           :                              

 102 REM RETURN PARAMETER         (=T2$)          :                              

 103 REM FILE CHANNEL PARAMETER   (XX.K1)         :                              

 150 REM FREE FIELD DEF ,6,       (T3)            :                              

 151 REM #D START DATA DEF. ,6,   (T3)            :                              

 200 REM INITIALIZE ENTRY         (4300)          :                              

 201 REM NORMAL ENTRY             (4400)          :                              

 202 REM SPECIAL ENTRY            (4500,FUNCA)    :                              

 300 REM VARIABLE REPLACEMENT     (T3)            :                              

 301 REM FILE VARIABLES           (KU.K4,A$,1%,A1):                              

 400 REM REENTRANT                (Y/N)           :                              

 401 REM RENUMBER FROM,TO,STEP    (4300,4999,10)  :                              

 402 REM WRITE ACCESS             (Y/N)           :                              

 403 REM PASSWORD                 (Y/N)           :                              

 404 REM NUMBER OF #Dx FIELDS     (0‑7)           :                              

 416 REM LOADING FN‑FUNCTIONS     (Y/N)           :                              

 419 REM ACCOUNTING ACTIVE        (Y/N)           :                              

 

 

 

 The first line with 1 REM you should fill out with the subfunction name and a brief‑list of parameters.This text will becom the subfunction help name, it is the field name in the dummy HLP file 00.

 

    In the following lines you may enter any description remarks for your subfunctions, these will together with the return value and  parameter specifications become the HLP detailed explanation of this subfunction. 

 

15.8.3.      100 Return variable.

 

             100 RETURNS:T3

 

 causes this variable to be inserted in the calculation line instead of the subfunction call. The statement: 

 

             #47=WORKD(#3,#4)    will be translated to

             S3(1)=T3

 

 If the subfunction is called with GOSUB the return variable will be ignored. If no RETURN is specifyed the subfunction will return R4 (error code #OK) as default.

 

15.8.5.      101‑149 Parameter variables.

 

             101 FROM DATE:D1

 

 causes a statement like  D1=#3 to be generated before the subfunction is called.

 

    A subfunction may contain up to 49 parameters but the restriction of a calculation line length will in praxis limit this number.

 

    If a parameter is not given in the subfunction call this is set to zero or delimiter.

 

15.8.6.1.    Return values in parameter values.

 

             105 NAME:=T2$(101)

 

 will cause statements like

 

              T2$(101)=#50

              GOSUB subfunction

              #50=T2$(101)

 

 to be generated. In this way you may return any number of values from the subfunction. 

 

15.8.7.      150‑199 Free field definitions.

 

   It is possible in a subfunction to define a free field with a control REMark like:

 

              150 TOTAL BALANCE 9,2 :B7

 

 DMS.RAPGEN will search all free fields for a field with the name TOTAL BALANCE. If such a field is found this will be used, if the field is not present a new field with this name and the given format will be created.

 

    Note that due to a very old bug the name of the last free field is 4 characters only so 19 free fields only can be used by this function.

 

    If the free field is found to be eg. S4(8) a statement

 

               S4(8)=B7

 

 will be generated after the subfunction call, it is the subfunction may return a value in this free field by setting B7.

 

15.8.8.1.    #Dx Start‑data definitions.

 

                 151 REM #D STARTDATE ,6,:T3

 

    will define a free field as above AND reserve one of the 7 start data input fields for the use for this.

 

    Note:The value of this free field will be set automatically when starting the report, you do not have to give a statement like #47=#D1 which is nessesary by the normal use. 

 

15.8.9.      200 Initialize entry.

 

               200 INIT:4300

 

 If you specify an initialize entry for the sucfunction, this routine will be called when the report is started as a very first calculation from statement 800 in the report program, before the users FIRST calculations are done.

 

    This routine is called only once and may contain DIM and all other statements nessesary to initialize the routine.

 

    Parameters are transferred to the initialize call as for as possible just like the normal subfunction call and may be used for the initialization. In a call like:

 

              #47 = WORKD(#D1,#3)

 

 you may use the value of #D1 in the initialize function, but #3 will always be zero as the initialize is called very first in the program.

 

    Note that you should take the initialize parameters from the standard report generator variables as T1,T3,T2$,T9$ as your local variables are not yet dimensioned and can not be used as parameters for the initialize call.

 

    If the specification of a initialize entry is omitted no initialization call is done.

 

15.8.11.      201‑299 Entry points.

 

             201 Entry point:4310

may be used to set a entry point for the subfunction. If the specification of an entry point is omitted the entry point will default to the first line number of the routine (1000‑1999).

 

15.8.12.1.    Dummy entry.

 

              201 ENTRY:0

causes only the initialize entry to be called.

 

    This may be used in subfunctions like INDEX(3) which sets the main index for the report before the first read is done. Nothing should be executed during the report run in this routine.

 

15.8.12.3.    Multiple entry points.

 

              201 ENTRY1: 4310,FUNCA

              202 ENTRY2: 4320,FUNCB

 

 You can specify up to 32 entry points for a subfunction, if the user calls FUNCA GOSUB 4310 will be generated, FUNCB will branch to 4320.

 

15.8.12.5.    Dummy subfunctions.

 

   As the subfunction above is named RAPX.FUNCA, and the report generator checks this textfile is present when the subfunction is called, a problem will occur if the user calls FUNCB before a call to FUNCA has made this routine name known to the generator.

 

    In this case you should place a textfile RAPX.FUNCB just containing the line

 

              99 REM placed in the file: RAPX.FUNCA

 

 to make DMS.RAPGEN to load the function from this file instead. 

 

15.8.13.      300‑399 Variables used.

 

            300 REM my variable:K1$

 

 will cause all occurenses of K1$ to be replaced by a free report generator variable (A5,A6...09) when the subfunction is loaded.

 

    You may specify several variables on the same line as:

 

            300 REM uses: K1$,T2$,T9$,K1,A5,A$

 

 but for documentation purpose we would recommend to give just one variable and a documentation text on each line.

 

    Note that single character variables as A,B,C can not be replaced by DMS.RAPGEN as the search operations to do this would be to time consuming.   

 

15.8.15.      400 Reentrant Y/N.

 

   As default all subfunctions will be considered reentrant by DMS.RAPGEN, it is multiple calls to the subroutine will load the routine only once.

 

    If you specify      400 REENTRANT:N

 

 a new copy of the subfunction will be loaded for each call.

 

    The copies will be renumbered and have their own variables according to the control REMarks.

 

    This may be used to initialize different variables due to speed for the same routine.

 

15.8.17.      401 Renumber from, to, step.

 

   As default DMS.RAPGEN will renumber the complete routine located in the line numbers 1000‑9999.

 

    For special purposes to modify the generated codes at fixed linenumbers you may set the control remark:

 

             401 RENUMBER: 4300,4399       or     401 RENUMBER: N

 

 You may even specify a step linenumber for the renumber routine if you would test/amend your program in live by:

 

             401 RENUMBER: 4300,4399,10

 

 Note that the renumber routine due to speed is restricted to renumber only lines in the range 1000‑9999. 

 

15.8.19.     402 Write access Y/N.

 

   DMS.RAPGEN will normally open all fields with Protect, it is no writing to any files can be performed.

 

    Another advantage is that the reading of locked records during the report print is possible so a report will not have to wait for other updating or forgotten terminals.

 

    If the user defines the report on the main file xx comma something, eg. XX,W or just XX, all files will be opened normal allowing eventually write on his own responsibility (for use for DATAMASTER files).

 

    You may update files from subfunctions by including the control remark:

 

              402 Write access: Y

 

 which will place a comma after the main file name causing normal open to be used.

 

    Setting write access to N causes the protect mode to be used.

    Setting write access to W (or any other letter or digit) causes the main file to be set to XX,W and the read statements x/DMREAD.XXW to be loaded. Normal open will be used.

 

15.8.21.

14.4.11.     403 Password Y/N.

 

   When a report is defined on a file like XX,W causing write statements to be loaded (DATAMASTER), password must be entered before the report can be started.

 

    By the control REMark

 

             403 Password:Y        or

             403 Password:N

 

you can switch this password on or off for the report. 

 

15.8.23.     404 Number of #Dx fields

 

             404 Number of start‑data fields:3

 

will set the number of start data to be given to 3. 

 

15.8.25.

14.4.13.     416 FN functions nessesary.

 

   If your subfunction is using any of the report generator standard functions like FNR,FNA etc. you should place

 

             416 FN‑functions:Y

 

or the functions may not be loaded into the program.

 

    The only function which will always be defined is the FND date turn function. For the use of this you do not have to load the FN segment.

 

15.8.27.     419 Acoounting report active

 

   As for the FN‑functions you may activate the accounting function in  DMS.RAPGEN by use of a subfunction control REMark.

 

    This facility has at the time being been releasedin danish due to the heavy manual required for this product.


15.9.        Using files in a subfunction.

 

   In a subfunction you may of cause open and handle your own files, you should use channel number 18 and onwards for this purpose.

    You can also request the report generator to open a file, it is one of the 9 files available for a user in a report program. DMS.RAPGEN will ensure the file variables is dimensioned and read statements will be loaded into the program.

    If you intend to write to any file (your own responce) you should remember the control REMark 402 to open the files without protect mode.

    Note that normal read statements is without record lock.

 

15.10.1.      File channels.

 

   DMS.RAPGEN works with logical channels for the files. If you get a parameter like above K1=3 you should use #R1(K1,3) as a physical channel to read the file.

 

    The logical channels are numbered from 1 to 9, the physical channels will normally be one higher to leave TF.LOGFILE and TF.PARAM free. Do not just use the logical channel +1 as this will not work for file 9 and the numbering may be changed or extended.

 

15.10.3.      Other file informations.

 

   The normal file channel no. is R1 (eg. 5). By R1=5, gosub 6700 you will clear all variables. By R1=5, R2=recno., gosub 8395 you can read record number R2. R2(R1,1) contains the first data record of the file. 

 

15.10.5.      File variables.

 

   As the report generator allocates the basic variables for the used files dynamic naming the main file S1,S2,S3,S4,S$ the second B etc. you will not know which variables to use when writing your subfunction.

 

    By the control REMark:

 

            300 REM FILE:KU:K4,A$,1%,A1,2%,A2,3%,A3,4%,A4

 

you can write your subfunction using the variables A1,A2,A3,A4,A$. DMS.RAPGEN will replace these by the file variables for the file KU in the given report.

 

    The KU: will cause the file KU to be opened, variables dimensioned and read statements to be loaded. The : as 3 character tells this control REMark should handle a file and will be followed by file variables.

 

    The following file variables must be given with type, it is 1%,A1 or A$ as above.

 

    If you omit the type as for K4 above, this variable will be substituted with the file logical channel. It is a statement in the subfunction as

                             R1=K4

will be generated to be eg.  R1=5

       

15.10.7.      File channels as parameters.

 

   In the parameter specification you can have one or more definition of file parameters by:

 

      101 FILE PARAM: XX: K1

 The XX: defines to the subfunction loader that the user will give a file shortname as parameter for the subfunction, eg:

 

             FUNC (VA)

 

This parameter will be given to the subfunction by a statement like:

 

             K1 = 3

 

before the GOSUB. You can now use K1 as channel no. in your subfunction (see below).

 

    NOTE: If the parameter is omitted from the subfunction call you will receive K1 = 0, it is no file given. 

15.11.        Subfunction examples.

 

Figure 19 The CHEX subfunction for modulus 11 control.

 

 1 REM DMS.RAPX.CHEX  ("1234","07020105")            28/02‑1989 /CH              

 10 REM CALCULATION OF OCR‑CHECKDIGIT MODULUS 11                                 

 11 REM THIS ROUTINE MAY BE USED FOR BANKS OR PERSON NUMBER CHECK DIGITS         

 20 REM EXAMPLE:#17=CHEX("123456","01020304")                                     

 100 REM RETURNS FIELD WITH CHECK DIGIT :T2$                                     

 101 REM PARAMETER ALPHA FIELD TO CALCULATE ON:T2$                               

 102 REM WEIGHTES "xxyy.." 2 CHARS.PR DIGIT    :T9$                               

 4205 LET T4=1                                                                   

 4206 LET T3=0                                                                   

 4207 FOR T1=1 TO  LEN T2$                                                        

 4208   IF T2$(T1,T1)=" " LET T2$(T1,T1)="0"                                     

 4209   LET T=T2$(T1,T1)                                                         

 4210   LET T4=T9$((T1‑1)*2+1,T1*2)                                              

 4211   LET T3=T3+T*T4                                                           

 4212   LET T4= NOT T4                                                           

 4213 NEXT T1                                                                    

 4214 LET T3=11‑(T3‑11* INT (T3/11))                                             

 4215 IF T3>9 LET T3=0                                                           

 4216 LET T2$( LEN T2$+1)=T3 USING "#"                                           

 4217 LET T=T3                                                                   

 4218 LET T3=T2$                                                                 

 4219 RETURN                                                                     

 

 

 

Figure 20 The INDEX / start key fix routine.

 

 1 REM DMS.RAPX.INDEX (1,"1234","5678")              28/02‑1989 /CH              

 10 REM FIX INDEXNUMBER (AND START/STOP) OF MAIN FILE                            

 20 REM EXAMPLE: INDEX(3) ==> MAIN FILE INDEX 3 IS USED                          

 30 REM EXAMPLE: INDEX(3,"1234","5678") ==> INDEX 1, START/STOP FIXED            

 99 REM                                                                          

 101 REM INDEXNUMMER                                  :R5                        

 102 REM START KEY   (OPTIONAL)                       :T2$                       

 103 REM END   KEY   (OPTIONAL)                       :T2$(100)                  

 200 REM ENTRY AS FIRST CALCULATION ALWAYS            :1000                      

 201 REM ENTRY IN NORMAL CALCCULATIONS IS SET TO DUMMY:0                         

 999 REM                                                                         

 1000 LET R1(0,2)=R5  /*INDEXNO.                                                 

 1010 IF T<2 RETURN   /*START/STOP GIVEN ?                                       

 1020 LET R1$=T2$                                                                

 1030 LET R3$=R1$                                                                 

 1040 LET R2$=T2$(100)                                                           

 1050 IF X0(14)=2 IF R2$="" LET R2$="

 1060 IF R2$="" LET R2$="å"  /*NORMAL HIGH KEY                                   

 1099 RETURN                                                                     

 

 

Figure 21 The VALID subfunction

 

 1 REM DMS.RAPX.VALIX (#7,#DA1)                      28/02‑1989 /CH              

 5 REM THIS ROUTINE SEARCHES THE VALUES OR RANGES OF VALUES GIVED AS             

 6 REM THE 2.PARAMETER FOR THE OCCURENCE OF THE 1.PARAMETER                      

 10 REM EXAMPLE: VALIX(#7,"1,3,5,10‑15")                                         

 11 REM          RETURNS 0 IF #7 IS ONE OF THE GIVEN VALUES, 1 ELSE.             

 12 REM          VALIX(#7,"‑1,3,5,10‑15") RETURNS 0 IF #7 IS NOT VALID           

 13 REM          VALIX(#7,#DA1) MAY BE USED IN SELECTIONS (OR SELECTION ON INPUT)

 100 REM RETURNS  (0=OK, 1=NOTOK)                 :R4                            

 101 REM VALUE TO BE CHECKED                      :T3                            

 102 REM ALLOWED VALUES                           :T2$                           

 103 REM OPTIONAL MAX VALUE (DEFAULT IS 99)       :T4                            

 200 REM INITIALIZE ENTRY                         :1030                          

 201 REM NORMAL ENTRY                             :1000                          

 300 REM WORK VARIABLE                            :T9$                           

 400 REM REENTRANT                                :N                             

 1000 LET R4=0                                                                   

 1010 IF T9$(T3+1)<"X" LET R4=1                                                  

 1020 RETURN                                                                     

 1030 IF T<3 LET T1=99                                                           

 1035 DEALLO T9$                                                                  

 1040 DIM T9$(T4+1)                                                              

 1050 LET T=1                                                                    

 1060 IF T2$(1,1)>="0" IF T2$(1,1)<="9" LET T=0                                  

 1070 LET T9$=" ",T9$                                                            

 1080 IF T LET T9$="X",T9$                                                       

 1090 LET T2$(250)="X"                                                            

 1100 IF T LET T2$(250)=" "                                                      

 1110 LET T=T+1                                                                  

 1120 IF T> LEN T2$ GOTO 1000                                                     

 1130 LET T1=T2$(T)                                                              

 1140 LET T=T+ CHR T1+ NOT T1                                                    

 1150 LET P5=T1                                                                   

 1160 IF T2$(T,T)<>"‑" GOTO  1190                                                

 1170 LET P5=T2$(T+1)                                                            

 1180 LET T=T+ CHR P5+1                                                           

 1190 IF T1>T4 LET T1=T4                                                         

 1191 IF P5>T4 LET P5=T4                                                         

 1195 LET T9$(T1+1,P5+1)=T2$(250),T9$(T1+1)                                       

 1200 GOTO 1110                                                                  

 1210 GOTO 1000                                                                  

 

 

Figure 22 The WORKD call of the workday subfunction

 

 5201 GOSUB  14000                                                               

 5202 LET S4(5)=T3  /* #47=WORKD(#PD,#42)                                        

 14000 REM #47=WORKD(#PD,#42)                                                    

 14001 LET T3=X(8)                                                               

 14002 LET T3(1)=S2(2)                                                           

 14003 LET T=2                                                                   

 14004 GOSUB 15001                                                               

 14005 RETURN                                                                    

 15000 REM #47=WORKD(#PD,#42)                                                    

 15001 REM CALCULATE WORKDAYS T3 FROM DATE DDMMYY T3 TO T3(1)                    

 15002 LET T3(2)= FND(T3)                                                        

 15003 REM ETC..ETC..ETC..                                                       

 

 

 

 

 

Figure 23 Control REMarks for the complex STARF subfunction.

 

 1 REM   DMS.RAPX.STARF  ‑ ACCOUNTING REPORT TOTALIZER                            

 100 REM RETURNS                                 :P1                              

 101 REM RETURNS BALANCE PERIOD                  :=P1(1)                          

 102 REM RETURNS BALANCE YEAR TO DATE            :=P1(2)                          

 103 REM RETURNS LAST YEAR PERIOD                :=P1(3)                          

 104 REM RETURNS LAST YEAR YEAR TO DATE          :=P1(4)                          

 105 REM RETURNS BUDGET PERIOD (IF REQUIRED)     :=P1(5)                          

 106 REM RETURNS BUDGET YTD    (IF REQUIRED)     :=P1(6)                          

 150 REM #D PERIODENS START ,6,                  :T3                              

 200 REM INITIALIZE ENTRY, GET YEAR START/PERIOD :1000                            

 201 REM NORMAL ENTRY, GET BALANCE/BUDGET        :2000,STARF                      

 202 REM GET ACOUNTING YEAR START DATE/PERIOD    :1500,STARD                      

 203 REM SET NEW START/END PERIOD                :1300,STARP                      

 300 REM VARIABLE FOR YEAR START DATE            :D0                              

 301 REM VARIABLE FOR PERIOD START MONTH         :D1                              

 302 REM VARIABLE FOR PERIOD END   MONTH         :D2                              

 303 REM VARIABLE FOR PARAMETERS/RETURN VALUES   :P1                              

 304 REM COMPANY FILE VIKA CHANNEL NO            :VI:V1                           

 305 REM GENERAL LEDGER FILE FIKA VARIABLES      :FI:F$,3%,F3                     

 306 REM BUDGET FILE VARIABLES                   :BU:B0,1%,B1,3%,B3               

 307 REM WORK‑VARIABLE                           :A1                              

 419 REM ACCOUNTING ACTIVE                       :Y                               

 

 

 

 

 

 

Figure 24 The STARF subfunction as source

 

 1000 REM INITIALIZE                                                              

 1010 DIM 4%,P1(6),2%,D0,D1,D2,A1                                                 

 1015 DEF  FNE(X)= DFV (X*1E‑02),1200* FRA X+100* FRA ( INT X*1E‑02)  /*DDMMYY == 

 1020 READ #R1(V1,3),280,44;P1;  /*YEAR START                                     

 1030 LET D0= FND(P1*100+1)  /*START OF YEAR DDMMYY                               

 1070 LET P1(1)=T3  /*SET DEFAULT PERIOD FROM #D1 TO #PD                          

 1080 LET P1(2)=X(8)                                                              

 1300 REM STARP(DDMMYY,DDMMYY) SET PERIOD FROM‑TO                                 

 1305 LET D1= FNE(P1(1))‑ FNE(D0)+1  /* START MONTH                               

 1310 LET D2= FNE(P1(2))‑ FNE(D0)+1  /* END   MONTH                               

 1400 IF D1<1 LET D1=1                                                            

 1410 IF D1>16 LET D1=16                                                          

 1420 IF D2<D1 LET D2=D1                                                          

 1430 IF D2>16 LET D2=16                                                          

 1500 REM STARD(FROM,TO) GET YEAR START DATE AND PERIOD FROM,TO                   

 1505 LET P1=D0  /*RETURN YEAR START DATE                                         

 1510 LET P1(1)=D1  /*AND FROM‑TO MONTH                                           

 1520 LET P1(2)=D2                                                                

 1599 RETURN                                                                       

 2000 REM STARF(PER‑BAL, YTD‑BAL, LYP‑BAL, LYR‑BAL, PER‑BUD, YTD‑BUD)             

 2010 IF P8 RETURN   /* SKIP THIS ROUTINE FOR TOTALS                              

 2020 CLEAR P1  /*ZERO ALL RETURN VALUES                                          

 2100 FOR A=1 TO D2  /* LOOP OVER PERIOD                                          

 2105   IF A>=D1 LET P1(1)=P1(1)+F3(16+A)  /*PERIOD                               

 2110   LET P1(2)=P1(2)+F3(16+A)  /*YTD                                           

 2115   IF A>=D1 LET P1(3)=P1(3)+F3(A)  /*LAST YEAR                               

 2120   LET P1(4)=P1(4)+F3(A)  /*LAST YEAR                                        

 2150 NEXT A                                                                       

 2160 IF T<5 RETURN   /* BUDGET NOT REQUIRED (NO PARAMETERS GIVEN)                

 2200 LET R1=B0  /*BUDGET FILE LOGICAL CHANNEL NO.                                

 2210 LET R$=F$(1,12)  /*ACCOUNT NO.                                              

 2220 SEARCH #R1(R1,3),2,1;R$,R2,R4                                               

 2230 IF R4 GOTO 6700  /*CLEAR RECORD AND RETURN IF NO BUDGET                     

 2240 GOSUB  8395  /*READ BUDGET FILE #R1, RECORD R2                              

 2300 FOR A=1 TO 16  /* LOOP OVER ALL BUDGETS                                     

 2305   LET B3(A)=B3(A)*1

 2306   IF A>=D1 IF A<=D2 LET P1(5)=P1(5)+B3(A)  /*BUDGET PERIOD                  

 2310   IF A<=D2 LET P1(6)=P1(6)+B3(A)  /*BUDGET YTD                              

 2330 NEXT A                                                                      

 2399 RETURN                                                                      

 

 

 

Figure 25 The user call of STARF

 

    STARF(#44,#48,#52,#53,#45,#49)       STARF(MD.REAL,ÅTD.REAL.,MD.SIDSTE ÅR,ÅTD 

    IF #60=0 LET #45=#52                 IF #D2BUDGET (Y/N)=0 LET BUDGET=MD.SIDST 

    IF #60=0 LET #49=#53                 IF #D2BUDGET (Y/N)=0 LET ÅTD BUDGET=ÅTD  

    IF Y1(1)=1 LET #48=#48+#40           IF Y1(1)=1 LET ÅTD.REAL.=ÅTD.REAL.+START 

    #46=#44‑#45                          DIFF.=MD.REAL‑BUDGET                     

    #50=#49‑#48                          ÅTD DIFF=ÅTD BUDGET‑ÅTD.REAL.            

    #47=#46%#45                          %=DIFF.%BUDGET                           

    #51=#50%#49                          ÅTD %=ÅTD DIFF%ÅTD BUDGET                

    FØRST                                FØRST                                    

    IF #DA2="Y" LET #60=1                IF #DA2="Y" LET #D2BUDGET (Y/N)=1        

    #61=" SIDSTE ÅR "                    TEKST=" SIDSTE ÅR "                      

    IF #60=1 LET #61="   BUDGET "        IF #D2BUDGET (Y/N)=1 LET TEKST="   BUDGE 

    STARD(#59,#55)                       STARD(START MÅNED,MÅNED)                 

 

 

 

 

 

Figure 26 STARF loaded into the report program.

 

 

 13001 LET S4(16)=Q(1)                                                            

 13002 REM STARF(#44,#48,#52,#53,#45,#49)                                         

 13003 LET T3=S4(16)                                                              

 13004 LET T=6                                                                    

 13005 GOSUB 15001                                                                

 13006 LET S4(16)=T3                                                              

 13999 RETURN                                                                     

 14000 REM STARF(#44,#48,#52,#53,#45,#49)                                         

 14001 LET A8(1)=S4(2)                                                            

 14002 LET A8(2)=S4(6)                                                            

 14003 LET A8(3)=S4(10)                                                           

 14004 LET A8(4)=S4(11)                                                           

 14005 LET A8(5)=S4(3)                                                            

 14006 LET A8(6)=S4(7)                                                            

 14007 LET T3=S4(16)                                                              

 14008 LET T=6                                                                     

 14009 GOSUB 15020                                                                

 14010 LET S4(2)=A8(1)                                                            

 14011 LET S4(6)=A8(2)                                                            

 14012 LET S4(10)=A8(3)                                                           

 14013 LET S4(11)=A8(4)                                                           

 14014 LET S4(3)=A8(5)                                                            

 14015 LET S4(7)=A8(6)                                                            

 14016 LET S4(16)=T3                                                              

 14017 RETURN                                                                     

 15000 REM STARF(#44,#48,#52,#53,#45,#49)                                         

 15001 REM INITIALIZE                                                             

 15002 DIM 4%,A8(6),2%,A5,A6,A7,A9                                                

 15003 DEF  FNE(X)= DFV (X*1E‑02),1200* FRA X+100* FRA ( INT X*1E‑02)             

 15004 READ #R1(2,3),280,44;A8;                                                   

 15005 LET A5= FND(A8*100+1)                                                      

 15006 LET A8(1)=T3                                                               

 15007 LET A8(2)=X(8)                                                             

 15008 REM STARP(DDMMYY,DDMMYY) SET PERIOD FROM‑TO                                

 15009 LET A6= FNEA8(1)‑ FNEA5+1                                                  

 15010 LET A7= FNEA8(2)‑ FNEA5+1                                                  

 15015 REM STARD(FROM,TO) GET YEAR START DATE AND PERIOD FROM,TO                  

 15016 LET A8=A5                                                                  

 15017 LET A8(1)=A6                                                               

 15018 LET A8(2)=A7                                                                

 15019 RETURN                                                                     

 15020 REM STARF(PER‑BAL, YTD‑BAL, LYP‑BAL, LYR‑BAL, PER‑BUD, YTD‑BUD)            

 15021 IF P8 RETURN                                                               

 15022 CLEAR A8                                                                   

 15023 FOR A=1 TO A7                                                              

 15024   IF A>=A6 LET A8(1)=A8(1)+S3(16+A)                                        

 15025   LET A8(2)=A8(2)+S3(16+A)                                                 

 15026   IF A>=A6 LET A8(3)=A8(3)+S3(A)                                           

 15027   LET A8(4)=A8(4)+S3(A)                                                    

 15028 NEXT A                                                                     

 15029 IF T<5 RETURN                                                              

 15030 LET R1=3                                                                   

 15031 LET R$=S$(1,12)                                                            

 15032 SEARCH #R1(R1,3),2,1;R$,R2,R4                                              

 15033 IF R4 GOTO  6700                                                           

 15034 GOSUB 8395                                                                 

 15035 FOR A=1 TO 16                                                              

 15036   LET C3(A)=C3(A)*10^C1(1)                                                 

 15037   IF A>=A6 IF A<=A7 LET A8(5)=A8(5)+C3(A)                                  

 15038   IF A<=A7 LET A8(6)=A8(6)+C3(A)                                           

 15039 NEXT A                                                                      

 15040 RETURN                                                                     

 


 

                                                                            Figures

 

Figure 1  Libr list...........................................................................................................................................................................................   3

Figure 2  Front page, commands in FILESHORTNAME........................................................................................................................   6

Figure 3 Front page, commands in FILENAME.......................................................................................................................................   6

Figure 4  Field definitions showing record contents...............................................................................................................................   9

Figure 5  Field definitions showing format.............................................................................................................................................   11

Figure 6  Field definitions showing variables.........................................................................................................................................   12

Figure 7  Extended field descriptions.......................................................................................................................................................   12

Figure 8  Allowed field values..................................................................................................................................................................   12

Figure 9  Index and file connection definitions......................................................................................................................................   14

Figure 10  Extended field description.......................................................................................................................................................   16

Figure 11 The XFO file investigator.........................................................................................................................................................   16

Figure 12 XFO mode 2, record displayed unpacked..............................................................................................................................   18

Figure 13 XFO mode 4, display all possible variable types..................................................................................................................   18

Figure 14 Allowed field values.................................................................................................................................................................   18

Figure 15 HLP on file 00 shows list of subfunctions.............................................................................................................................   24

Figure 16 HLP on 0005 gives details........................................................................................................................................................   25

Figure 17 Print of the fields in file 00........................................................................................................................................................   25

Figure 18 The DMS.RAPX control REMark master textfile..................................................................................................................   30

Figure 19 The CHEX subfunction for modulus 11 control...................................................................................................................   35

Figure 20 The INDEX / start key fix routine............................................................................................................................................   35

Figure 21 The VALID subfunction..........................................................................................................................................................   35

Figure 22 The WORKD call of the workday subfunction....................................................................................................................   36

Figure 23 Control REMarks for the complex STARF subfunction......................................................................................................   36

Figure 24 The STARF subfunction as source........................................................................................................................................   36

Figure 25 The user call of STARF............................................................................................................................................................   37

Figure 26 STARF loaded into the report program.................................................................................................................................   37

 


 

                                                                            Keyword index

 


#DD.............................................................................. 24, 25, 29

#OK.............................................................................. 27, 29, 30

#PD......................................................................... 24‑26, 29, 36

Account.................................................................. 9, 27, 28, 36

Checks..................................................................................... 32

Core...................................................................................... 4, 29

DATAMASTER................................................ 2, 3, 15, 19, 33

DIM........................................................................ 21, 31, 35‑37

Division................................................................................... 10

DMREAD............................................................................ 7, 33

DMS.RAPGEN.SYS............................................................. 8, 9

DMS.RAPS............................................................................. 21

DMSORTWORK................................................................... 15

DRN.............................................................................. 1, 3‑6, 25

FNA................................................................................... 26, 33

FNB.......................................................................................... 26

FND...................................................... 10, 15, 20, 26, 33, 36, 37

FNH.......................................................................................... 26

FNR.................................................................................... 26, 33

FNU.......................................................................................... 26

FNV.......................................................................................... 26

Format............................................... 1, 4, 5, 9‑12, 15, 25‑27, 31

GOSUB.................................... 20, 22, 23, 29, 30, 32, 34, 36, 37

HBA........................................................................................... 3

INT...................................................................................... 35‑37

LEN.......................................................................................... 35

LOAD.................................................... 2, 20, 21, 28, 30, 32, 33

LPT....................................................................................... 6, 13

LU......................................................................... 3, 8, 16‑18, 20

MODE.................................. 1, 2, 4, 5, 11, 12, 16‑19, 26, 33, 34

Modulus............................................................................ 26, 35

NIROS.................................................................................. 3, 29

NOT................................................. 1, 3‑7, 10, 11, 13‑17, 19‑36

NYRUP...................................................................................... 8

Ocr...................................................................................... 26, 35

over.................................................................................... 21, 36

Partition..................................................................................... 3

Pass.................................................................................. 1, 4, 19

Password............................................................. 1, 2, 13, 30, 33

POS............................................................................................ 8

REM.................................................................. 21, 30‑32, 34‑37

SCOPE....................................................................................... 3

Search.............................................. 4, 12, 25, 26, 31, 32, 36, 37

STAR......................................................................... 1, 9, 27, 28

Status............................................................................. 4, 27, 29

STOP.................................................................................. 26, 35

T2$................................................................................ 29‑32, 35

T3................................................................. 20‑22, 29‑31, 35‑37

T3(1)............................................................................. 20‑22, 36

T9$......................................................................... 29, 31, 32, 35

TAMOS..................................................................... 3, 4, 6, 8, 9