RAPGEN

 

User Manual

 

 

Part 1.


 


                                                                            Table of contents

 

1.           PREFACE.........................................................................................................................................................................................   6

1.1.         Start DMS.REPGEN.......................................................................................................................................................................   6

1.2.         How to use this manual!...............................................................................................................................................................   6

1.3.         Files used in the examples............................................................................................................................................................   7

1.3.1.       VA ARTICLE FILE.   ...................................................................................................................................................................   7

1.3.2.       LE SUPPLIER FILE.       ...............................................................................................................................................................   7

1.3.3.       KU CURRENCY FILE.      ............................................................................................................................................................   7

1.3.4.       GR ARTICLE GROUP FILE     ....................................................................................................................................................   7

1.3.5.       Contents of the files.....................................................................................................................................................................   8

1.4.         General operating rules.................................................................................................................................................................   9

1.5.         DMS.DATAMASTER................................................................................................................................................................   10

1.6.         Operating systems.......................................................................................................................................................................   10

1.7.         Disc space.....................................................................................................................................................................................   10

1.8.         DMS.REPGEN SYSTEM.............................................................................................................................................................   10

 

2.           Define a new report......................................................................................................................................................................   11

2.1.         Overview.......................................................................................................................................................................................   11

2.2.         Define a new report ‑ Function 1...............................................................................................................................................   11

2.2.1.       Reportnumber..............................................................................................................................................................................   11

2.2.2.       File identification........................................................................................................................................................................   12

2.2.3.       File password..............................................................................................................................................................................   12

2.3.         Main information for a Report...................................................................................................................................................   12

2.3.1.       Reportname..................................................................................................................................................................................   12

2.3.2.       No.of lines per page...................................................................................................................................................................   13

2.3.3.       Report heading............................................................................................................................................................................   13

2.3.4.       Zeros printed Y/N?.....................................................................................................................................................................   13

2.3.5.       Printer...........................................................................................................................................................................................   13

2.3.6.       Username/password...................................................................................................................................................................   13

2.4.         TAMOS selector..........................................................................................................................................................................   13

2.5.         Report lines...................................................................................................................................................................................   14

2.5.1.        +xx Move xx characters forward..............................................................................................................................................   14

2.5.2.        -xx Move xx characters backward............................................................................................................................................   14

2.5.3.        Pxxx Move to position xxx.........................................................................................................................................................   14

2.5.4.        Hxx Fieldno.xx with user heading............................................................................................................................................   15

2.5.5.        D Delete previous fields...........................................................................................................................................................   15

2.5.6.        T Text in the line........................................................................................................................................................................   15

2.5.7.        Nxx Fieldnumber xx without heading......................................................................................................................................   15

2.5.8.        N Remove all headings.............................................................................................................................................................   15

2.5.9.        H@xx Fieldno. new fieldname..................................................................................................................................................   15

2.5.10.       KK#xx Fieldno. from another file............................................................................................................................................   15

2.5.11.       HLP Help overview of fields in other files............................................................................................................................   15

2.5.12.       Line statement of account type of report..............................................................................................................................   15

2.5.13.       CR. End this line........................................................................................................................................................................   15

2.5.14.      Blank lines (double space).......................................................................................................................................................   15

2.6.         Free fields......................................................................................................................................................................................   16

2.6.1.       Heading/Name.............................................................................................................................................................................   16

2.6.2.       Field formats................................................................................................................................................................................   16

2.6.3.       Defining field format...................................................................................................................................................................   16

2.6.4.       Changing free field formats in a report....................................................................................................................................   16

2.6.5.       Calculation precision ‑ free fields.............................................................................................................................................   16

2.6.6.       Automatic field format expansion (overflow).........................................................................................................................   16

2.7.         Totals ‑ automatic........................................................................................................................................................................   17

2.8.         Format of a report........................................................................................................................................................................   17

 

3.           Selection.........................................................................................................................................................................................   18

3.1.         Normal use of selections............................................................................................................................................................   18

3.2.         Deleting selections......................................................................................................................................................................   18

3.3.         Selections not equal to 0............................................................................................................................................................   19

3.4.         Selection on alphanumeric fields...............................................................................................................................................   19

3.5.         Calculations in selections...........................................................................................................................................................   19

3.6.         Selections entered at the time of printing................................................................................................................................   19

3.7.         Selections on parts of fields.......................................................................................................................................................   19

3.8.         Selections combined with calculations....................................................................................................................................   19

3.9.         QUICK selections........................................................................................................................................................................   20

 

4.           Calculations...................................................................................................................................................................................   21

4.1.         Structure of the calculation function........................................................................................................................................   21

4.2.         How to use the calculation‑module..........................................................................................................................................   21

4.3.         Amendments to calculations.....................................................................................................................................................   22

4.4.         Operands and operators.............................................................................................................................................................   23

4.5.         Percentage calculations and division.......................................................................................................................................   23

4.6.         Part of a field.................................................................................................................................................................................   24

4.7.         Alpha numeric textfields.............................................................................................................................................................   24

4.8.         Specialfields..................................................................................................................................................................................   24

4.8.1.       #DD ‑ Today's date....................................................................................................................................................................   24

4.8.2.       #PD ‑ 'As of' date........................................................................................................................................................................   25

4.8.3.       #Dx ‑ Data from #D1‑#D7 ‑ Numeric........................................................................................................................................   25

4.8.4.       #DAx ‑ Data from #DA1 to #DA7 ‑ Alpha numeric...............................................................................................................   25

4.8.5.       #PP ‑ Pagenumber.......................................................................................................................................................................   25

4.8.6.       #OK ‑ Status after reading another file....................................................................................................................................   25

4.8.7.       #SC ‑ Screennumber...................................................................................................................................................................   25

4.8.8.       #LEVEL ‑ Total level nos...........................................................................................................................................................   25

4.8.9.       #GROUP ‑ total group numbers................................................................................................................................................   26

4.8.10.      Workfields..................................................................................................................................................................................   26

4.9.         REM ‑ REMARKS.......................................................................................................................................................................   26

4.10.        Functions.....................................................................................................................................................................................   27

4.10.1.      FNR ‑ Rounding to 2 decimals.................................................................................................................................................   27

4.10.2.      FNH ‑ Rounding ‑ No decimals................................................................................................................................................   27

4.10.3.      FND ‑ Date conversion.............................................................................................................................................................   27

4.10.4.      FNA ‑ Convert date (DDMMYY) to numbers of days from year 1900. (Or days between two dates).........................   27

4.10.5.      FNB ‑ Calculate numbers of days from year 1900 to date DDMMYY...............................................................................   27

4.10.6.      FNU ‑ Calculate date (DDMMYY) to a weekday:.................................................................................................................   28

4.10.7.      FNV ‑ Calculate to year and week (YYWW)..........................................................................................................................   28

4.10.8.      Internal storage of functions...................................................................................................................................................   28

4.11.        Basic functions...........................................................................................................................................................................   28

4.11.1.      ABS ‑ Absolute value of a number.........................................................................................................................................   28

4.11.2.      SQR ‑ Square Root.....................................................................................................................................................................   28

4.11.3.      FRA ‑ Decimal part of a numeric field.....................................................................................................................................   28

4.11.4.      INT ‑ Integerpart of a numeric field.........................................................................................................................................   28

4.11.5.      SGN ‑ Sign of a field..................................................................................................................................................................   28

4.11.6.      NOT ‑ Logical negation............................................................................................................................................................   29

4.11.7.      LEN ‑ Length of a string...........................................................................................................................................................   29

4.11.8.      IF ‑ Conditional calculations....................................................................................................................................................   29

4.11.9.      Relational operators..................................................................................................................................................................   29

4.11.10.     When ‑ when to perform calculations...................................................................................................................................   30

4.11.11.     FIRST/NORMAL/LAST and AFTER calculations..............................................................................................................   30

4.11.12.     Load command..........................................................................................................................................................................   30

4.11.12.1.   CHECK ‑ checkdigit calculation (OCR)................................................................................................................................   31

4.11.12.2.   CHEX ‑ checkdigits ‑ modulus 11..........................................................................................................................................   31

4.11.12.3.   ARB ‑ Calculations of working days....................................................................................................................................   31

4.11.12.4.   NAME ‑ Separation of christian name and surname..........................................................................................................   32

4.11.13.     Calculation lines with predefined linenumbers....................................................................................................................   32

4.11.13.1.   Selection of a file index number for report purposes..........................................................................................................   32

4.11.13.2.   Lock on lowest total level.......................................................................................................................................................   32

4.11.13.3.   Enforced start/stop values.....................................................................................................................................................   32

4.11.14.     Update of files...........................................................................................................................................................................   33

 

5.           Using multiple files.......................................................................................................................................................................   34

5.1.         Principles in using multiple files................................................................................................................................................   34

5.2.         Help function................................................................................................................................................................................   34

5.3.         READ used in calculations........................................................................................................................................................   35

5.4.         Relation between files.................................................................................................................................................................   36

5.5.         Continue reading of the third file..............................................................................................................................................   36

5.6.         Files with more than one index..................................................................................................................................................   36

5.7.         Different records from the same file..........................................................................................................................................   36

5.8.         Max. numbers of files..................................................................................................................................................................   36

5.9.         Conditional reading of other files..............................................................................................................................................   36

5.10.        Reading AFTER the selections are done................................................................................................................................   36

5.11.        Sum of the postings...................................................................................................................................................................   37

5.12.        Statement of account reports....................................................................................................................................................   37

5.13.        Sequential (relative) files and pointers....................................................................................................................................   37

5.14.        Very special key structures.......................................................................................................................................................   37

5.15.        READ(KU) Balance list with currency conversion...............................................................................................................   37

5.16.        Price calculations with READ of more files............................................................................................................................   38

5.17.        Price calculations without automatic connections................................................................................................................   38

5.18.        Alternative suppliers: several references in the same file....................................................................................................   39

5.19.        READ in connection with totals...............................................................................................................................................   40

5.20.        START/NEXT/REPEAT Sum of the postings.......................................................................................................................   40

5.20.1.      Conditional sum with START/NEXT/REPEAT....................................................................................................................   41

5.20.2.      Several loops of START/NEXT/REPEAT inside each other..............................................................................................   42

5.20.3.      Selection in connection with START/NEXT/REPEAT........................................................................................................   42

5.21.        READH/LINE statement of account type report...................................................................................................................   43

5.21.1.      Selection in connection with READH/LINE..........................................................................................................................   44

5.21.2.      Totals in connection with READH/LINE...............................................................................................................................   44

5.22.        The key building routine of Repgen........................................................................................................................................   45

5.22.1.      Fields...........................................................................................................................................................................................   45

5.22.2.      Functions....................................................................................................................................................................................   45

5.22.3.      Grouping of fields and functions............................................................................................................................................   45

5.22.4.      Examples of key buildings........................................................................................................................................................   45

 

6.           SORTING AND TOTALLING.....................................................................................................................................................   46

6.1.         Sorting...........................................................................................................................................................................................   46

6.1.1.       Subtotal levels.............................................................................................................................................................................   46

6.1.2.       Sorting technique.......................................................................................................................................................................   47

6.1.3.       Sortfile ‑ DMSORTWORK........................................................................................................................................................   47

6.1.4.       Sorting in descending sequence..............................................................................................................................................   48

6.1.5.       Secondary sorting sequence....................................................................................................................................................   48

6.1.6.       New sortkey.................................................................................................................................................................................   48

6.2.         Subtotal levels without sorting.................................................................................................................................................   49

6.3.         Weighted totals...........................................................................................................................................................................   50

6.3.1.       Principles......................................................................................................................................................................................   50

6.3.2.       First pass......................................................................................................................................................................................   50

6.3.3.       Collecting the total value...........................................................................................................................................................   50

6.3.4.       Second pass ‑ weighted detail‑/total lines..............................................................................................................................   50

6.3.5.       Weighted totals and selections................................................................................................................................................   51

6.3.6.       Weighted totals and quick selections.....................................................................................................................................   51

6.4.         The report sequence...................................................................................................................................................................   52

6.5.         Calculated totals..........................................................................................................................................................................   52

6.5.1.       Principles......................................................................................................................................................................................   52

6.5.2.       Fundamental rules for calculated totals..................................................................................................................................   53

6.5.3.       Use of the WHEN command.....................................................................................................................................................   53

6.5.4.       Example of calculated totals......................................................................................................................................................   53

6.5.5.       Technique for calculated totals................................................................................................................................................   54

6.6.         Fields to be totalled.....................................................................................................................................................................   55

6.6.1.       ‑ Fieldnumber. Print out fields on the totalline.......................................................................................................................   55

6.6.2.       ‑ No 'grand total' text..................................................................................................................................................................   55

6.6.3.       2% or 3% total precision............................................................................................................................................................   55

6.7.         Group totals..................................................................................................................................................................................   56

6.7.1.       Group totals (Y/N/LEVEL)?.......................................................................................................................................................   56

6.7.2.       GROUP FIELDNUMBER: NUMBERS OF CODES AND NAMES......................................................................................   57

6.7.3.       "Undefined" group totals..........................................................................................................................................................   57

6.7.4.       Part of fields/other files..............................................................................................................................................................   57

 

7.           Defining a letter and amendments to reports/­letters...............................................................................................................   58

7.1.         Defining a letter............................................................................................................................................................................   58

7.2.         Screen‑inquiry program..............................................................................................................................................................   58

7.3.         Using function 6 and 7................................................................................................................................................................   58

7.4.         Correcting a letter or report........................................................................................................................................................   59

7.5.         Using commands in function 6 and 7.......................................................................................................................................   59

7.5.1.       Lineno...........................................................................................................................................................................................   59

7.5.2.        position.......................................................................................................................................................................................   60

7.5.3.       CR..................................................................................................................................................................................................   60

7.5.4.       End or CR.....................................................................................................................................................................................   60

7.5.5.       HLP command.............................................................................................................................................................................   60

7.5.6.       POS set start position of the screen........................................................................................................................................   60

7.5.7.       PRINT‑printout on printer.........................................................................................................................................................   60

7.5.8.       Top of form..................................................................................................................................................................................   60

7.5.9.       PRINTER define the printer assignment and page height....................................................................................................   60

7.5.10.      MASK turn the print raster on/off..........................................................................................................................................   60

7.5.11.      MODE shows field formats and numbers or names.............................................................................................................   61

7.5.12.      IL or LI inserting a line..............................................................................................................................................................   62

7.5.13.      DL or LD deleting a line............................................................................................................................................................   62

7.5.14.      FORMAT changing the format for the free field..................................................................................................................   62

7.6.         Special fields in a letter/report...................................................................................................................................................   63

7.6.1.       #DD todays date.........................................................................................................................................................................   63

7.6.2.       #PD per date................................................................................................................................................................................   63

7.6.3.       #PP pagenumber.........................................................................................................................................................................   63

7.6.4.       #KA filenumber...........................................................................................................................................................................   63

7.6.5.       #SN systemname........................................................................................................................................................................   63

7.6.6.       #SY systemnumber.....................................................................................................................................................................   63

7.6.7.       #TI system clock.........................................................................................................................................................................   63

7.6.8.       #NO programno..........................................................................................................................................................................   63

7.6.9.       #SC screennumber......................................................................................................................................................................   63

7.7.         Special characters (quotation marks etc).................................................................................................................................   63

7.8.         Letters in more versions.............................................................................................................................................................   64

7.9.         Useful lines and positions..........................................................................................................................................................   64

 

8.           Copying ‑ Deleting and documentation....................................................................................................................................   65

8.1.         Copying a report..........................................................................................................................................................................   65

8.1.1.       Copying a report between systems.........................................................................................................................................   65

8.2.         Delete a report..............................................................................................................................................................................   66

8.3.         Documentation of report definitions........................................................................................................................................   66

8.4.         Other functions............................................................................................................................................................................   68

8.4.1.       F Formfeed...................................................................................................................................................................................   68

8.4.2.       End ‑ return to main selector.....................................................................................................................................................   68

8.4.3.       System ‑ shifting to another system........................................................................................................................................   68

8.4.4.       Stop ‑ Stopping the background port......................................................................................................................................   69

8.4.5.       Jobqueue......................................................................................................................................................................................   69

8.4.6.       # ‑ Scope and systemprograms................................................................................................................................................   69

 

9.           Starting a report............................................................................................................................................................................   70

9.1.         The use of Function 9.................................................................................................................................................................   70

9.1.1.       Todays date.................................................................................................................................................................................   70

9.1.2.       'As of' date...................................................................................................................................................................................   71

9.1.3.       Start from and stop at.................................................................................................................................................................   71

9.1.3.1.     Selecting an index at START FROM:.....................................................................................................................................   71

9.1.3.2.     SORT‑use a previous sort........................................................................................................................................................   71

9.1.4.       User defined data field at start..................................................................................................................................................   72

9.1.5.       Warning concerning sorting/weighted totals........................................................................................................................   72

9.1.6.       Lowest total level 9.....................................................................................................................................................................   72

9.1.6.1.     Suppression of printout............................................................................................................................................................   72

9.1.7.       Filenumber...................................................................................................................................................................................   72

9.1.8.       Starting on screen/printer/backgroundport............................................................................................................................   73

9.1.9.       Test print......................................................................................................................................................................................   73

9.2.         Generation of the program..........................................................................................................................................................   73

9.3.         Controlling the background ports (phantomports)................................................................................................................   74

9.4.         Latch‑key functions....................................................................................................................................................................   74

 

10.          Messages......................................................................................................................................................................................   75

10.1.        Error Messages...........................................................................................................................................................................   75

10.1.1.      Printer not ready........................................................................................................................................................................   75

10.1.2.      This program is not defined.....................................................................................................................................................   75

10.1.3.      This report is not defined.........................................................................................................................................................   75

10.1.4.      This report is defined already..................................................................................................................................................   75

10.1.5.      There are no free reports..........................................................................................................................................................   75

10.1.6.      This report is not defined with this report generator...........................................................................................................   75

10.1.7.      This is not your report..............................................................................................................................................................   75

10.1.8.      This report is in use by another screen..................................................................................................................................   76

10.1.9.      Invalid system no......................................................................................................................................................................   76

10.1.10.     The reportgenerator is in use by another user.....................................................................................................................   76

10.1.11.     Please call your local Nixdorf consultant..............................................................................................................................   76

10.1.12.     Please call your local Nixdorf consultant..............................................................................................................................   76

10.1.13.     File not found............................................................................................................................................................................   76

10.1.14.     This file is not implemented....................................................................................................................................................   76

10.1.15.     This file is not implemented (READ missing).......................................................................................................................   76

10.1.16.     This file is not implemented (DRN missing).........................................................................................................................   77

10.1.17.     This report cannot be started.................................................................................................................................................   77

10.1.18.     This report file is full................................................................................................................................................................   77

10.1.19.     Invalid character in numeric field...........................................................................................................................................   77

10.1.20.     Invalid report number...............................................................................................................................................................   77

10.1.21.     Sorting cannot be performed during definition of sort.......................................................................................................   77

10.1.22.     Sorting is not implemented......................................................................................................................................................   77

10.1.23.     Invalid fieldno...........................................................................................................................................................................   77

10.1.24.     Invalid number..........................................................................................................................................................................   77

10.1.25.     The program will become too large........................................................................................................................................   78

10.1.26.     This field is totalled already....................................................................................................................................................   78

10.1.27.      Retry (Y/N)?..............................................................................................................................................................................   78

10.1.28.     Line too long.............................................................................................................................................................................   78

10.1.29.     BASIC ERROR NO.xxxx IN LINE NO.xxxx..............................................................................................................................   78

10.1.30.     BASIC ERROR NO.xxxx IN LINE NO.xxxx IN DMS.REP­GEN.xxx........................................................................................   78

10.1.31.     Sorry ‑ not enough core for testprint.....................................................................................................................................   78

10.1.32.      STATUS=x................................................................................................................................................................................   79

10.1.33.     Function x cannot be performed on this report....................................................................................................................   79

10.1.34.     These reports are not free for use..........................................................................................................................................   79

10.1.35.     Invalid format............................................................................................................................................................................   79

10.1.36.      must be between 1 and xx.......................................................................................................................................................   79

10.1.37.     Totals cannot be defined on letters.......................................................................................................................................   79

10.1.38.     Sortkey translated to xx characters........................................................................................................................................   79

10.1.39.     DMS.REPGEN is not installed................................................................................................................................................   79

10.2.        Save error numbers.....................................................................................................................................................................   80

10.2.1.      Save error number 104...............................................................................................................................................................   80

10.2.2.      Save error number 108...............................................................................................................................................................   80

 

Figures..........................................................................................................................................................................................................   81

 

Keyword index............................................................................................................................................................................................   82

 


1.           PREFACE.

 

   DMS.REPGEN is a programming tool for users who have no programming experience. After a short introduction, all users may produce reports in a step by step dialogue with the Nixdorf 8870.

 

   DMS.REPGEN has been developed and improved over a period of 10 years and has hundreds of satisfied users.

 

   The main objective has been to create a tool so simple that everybody can use it.

 

   Reports may be printed on any type of printer or shown on the screen.

 

   DMS.REPGEN is built around a data‑dictionary, defined during implementation by the installer, which contains information on all files, fields and their internal relationships.

 

   The user needs only to concentrate on the files and fields he wants in the report. DMS.REPGEN produces reports from up to 9 files at the same time.

 

2.1.         Start DMS.REPGEN.

 

   When you select DMS.REPGEN, this main menu is shown.

   

 

Figure 1  DMS.REPGEN main selection module.

 

 REPORT GENERATOR     REPORT GENERATOR     REPORT GENERATOR    # 3 87.09.21/11:28

                                                                                 

                                                                                 

                                                                                 

                      DMS.RAPGEN                                                 

                                                                                  

                      1 ... DEFINE NEW REPORT                                    

                      2 ... DEFINE SELECTIONS                                    

                      3 ... DEFINE SORTING AND TOTALLING                         

                      4 ... DEFINE CALCULATIONS                                  

                      5 ... DELETE REPORT                                        

                      6 ... DEFINE NEW LETTER                                    

                      7 ... AMENDMENTS TO A REPORT/LETTER                        

                      8 ... PRINT OF DEFINITIONS                                 

                      9 ... START AND GENERATE REPORT                            

                     10 ... COPY REPORT                                          

                                                                                 

                     ENTER CODE:........                                         

                                                                                 

                                                                                 

                                                                                 

                                                                                 

                                                                                 

 MESSAGE  :                                                                      

 

 

 

 

  

2.3.         How to use this manual!.

 

   The step by step dialogue and information texts on the screen will hopefully be suffient guidance in most cases,but if you have a problem then use the manual as a handbook and look the main function up in the table of contents in the keyword section. If you get an error message and the explanation on the screen is not suffient, then look the message up in the error message section.

 

   The manual includes a lot of examples, based on four simple files. The structure and contents of these files are explained in detail in the next section.


2.5.         Files used in the examples.

 

   We have used 4 simple files, all created with DMS.DATAMASTER, for the           examples in this manual.

 

    DMS.REPGEN may of course be used on any type of file,indexed/relative, with packed/unpacked or partly packed keys and all types of record formats.

 

    In order to show you how to use DMS.REPGEN on several files at the same time, we have based the examples on a simple article file. Each Article belongs to an article group with information on group name and a calculation factor which could be used to calculate a new  sales price based on the cost price and the vendors payment currency code.

 

    Detailed descriptions of the four files used in the examples are given overleaf, these files are:

 

        ‑ an article file, which contains fields pointing to

        ‑ an article group file and

        ‑ a supplier file, which itself contains a field pointing to

        ‑ a currency file

 

Each file is referred to by a 2 character short name

 

FILES USED IN THE EXAMPLES:

                  

                 Article no.

                 Supplier no.                    Group no.

             

VA                              GR               

Article file      ®Article group file

             

         ­                                          

                                                   

                                                   

         ¯        Supplier no.                    Currency code

             

LE                              KU               

Supplier file     Currency file    

             

 

2.6.1.       VA ARTICLE FILE.  

 

  NO.DESCRIPTION         FORMAT   LAYOUT                   INDEX

   1 ARTICLE NO.           4      xxxx                     INDEX 1

   2 DESCRIPTION          20      xxxxxxxxxxxxxxxxxxxx

   3 SALE PRICE            6.2    999999.99

   4 COST PRICE            6.2    999999.99

   5 LAST DATE PURCHASE   .6.     99,99,99

   6 SUPPLIER NO.          3      xxx                      INDEX 2

   7 ARTICLE GROUP NO.     2.     99.

   8 STOCK BALANCE        ‑6      ‑999999

   9 ALTERNATIVE SUPPLIER  3      xxx

  10 FREE FIELD           ‑6.2    ‑999999.99

 

2.6.3.       LE SUPPLIER FILE.      

 

  NO.DESCRIPTION         FORMAT   LAYOUT                   INDEX

   1 SUPPLIER NO.          3      xxx                      INDEX 1

   2 NAME                 24      xxxxxxxxxxxxxxxxxxxxxxxx

   3 ADDRESS              24      xxxxxxxxxxxxxxxxxxxxxxxx

   4 TOWN                 24      xxxxxxxxxxxxxxxxxxxxxxxx

   5 CURRENCY CODE         2.     99

   6 BALANCE              ‑8.2    ‑99,999,999.99

 

2.6.5.       KU CURRENCY FILE.     

 

  NO.DESCRIPTION         FORMAT   LAYOUT                   INDEX

   1 CURRENCY CODE         2.     99                       INDEX 1

   2 CURRENCY NAME         4      xxxx

   3 RATE                  4.4    9999.9999

 

2.6.7.       GR ARTICLE GROUP FILE    

 

  NO.DESCRIPTION         FORMAT   LAYOUT                   INDEX

   1 GROUP NO.             2.     99                       INDEX 1

   2 GROUP NAME           16      xxxxxxxxxxxxxxxx

   3 PRICE FACTOR          4.4    9999.9999

 

 


2.6.9.       Contents of the files.

 

 

Figure 2 Article file.

 

DATE:14,01,87             * ARTICLE LIST *       AS OF 14,01,87   PAGE:   1  

                                                                             

NO   DESCRIPTION           SALE PRICE   COST PRICE     DATE SUP ALT GR   STOCK

0101 BOLT                        2.00         1.50  1,01,87 271 270  0     100

0102 TRUCK‑HOPPER            20000.00     10000.00  1,01,85 100   0  9       0

0110 TRUCK‑WORK             100000.00     60000.00 15,12,86 123 100  2       1

1001 TRUCK‑WHEEL              1000.00       500.00 31,12,86 205 102  0     100

1005 TRUCK‑GEARBOX            2000.00      1500.00  1,06,86 100   0  1      10

2001 BOLT‑SPEC./AL              20.00        10.00  1,01,87 205 102  9      10

2002 BOLT‑SPEC./BR              25.00        10.00 30,07,86 205 102  9     200

 

 

 

 

Figure 3 Supplier file.

 
   

DATE:14,01,87  * SUPPLIER LIST *   AS OF 14,01,87    PAGE:   1               

                                                                              

NO.     NAME                  CURRENCY CODE        BALANCE                   

100     HUMBER LTD.                       0           0.00                   

102     AX & AX LTD.                      0      25,000.00                   

105     WEBB'S SUPPLIERS LTD.             0         500.00                   

111     TRAWSOM LTD.                      0       1,000.00                   

123     BRAUN GMBH                        1           0.00                   

205     SCHIERMACHER GMBH                 1      20,000.00                   

260     CLORID LTD.                       0       2,000.00                   

270     OHIO INC.                         2         200.00                   

271     DANDY INC.                        2           0.00                   

 

 

 

 

Figure 4 Currency file.

 
         

DATE:14,01,87  * CURRENCY LIST *    AS OF 14,01,87   PAGE:   1               

                                                                             

CURRENCY CODE   NAME       RATE                                              

            0   UKP      1.0000                                              

            1   DEM      2.7990                                              

            2   USD      1.5160                                              

 

 

 

 

 

Figure 5 Article group file.

 
 

DATE:14,01,87  * ARTICLE GROUP LIST *   AS OF 14,01,87   PAGE:   1           

                                                                             

GROUP NO GROUP NAME     PRICE FACTOR                                         

       0 STOCK                1.0000                                          

       1 AUX.                 2.0000                                         

       2 SPECIAL              1.2345                                          

       9 N/STOCK              3.0000                                         

 


2.7.         General operating rules.

 

   When DMS.REPGEN is selected, you will see the main menu on the screen.

 

   Type CR to return to the systems main menu, for example a TAMOS menu.

 

   All functions in DMS.REPGEN are ended by entering END or CR.

 

   A function may be terminated by pressing the ESCape‑key, and all corrections are deleted.

 

   A function may also be selected directly, for example 4,28, allows you to define new calculations in reportno. 28.

 

   When using more files you may look up the fields in the files by typing ? or press the HELP‑key, the lowest key to the right of the keyboard.

 

 

 

Figure 6  Keys used in DMS.RAPGEN.

 
                                                      

    

_    L4 _     L3 _    L2 _     L1 _       _       

                                                       

                                                       

_    R4 _     R3 _    R2 _     R1 _   S   _ ON/OFF

                  ENTER   SHOW KEY                   

                                                     

BS      Y      N            ­                      

                                                     

                                                     

  C      7      8      9                             

                                                     

   @  

                                                    

         4      5      6             ­               

                                                     

                                                     

         1      2      3          SPR               

                                                     

  CR  

                                                       

          0              ,                        END 

                                                       

 

 


2.9.         DMS.DATAMASTER.

 

   DMS.DATAMASTER has been mentioned several times in this manual. With this tool the user may create and maintain his own files. Furthermore, these files may be changed and expanded without loss of existing data. Further details can be found in the DATAMASTER user manual.

 

    Without DMS.DATAMASTER, it is not possible to define new files.This must be done by your Software Support contact.

 

2.11.         Operating systems.

 

   DMS.REPGEN may be used with all current versions of Niros from 3.27 DMS.REPGEN is written in BASIC and uses only BASIC to produce the report program, itself written in BASIC. These programs may be modified like any other program.

 

   DMS.REPGEN normally needs at least a 16 K partition and 16 data files open.

 

   If a report is very complex and needs a large number of totals, you may need a larger partition size, this should be discussed with your system installer.

 

2.13.         Disc space.

 

   DMS.REPGEN normally takes up approximately 2500 sectors (blocks) of disc space.

 

   The actual space can be calculated in the following way:

 

1. DMS.REPGEN‑programs                               1000 sectors.

2. Per additional user at     1 * 75, eg.  75       =  75 ‑

   the same time

3. Per file                   x * 20, eg.  10       = 200 ‑

4. Per report                 x *  4, eg.  44       = 176 ‑

5. Textfile per.report        x *  4, eg.  44       = 176 ‑

6. Program per report         x * 16, eg.  44       = 704 ‑

7. Sortfile per 1000 records  x *150, eg.1000       = 150 ‑

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

                                                     2481 sectors.

 

   If an installation has limited disc space, Item 6, Program per Report, may be omitted.This will reduce performance in the main selection module, but not in printing the report itself.

 

2.15.         DMS.REPGEN SYSTEM.

 

   A DMS.REPGEN SYSTEM is a collection of parameters used by DMS.REPGEN. Systems are stored in 0/CHSYSTEM and are maintained by the program DMS.REPGEN.SYS.

 

   It is possible to define up to 100 systems on one 8870,but normally 1 will be sufficient.

 

   The parameters help the installer to integrate DMS.REPGEN into the applications, for example COMET, TAMOS or any special application.

 

   A system may contain up to 88 reports.


2.           Define a new report.    

 

3.1.         Overview

 

   When you define a new report (Function 1),just tell DMS.REPGEN which files you want  to use,give the report a number and a name and define the fields you want to be written in the report. In order to make it easier to select the fields,    DMS.REPGEN will show you the fields in the files on the screen.

 

   From the overview of fields in the files you simply type in the number of the selected field and then DMS.REPGEN will position the fields left or right justified on the line (alpha/numeric) with suggested headings  (fieldnames).

 

  Once you have selected the fields you want in your report,it is possible to continue directly to Function 9 and produce a printout,or have the report displayed on the screen. Based on your information, DMS.REPGEN will generate a Basic program.

 

   This program may be changed either within DMS.REPGEN or outside it and will as an option total all suitable numeric fields and print out grand totals.

 

   If you want to improve the lay‑out of your report then type in headings, alter the field positions, use multiple lines and use fields from other files. It is possible to concentrate first on the layout of your report and then later to introduce other functions, define the selections, sorting, the calculations and the totalization you want done in the report. Each function may be changed without any effect on the others.

 

3.3.         Define a new report ‑ Function 1.

 

   When you select Function 1, the screen shows the names of all the existing reports that have been created with DMS‑REPGEN.

 

Figure 7  Report overview

 

 DMS.RAPGEN                                           1.....DEFINE NEW REPORT    

   1 PRICE LIST                                                                  

   2 STOCK VALUE                                                                 

   3 MARGIN LIST                                                                 

   4 PRICE CALCULATIONS                                                          

   5 VENDOR LABELS                                                               

   6 VENDOR BALANCE                                                              

   7 STOCK LIST                                                                  

   8 GROUP LIST                                                                  

   9 SUPPLIER LIST                                                                

  10 CURRENCY LIST                                                               

  11 ITEMS BY SUPPLIERS                                                          

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

 REPORT NUMBER ? (CR=NEXT FREE REPORT)                                           

                                                                                  

 

 

3.4.1.       Reportnumber.

 

   If CR is pressed at the prompt 'REPORTNO.?', the next free number will be allocated. If you want a special report number, just type it in. Depending on the available disc space of the installation, the system uses numbers 1‑88. If you are short of disc space then use low numbers to obtain better performance in the program selection, Function 9. 


3.4.3.       File identification.

 

   Once the report number is selected, the next thing to do is to define which file or files one wants to use. The screen shows all files implemented for use with DMS.REPGEN in this System.

 

 

Figure 8  Files.

 

 DMS.RAPGEN      1                                    1....DEFINE NEW REPORT     

 GR.... ARTICLE GROUP FILE                                                       

 KU.... CURRENCY FILE                                                            

 LE.... SUPPLIER FILE                                                            

 VA.... ARTICLE FILE                                                             

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                 

                                                                                 

                                                                                 

                                                                                  

 FILE SHORTNAME ?                                                                

 

 

 

     

   A file is identified by a 2‑letter short name. The file selected will be the main file, i.e the file read through and from which references to other files are made.

 

   DMS.DATAMASTER files may be updated if the file short name is specified as xx,w. It is then possible to calculate on fields and write the results back into the main file. Please note that when using the rewrite facility, the user must be very careful, as it is possible to destroy important information. Files defined with xx,w are password protected automatically. It is not possible to write back into files other than the main file.

 

   In the installation phase all files may be password protected,except personal files, to avoid unauthorised use. Furthermore, each report may be password protected.

 

3.4.5.       File password.

 

   The programmer is able to connect a password to the file which has to be entered before a report can be defined.

 

3.5.         Main information for a Report.

 

 

Figure 9  Report main information.

 

 DMS.REPGEN     1                                     1....DEFINE NEW REPORT     

 GR.... ARTICLE GROUP FILE                                                       

 KU.... CURRENCY FILE                                                            

 LE.... SUPPLIER FILE                                                            

 VA.... ARTICLE FILE                                                             

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

 FILE SHORTNAME ? VA......ARTICLE FILE                                           

                                                                                 

 REPORT NAME (FOR SELECTOR) ?         PRICELIST                                  

                                                                                 

 LINES ON FORM         (CR=66)    ?   66                                         

                                                                                  

 MAIN HEADING (N=NONE, CR=AS NAME) ?  PRICELIST                                  

                                                                                 

 PRINT ZERO FIELDS  (Y/N) ? Y         USER NAME ? XXXXXXXXX                      

 

  

 

3.6.1.       Reportname.

 

   The name identifies a report to the user and is normally shown on the screen with 1‑25 letters. The name may be changed by copying the report to another reportnumber (Function 10).


3.6.3.       No.of lines per page.

 

   Typing CR will set a page length defined at the time of installation, alternatively, type in the number of lines you want on a page. (Useful for labels, letters and preprinted forms). As standard, DMS.REPGEN will shift to a new page 3 lines before the page end. If you want to change this, just type pagelength, number of empty lines, for example 66,5 and the page shift will take place 5 lines before the page end.

 

3.6.5.       Report heading.

 

   Just type CR and the report name will be taken as the heading or type in the heading you want. Type N and you will get no heading at all. The heading is automatically positioned in the center of the report, according to the number of fields in the report.

 

3.6.7.       Zeros printed Y/N?.

 

   Type 'Y' and zero fields will be printed.

 

   Type 'N' and zero fields will be suppressed.

 

3.6.9.       Printer.

 

   The user may enter a printerno. if this facility is included at installation time.

 

3.6.11.       Username/password.

 

   Type CR if you do not want to protect the report or type in a  9‑letter password that will protect your report from any attempt to  change/delete it. If you want to protect your report from unauthorised printing as well, then include the password in the form Control‑E, password, for example CTL E TEST. The username/passwords may be changed in the copy function (10). NOTE! Do not forget the username/ password or you will have to contact your software supplier for assistance.

 

3.7.         TAMOS selector.

 

   If this function is not activated, you may start to define the lines on your report immediately.

 

   However, if the DMS.REPGEN is integrated with TAMOS you will see the screen display shown below:

   

 

Figure 10  TAMOS selector definition.

 

 DMS.REPGEN   1 PRICE LIST                            1.....DEFINE A NEW REPORT  

                                                                                 

 * TAMOS SELECTOR *   REPORT NO:  1 PRICELIST                                    

  1 SYSTEM FUNCTIONS    1 DAILY PROCEDURES    1 PORT INQUIRY        00/TA.STRPIQ 

  2                     2 UTILITIES           2 DISPLAY ARCHIVES    00/TA‑PRTARC 

  3                     3 DISK MANAGEMENT     3 EVALUATE LOGBOOK    00/UT.ZDM    

  4                     4                     4 PRINT LOGBOOK       00/UT.ZDM    

  5                     5                     5 SET SYSTEM TIME     00/TA.STRPIQ 

  6                     6                     6 DEVICE ASSIGNMENT   00/TA‑PRTASGN

  7                     7                     7 DISP.PRINT SPOOLFILE00/TA.DISPQ  

  8                     8                     8 SPOOLER ASSIGNMENT  00/TA.PRTASGN

  9                     9                     9 PRICE LIST          DMS.RAP      

 10                    10                    10                                  

 11                    11                    11                                  

 12                    12                    12                                  

 13                    13                    13                                  

 14                    14                    14                                  

 15                    15                    15                                  

 NO.? 1                NO.? 2                NO.? 9                              

                                                                                  

 PROGRAMNO. USED BY: PRICELIST                                                   

                                                                                 

 REPLACE THE OLD REPORT (Y/N) ?                                                  

 

 

 

   You may enter under which numbers at each of the 3 levels the report should be placed. If you type CR, the report is not stored in the selector.

 

    If there is already a report with the number in the selector under which you want to place the new one, you may replace the old one. Only DMS.REPGEN programs may be replaced in this way.


3.9.         Report lines

 

   When you have ended the definition of the main information of a report the screen will show you an overview of fields in the file and 20 additional free fields for use in calculations.

 

 

Figure 11  Definition of report lines.

 

 DMS.RAPGEN     1 PRICE LIST                          1......DEFINE NEW REPORT   

   1 ARTICLE NO              19 @FREE                                            

   2 DESCRIPTION             20 @FREE                                            

   3 SALE PRICE              21 @FREE                                            

   4 COST PRICE              22 @FREE                                            

   5 DATE LAST PURCHASE      23 @FREE                                            

   6 SUPPLIER NO             24 @FREE                                            

   7 ARTICLE GROUP NO        25 @FREE                                            

   8 STOCK BALANCE           26 @FREE                                            

   9 ALTERNATIVE SUPPLIER    27 @FREE                                            

  10 FREE FIELD              28 @FREE                                            

  11 @FREE                   29 @FREE                                            

  12 @FREE                   30 @FREE                                            

  13 @FREE                                                                       

  14 @FREE                                                                        

  15 @FREE                                                                       

  16 @FREE                                                                       

  17 @FREE                                                                        

  18 @FREE                                                                       

 1...,....10...,....20...,....30...,...;40...,....50...,....60...,....70...,....8

 +xx , ‑xx , Pxx =POSITION , Hxx =HEADING , Nxx =NO HEADING , D =DELETE , T=TEXT 

 ARTICLE NO DESCRIPTION          SALE PRICE                                      

 AAAA       AAAAAAAAAAAAAAAAAAAA  ######.##                                      

 LINE NO.  1 FIELDNO.?                                                            

                                                                                 

 

 

 

   Below the file definitions the main functions are shown and 3 lines are used to show the 3 previous lines.

   

               Lineno. 1:   Fieldno.

 

   Just type the fieldnumber you wish to show in your report and the field, with the fieldname as heading, is positioned in the line according to the field format and the length of the name/heading. Alpha fields are left justified and numeric fields are right justified. When a fieldnumber is selected, the number and name are highlighted on the screen. When all lines are defined, type END and press the CR‑key. DMS.REPGEN will store your definitions and you may print the report out or show it on the screen. The example defined above is shown overleaf:

   

 

Figure 12  The defined report.

 

DATE:14,01,87     * PRICELIST *    AS OF 14,01,87   PAGE:   1                

                                                                             

ARTICLE NO DESCRIPTION         SALE PRICE GROUP NO                           

0101       BOLT                      2.00        0                           

0102       TRUCK‑HOPPER          20000.00        9                           

0110       TRUCK‑WORK           100000.00        2                           

1001       TRUCK‑WHEEL            1000.00        0                           

1005       TRUCK‑GEARBOX          2000.00        1                           

2001       BOLT‑SPEC./AL            20.00        9                           

2002       BOLT‑SPEC./BR            25.00        9                           

                                                                              

GRAND TOTAL                     123047.00                                    

 

 

   

   As an aid to the editing of the report you may use the following functions:

 

3.10.1.        +xx Move xx characters forward.

 

   The arrow on the report line shows you where the next field will be placed, for example, typing +5, the arrow will move 5 positions to the right.

 

3.10.3.        -xx Move xx characters backward.

 

   This function works similarly to the one described above. You may only move left until you reach the previous field in the line. In order to move further to the left, you have to use the D‑function and delete the previous field.

 

3.10.5.        Pxxx Move to position xxx.

 

   You may move to an exact position in the line, but never further backward than the previous field.


3.10.7.        Hxx Fieldno.xx with user heading.

 

   When you just type the fieldnumber the field heading will  automatically be the fieldname. If you type H and the fieldnumber you may type in the heading. A heading is always only on one line in this function. By using Function 7, Amendment to a report/‑letter, you may add additional lines.

 

3.10.9.        D Delete previous fields.

 

   With this function, you may delete previous fields one by one.

 

3.10.11.        T Text in the line.

 

   If you type TBALANCE the text 'Balance' will occur at the line (not as a heading).

 

3.10.13.        Nxx Fieldnumber xx without heading.

 

   You may suppress the heading by typing N and the fieldnumber.

 

3.10.15.        N Remove all headings.

 

   If you type N, all the field headings are suppressed.

 

3.10.17.        H@xx Fieldno. new fieldname.

 

   You may change the fieldname permanently in the file definitions. This is normally used to shorten the fieldnames given by the installer.

 

3.10.19.       KK#xx Fieldno. from another file.

 

   You may select fields from other files by typing: KK#XX

   

                 Fileshortname (2 letters) #

                 Fieldnumber             

 

   If you select fields from other files you MUST define how to READ the file.(See Chapter 4, Calculations and multiple files).

 

3.10.21.

2.5.11.       HLP Help overview of fields in other files.

 

   If you type the keyword HLP you will get an overview of files and their fields. (See Chapter 4).

 

3.10.23.       Line statement of account type of report.

 

   At the beginning of a new line, you may type LINE and in this way define that previous lines are to printed only once and that this line is to be printed more often. The procedure is controlled with the READH function. (See Chapter 4 Multiple files).

 

3.10.25.

2.5.13.       CR. End this line.

 

   Just type CR and you are asked to approve the line:

                      

          Line OK (Y/N)?

 

    You may accept or delete the line layout. If you accept the line, it is moved to a higher position on the screen and you may then define a new line. You may define as many lines as you wish. Each line will have headings unless they are removed by the N‑function. Labels should be defined as a letter‑type of report.

 

3.10.27.      Blank lines (double space).

 

   If you require a report with double spacing then just define a second line without fields.


3.11.         Free fields.

 

   On the screen you will see the fields of the file and an additional 20 fields marked FREE. Free fields are used for calculations. (See Chapter 4).

 

3.12.1.       Heading/Name.

 

   When you select a free field at your report line, you are asked to give it a heading/name which will appear as field name when you define the calculation rules.

 

3.12.3.       Field formats.

 

   The first 10 free fields are defined as ‑9,2 i.e. ‑999999999,99, the following 10 free fields are defined as ‑5 i.e. ‑99999. These definitions may be changed according to your specific requirements.

 

3.12.5.       Defining field format.

 

        1. xx,    =  xx numbers of digits ‑ no sign.

        2. xx,y   =  xx nos. of digits before decimalpoint ‑ Y nos. of digits after decimalpoint ‑ no sign.

        3. ‑xx,   =  As 1. ‑ with sign.

        4. ‑xx,y  =  As 2. ‑ with sign.

        5. ,xx,   =  As 1. ‑ with editing per. 1000.

           ,9,2   =  e.g. 999,999,999.99.

        7. xx     =  If the comma is left out a textfield of xx characters are defined. Max. 80.

 

3.12.7.       Changing free field formats in a report.

 

   Once a free field format is redefined in a report, this will be stored by DMS.REPGEN and is not easily changed. If you wish to change a format when you are defining a report line, then delete the field with the D‑function and use another free field in the report.

 

    If you wish to change a field format after you have defined a report, you may use Function 7. (Amendments to a report/letter) and use the Format command in order to redefine the field.

 

    Only numeric fields may be redefined.

 

3.12.9.       Calculation precision ‑ free fields.

 

   Irrespective of the field formats, calculations will always take place with floating decimal point and maximum precision of 14 digits. (See Chapter 4 Calculations & Rounding).

 

3.12.11.       Automatic field format expansion (overflow).

 

   Normally a field is printed with '*' if a result is too large to be held in a field (overflow). In order to avoid this, field formats are expanded with additional digits to the left if there is free space in the line. If you produce a report and '*' are printed then you do not have to change formats but only need to ensure that there is space to the left of the field (Function 7).


3.13.         Totals ‑ automatic.

 

   When a report is defined DMS.REPGEN will automatically total all suitable fields as final totals. If some of the totals do not make sense or you only require some of them, you may exclude these in Function 3. (Define sorting and totalling).

 

   DMS.REPGEN totals fields according to the following criteria:

 

             1. Field must be numeric.

             2. Field format must be at least 5 digits or

             3. Defined as a 4 words‑variable (max.precision).

             4. Fields with date format (,6,) are not totalled.

             5. Fields defined as keys,indexes and special checkcode (1‑9),are not totalled.

 

3.15.         Format of a report.

 

   A report page may be defined with a maximum of 80 lines. A4 format is 72  lines. You may define as many lines as you wish, up to 3 lines from the bottom of a page. Please remember that a line normally counts as 2 lines, the line itself and a heading.

 

   If a record is displayed on the screen you have to press CR, when a screen is full, i.e. per 24 lines, to scroll the display.

 

   A report may be up to 177 characters wide, normally limited by forms and type of printer. 132 characters is standard for most printers and an A4 document form normally takes 80 characters.

 

   If a report is defined with more than 80 pos. and shown on screen each line is shown as 2 lines.


3.           Selection. 

 

   Selection is used to select specific records in files.

 

Figure 13 SUPPLIER LIST,only balances over 500 are printed

 

DATE:14,01,87  * SUPPLIER LIST *   AS OF 14,01,87    PAGE:   1               

                                                                             

NO.     NAME                  CURRENCY CODE        BALANCE                   

102     AX & AX LTD.                      0      25,000.00                   

111     TRAWSOM LTD.                      0       1,000.00                   

205     SCHIERMACHER GMBH                 1      20,000.00                   

260     CLORID LTD.                       0       2,000.00                   

 

 

 

4.1.         Normal use of selections.   

 

   When you choose Function 2, (Defining selections) for a report, you can review the fields in the file on the screen, and then you may select any of these by typing in the field number:

 

 

Figure 14 Defining selections.

 

 DMS.RAPGEN     1 PRICE LIST                          2......DEFINE SELECTIONS   

   1 ARTICLE NO              19 @FREE                                            

   2 DESCRIPTION             20 @FREE                                            

   3 SALE PRICE              21 @FREE                                            

   4 COST PRICE              22 @FREE                                            

   5 DATE LAST PURCHASE      23 @FREE                                            

   6 SUPPLIER NO             24 @FREE                                            

   7 ARTICLE GROUP NO        25 @FREE                                            

   8 STOCK BALANCE           26 @FREE                                            

   9 ALTERNATIVE SUPPLIER    27 @FREE                                            

  10 FREE FIELD              28 @FREE                                            

  11 @FREE                   29 @FREE                                            

  12 @FREE                   30 @FREE                                            

  13 @FREE                                                                        

  14 @FREE                                                                       

  15 @FREE                                                                       

  16 @FREE                                                                        

  17 @FREE                                                                       

  18 @FREE                                                                       

                                                                                  

                                                                                 

 ARTICLE GROUP NO            >=3                          <=15                   

 STOCK BALANCE               >=100                                                

 FIELDNO.? 8                 MINIMUM:100                  MAXIMUM:               

                                                                                 

 

 

 

        

   After entering the field number you may define a minimum and maximum value for the fields, so that only records in this field range will be printed.

 

    You may simply define one of the minimum/maximum values.

 

    After this you may type in a new field number and define combined selections on multiple fields. You should note that this would be a selection where both the first AND the second selection have to be true. For example field number 7 must contain the number 5 AND field number 15 must contain the number 1 at the same time. If you define a selection like this and field number 7 contains 5 and field number 7 contains 9,nothing at all will be printed on the report. "OR" selections must be done by calculations,as explained later. (See Chapter 3.8).

 

    You may select on the fields of the file, calculated fields, and fields from other files. When you have finished the definition type END or CR., this will bring you back to the DMS.REPGEN main module.

 

4.3.         Deleting selections.

 

   The next time you define selections on the report, the old ones are automatically deleted and replaced with the new ones. If you finish without defining any selections the report will be printed without any selection.


4.5.         Selections not equal to 0.

 

   If you state a minimum/maximum, the value of the field must be within the range . In both minimum/maximum specification, you may use one of the relational operators (see Chapter 4 Calculations).

 

                MINIMUM: #5<>0

 

and no maximum. This will give the result that only records with the field not equal to 0 will be printed.

 

4.7.         Selection on alphanumeric fields.

 

   You should note that minimum/maximum values must be stated in quotation‑marks, for example "A", if the field is alphanumeric.

 

4.9.         Calculations in selections.

 

   In both minimum and maximum fields you may enter a calculation, in this way it is possible to define, for example:

 

            FIELDNO: #5 + #7

            MINIMUM: #15 * 100

 

   In using this example you have defined a selection on the condition that a total of fields must be greater than another field.

 

4.11.         Selections entered at the time of printing. 

 

   You may use data input when printing a report, (explained in an earlier chapter), as a basis for selection when the report is printed. For example:

 

            MINIMUM: #D1  MAXIMUM: #D2

 

    In this situation, you would have to type in values which the selected fields should be between when the report starts. You may even have a text  attached to these min./max.fields which explains what should be typed in. The name of a free field is defined by #D1TEXT.

 

4.13.         Selections on parts of fields.

 

   If you want to select on the condition that the 3rd digit in a number is a given maximum or minimum, you may define #7(3,3) as a fieldnumber. This is explained in more detail in Chapter 4.

 

4.15.         Selections combined with calculations.

 

   The fact that you may select on calculated fields may be used to allow more complicated selections by calculating a free field for use in selections, for example:

 

        #50=0         (#50 is a free field)

 

        IF #7=3 LET #50=1                                                               

        IF #7=5 LET #50=1

        IF #9>3 LET #50=0  

 

and then define a selection as follows: FIELDNO:50  MINIMUM:1 In the case you will only process records where fieldnumber 7 is either 3 or 5, but not if fieldnumber 9 is greater than 3.

 

    This method can be used to provide logical "OR" selections.


4.17.         QUICK selections.

 

   This function may only be used in connection with files defined with the DMS.DATAMASTER file definition program, i.e. COMET and DMS files.

 

    Normally, selection will take place after calculations have been made, i.e. after all fields in all files have been read and all calculations made.

 

    With QUICK selections you can define that one specific field should be read before anything else, and the selection on this field must take place before anything else, which means the normal READ‑statements must be used for the selection, DMS‑REPGEN will generate a high priority reading of each field. This demands that the field is a simple numeric one, which has not been packed, and that when the installation took place the field displacement (bytenumber) in the record was defined. This is the situation for DATAMASTER files.

 

    Quick selection only effects the speed of the report, not the function itself. Quick selection is usually used when printing out few records from very big files, where you can expect to make a report up to 20 times faster. (Note the problem with weighted totals, explained in Chapter 6).

 

    You may not make any calculations on other fields in conjunction with QUICK selections, when these are not accessable.

 

    Quick selections are activated by typing the command QUICK when the word fieldnumber appears on the screen. DMS‑REPGEN will answer: QUICK SELECTIONS ACTIVATED. You then define a normal selection based on a simple numeric value, and this will achieve priority above everything else on the report.

 

    If the field is not a simple numeric value the report generator will ignore the quick selection. You may define a maximum of 2 quick selections on one report.


4.           Calculations.

 

5.1.         Structure of the calculation function.

 

   With this function, you may calculate results and print them in a report or use the calculation to sort a file into a new order or to select on certain conditions. The syntax is identical to normal algebra, e.g. A = B + C and you can use all the normal operators including square roots and trigometric functions.

 

   When calculating, you have access to the BASIC lanquage of the Nixdorf 8870 including all its facilities. To make it simple to use DMS.REPGEN  translates your commands into BASIC. Just refer to a free‑fieldnumber e.g. #51 = #20 + #19 and the sum of fieldnumber 20 and fieldnumber 19 are  placed in fieldnumber #51. If you wish to know fieldnumber #20 as a percentage of fieldnumber #19, just type #51 = #20% #19. You may use a field from another file in the calculations by using the file shortname and a fieldnumber e.g. #52 = KU#12 ‑ #20.

 

   There are also functions for rounding, e.g. to 2 decimal places, calculation of days between 2 dates, calculation of workdays, reading other files, calculation of checkdigits of fields or lines printed for optical reading (OCR).

 

5.3.         How to use the calculation‑module.

 

   In the main module, you select Function 4, Calculations and then you select the report number in which you wish to use the module.

 

   The screen will appear as in the following example:

   

 

Figure 15 Definition of calculations.

 

 DMS.RAPGEN     2 STOCK VALUE                         4......DEFINE CALCULATIONS 

   1 ARTICLE NO              19 @FREE                                            

   2 DESCRIPTION             20 @FREE                                            

   3 SALE PRICE              21 @FREE                                            

   4 COST PRICE              22 @FREE                                            

   5 DATE LAST PURCHASE      23 @FREE                                            

   6 SUPPLIER NO             24 @FREE                                            

   7 ARTICLE GROUP NO        25 @FREE                                            

   8 STOCK BALANCE           26 @FREE                                            

   9 ALTERNATIVE SUPPLIER    27 @FREE                                            

  10 FREE FIELD              28 @FREE                                            

  11 STOCK VALUE             29 @FREE                                            

  12 @FREE                   30 @FREE                                            

  13 @FREE                                                                        

  14 @FREE                                                                       

  15 @FREE                                                                       

  16 @FREE                                                                        

  17 @FREE                                                                       

  18 @FREE                                                                       

                                                                                  

                                                                                 

 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:                                                                    

                                                                                 

 

 

 

   In Function 1 ‑ Define a new report, you have edited the report and have chosen to print a free field with a related format and name. If you printed out the report before you defined the calculation, you would have had 0 in the field.

 

    You may enter, for example:

                       

        #11 = #8 * #4

 

This means that Fieldnumber 11 (Stockvalue) is to be calculated as #8 (Costprice) * #4 (Stockbalance).


    You may now accept the line or delete it at the prompt:  OK Y/N?

 

 

Figure 16 Entering a calculation line.

 

 DMS.RAPGEN     2 STOCK VALUE                         4......DEFINE CALCULATIONS 

   1 ARTICLE NO              19 @FREE                                            

   2 DESCRIPTION             20 @FREE                                             

   3 SALE PRICE              21 @FREE                                            

   4 COST PRICE              22 @FREE                                            

   5 DATE LAST PURCHASE      23 @FREE                                             

   6 SUPPLIER NO             24 @FREE                                            

   7 ARTICLE GROUP NO        25 @FREE                                             

   8 STOCK BALANCE           26 @FREE                                             

   9 ALTERNATIVE SUPPLIER    27 @FREE                                            

  10 FREE FIELD              28 @FREE                                            

  11 STOCK VALUE             29 @FREE                                            

  12 @FREE                   30 @FREE                                            

  13 @FREE                                                                       

  14 @FREE                                                                       

  15 @FREE                                                                       

  16 @FREE                                                                       

  17 @FREE                                                                        

  18 @FREE                                                                       

                                                                                 

 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 

 STOCK VALUE=STOCK BALANCE*COST PRICE                                            

 CALCULATION:#11=#8*#4                                                            

                                                                  OK (Y/N) ? Y   

 

 

 

   You may see above that the field numbers used in calculations are translated into fieldnames and on the screen you will see that the result (Fieldnumber 11 ‑ Stockvalue) is highlighted.

 

    Now you may proceed with more calculations or stop and print your report.

 

5.5.         Amendments to calculations.

 

   If you have selected the calculation function with a report number and calculations have already been defined, you may see them one by one on the screen and may accept them, change them, delete them or define new ones.

   

 

Figure 17 Amending a calculation line.

 

 DMS.RAPGEN     2 STOCK VALUE                         4......DEFINE CALCULATIONS 

   1 ARTICLE NO              19 @FREE                                            

   2 DESCRIPTION             20 @FREE                                            

   3 SALE PRICE              21 @FREE                                            

   4 COST PRICE              22 @FREE                                            

   5 DATE LAST PURCHASE      23 @FREE                                            

   6 SUPPLIER NO             24 @FREE                                            

   7 ARTICLE GROUP NO        25 @FREE                                            

   8 STOCK BALANCE           26 @FREE                                            

   9 ALTERNATIVE SUPPLIER    27 @FREE                                            

  10 FREE FIELD              28 @FREE                                            

  11 STOCK VALUE             29 @FREE                                            

  12 @FREE                   30 @FREE                                            

  13 @FREE                                                                        

  14 @FREE                                                                       

  15 @FREE                                                                       

  16 @FREE                                                                        

  17 @FREE                                                                       

  18 @FREE                                                                       

                                                                                  

 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 

 STOCK VALUE=STOCK BALANCE*COST PRICE                                             

 CALCULATION:#11=#8*#4                                                           

                                                                  OK (Y/N/I) ? Y 

 

 

 

 You are asked to type:         OK (Y/N/I)?

       

            Y = Line is OK.

            N = Line is deleted.

            I = You may enter a new line before the one on the screen. (Is repeated next time).

           XX = Type in a no., e.g. 5, and the next 5 lines will be accepted.

           99 = All lines are accepted. (See p.39).

          ESC = Press the ESC ‑key and all old calculations are retained and the new ones are deleted.


5.7.         Operands and operators.

 

   As the lines entered are translated by DMS.REPGEN to BASIC it is possible to use all statements in the Nixdorf Basic lanquage.

 

    You may use the following operators:

   

               + = Addition

               ‑ = Subtraction

               * = Multiplication

               / = Division

               ­ = Exponentiation

 

and these will be executed in this order:  

 

               ­ = First all exponentiations

               * = Then multiplications and divisions

               + = Then additions and subtractions

 

This order may be changed by the use of brackets.

 

   As operands you may normally use field numbers, e.g.#7 means field number 7. If you wish to use fields from other files you must also enter the file shortname (2 letters). E.g. KU#15 means field number 15 in the file KU.

 

   You may also use constants in expressions, e.g. #18 = #10 * 100. Note that decimal separator must be entered as a point. E.g. l0.47.

 

   The result field in a calculation will normally be stored in one of 20 free fields in the main file.

 

5.9.         Percentage calculations and division.

 

   As you may know, it is NOT possible to divide by 0. If you try to do this you will get an error message. (Basic Error 15).

 

   To avoid this, you can ensure that you do not try to divide by 0 by using the IF statement.

   E.g.

               #50 = 0

               IF #22 <> 0 LET #50 = #21 * 100/#22

 

   In this example the calculation will only take place if #22 is not 0. If field #22 is 0, the result field #50 will also be 0. In this calculation, we have calculated #21 as a percentage of #22.

 

   In order to make this very common operation easy to use DMS.REPGEN has a % operator. Just enter:

 

               #50 = #21% #22 

 

and the 2 lines shown above will be generated automatically.

 

   Note that multiplication is performed much faster than division, so it is better not to enter:

 

               #50 = #21/4

 

but to use     #50 = #21 * 0.25

 

It is not permitted to use the % operator together with the ROUNDfunction. (See page 43).


5.11.         Part of a field.

 

   You may need to work on selected characters or digits in a field. This may be done as follows:

 

   #7(3,4) will give you the 3rd and 4th character/digits of fieldnumber 7.

 

   #15(5,8) will give you the 5th to the 8th character/digits of fieldnumber 15.

 

   You may also make calculations which depend on the contents of part of a field:

 

              IF #7(3,3) = 5 LET #50 =............

 

   The calculation will only be performed if field 7's 3rd digit is 5.  

 

   It is also possible to use a digit directly in a calculation:

 

              #50 = #21 * #7(3,3) + #22

 

5.13.         Alpha numeric textfields.

 

   You may not use text fields directly in calculations or selections. In order to use them, the following rules should be applied:

   

   1.) If a text field only contains numeric characters you may move it to a numeric free field and use the free field in

       calculations. For example #52 = #26

 

   2.) A text constant must be defined between two quotation marks e.g. "A".   

 

   3.) A text constant may be moved to a part of another text field. For example  #15(7,8) = "XY"

       Note: This is not possible with a numeric field.

           

   4.) If you move fewer characters into a larger field, for example #15(7,8)="X",all characters from position 9 will be moved         1 position to the left. In order to avoid this, ensure that the text constant is followed by blanks.                                      ex. #15(7,8) = "X  "    

       Instead of using blanks, you may use a DMS.REPGEN special variable S9$, already containing (128) blanks.                    ex. #15(7,8) = "X",S9$.  

 

   5.) You may combine text fields or text constants as per the example above, this means that a line like: 

           READ(KU),#1,#2  

       a look up instruction on another file, is only valid if #1 and #2 are alfa numeric.

 

    Use Function 8 ‑ Printout of File Definitions to find out if fields are defined as numeric or alpha numeric.

 

    Numeric fields are marked with # and alpha numeric with A.  

 

5.15.         Specialfields.

 

We may define calculations like:

                                      #8 = #7 * #6       or

                                      #8 = #7 * KU#15

 

but may also use the following special fields.  

 

5.16.1.       #DD ‑ Today's date.

 

   This value is entered as the first date at the start of the program. [1]


5.16.3.       #PD ‑ 'As of' date.

 

   This value is entered as the second date at the start of the program. [2]

 

5.16.5.       #Dx ‑ Data from #D1‑#D7 ‑ Numeric.

 

   With these fields you may define up to 7 fields that can be entered before the start of a reporting program.[3]   

The fields may be used to change start parameters such as currency rates, limits, factors, interest rates etc.

 

   You may have names attached to the fields by defining: #50 = #D1RATE  

 

   Fieldno. 50 is a free field and now when starting the program you are asked to enter:

 

                RATE ?  

 

5.16.7.       #DAx ‑ Data from #DA1 to #DA7 ‑ Alpha numeric.

 

   These fields work like the #Dx fields but are alpha numeric. Max. 80  ch. per field.[4]

 

5.16.9.       #PP ‑ Pagenumber.

 

   You may use the pagenumbers in calculations via this variable.[5]  

 

5.16.11.       #OK ‑ Status after reading another file.

 

   After a calculation which reads another file, for example READ(KU), you can check if the read was succesful and thus control other calculations or selections.[6]

 

            Ex. IF #OK=0 LET #7=1 (OK!)

or

                IF #OK <> 0 READ(LE) (NOT OK!)

i.e.            #OK=0  Reading OK!

                #OK>0  Reading not OK!

 

5.16.13.       #SC ‑ Screennumber.

 

   You may wish to make calculations conditional on the screennumber that started the program.   For example, only transactions‑/records created from this screen are printed.[7]

 

5.16.15.       #LEVEL ‑ Total level nos.

 

   If you have defined that totals must be calculated before printing in Function 3 (Sorting and totals), you may make the calculations conditional on the total level number.

 

    A normal line has #LEVEL=0. Subtotal levels run from #LEVEL=1 to #LEVEL=9. If a report has only one grand total, this will be at LEVEL=1.

 

    Normally the field is only used in very complicated reports.[8]


5.16.17.       #GROUP ‑ total group numbers.

 

   In connection with grouptotals, you may wish to attach a text to the group numbers.  For example:

 

            IF #GROUP=1 LET #50 = "TEXT1"

            IF #GROUP=2 LET #50 = "TEXT2"  

 

   If the group names are in another file you may prefer to use the READ instruction instead of the text constants in the report  definitions.[9]

 

5.16.19.      Workfields.

 

   As you may have seen from the previous examples, DMS.REPGEN uses workfields for special functions like complicated creation of text strings, calculation of check digits and building keys for access to other files etc.

   

            eg. #50=#7(3,4)        ‑ Field 50 = digits 3 to 4 of field 7.

            eg. READ(KU)1,2(3,6),P ‑ Read a file with a key built up from several fields then packed.

 

   It will often be an advantage to use work fields to build combined keys.      

 

            ex. READ(KU),T2$.  

 

DMS.REPGEN has the following work fields at your disposal:

 

            T2$....256 Alpha numeric string.

            T9$....128 Alpha numeric string.

            R$..... 32 Alpha numeric string. (For keys!)

            S9$....128 Alpha numeric (Blanks ‑ note: Must not be changed).

            T3.....  4 Words numeric variable.

            T3(1)..  4 Words numeric variable.  

 

5.17.

4.9.         REM ‑ REMARKS.

 

   The REM lines help to document your calculations in normal text, so you can make use of this facility to note what you have actually done in your calculations.

   

            For example REM calculation of days overdue.

            REM #53 = calculation of days overdue.  

 

In the Basic lanquage you have an option to make a remark after a statement by using /*.

 

   This function MUST NOT be used here because DMS.REPGEN uses this function internally.


5.19.        Functions.

 

   DMS.REPGEN has a number of built in functions for rounding, date calculations etc., which can be used to make your calculations simpler.

 

5.20.1.

4.10.1.      FNR ‑ Rounding to 2 decimals.

 

   For example FNR(123.456) = 123.46

 

   If you multiply or divide, then in principle you should round the result, otherwise the result will contain, a maximum of 14 digits. This may give you differences in further calculations or totals.             

 

   In order to avoid this.  

   ex.

                #50 = #21 * #22/100       Should be entered as:

                #50 = FNR(#21 * #22/100) 

   or ex.

                #50 = #21%#22.            Should be followed by:

                #50 = FNR(#50).   

 

Note that the % operator may NOT be used directly, but has to be entered in a second calculation line.

 

5.20.3.

4.10.2.      FNH ‑ Rounding ‑ No decimals.

 

   The function is like FNR but rounds to whole numbers. (Integers)

 

5.20.5.

page \* arabic284.10.3.      FND ‑ Date conversion.

 

   FND (DDMMYY) = YYMMDD.

 

   This function may be used to convert dates from one format to another, and is normally used with sorting and selections.

   Ex.

                860101 is greater than 851231

                       but

                311285 is greater than 010186  

 

You can see the need for using the FND function if you try similar comparisons with a datefield defined DDMMYY.

 

5.20.7.

4.10.4.      FNA ‑ Convert date (DDMMYY) to numbers of days from year 1900. (Or days between two dates).

 

   The actual number of days from year 1900 is not very useful in itself, but is essential if you need to calculate the difference between two dates, for example  in interest calculations. This format of a date is known as the Julian date.

   Ex.    

               #50 = FNA(#20) ‑ FNA(#21)

   Nos. of days between Date 20 and Date 22

 

   This gives the exact numbers of days between Date 1 and Date 2.

 

   Note that the dates must be at the format DDMMYY, if not they have to be converted with the FND functions.

   Ex.

               #50 = FNA(FND(#20))‑FNA(FND(#21))  

  

5.20.9.

date \@ "MMMM d, yyyy"januar 10, 20084.10.5.      FNB ‑ Calculate numbers of days from year 1900 to date DDMMYY.

 

   This function will normally be used in connection with the FNA function to add a number of days to a date and calculate a new date.

   Ex.

                #50 = FNB(FNA(#20)+10)

                New date =    Date+10

                New date is date + 10 days.   


5.20.11.

4.10.6.      FNU ‑ Calculate date (DDMMYY) to a weekday:

 

   The result of this function will be:

   

               0 ‑ Saturday

               1 ‑ Sunday

               2 ‑ Monday

               3 ‑ Tuesday

               4 ‑ Wednesday

               5 ‑ Thursday

               6 ‑ Friday  

   Ex.

             #50 = FNU(#28)

   

5.20.13.

4.10.7.      FNV ‑ Calculate to year and week (YYWW).

 

   The result of this function will be a YYWW number.;

   

     FNV(010486) = 8618  

 

You may use the function to give information on the weeknumber in weekly reports.

 

   The weeknumber calculation takes leap‑years into account. The first Thursday in a year defines the first week in the year.

 

5.20.15.

4.10.8.      Internal storage of functions.

 

   Functions defined in DMS.REPGEN are stored in a textfile (DMS.REPGEN.SGA).

 

   This file is included in the generated program once the functions are used in calculations or selections. New functions may be added in the textfile, but the user must remember that these individual functions will not be contained in new versions of DMS.REPGEN.

 

5.21.

4.11.        Basic functions.

 

   You also have access to many useful functions, within the Basic programming lanquage. These functions are described fully in the NIXDORF BASIC manual, but some of the most common ones are briefly outlined below.

 

5.22.1.      ABS ‑ Absolute value of a number.

 

   For example   #50=ABS(#7)     #50 contains the contents of fieldnumber 7 without any sign.

 

5.22.3.      SQR ‑ Square Root.  

 

   For example   #50=SQR(#7)     #50 contains the squareroot of fieldnumber 7.

 

5.22.5.      FRA ‑ Decimal part of a numeric field.  

 

    For example   #50=FRA(123.45) #50 contains 0.45. 

 

5.22.7.      INT ‑ Integerpart of a numeric field.  

 

    For example   #49=INT(123.45) #49 contains 123. 

 

5.22.9.      SGN ‑ Sign of a field.   

 

    For example          #51=SNG(#7)

    If fieldnumber 7 is:

           Positive      #51 contains  1

           Zero          #51 contains  0

           Negative      #51 contains ‑1 


5.22.11.      NOT ‑ Logical negation.

 

    For example          #51=NOT(#7)

    If fieldnumber 7 is:

           Zero          #51 contains 1

           Not zero      #51 contains 0  

 

5.22.13.      LEN ‑ Length of a string.

      

For example   #52=LEN(T2$)       #52 contains the length of the text in T2$.

 

5.22.15.      IF ‑ Conditional calculations.

 

   DMS.REPGEN supports conditional calculations based on the BASIC statements IF, LET and the relational operators (4.11.9).

 

   In order to avoid errors in your calculations, remember to clear your result field before use.

   

            #50=0

            IF #7=2 LET #50=#21%#22

 

Note that you HAVE TO use the BASIC word LET after an IF.

 

    You may even combine several IF's on the same line:

   

            #50=0

            IF #7>1 IF #7<5 LET #50=#21%#22

 

Both IF's must be true or the calculation will not be executed.

 

   Conditional calculations are often used in connection with selections, i.e. you perform conditional calculations and the result (Free field) is used in the selection module.

    

            #50=0

            IF #7=2 LET #50=1

            IF #7=5 LET #50=1

 

In the selection module, selection is defined on fieldnumber 50.

   

        For example #50    MIN.1     MAX.1

 

and only records where fieldnumber,; #7 are 2 or 5 are processed.

 

   You may also use IF in connection with multiple reports:

 

        For example IF #7=2 READ(KU)

 

    The file KU will only be read when fieldnumber 7 equals 2. This may speed up multiple file reports and in connection with the READH it may be used to exclude records in the mainfile where there are no records       in a related transaction file.

 

5.22.17.      Relational operators.

 

   In selections, and in connection with the IF statement the following          operators may be used.

   

            = Equal to

            > Greater than

            < Less than

            >= Greater than or equal to

            <= Less than or equal to

            <> Not equal to


5.22.19.     When ‑ when to perform calculations.

 

   The command WHEN is used to define when calculations may be performed, i.e. before/after sorting or accumulating totals.

 

   When you enter WHEN, the screen shows:

   

             Calculate in pass:  0=Both, 1=First, 2=Second.

             Calculate totals:   0=Always, 1=Not totals, 2=Only totals.

 

In this way, you can control calculations until a new WHEN command is entered.

 

   The WHEN command may also be used to reduce look‑up in other file during sorting.

 

   DMS.REPGEN saves the linenumber when the WHEN command is given, when a new WHEN command is given or the calculations ended.

   

            IF X/IF NOT X GO TO (Before first/second pass).

            If P8/IF NOT P8 GO TO (Before totals/not totals).

 

5.22.21.

4.11.11.     FIRST/NORMAL/LAST and AFTER calculations.

 

   These commands are normally only used in very complicated reports.

   

    First:   This command will cause your calculations to take place before reading the files,

             e.g Dimensioning of user files.[10]

 

    Normal:  This command is used when you wish to return to normal.

             Normal means of reading records, before selections, sorting and totals.[11]                     

 

    After:   This command is used when you wish to perform calculations after selections,

             i.e. calculations reading other files are only performed on selected records.[12]

             This might improve the speed of the reports.     

 

    Last:    This command is used when you wish to perform calculations after the last record has been read

             and the last total line has been printed and the lasttotal line.[13]

            

5.22.23.     Load command.

 

   The BASIC LOAD command is used to load any special routines saved in the textfile, DMS.RAPS.xxxxxx.

   Ex.

                LOAD CHECK

                Parameter values

                GOSUB 4200

                Move result variable to free field

 

The structure of the DMS.RAPS.xxxxx textfile is described in detailed in the DMS.REPGEN ‑ Installation Manual.


5.22.24.1.

4.11.12.1.   CHECK ‑ checkdigit calculation (OCR).

 

   Modulus 10 weighted 2121...

                 1. LOAD CHECK.

                 2. T2$=#1 USING "###############".

                 3. Gosub 4200.

                 4. #50=T2$.

 

These lines give the result listed below:

 

   1. The routine CHECK is loaded.

   2. The parameter T2$ receives the value of fieldnumber 1 and the length of 15 characters.

   3. The performance of the routine.

   4. The result in T2$ is moved into a 16 character freefield, fieldnumber 50.

      The 16'th digit is the checkdigit. The length of T2$ may be different from country to country.

 

5.22.24.3.

4.11.12.2.   CHEX ‑ checkdigits ‑ modulus 11.

  

                 1. LOAD CHEX.

                 2. T2$=#1 USING "##########".

                 3. T9$="090507020506090701".

                 4. Gosub 4200.

                 5. #50=T2$.

 

The lines will give the results listed below:

 

   1. The routine CHEX is loaded.

   2. The parameter T2$ gets the value of fieldnumber 1 and its length.              

   3. The parameter T9$ get the value (weights) you wish to use in the calculation, 2 digits per digit i.e.

              09*1st.digit+05*2nd.digit+07*3rd.digit+...01*9th.digit

   4. The routine is performed as described above.

   5. The result field T2$ is moved into a 10 characters free field number 50.

 

Note: It is not possible to use the modulus 10 and modulus 11 calculations in the same report.

 

5.22.24.5.

page \* arabic484.11.12.3.   ARB ‑ Calculations of working days.

 

                1. LOAD ARB.

                2. T3=#PD.

                3. T3(1)=#20.

                4. Gosub 4220.

                5. #50=T3.

 

These lines will give the results listed below:

 

   1. The ARB‑routine is loaded.

   2. The paramater T3 gets the value of #PD ‑ entered at printouttime as start parameter.

      (Format DDMMYY).

   3. The parameter T3(1) gets the value of fieldnumber 20 ‑ this field must be a date too. (Format DDMMYY).    

      Use T3(1)=FND(#20) if format is YYMMDD.

   4. The routine is performed.

   5. The resultfield T3 is moved into a free field. Fieldnumber 50 will now contain

      the numbers of working days between the two dates.

 

The routine works in the following way:

   1. The number of days between the two dates is calculated.

   2. The result is reduced by the number of Saturdays and Sundays.

   3. This result is reduced by the number of days in a built in calendar

      containing all other non‑working working days in the date interval.

 

   This built in calendar may be changed from country to country or from user to user.

   The calendar is stored in the textfile, DMS.RAPS.ARB in the DATA-lines.


5.22.24.7.

4.11.12.4.   NAME ‑ Separation of christian name and surname.

 

   This function may be used to separate christian name and surname created in  the same field. You may use this function if you wish to define a list sorted by surname.

   

                1. LOAD NAME.

                2. T2$=#2.

                3. Gosub 4220.

                4. #50=T2$.

     

These lines will give the result explained below:

  

   1. The NAME‑routine is loaded.

   2. The parameter T2$ is loaded with the contents of fieldnumber 2.(Format: Title, Christian name, Surname).

   3. The routine is performed.

   4. The result field is moved into the free field #50 (new format: Christian name, Surname).

      This field may then be used for sort definitions.

 

The routine converts the contents of T2$ to the format: Christian name and Firstname and return the result into T2$.[14][15][16]

 

In the conversion, the most used title formats are recognised:

 

   ‑ MR/MRS/LTD etc must be changed from country to country and are not converted.

 

   ex. 1. MR. Peter BROWN      ==>      BROWN Peter    

   ex. 2. LDT. UNITED BROWN    ==>      BROWN UNITED    

 

Leading blanks are ignored. If a name field contains a comma, the field is supposed to be in the format:

        Surname, Christian name, Title, and the field will not be converted.

 

5.22.25.

date \@ "MMMM d, yyyy"januar 10, 20084.11.13.     Calculation lines with predefined linenumbers.

 

   This function may be used by the VERY experienced user to place calculation lines directly in the generated program.

 

   DMS.REPGEN will hold the calculations in linenumbers 5200‑5299. If you enter ¬xxxx (where xxxx = linenumbers) the standard routines of DMS.REPGEN can be overwritten in this report.

 

   You may also use this function to define your own work‑variables in linenumbers 1000‑1099.

 

5.22.26.1.   Selection of a file index number for report purposes.

 

   ¬1000 R1(0,2)=2

   This line will ensure that the 2nd index of a file is always used. The normal start routine is overwritten by this function.

 

5.22.26.3.   Lock on lowest total level.

 

   ¬1001 xo(15)=1

   This line will overwrite the normal start routine.

 

5.22.26.5.   Enforced start/stop values.

 

    ¬1002 R1$="4711"

    ¬1003 R2$="4750"

    ¬1004 R3$=R1$

 

    These lines will ensure that a printout always contains records from number 4711 to number 4750.


5.22.27.     Update of files.

 

   You are normally only allowed to update files created with DMS.DATAMASTER, and then only under a password protection.

 

   This ensures that you are not able to destroy valuable information in your application files by using DMS.REPGEN.

 

   It is possible for the installer to allow up‑date of application files, but this should be done with the most outmost care and only with free fields not used in the main application.

 

   The update is done as a calculation where the result field is the field you wish to update.

   

            ex. #7=#7+1

 

   This will cause fieldnumber #7 to be calculated and updated.         

 

   NOTE:If the field is part of an index key this key will NOT be updated.

 

   If you update such a field, the contents of key and datafield will be inconsistent and DATAMASTER will reject any attemt to charge/delete such records.

 

   In the DATAMASTER function for extension of a file you may reconstruct the file.

 

   It is only possible to update the mainfile of a report. If you wish to update a DATAMASTER file this must be defined together with the report definitions.

   

            ex. 1. Filename? KU,W ‑ update is allowed.

 

and the textfile DMREAD.KUW is included in the report.

 

            ex. 2. Filename? KU ‑ update is NOT allowed.

 

and the textfile DMREAD.KU is included in the report.

                                                 

   The update report program is password protected.   

 

Password is ECAREE, E is typed CTL.E.


5.           Using multiple files.

 

 

 

6.1.         Principles in using multiple files.

 

   All reports must have a mainfile and many reports will only use one file.

 

   If you refer to datafields in a mainfile the reference will be:

 

                                 #7

 

   If you refer to a field in another file,add the 2 letter abreviation before the fieldno.:

   

                                KU#7

 

Fields in all files may be used in calculations, selections and sorting.

 

    The relations between files may be established in two ways:

 

    1. By the installer of the applications or

 

    2. By the user in the calculation section of a report. The user just enters:

   

                            READ(KU),#1                                 

 

The information will cause DMS.REPGEN to READ a file, KU,with fieldno. 1 as a key.

 

   If the installer has defined the file relations then just enter:

 

                            READ(KU)

 

You may use up to 9 files in a report.

 

6.3.         Help function.

 

   Normally the user may see a listing of all fields in your report. To look up another file, you type in the keyword HLP.

 

   On the screen you will see a list of all files known to DMS.REPGEN. You may then select a file shortname and see all the fields in that specific file.

   

 

Figure 18 File menu by use of the HELP function.

 

 DMS.RAPGEN   19 NOT USED SUPPLIERS                  4......DEFINE CALCULATIONS  

 GR ARTICLE GROUP FILE                                                           

 KU CURRENCY FILE                                                                

 LE SUPPLIER FILE                                                                

 VA ARTICLE FILE                                                                 

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                 

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

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

 DATE LAST PURCHASE=0                                                            

 START (VA.02)                                                                   

 NEXT (VA.02)                                                                     

 CALCULATION:                                                                    

                                                ENTER FILESHORTNAME OR CR:       

 

 

 

          

 

 

Figure 19 HELP for a single file.

 

 DMS.RAPGEN   19 NOT USED SUPPLIERS                  4......DEFINE CALCULATIONS  

  1 ARTICLE NO                                                                   

  2 DESCRIPTION                                                                   

  3 SALE PRICE                                                                   

  4 COST PRICE                                                                   

  5 DATE LAST PURCHASE                                                            

  6 SUPPLIER NO                                                                  

  7 ARTICLE GROUP NO                                                             

  8 STOCK BALANCE                                                                 

  9 ALTERNATIVE SUPPLIER                                                         

 10 FREE FIELD                                                                   

                                                                                 

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

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

 DATE LAST PURCHASE=0                                                            

 START (VA.02)                                                                   

 NEXT (VA.02)                                                                    

 CALCULATION:                                                                     

 VA ARTICLE FILE                8/CH.VAKA#      ENTER FILESHORTNAME OR CR:       

 

 

 

                         

 

 

Figure 20 Extended HELP for a single file.

 

 DMS.RAPGEN   19 NOT USED SUPPLIERS                  4......DEFINE CALCULATIONS  

  1 ARTICLE NO                             9 ALTERNATIVE SUPPLIER                

    KEY 1.                                   REFERENCE FOR LE,SUPPLIER FILE      

    MUST BE UNIQUE                        10 FREE FIELD                          

  2 DESCRIPTION                              NOT USED.                           

  3 SALE PRICE                                                                   

    NORMAL SALESPRICE IN UKP                                                     

  4 COST PRICE                                                                   

    COST PRICE HELD IN SUPPLIERS CURRENCY                                        

  5 DATE LAST PUCHASE                                                            

    BEING UPDATED BY REGISTRATION                                                

  6 SUPPLIER NO                                                                  

    KEY 2                                                                        

    REFERENCE FOR LE,SUPPLIER FILE                                               

  7 ARTICLE GROUP NO                                                             

    REFERENCE FOR GR,ARTICLE GROUP FILE                                          

    (ARTICLE GROUP NAME AND PRICE FACTOR)                                        

  8 STOCK BALANCE                                                                

    CURRENT BALANCE OF THIS ARTICLE                                              

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

 DATE LAST PURCHASE=0                                                            

 START (VA.02)                                                                    

 NEXT (VA.02)                                                                    

 CALCULATION:                                                                    

 VA ARTICLE FILE                8/CH.VAKA#      ENTER FILESHORTNAME OR CR:       

 

 

 

                

Enlarged help for a file appears, when you key in the file shortname and a fieldnumber, for example VA01.

 

   As many fields from the file, starting from the fieldno. entered are shown as there is space for on the screen.

 

   Each field will be shown with the full field description which can be defined with the T command in the file definition module.

 

6.5.         READ used in calculations.

 

   When using fields from files other than the main file, it must be defined how to READ the file, e.g. READ(KU) to read file KU.


6.7.         Relation between files.

 

   In connection with the READ,it is necessary to give information of the structure of the key. If fieldno. 15 in the mainfile is e.g. a customerno. and you wish to use this as a key to the file KU, information on this may be given to DMS.REPGEN:

 

   

   1.) The installer can define the relationship at installation time. Then you need only use the command READ(KU).

   2.) The relationship is not known! Use READ(KU),#15. I.e. READ file KU with fieldno. 15 as a key.

   3.) If the relationship is more complicated and consists of more fields, parts of the fields, packed fields

       you may use READ(KU)14 by omitting the , and # you get all the facilities of DATAMASTER key building

       routines to concatenate fields, pack these or take subset of fields in combinations.

       This function is discussed in details later in this chapter.

 

6.9.         Continue reading of the third file.

 

   When you have read in a file with the READ instruction, it is possible to refer to all the fields in the files when printing, e.g. KU#15, as with the fields of the main files, and to use theese fields in calculations. While the READ instruction may be understood as a calculation line itself you may continue reading more files accessed with fields in files you have already read, e.g. by inserting READ(XX),KU#7, the file XX is read using fieldnumber 7 from the file KU as the key.

 

   In the case where an automatic connection between the different files was created during implementation, the user only has to key in READ(XX). REPGEN itself will search through the allready defined files starting with the main file, after that referencing files until a connection between a "known" file and the new file is found.

 

   If you use the special key creation routines you may only use the fields of the main file and the 20 free fields, but you may if necessary move fields from other files to these.

 

6.11.         Files with more than one index.

 

   If a file has more then one index, you may refer to index 2 by e.g. READ(KU.02),#15.

 

   With fields which may be used as a key, the programmer may specify which index should be used during installation of the file connections.

 

6.13.         Different records from the same file.

 

   You may get into situations, where several different records from the same file need to be treated at the same time. Here you may refer to the same file KU with big or small letters, and you may use the same file definitions but different records.

 

   The fields KU#1 and ku#1 refer to different recordtypes in the same file, and therefore there may be both a READ(KU) and READ(ku) in the calculations.

 

   The combinations KU, ku, Ku and kU may be used, so a maximum of 4 different record types from one file may be used. Each of these references counts as an independent file in the total number of files in the report.

 

6.15.         Max. numbers of files.

 

   One report may work with a maximum of 9 files at the same time, i.e. the main file with references to 8 other files.

 

6.17.         Conditional reading of other files.

 

   By placing the READ instructions in conjuction with the calculations on the report, you will get the advantage that reading other files, as well as other calculation lines, may be made conditionally e.g.

                     IF #7=3 READ(KU),#15.

 

6.19.        Reading AFTER the selections are done.

 

   You may refer to other files after the normal selections on the report, by using the AFTER command in definition of the calculations. This may increase program speed, but can only be used if no selection is based on the fields from these files.


6.21.

5.11.        Sum of the postings.

 

   You may in calculations make a run through a file, e.g. the postings on a customer,to select the total posting amount into a free field.

 

    The command START(XX), NEXT(XX) and REPEAT(XX) defined respectively an interval in the file XX, read the next record after which you may put in calculation lines to do summation, and repeat until there are no more records in the interval.

 

6.23.        Statement of account reports.

 

   There are functions for 'statement of acount' type of reports, where you print out information from a customer, followed by a row of postings and at the end a total.

 

    Here you split up the print out definitions into respectively header and lines with the LINE command when defining the report on the posting file, and as calculation you give the command READH(KU), which will print out a header each time the customer changes.

 

6.25.

5.13.        Sequential (relative) files and pointers.

 

   The previous examples have all been based on references to indexed files, which are the most common file types in any installation. Relative files may be accessed with the commands READR and READX.

 

    These functions may also be used with file structures, where a file contains a pointer to another file in form of a record number, either explicit (READR) or relative to the first data record number (READX).

 

6.27.        Very special key structures.

 

   In cases of complex key structures, the user may define a calculation of a workfield, e.g. T2$, down to bit manipulations with assembler CALLs, and then use READ(KU),T2$.

 

6.29.        READ(KU) Balance list with currency conversion.

 

   We wish to build up a balance list with the following format:

 

 

Figure 21 Supplier balance sheet with currency calculation.

 

DATE:14,01,87     * SUPPLIER BALANCE *   AS OF 14,01,87    PAGE:   1         

                                                                             

NO      NAME                           BALANCE     BALANCE UKP               

100     HUMBER LTD.                       0.00 UKP        0.00               

102     AX & AX LTD.                 25,000.00 UKP   25,000.00               

105     WEBB'S SUPPLIERS LTD.           500.00 UKP      500.00               

111     TRAWSOM LTD.                  1,000.00 UKP    1,000.00               

123     BRAUN GMBH                        0.00 DEM        0.00               

205     SCHIERMACHER GMBH            20,000.00 DEM   55,980.00               

260     CLORID LTD.                   2,000.00 UKP    2,000.00               

270     OHIO INC.                       200.00 USD      303.20               

271     DANDY INC.                        0.00 USD        0.00               

                                                                             

GRAND TOTAL                                          84,783.20               

 

 

 

   The supplier file, LE, is chosen as the report main file and under the definition of the report with function 1, you place the value designation from the value file KU#2 after the balance field.

 

   During calculation, the currency file may be read, after which the BALANCE in home currency may be calculated in the following way:

                     READ(KU)5

                     #7 = FNR(#6*KU#3/100)

READ(KU)5, where 5 is placed just after the end brackets without blanks or comma, specified that the valuefile is read using field 5 from the main file (supplier file) as key, named as the value code, converted to the correct format.

 

   The value code in the supplier file is defined as 2 digits, and the key to  the valuefile is built up as 2 characters from this, with leading zeroes if the code is less than 10.


6.31.        Price calculations with READ of more files.

 

   From the stock file as main file you may build up the following price calculation list:

   

 

Figure 22 Calculation of new sale price from rate and price factor.

 

DATE:14,01,87      * PRICE CALCULATIONS *        AS OF 14,01,87   PAGE:    1 

                                                                             

NO   NAME              COSTPRICE             UKP GR     FACTOR    NEW PRICE  

0101 BOLT                   1.50 USD        2.27  0     1.0000         2.27  

0102 TRUCK‑HOPPER       10000.00 UKP    10000.00  9     3.0000     30000.00  

0110 TRUCK‑WORK         60000.00 DEM   167940.00  2     1.2345    207321.93  

1001 TRUCK‑WHEEL          500.00 DEM     1399.50  0     1.0000      1399.50  

1005 TRUCK‑GEARBOX       1500.00 UKP     1500.00  1     2.0000      3000.00  

2001 BOLT‑SPEC./AL         10.00 DEM       27.99  9     3.0000        83.97  

2002 BOLT‑SPEC./BR         10.00 DEM       27.99  9     3.0000        83.97  

 

 

   

with the following calculation connections:

   

         1. READ (LE)

         2. READ (KU)

         3. READ (GR)

         4. #11=FNR(#4*KU#3/100)   DKR=FNR(BUYING PRICE*CURRENCY RATE/100)

         5. #12=FNR(#11*GR#3)      NEW SALES PRICE=FNR(DKR*PRICE FACTOR)

 

In this example we use all the files:

   

   1. First you read the supplier file from the stock file, after which the currency code from the supplier file is known.

   2. After that you read the currency file (with access by the suppliers currency code).

   3. Finally, you read the Article group file (from the stock file field for the stock group).

   4. You may now calculate a buying price in danish kroner using the currency rate.             

   5. New salesprice in danish kroner is calculated as the buying price * stockgroup price factor.

 

If Repgen has been installed with the option of rewriting in the file, you could have updated the stock price directly by putting in an extra line:        

 

           #3=#11 Sales price = new sales price

 

6.33.        Price calculations without automatic connections.

 

   In this example we assumed that the programmer has installed Repgen with automatic connection between the files. It is therefore not nessesary to insert which fields are used as keys for the different read commands as Repgen itself can see that the valuefile may be read from a field in the supplier file.

 

   If these automatic connections have not been defined, the read commands would be more complicated:

   

           1. READ (LE),#6

           2. #13=LE#5

           3. READ (KU)13

           4. READ (GR)7

 

    You may here see the great advantage of definition of automatic connections, otherwise you must know details of the keys in the file:

   

   1. The supplier file is read using field number 6 of the stock file as key. As this is alpha numeric we may use both

      READ(LE), #6 and READ(LE)6. It is not necessary to use the key building routine for such a simple key.           

 

   2. When you have to read the currency file, you can use this routine. As the value code is 2 numbers numeric,

      this cannot be done directly, since READ(KU)LE#5 not is permitted.                    

      You must use a free field to obtain this function, eg.#13, and define this field as 2 numeric digits matching the key

      when entering a calculation as:

              #13=LE#5

              READ (KU)13


Another way to do this could be:

 

           2. T2$=LE#5 USING "##"

           3. READ (KU),T2$

 

so you yourself may build up an alpha numeric workfield with the key and use this for reading.

 

   4. By reading the stock group file, you may directly use the key routine and read using field 7, stock group, as key.        

 

6.35.        Alternative suppliers: several references in the same file.

 

   If you want to define a stock list, where the name of both the normal supplier and the alternative supplier may be printed out, you may read the same file several times.

 

 

Figure 23 Reading the same file multiple times.

 

DATE:14,01,87    * ALTERNATIVE SUPPLIERS *       AS OF 14,01,87   PAGE:    1 

                                                                              

NO   NAME               SUP NAME                   ALT NAME                  

0101 BOLT               271 DANDY INC.             270 OHIO INC.             

0102 TRUCK‑HOPPER       100 HUMBER LTD.                                       

0110 TRUCK‑WORK         123 BRAUN GMBH             100 HUMBER LTD.           

1001 TRUCK‑WHEEL        205 SCHIERMACHER GMBH      102 AX & AX LTD.          

1005 TRUCK‑GEARBOX      100 HUMBER LTD.                                       

2001 BOLT‑SPEC./AL      205 SCHIERMACHER GMBH      102 AX & AX LTD.          

2002 BOLT‑SPEC./BR      205 SCHIERMACHER GMBH      102 AX & AX LTD.          

 

 

 

 

This may be done with the calculations:

   

           1. READ (LE)6

           2. READ (le)9

 

while the second supplier is inserted with small letters. We could instead have used Le or lE, a combination of big and small letters. Each file may be included in a report in up to 4 variants. Every variant counts as one file out of the maximum of 9 files for each report.

 

   The first reading is done with field 6, normal supplier number, as key, and the second reading with field 9, alternative supplier number, as key. Please notice that it does not matter if the field is numeric (#9) or alpha numeric (#6), Repgens key building is used, i.e. the field numbers do not contain if # or ,.

 

   During definition of a report, you print out the first name as LE#2 and the second name as le#2. The same effect could have been reached in another way by printing out two free fields, e.g. #11 and #12, both defined as 24 characters, after the following calculations:

 

           1. READ (LE)6

           2. #11 = LE#2

           3. READ (LE)9

           4. #12 = LE#2

 

   First you read in the normal supplier number, after which the field you want to use from this may be stored in free fields, and then the alternative supplier is read in from the same file on top of the last  record, thus changing the contents of LE#2. In this way, you only use one  file of Repgens max. of 9 files per report. 


6.37.        READ in connection with totals.

 

   The example on group totals may be improved by printing out the stock group name for each group:

   

 

Figure 24 Reading the name of group totals.

 

DATE:14,01,87         * MARGIN LIST *            AS OF 14,01,87   PAGE:    1 

                                                                             

NO   DESCRIPTION   GR SALEPRICE COSTPRICE    MARGIN MARGIN% BALANCE      VALUE

0101 BOLT           0      2.00      1.50      0.50   33.33     100     150.00

0102 TRUCK‑HOPPER   9  20000.00  10000.00  10000.00  100.00       0       0.00

0110 TRUCK‑WORK     2 100000.00  60000.00  40000.00   66.67       1   60000.00

1001 TRUCK‑WHEEL    0   1000.00    500.00    500.00  100.00     100   50000.00

1005 TRUCK‑GEARBOX  1   2000.00   1500.00    500.00   33.33      10   15000.00

2001 BOLT‑SPEC./AL  9     20.00     10.00     10.00  100.00      10     100.00

2002 BOLT‑SPEC./BR  9     25.00     10.00     15.00  150.00     200    2000.00

                                                                             

    2 GROUP   0     STOCK                             99.80           50150.00

    1 GROUP   1     AUX.                              33.33           15000.00

    1 GROUP   2     SPECIAL                           66.67           60000.00

    3 GROUP   9     N/STOCK                          100.05            2100.00

                                                                              

GRAND TOTAL                                           70.85          127250.00

 

 

 

This is done by defining the following calculation lines:

   

           1. WHEN 2 BOTH PASS ‑ ONLY TOTALS

           2. READ (GR)7

           3. #2=GR#2,S9$                     NAME=GROUP NAME, S9$

           4. IF #LEVEL=1 LET #2=S9$          IF LEVEL=1 LET NAME=S9$

 

When defining which fields might be totaled, insert ‑2, print out of field 2, the stock name, on the total line. Calculated totals may also be defined on the list.

 

   The calculations do the following:

   

   1. The lines may only be done for totals.

   2. The stockgroup file is read with field 7 as key.

   3. The stockname is equal to the read stockgroup name, to be sure put a number of blanks after this with S9$.

   4. If the GRAND TOTAL is being printed (#LEVEL=1) you set the stockname equal to blanks as

      printout of the stockgroup name is not relevant on this line.

 

6.39.        START/NEXT/REPEAT Sum of the postings.

 

   If we want to define a report on a file with a underlying posting file, where the postings are not to be printed out, but only their sum, this may be done with the START/NEXT/REPEAT commands.

 

 

Figure 25 Total stock value collected with START/NEXT/REPEAT.

 

DATE:14,01,87  * SUPPLIER VALUE * AS OF 14,01,87   PAGE:   1                 

                                                                             

NO.     NAME                       STOCK VALUE                               

100     HUMBER LTD.                   15000.00                               

102     AX & AX LTD.                      0.00                               

105     WEBB'S SUPPLIERS LTD.             0.00                               

111     TRAWSOM LTD.                      0.00                               

123     BRAUN GMBH                    60000.00                               

205     SCHIERMACHER GMBH             52100.00                               

260     CLORID LTD.                       0.00                               

270     OHIO INC.                         0.00                                

271     DANDY INC.                      150.00                               

                                                                             

GRAND TOTAL                          127250.00                                

 

 

 


 

Figure 26 The report definition for collection total stock value.

 

DMS.RAPGEN        REPORT NO.15  SUPPLIER STOCK VALUE     JAN 14, 1987 13:34:03

                                                                             

PRINTER:$LPT   STARTPOSITION:001   LINES ON FORM:66                          

                                                                             

FILE: 1 LE    SUPPLIER FILE                  8/CH.LEKA#                      

FILE: 2 VA    ARTICLE FILE                   8/CH.VAKA#                      

                                                                             

  1...,....10...,....20...,....30...,....40...,....50...,....60...,....70...,.

1:DATE:#DD  * SUPPLIER VALUE *  AS OF #PD           PAGE:#PP                 

2:                                                                           

3:NO      NAME                  STOCK VALUE                                  

4:                                                                           

5:#1      #2                  #7                                             

  1...,....10...,....20...,....30...,....40...,....50...,....60...,....70...,.

                                                                             

SELECTIONS:                                                                  

                                                                              

CALCULATIONS:                                                                

   #7=0                      STOCK VALUE=0                                   

   START (VA.02),#1          START (VA.02),SUPPLIER NO                       

   NEXT (VA.02)              NEXT (VA.02)                                    

   #7=#7+VA#8*VA#4           STOCK VALUE=STOCK VALUE+STOCK BALANCE*COST PRICE

   REPEAT (VA)               REPEAT (VA)                                     

                                                                              

TOTAL LEVELS                                                                 

                                                                             

 FIELDS TO BE TOTALLED:                                                       

    #11   STOCK VALUE                                                        

 

 

 

 

In the examples we have chosen to print out the supplier file and per supplier to calculate the value of supplied articles. We choose a free field #7 to contain the stock value, and this field is printed out and totalised on the report. The calculations are built up in the following way:

   

   1. #7=0 First you zeroise the total fields for the stock value:

 

   2. START (VA.02),#1 starts the addition of records in the article file, while VA.02 means that

      we wish to run through the file according to the 2nd index, which is the supplier number‑key.       

 

   3. NEXT(VA.02) With the command NEXT you read an article from the article file, and the next calculations

      are done until there are no more articles, after which Repgen jumps to the calculation line REPEAT.

 

   4. #7=#7+VA#8*VA#4 Summation of stock value.           

 

   5. REPEAT(VA). With the command REPEAT you jump back to NEXT line after which the sum continues,

      until there is no more articles.

 

   Please note, that key building is inserted in connection with the START command, but is not necessary for the NEXT and REPEAT commands (the key may naturally also be defined). The indexnumber must be inserted in both the START and NEXT commands, if you dont use the first index, but this is not necessary with the REPEAT command.

 

6.40.1.      Conditional sum with START/NEXT/REPEAT.

 

   The sum of the stock value may naturally be conditional on an IF, e.g.

 

            IF VA#7=1  LET #7=#7+VA#8*VA#4

            IF VA#7<>1 LET #8=#8+VA#8*VA#4

 

whereby you may split up the stock value for all articles in article group 1 and all other articles (Remember to zero both field 7 and field 8 before summation).


6.40.3.      Several loops of START/NEXT/REPEAT inside each other.

 

   You may in a loop of START/NEXT/REPEAT have several loops of the same kind. If the system was built up so the supply of an article was in each file inserted per stock place (LA), the summation could be done with a loop over these:

   

            1. #7=0

            2. START (VA.02),#1

            3. NEXT (VA.02)

            4. START (LA),VA#1

            5. NEXT (LA)

            6. #7=#7+LA#8*VA#4

            7. REPEAT (LA)

            8. REPEAT (VA)

 

In the same way you may READ other files inside such a loop e.g. find the price factor for the articles article group.

 

6.40.5.      Selection in connection with START/NEXT/REPEAT

 

   Selection in connection with START/NEXT/REEPEAT may typically be used for exception reports. E.g. you wish to get a list for all the suppliers, where you haven't bought articles since a key'ed in date:  

          

 

Figure 27 Suppliers not used since 30/6‑1986.

 

DATE:14,01,87  * NOT USED SUPPLIERS *  AS OF 30,06,86   PAGE:   1            

                                                                             

NO      NAME                                                                  

100     HUMBER LTD.                                                          

102     AX & AX LTD.                                                         

105     WEBB'S SUPPLIERS LTD.                                                 

111     TRAWSOM LTD.                                                         

260     CLORID LTD.                                                          

270     OHIO INC.                                                             

 

 

 

We use the free field #7 to control the selection and define this as only records, where #7 is equal zero, shall be printed out.

 

   The calculations are defined as follows:

   

            1. #7=0

            2. START (VA.02),#1

            3. NEXT (VA.02)

            4. IF FND (VA#5)>FND (#PD) LET #7=1

            5. REPEAT (VA)

 

Field 7 will be 1. If the supplier has one or more articles where the last buying date is greater than the one inserted by start in per date, and such suppliers are not printed out (please notice the date reversal) with FND, while the dates here are on the form DDMMYY). 


6.41.        READH/LINE statement of account type report.

 

   If we wish to make a report, where each suppliers articles are printed out, this is defined with function 1 with the article file as main file, a "posting file".

 

 

Figure 28 Articles by supplier defined with READH and LINE commands.

 

DATE:14,01,87          * ARTICLES BY SUPPLIERS *      AS OF 14,01,87    PAGE 1

                                                                             

NO  NAME                                                                     

                      ARTICLE NAME          STOCK BALANCE COSTPRICE      VALUE

100 HUMBER LTD.                                                              

                         0102 TRUCK‑HOPPER              0  10000.00       0.00

                         1005 TRUCK‑GEARBOX            10   1500.00   15000.00

                                                                             

123 BRAUN GMBH                                                                

                         0110 TRUCK‑WORK                1  60000.00   60000.00

                                                                             

205 SCHIERMACHER GMBH                                                         

                         1001 TRUCK‑WHEEL             100    500.00   50000.00

                         2001 BOLT‑SPEC./AL            10     10.00     100.00

                         2002 BOLT‑SPEC./BR           200     10.00    2000.00

                                                                             

271 DANDY INC.                                                               

                         0101 BOLT                    100      1.50     150.00

                                                                              

GRAND TOTAL                                           421  72021.50  127250.00

 

 

 

 

   On the first line of the report the fields LE#1 and LE#" supplier number and name are printed out from the supplier file. After that the line is finished (by CR) and approved.

 

   Before the next line is defined you give the command LINE, and tell Repgen, that the previously defined lines should only be printed out each time the supplier changes. The next lines, on the other hand, will be printed out for each article.

 

   The line is now defined with the fields from the article file, which you want printed out.

 

   As calculation you may define the connection between the files:

   

      READH (LE),#6

 

this command works in the same way as the normal READ command, the supplier file is read using the Article file field 6, supplier number, as key.

 

   If, and only if, you read a new supplier, the first defined lines, supplier number and name will be printed out.

 

   To get a reasonable print out, the article file may be sorted by supplier number, so that all articles from the same supplier appear together. This may be done by using Index 2.

 

   If the article group should have controlled the report, you would have had  to sort the list, as the article group is not defined as an index in the system.


6.42.1.      Selection in connection with READH/LINE.

 

   If you define a selection on the list, so that articles with article group 0 are not printed, the list will appear as follows:

   

 

Figure 29 Selection of article group > 0.

 

DATE:14,01,87          * ARTICLES BY SUPPLIERS *      AS OF 14,01,87    PAGE 1

                                                                             

NO  NAME                                                                     

                      ARTICLE NAME          STOCK BALANCE COSTPRICE      VALUE

100 HUMBER LTD.                                                              

                         0102 TRUCK‑HOPPER              0  10000.00       0.00

                         1005 TRUCK‑GEARBOX            10   1500.00   15000.00

                                                                             

123 BRAUN GMBH                                                               

                         0110 TRUCK‑WORK                1  60000.00   60000.00

                                                                             

205 SCHIERMACHER GMBH                                                        

                         2001 BOLT‑SPEC./AL            10     10.00     100.00

                         2002 BOLT‑SPEC./BR           200     10.00    2000.00

                                                                             

271 DANDY INC.                                                               

                                                                              

GRAND TOTAL                                           221  71520.00   77100.00

 

 

 

 

   Please notice, that the supplyer number 271 is printed out, because this has an article connected in the system, even if there is no articles, which shall be printed on the report due to the selection.

 

   To avoid print out of such suppliers we have to control the head line to and change our calculation to:

   

            IF #7<>0 READH(LE),#6

 

so that the supplierfile is only read if article group is not equal to 0. The selection is thus incorporated in the read.

 

   Another way to avoid 'zero‑suppliers' is to define calculations as an AFTER calculation, that means calculation which is only done for those articles, which meet the selection criteria. This is done by inserting the command AFTER on the calculation line before reading.

   

            1. AFTER

            2. READH (LE),#6

 

6.42.3.      Totals in connection with READH/LINE.

 

   If we wish a total of the stock value per supplier:               

 

 

Figure 30 Totals in connection with START/NEXT/REPEAT.

 

DATE:14,01,87          * ARTICLES BY SUPPLIERS *      AS OF 14,01,87    PAGE 1

                                                                             

NO  NAME                                                                     

                      ARTICLE NAME          STOCK BALANCE COSTPRICE      VALUE

100 HUMBER LTD.                                                              

                         0102 TRUCK‑HOPPER              0  10000.00       0.00

                         1005 TRUCK‑GEARBOX            10   1500.00   15000.00

                                                                             

TOTAL 100                                                             15000.00

                                                                             

                                                                             

123 BRAUN GMBH                                                               

                         0110 TRUCK‑WORK                1  60000.00   60000.00

                                                                             

TOTAL 123                                                             60000.00

                                                                              

                                                                             

205 SCHIERMACHER GMBH                                                        

                         2001 BOLT‑SPEC./AL            10     10.00     100.00

                         2002 BOLT‑SPEC./BR           200     10.00    2000.00

                                                                             

TOTAL 205                                                              2100.00

                                                                             

GRAND TOTAL                                           221  71520.00   77100.00

 

 

 

   this may be done by defining a subtotal level for each time the first 3 digits in the Article File Key 2 change. I.e. every time the supplier number changes.


6.43.        The key building routine of Repgen.

 

   A key to a file is always an alpha numeric field up to 30 characters long. In creating the file, the programmer has defined how the key is built up from the fields of the file. If these fields are numeric there must be a conversion from numbers to text before the field can be used as a key. This conversion is performed by the Repgen key‑building routine.

 

   To save disc space, the programmer may have "packed" numbers in the key, which will reduce the discspace but makes the programs more complicated. It is also normal for parts of fields or text constants to be used in the keys. It may be difficult to get the different file keys to agree, without documentation detailing the systems keys.

 

   The programmer may define this information on the machine, so that Repgen knows the different keys in the system. The user thus does not have to think about these. Please note if any numbers are in the keys with or without leading zeroes.

 

   The Repgens key boulding routines are activated by writing the key definitions just after READ(XX) without blanks or commas. Fieldnumbers are inserted without # in front and text constants should be  in quotation marks (").

 

   With the aid of letters you may specify special functions such as Packing, Date reversal and Zero suppression. Parts of fields are inserted in the normal way, e.g. 10(5,6) means character 5 to 6 of field 10.

 

    A key always contains an even number of characters, so if you have a five digit customer number this will always be held in the system as 6 characters in the key. This extra character may be a zero‑character, the number 0 or a blank. With the Space function you may fill out the key with blanks. In the following paragraphs the full syntax for these key definitions are explained, and after that you will find some examples.

 

6.44.1.      Fields.

 

   Fields are inserted as fieldnumbers without # in front:

   

           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

 

6.44.3.      Functions.

 

   Functions are inserted just after the field as a letter:

    

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

           P        =  Packing

           Z        =  Zero, suppressed

           S        =  Space, some blanks

 

6.44.5.      Grouping of fields and functions.

 

   Several fields are combined by separating them with commas.

The P function may be used for each field or alone without a field number.In the latter case, you pack the total defined key.

The S function may only be used at last or alone.

 

6.44.7.      Examples of key buildings.

 

        1. 1            Field 1.

        2. 1,2          Field 1 and after that field 2.

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

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

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

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

        7. 1,S          Field 1 with possible leading blanks.

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

 

    The two last key structures are used normally by DATAMASTER, the first when defining a unique key, the second when defining a key where there might be  several equal values of the field.


6.           SORTING AND TOTALLING.

 

   Sorting and totals are defined in the same function because very often totals are related to the sequence in which you may wish to process the files. Total levels occur when one or more of the characters in a file key or a sort key changes value. These levels may be defined in the structure of sort keys.

 

7.1.         Sorting.

 

   When you have selected Function 3 ‑ Sorting and Totals just enter the number of the report you wish to work on. On the screen you will see the fields used in the report.

 

    Just answer Y to the question:      Sorting (Y/N) ?           

 

    If Yes you define the sorting criteria. If No you may define weighted totals, se later.

 

 

Figure 31 Definition of a sort‑key.

 

 DMS.RAPGEN     2 STOCK VALUE                 3......DEFINE SORTING AND TOTALLING

   1 ARTICLE NO              19 @FREE                                            

   2 DESCRIPTION             20 @FREE                                            

   3 SALE PRICE              21 @FREE                                            

   4 COST PRICE              22 @FREE                                            

   5 DATE LAST PURCHASE      23 @FREE                                            

   6 SUPPLIER NO             24 @FREE                                            

   7 ARTICLE GROUP NO        25 @FREE                                            

   8 STOCK BALANCE           26 @FREE                                            

   9 ALTERNATIVE SUPPLIER    27 @FREE                                            

  10 FREE FIELD              28 @FREE                                            

  11 @FREE                   29 @FREE                                            

  12 @FREE                   30 @FREE                                            

  13 @FREE                                                                       

  14 @FREE                                                                       

  15 @FREE                                                                        

  16 @FREE                                                                       

  17 @FREE                                                                       

  18 @FREE                                                                        

 NOTE:IT WILL TAKE SOME TIME TO READ THE FILES BEFORE PRINTING STARTS.           

                                                                                 

 ARTICLE GROUP NO                                                                 

 ##                                                 FROM CHAR NO:1               

 SORT‑KEY:     FIELDNO.? 7                          TO   CHAR NO:2               

 TOTAL LEVEL (Y/N) ? Y  TOTAL NAME ? GROUP  FORMFEED (Y/N) ? N                   

 

 

 

    

To define a sort criteria just enter:  ex. Fieldnumber 7 FROM character 1

                                                         TO character 2

 

and in this way you can combine fields or parts of fields until you have got the sort criteria you require. If you just press CR in the FROM/TO fields the whole field will be in the sort criteria.

 

7.2.1.       Subtotal levels.

 

   Per sort field you are asked:

   

         TOTAL (Y/N) Y                          and if YES

         TOTAL NAME: GROUP    NEW PAGE (Y/N) Y

 

 This will create a subtotal named GROUP each time this part of the sort     field changes, and printing can continue on a new page after the subtotal.


 

Figure 32 Sorted list with subtotals.

 

DATE:14,01,87          * STOCK VALUE *           AS OF 14,01,87   PAGE:    1 

                                                                             

NO     DESCRIPTION        GROUP COST PRICE STOCK BALANCE STOCK VALUE SUP.NO. 

0101   BOLT                   0      1.50            100      150.00 271     

1001   TRUCK‑WHEEL            0    500.00            100    50000.00 205     

                                                                             

GROUP  0                                                    50150.00         

                                                                              

1005   TRUCK‑GEARBOX          1   1500.00             10    15000.00 100     

                                                                             

GROUP  1                                                    15000.00         

                                                                             

0110   TRUCK‑WORK             2  60000.00              1    60000.00 123     

                                                                              

GROUP  2                                                    60000.00         

                                                                             

0102   TRUCK‑HOPPER           9  10000.00              0        0.00 100     

2001   BOLT‑SPEC./AL          9     10.00             10      100.00 205     

2002   BOLT‑SPEC./BR          9     10.00            200     2000.00 205     

                                                                             

GROUP  9                                                     2100.00         

                                                                             

GRAND TOTAL                                                127250.00         

 

 

 

                  

7.2.3.       Sorting technique.

 

   Before printing, DMS.REPGEN reads the files involved and builds a sortfile (DMSORTWORK). During this phase, calculations and selections of the report are performed.

 

   This makes it possible to sort on results of calculations, fields in other files, etc. e.g. an article report sorted by supplier name.

 

   Only records meeting the selection criteria are sorted. This saves space and improves performance.

 

   When starting a sorted report, the user is informed that it might take some time before the report is printed. If a sorted report uses a previously built sortfile, you may use the SORT ‑ command (see section 9.1.3.2).

 

   Using the WHEN‑command (see section 4.11.10) you may control when to perform calculations ‑ during the sort phase and/or the printout. Note the chapter on weighted totals (6.3).

 

   Starting a sorted report will lock the sortfile and it is thus not possible to start or define more than one sorted report at the same time ‑ unless DMS.REPGEN is installed on more than one system.

 

7.2.5.       Sortfile ‑ DMSORTWORK.

 

   DMS.REPGEN builds a file containing the sortkeys and a recordnumber pointing to a report main file.

 

   The installer builds this file to a size equal to the maximum numbers of records one may wish to sort, normally the number of records in the largest file.

 

   Note that in connection with substantial file expansions, the sortfile might also need to be expanded.

 

   The sortfile takes 100 sectors per 1000 records.

 

   On installations with very little disc space, the sortfile may be left out. Sorting is then not possible but all other functions can be used.

 

   A sortkey may be maximum of 27 characters, because 3 characters are used by DMS.REPGEN as a packed 6 digit record number.


7.2.7.       Sorting in descending sequence.

 

   Normally a sort will be performed in ascending order.

 

    e.g.1  100l                 Sortfield:

           1002                 Fieldno. #24

           1003

    e.g.2  ANDERS

           BROWN

           BRYDE

           CALLE

 

You may sort numeric fields in descending sequence by performing a calculation:

 

    e.g.   #50 = 1000000000 ‑ #24 (Invert)

    e.g.3  1003                 Sortfield:

           1001                 Fieldno. #50

 

7.2.9.       Secondary sorting sequence.

 

   If a supplier file with more indexes uses index 1(supplier) in a report sorted on currencycode, the detail lines in the report with the same currency code, will appear in the sequence they were read from the supplier file, i.e. supplier number sequence.

 

   If the same report is started using index 2 (supplier name), the sequence  will now be alphabetic by supplier name with the same currencycode.

 

7.2.11.       New sortkey.

 

   If an articlefile has e.g. two fields:

   

              ‑ Primary supplier number

              ‑ Alternative supplier number

 

is it possible to sort a report by both supplier numbers.

 

    Just define a normal sort of one of the fields with subtotals.

 

    Then enter NEW as fieldnumber and on the screen you will see:

   

                 NEW sortkey

 

and you may now define the other field as a sortfield as well. Subtotals should not be defined on this second sort key.

   

 

Figure 33 Articles sorted by normal and alternative supplier.

 

DATE:14,01,87          * ARTICLES / SUPPLIERS *     AS OF 14,01,87    PAGE   1

                                                                             

NO     DESCRIPTION         SUP.NO. ALT.SUP.NO    COST PRICE DATE LAST PURCHASE

0102   TRUCK‑HOPPER        100              0      10000.00            1,01,85

1005   TRUCK‑GEARBOX       100              0       1500.00            1,08,86

0102   TRUCK‑HOPPER        100              0      10000.00            1,01,85

0110   TRUCK‑WORK          123            100      60000.00           15,12,86

1005   TRUCK‑GEARBOX       100              0       1500.00            1,06,86

1001   TRUCK‑WHEEL         205            102        500.00           31,12,86

2001   BOLT‑SPEC./AL       205            102         10.00            1,01,87

2002   BOLT‑SPEC./BR       205            102         10.00           30,07,86

0110   TRUCK‑WORK          123            100      60000.00           15,12,86

1001   TRUCK‑WHEEL         205            102        500.00           31,12,86

2001   BOLT‑SPEC./AL       205            102         10.00            1,01,87

2002   BOLT‑SPEC./BR       205            102         10.00           30,07,86

0101   BOLT                271            270          1.50            1,01,87

0101   BOLT                271            270          1.50            1,01,87

 

 

 

 

   On the above list you will see each article mentioned twice, first 0102 i sorted on alternative supplier no.0 , 1005 on alternative supplier 0 also, second 0102 on supplier 100, 0110 on alternative supplier 100 and so on.


7.3.         Subtotal levels without sorting.

 

   Even if you do not wish to sort, you may define subtotals in a similar way:

 

 

Figure 34 Definition of a subtotal‑level.

 

 DMS.RAPGEN     2 STOCK VALUE                 3......DEFINE SORTING AND TOTALLING

   1 ARTICLE NO              19 @FREE                                            

   2 DESCRIPTION             20 @FREE                                            

   3 SALE PRICE              21 @FREE                                            

   4 COST PRICE              22 @FREE                                            

   5 DATE LAST PURCHASE      23 @FREE                                            

   6 SUPPLIER NO             24 @FREE                                            

   7 ARTICLE GROUP NO        25 @FREE                                            

   8 STOCK BALANCE           26 @FREE                                            

   9 ALTERNATIVE SUPPLIER    27 @FREE                                            

  10 FREE FIELD              28 @FREE                                            

  11 @FREE                   29 @FREE                                            

  12 @FREE                   30 @FREE                                            

  13 @FREE                                                                       

  14 @FREE                                                                        

  15 @FREE                                                                       

  16 @FREE                                                                       

  17 @FREE                                                                        

  18 @FREE                                                                       

                                                                                 

                                                                                  

 ARTICLE NO                                                                      

 AAAA                                               FROM CHAR NO:1               

 TOTAL‑LEVEL:  FIELDNO.? 1                          TO   CHAR NO:2               

 TOTAL LEVEL (Y/N) ? Y  TOTAL NAME ? ARTICLE GROUP  FORMFEED (Y/N) ? N           

 

 

 

 

   As with subtotal definitions in connection with sorting, you may define a subtotal level each time a part of the index used for this report changes, e.g. 2 first digits of an articlenumber.

 

    You must, of course, know the structure of the indexes in order to use this function. Normally, only the primary index is used.

 

Figure 35 Report containing sub‑totals.

 

DATE:14,01,87          * STOCK VALUE *          AS OF  14,01,87   PAGE:    1 

                                                                             

NO     DESCRIPTION             GROUP COSTPRICE  STOCK BALANCE STOCK VALUE SUP

0101   BOLT                        0      1.50            100      150.00 271

0102   TRUCK‑HOPPER                9  10000.00              0        0.00 100

0110   TRUCK‑WORK                  2  60000.00              1    60000.00 123

                                                                             

ARTICLE GROUP 01                                                 60150.00    

                                                                             

1001   TRUCK‑WHEEL                 0    500.00            100    50000.00 205

1005   TRUCK‑GEARBOX               1   1500.00             10    15000.00 100

                                                                             

ARTICLE GROUP 10                                                 65000.00    

                                                                             

2001   BOLT‑SPEC./AL               9     10.00             10      100.00 205

2002   BOLT‑SPEC./BR               9     10.00            200     2000.00 205

                                                                             

ARTICLE GROUP 20                                                  2100.00    

                                                                              

                                                                             

GRAND TOTAL                                                     127250.00    

 

 

 

 

Figure 36 Report with sub‑totals only.

 

DATE:14,01,87          * STOCK VALUE *          AS OF  14,01,87   PAGE:    1 

                                                                             

NO     DESCRIPTION             GROUP COSTPRICE  STOCK BALANCE STOCK VALUE SUP

                                                                              

ARTICLE GROUP 01                                                 60150.00    

ARTICLE GROUP 10                                                 65000.00    

ARTICLE GROUP 20                                                  2100.00    

                                                                             

GRAND TOTAL                                                     127250.00    

 

 

 

All characters in an index field may be used to separate subtotal levels. If the field which defines the sub‑total breaks is not an index, the report MUST be sorted.

 

    If a file has a packed index, the unpacked number of characters should be calculated to find the subtotal level. The key/index is unpacked in read 4800/4900.


7.5.         Weighted totals.               

 

7.6.1.       Principles.

 

   Weighted totals are detail lines weighted with a final total of the report.

   

   example:   Number  Name           Revenue    %

                100   JONES          20         10,0

                200   ABLE           40        20,0

                300   MICH           50        25,0

                400   CAKE           50        25,0

                500   BREW           40        20,0

                                    ‑‑‑‑‑       ‑‑‑‑‑

              Total                  200        100,0

 

7.6.3.       First pass.

 

   DMS.REPGEN has to know the final totals in order to use them in the calculation of the detail lines.

 

   This is done by reading the file(s) or part of it/them, and then reading it/them once more performing the calculations and printout.

 

7.6.5.       Collecting the total value.

 

   The final totals are produced by calculations using free fields. During the first pass, final totals of the selected fields are calculated. With the WHEN command, you may define if a calculation is to be performed in the first, second or both passes.

   

    e.g. When:  only first pass

         #50 = #50+#24

 

7.6.7.       Second pass ‑ weighted detail‑/total lines.

 

   When entering the second pass, field 50 now contains the total value of field 24 (#50 equal 100 %).

 

   During the second pass this field, #50, is used as a constant value:

   

     e.g. #51 = #24% #50

 

In this way you calculate fieldnumber #51 equals field #24 as a percentage of fieldnumber #50. You may even use this field in selection so that only  results greater than 2% are printed.

   

 

Figure 37 Report with weighted totals.

 

DATE:14,01,87      * WEIGHTED STOCK VALUE *     AS OF  14,01,87   PAGE:    1 

                                                                             

NO     DESCRIPTION        COST PRICE    BALANCE STOCKVALUE      WEIGHTED     

0101   BOLT                     1.50        100     150.00          0.12     

0102   TRUCK‑HOPPER         10000.00          0       0.00          0.00     

0110   TRUCK‑WORK           60000.00          1   60000.00         47.15     

                                                                              

ARTICLE GROUP 01                                  60150.00         47.27     

                                                                             

1001   TRUCK‑WHEEL            500.00        100   50000.00         39.29     

1005   TRUCK‑GEARBOX         1500.00         10   15000.00         11.79     

                                                                             

ARTICLE GROUP 10                                  65000.00         51.08     

                                                                             

2001   BOLT‑SPEC./AL           10.00         10     100.00          0.08     

2002   BOLT‑SPEC./BR           10.00        200    2000.00          1.57      

                                                                             

ARTICLE GROUP 20                                   2100.00          1.65     

                                                                             

                                                                              

GRAND TOTAL                                      127250.00        100.00     

 

 

 

You may also sort the resultfields and produce A‑B‑C‑analysis.


 

Figure 38 Report definition for weighted totals.

 

DMS.RAPGEN        REPORT NO.12  WEIGHTED STOCK VALUE     JAN 14, 1987 11:34:03

                                                                             

PRINTER:$LPT   STARTPOSITION:001   LINES ON FORM:66                           

                                                                             

FILE: 1 VA     ARTICLE FILE              8/CH.VAKA#                          

                                                                             

                                                                             

  1...,....10...,....20...,....30...,....40...,....50...,....60...,....70...,.

1:DATE:#DD           * WEIGHTED STOCK VALUE *     AS OF #PD           PAGE:#PP

2:                                                                           

3:NO     DESCRIPTION         COST PRICE    BALANCE   STOCK VALUE      WEIGHTED

4:                                                                            

5:#1     #2                   #4           #8      #11               #12     

  1...,....10...,....20...,....30...,....40...,....50...,....60...,....70...,.

                                                                              

SELECTIONS:                                                                  

                                                                             

CALCULATIONS:                                                                 

   #11=#8*#4                    STOCK VALUE=STOCK BALANCE*COST PRICE         

   #12=#11%#13                  WEIGHTED=STOCK VALUE%TOTAL VALUE             

   #12=FNR(#12)                 WEIGHTED=FNR(WEIGHTED)                       

                                WHEN 10   FIRST PASS ONLY   ALWAYS           

   #13=#13+#11                  TOTAL VALUE=TOTAL VALUE+STOCK VALUE          

                                                                             

THE FILE MUST BE READ BEFORE PRINTING STARTS TO CALCULATE TOTALS.            

TOTAL LEVELS                                                                 

                                                                             

 SORTING (Y/N) ? N                                                            

                                                                             

 TOTALS IN AN EXTRA INITIAL PASS (Y/N) ? Y                                   

                                                                             

 TOTAL‑LEVEL: FIELDNO.? 1(1,2) ARTICLE NO   TOTAL LEVEL (Y/N) ? Y            

                               TOTAL NAME ? ARTICLE GROUP   FORMFEED (Y/N) ? N

                                                                              

 CALCULATE TOTALFIELDS BEFORE PRINT (Y/N) ? N                                

                                                                            

 FIELDS TO BE TOTALLED:                                                      

    #11   STOCK VALUE                                                       

    #12   WEIGHTED                                                          

                                                                              

 

 

 

 

7.6.9.       Weighted totals and selections.

 

   Please note that a calculation is normally perfed before a selection.

 

   If you only wish to create a report with weighted totals on a part of a file(s), then use the IF‑statement in the calculation function:

   

    e.g. WHEN: Only first pass

         IF #7 = 2 LET #50 = #50 + #24   

 

Now fieldnumber #50 is only accumulated when fieldnumber #7 is equal to 2.

 

7.6.11.       Weighted totals and quick selections.

 

   Quick selections are performed before anything else in order to speed up the printing of a report.

 

   A report defined with quick selections and weighted totals will only as the final totals, contain records NOT selected with the quick selection function.

 

   Note this is just opposite to the normal selections, which is performed AFTER the calculationes, the QUICK selections are effectuated BEFORE the calculations which collect the total sum.


7.7.         The report sequence.                      

 

   Before you go on, we can review the structure of the Repgen subroutines. The following sections explain the stages of the sequence.

 

Figure 39 Subroutines in the generated program.

 

                         

                                 START      

                         

                                   

                         

                             FIRST calc.    

                         

®          

                        

                         Find next record 

                        

                                   ¬

                         Yes                                    

                               TOTAL ?                            

                                                                

                                                              ¯                      

                      Yes               

                    END  ?               Calculated totals ?          

                                       

                                                   No              Yes            

Yes                      

¬  More passes ?         Read record                      Fields=totals    

                        

                                                                                  

                        

   LAST calculations NORMAL calc.                         NORMAL calc.     

                        

                                                                                  

       

          END            Selections      Print totals    Print totals     

       

                                                                                   

                      No                 

¬        OK ?               Add next / zero this         

                                         

                         5300                                                       

                                           

                            AFTER calc.    

                        

                                  

                 Sorting No 

                First Pass  ?  

                                         

                                  Weigthed totals            

                                                                       

                               

     Insert sortkey                                  Print line      

                               

                                                             

 

        

 

 

7.9.         Calculated totals.

 

   Normally you will just answer NO to the question: SHALL TOTALS BE CALCULATED BEFORE PRINT OUT (Y/N)? Calculations on totals are normally only necessary for percentages on total lines.

 

7.10.1.       Principles.

 

   Normally, calculations on a report will be made for each record which is read from the files, i.e. per line on the report, and the totals will be created as the sum of those fields you have asked to be totalized. This will be suitable for most reports.

 

   If the calculations maintain percent calculations, e.g. profit margin for  each article, the total will be the total of the percentages of the single lines, which is not meaningful. However, since totals may be calculated before printing out, you may make Repgen create percentage calculations for the total lines.

 

   It may not be desirable to calculate all total fields, e.g. if you print out lines with a field calculated as a foreign currency amount, you will not wish calculate the total of this field, as the total foreign currency amount will be nonsense. In using the calculated totals, you will normally also use the WHEN command in connection with calculations, allowing you to state which calculations shall be made for the totals. For special reports, you may use the special fields #LEVEL and #GROUP to control different calculations for different total levels or total groups.


7.10.3.       Fundamental rules for calculated totals.

 

   With calculated totals,all fields which enter into the calculations will be totalized!

 

   If you calculate e.g. #51=#24% #50 all the included fields, such as 24, 50 and 51 will be defined as totals, even though not all the fields are printed out on the report. If you do not define a total on a field, this field will be 0 from that moment when the total calculations are made, and you will not get the desired results.

 

7.10.5.       Use of the WHEN command.

 

   With the aid of the WHEN command during calculations, (see below), you may control when calculations shall be made:

   

            0 = Both totals and lines.

            1 = Only totals.

            2 = Only lines.

 

e.g. currency conversion may only be made for lines, while percent calculations are be made for both lines and totals.

 

   In the next example a report is defined, where the stockvalue is calculated as stock * bargain price, which is a typical example of a calculated total, since (total stock) * (total bargain price), is nonsense.

 

7.10.7.       Example of calculated totals.

 

 

Figure 40 The report without calculated totals, margin % is wrong.

 

DATE:14,01,87         * MARGIN LIST *            AS OF 14,01,87   PAGE:    1 

                                                                             

NO   DESCRIPTION   GR SALEPRICE COSTPRICE    MARGIN MARGIN% BALANCE      VALUE

0101 BOLT           0      2.00      1.50      0.50   33.33     100     150.00

0102 TRUCK‑HOPPER   9  20000.00  10000.00  10000.00  100.00       0       0.00

0110 TRUCK‑WORK     2 100000.00  60000.00  40000.00   66.67       1   60000.00

1001 TRUCK‑WHEEL    0   1000.00    500.00    500.00  100.00     100   50000.00

1005 TRUCK‑GEARBOX  1   2000.00   1500.00    500.00   33.33      10   15000.00

2001 BOLT‑SPEC./AL  9     20.00     10.00     10.00  100.00      10     100.00

2002 BOLT‑SPEC./BR  9     25.00     10.00     15.00  150.00     200    2000.00

                                                                             

GRAND TOTAL                                          583.33          127250.00

 

 

 

 

 

Figure 41 The report with calculated totals, total value is wrong.

 

DATE:14,01,87         * MARGIN LIST *            AS OF 14,01,87   PAGE:    1 

                                                                             

NO   DESCRIPTION   GR SALEPRICE COSTPRICE   MARGIN MARGIN% BALANCE       VALUE

0101 BOLT           0      2.00      1.50     0.50   33.33     100      150.00

0102 TRUCK‑HOPPER   9  20000.00  10000.00 10000.00  100.00       0        0.00

0110 TRUCK‑WORK     2 100000.00  60000.00 40000.00   66.67       1    60000.00

1001 TRUCK‑WHEEL    0   1000.00    500.00   500.00  100.00     100    50000.00

1005 TRUCK‑GEARBOX  1   2000.00   1500.00   500.00   33.33      10    15000.00

2001 BOLT‑SPEC./AL  9     20.00     10.00    10.00  100.00      10      100.00

2002 BOLT‑SPEC./BR  9     25.00     10.00    15.00  150.00     200     2000.00

                                                                             

GRAND TOTAL           123047.00  72021.50 51025.50   70.85     421 30321051.00

 

 

 

 

Figure 42 The report with calculated totals and WHEN calculations.

 

DATE:14,01,87         * MARGIN LIST *            AS OF 14,01,87   PAGE:    1 

                                                                             

NO   DESCRIPTION   GR SALEPRICE COSTPRICE   MARGIN MARGIN% BALANCE       VALUE

0101 BOLT           0      2.00      1.50     0.50   33.33     100      150.00

0102 TRUCK‑HOPPER   9  20000.00  10000.00 10000.00  100.00       0        0.00

0110 TRUCK‑WORK     2 100000.00  60000.00 40000.00   66.67       1    60000.00

1001 TRUCK‑WHEEL    0   1000.00    500.00   500.00  100.00     100    50000.00

1005 TRUCK‑GEARBOX  1   2000.00   1500.00   500.00   33.33      10    15000.00

2001 BOLT‑SPEC./AL  9     20.00     10.00    10.00  100.00      10      100.00

2002 BOLT‑SPEC./BR  9     25.00     10.00    15.00  150.00     200     2000.00

                                                                              

GRAND TOTAL                                          70.85           127250.00

 

 


 

Figure 43 The report definition for calculated totals.

 

DMS.RAPGEN        REPORT NO. 3    MARGIN LIST            JAN 14, 1987 11:37:05

                                                                             

PRINTER:$LPT   STARTPOSITION:001   LINES ON FORM:66                          

                                                                              

FILE: 1 VA    ARTICLE FILE                   8/CH.VAKA#                      

                                                                             

                                                                              

  1...,....10...,....20...,....30...,....40...,....50...,....60...,....70...,.

1:DATE:#DD              * MARGIN LIST *           AS OF #PD           PAGE:#PP

2:                                                                            

3:NO   DESCRIPTION    GR SALEPRICE COSTPRICE MARGIN MARGIN% BALANCE     VALUE

4:                                                                           

5:#1   #2             #7 #3       #4       #11     #12        #8     #13      

  1...,....10...,....20...,....30...,....40...,....50...,....60...,....70...,.

                                                                             

SELECTIONS:                                                                  

                                                                              

CALCULATIONS:                                                                

                                WHEN 1   BOTH         LINES ONLY             

   #11=#3‑#4                    MARGIN=SALES PRICE‑COST PRICE                

   #13=#8*#4                    STOCK VALUE=STOCK BALANCE*COST PRICE         

   #14=#4                       COST PRICE=COST PRICE                        

   #15=#11                      MARGIN=MARGIN                                

                                WHEN 0   BOTH         BOTH                   

   #12=#15%#14                  MARGIN PERCENT=MARGIN%COST PRICE             

   #12=FNR(#12)                 MARGIN PERCENT=FNR(MARGIN PERCENT)           

                                                                             

TOTAL LEVELS                                                                 

                                                                              

 SORTING (Y/N) ? N                                                           

                                                                             

 TOTALS IN AN EXTRA INITIAL PASS (Y/N) ? N                                   

                                                                              

 CALCULATE TOTALFIELDS BEFORE PRINT (Y/N) ? Y                                

                                                                             

 FIELDS TO BE TOTALLED:                                                       

    #12   MARGIN PERCENT                                                     

    #13   STOCK VALUE                                                        

    #14   COST PRICE                                                          

    #15   MARGIN                                                             

 

 

 

Please notice the use of the free fields 14 and 15:

 

   The fields 14 and 15 are written out on the list, but you dont wish totals for these.

 

   Instead you totalise field 14 and 15, and use them in the total calculations, these fields will not be written out on the list, but will be line 4 and 11 for each line (not totals) in the calculations.

 

7.10.9.       Technique for calculated totals.

 

   Normally, Repgen will collect the totals for the chosen fields in a special (4 words) set of fields, which are written out directly on the total line.

 

   If calculated totals are defined, the fields of the files will be changed to 4 word fields (deallocated and redimensioned), when the total levels arise, and those fields which are specified as total fields will be moved to these new, memo fields (S1, S2, S3, S4). The calculations are made with the usual variables and the total line is written out, and after that the memo fields are reset to normal size.

 

   A report with calculated totals will therefore require more space than a report without such totals.

 

   With calculated totals you may omit totaling fields from other files, and instead move these into free fields, which are then totalised. Such a deallocation and redimensioning may result in rounding errors.


7.11.         Fields to be totalled.

 

   Here you insert the numbers of the fields you want totalled on the report. The chosen fields will be shown highlighted on the screen.

 

   Each field can only be chosen once, and it is naturally only numeric fields which may be totalled. If you try to choose a alpha numeric field it will result in a error message. Up to 34 fields may be totalled on a report.

   

 

Figure 44 Definition of fields to be totalled.

 

 DMS.RAPGEN     2 STOCK VALUE                 3......DEFINE SORTING AND TOTALLING

   1 ARTICLE NO              19 @FREE                                            

   2 DESCRIPTION             20 @FREE                                            

   3 SALE PRICE              21 @FREE                                             

   4 COST PRICE              22 @FREE                                            

   5 DATE LAST PURCHASE      23 @FREE                                            

   6 SUPPLIER NO             24 @FREE                                             

   7 ARTICLE GROUP NO        25 @FREE                                            

   8 STOCK BALANCE           26 @FREE                                            

   9 ALTERNATIVE SUPPLIER    27 @FREE                                             

  10 FREE FIELD              28 @FREE                                            

  11 MARGIN                  29 @FREE                                            

  12 MARGIN PERCENT          30 @FREE                                             

  13 STOCK VALUE                                                                 

  14 COST PRICE                                                                  

  15 MARGIN                                                                       

  16 @FREE                                                                       

  17 @FREE                                                                       

  18 @FREE                                                                        

 GRAND TOTAL IS AUTOMATICALLY DEFINED.                                           

 CALCULATE TOTALFIELDS BEFORE PRINT (Y/N) ? N                                    

                                                                                 

                                                                                  

 FIELDS TO BE TOTALLED: FIELDNO:14                                               

                                                                                 

 

 

 

 

   You may select fields from extern files, e.g. KU#24. With calculated totals all fields which are in the total calculation will be totalled. When you are finished with the total fields you insert END (or CR.). You also have the possibility to define special positioning of the totals:

 

7.12.1.       ‑ Fieldnumber. Print out fields on the totalline.

 

   If you input e.g. ‑7, this field will not be totalised, but only written out on the total line,(naturally only if it is placed on the line in the reportdefinition). The contents of the fields will be the last value from the file, unless you have defined something else with the aid of the calculations.

 

   The function is typically used to put a customer name down on the total line for the customer, or to write out the same of the article group on a article group total line. Such a name may either be written directly in the report with the aid of calculated totals, or read from another file.

 

7.12.3.       ‑ No 'grand total' text.

 

   If you set up ‑ alone, the text 'GRAND TOTAL' will be suppressed on the reports last line.

 

   The function is typically used on reports, where there is room for such a text, e.g. if a field on the left of the report is to be totalled, print out of the text "grand total" on the report, will displace the characters to the right.

 

7.12.5.       2% or 3% total precision.

 

   Reports with many totals, e.g. group totals and subtotal levels on many fields, may cause the program to run out of space. The totals are normally defined with the machines greatest arithmetic precision, e.g. 4 word variables, which allows 14 digits, and put in a matrix whose size is decided by:

   (numbers of fields which are to be totalled + 1) * (numbers of total levels + 1) * (numbers of groups + 1).

 

    To save space in such a report you may reduce one of the above factors, or use 2% or 3% variables in the total field number to reduce the precision on the tables. With 2% you get up to 6 digits, with floating comma, so that it will be the less significant digits, which will be lost if the number exceeds this limit. You may also increase the machines program size (active partition) to get space for such reports, but this should only be done in consultation with your Software Support organisation.


7.13.         Group totals.

 

   With the help of group totals you may at the end of the report get the totals by inserting that there e.g. are 5 customers in group 7 with total value 9000 kr.

 

Figure 45 Example of group totals.

 

DATE:14,01,87         * MARGIN LIST *            AS OF 14,01,87   PAGE:    1 

                                                                             

NO   DESCRIPTION   GR SALEPRICE COSTPRICE    MARGIN MARGIN% BALANCE      VALUE

0101 BOLT           0      2.00      1.50      0.50   33.33     100     150.00

0102 TRUCK‑HOPPER   9  20000.00  10000.00  10000.00  100.00       0       0.00

0110 TRUCK‑WORK     2 100000.00  60000.00  40000.00   66.67       1   60000.00

1001 TRUCK‑WHEEL    0   1000.00    500.00    500.00  100.00     100   50000.00

1005 TRUCK‑GEARBOX  1   2000.00   1500.00    500.00   33.33      10   15000.00

2001 BOLT‑SPEC./AL  9     20.00     10.00     10.00  100.00      10     100.00

2002 BOLT‑SPEC./BR  9     25.00     10.00     15.00  150.00     200    2000.00

                                                                             

    2 GROUP   0                                       99.80           50150.00

    1 GROUP   1                                       33.33           15000.00

    1 GROUP   2                                       66.67           60000.00

    3 GROUP   9                                      100.05            2100.00

                                                                             

GRAND TOTAL                                           70.85          127250.00

 

 

 

 

7.14.1.       Group totals (Y/N/LEVEL)?

 

   If you wish group totals on the report, if you answer N Repgen returns to the menu, if you answer Y you continue with the next question. (See the example overleaf).

 

 

Figure 46 Definition of group totals.

 

 DMS.RAPGEN     2 STOCK VALUE                 3......DEFINE SORTING AND TOTALLING

   1 ARTICLE NO              19 @FREE                                            

   2 DESCRIPTION             20 @FREE                                            

   3 SALE PRICE              21 @FREE                                            

   4 COST PRICE              22 @FREE                                            

   5 DATE LAST PURCHASE      23 @FREE                                            

   6 SUPPLIER NO             24 @FREE                                            

   7 ARTICLE GROUP NO        25 @FREE                                            

   8 STOCK BALANCE           26 @FREE                                            

   9 ALTERNATIVE SUPPLIER    27 @FREE                                            

  10 FREE FIELD              28 @FREE                                            

  11 MARGIN                  29 @FREE                                            

  12 MARGIN PERCENT          30 @FREE                                            

  13 STOCK VALUE                                                                 

  14 COST PRICE                                                                  

  15 MARGIN                                                                       

  16 @FREE                                                                       

  17 @FREE                                                                       

  18 @FREE                                                                       

 SPLIT TOTALS INTO GROUPS (Y/N/LEVEL) ? Y                                        

                                                                                 

                                                                                  

 GROUP FIELDNO.? 7  NO.OF CODES IN THE GROUP ? 10   GROUP NAME ? GROUP           

 GROUP FIELDNO.? U6 NO.OF CODES IN THE GROUP ? 20   GROUP NAME ? SUPPLIER        

                                                                                  

 

 

 

 

   If the report is defined with more SUBTOTAL levels, the group totals will be written out on all levels. If you only wish the group total at the end of the list, you may instead of Y, insert the total level, you wish the group totals printed out from, while the levels are numbered as e.g.:

   

            1 = First subtotal.

            2 = Next subtotal.

            3 = Grand total.

 

For a report with one single subtotal you may key in 2 to get the group totals at the end of the list.


7.14.3.       GROUP FIELDNUMBER: NUMBERS OF CODES AND NAMES.

 

   Here you key in the number of the field, which may control the index of the totals, the field must be numeric (see later) and contain a code between 0 and 100.

 

   The highest value of the field is set in NUMBERS OF CODES IN THIS GROUP, e.g. 100, and Repgen will make room for the codes 0‑100, if the value of the field in a record is outside this range the totalling will be performed in group 0.

 

   Please notice that there are not 100 different values, but the values 0 to 100.

 

   The numbers of such values in a group influence the size of a report program.

 

   At the end you can key in a groupname, which is printed out on the total line and Repgen returns to the question about group field number. You may define up to 3 different groups of totals on the same report, the definition is ended by key in END (or CR‑).

 

7.14.5.       "Undefined" group totals.

 

   One of the group totals may be defined as a undefined group, which is done by the key U before the groupfield number, e.g. U7.

 

   Repgen will then build a table around the different values which are in the field when you run through the file. In NUMBERS OF CODES, you state different numbers of values for the field, not as usual the highest value of the code.

 

   You may in that way split up the totals, e.g. after a 4 numbered code or a date field, and specially those groups may be defined with a alpha numeric text field, e.g. the groups A,B,C.... If there are more than the named numbers of values of the field, the rest will be placed in a various group.

 

 

Figure 47 Example of more groups, the last group 'undefined'.

 

DATE:14,01,87         * MARGIN LIST *            AS OF 14,01,87   PAGE:    1 

                                                                             

NO   DESCRIPTION   GR SALEPRICE COSTPRICE    MARGIN MARGIN% BALANCE      VALUE

0101 BOLT           0      2.00      1.50      0.50   33.33     100     150.00

0102 TRUCK‑HOPPER   9  20000.00  10000.00  10000.00  100.00       0       0.00

0110 TRUCK‑WORK     2 100000.00  60000.00  40000.00   66.67       1   60000.00

1001 TRUCK‑WHEEL    0   1000.00    500.00    500.00  100.00     100   50000.00

1005 TRUCK‑GEARBOX  1   2000.00   1500.00    500.00   33.33      10   15000.00

2001 BOLT‑SPEC./AL  9     20.00     10.00     10.00  100.00      10     100.00

2002 BOLT‑SPEC./BR  9     25.00     10.00     15.00  150.00     200    2000.00

                                                                             

    2 GROUP   0                                       99.80           50150.00

    1 GROUP   1                                       33.33           15000.00

    1 GROUP   2                                       66.67           60000.00

    3 GROUP   9                                      100.05            2100.00

                                                                              

    2 SUPPLIER 100                                    91.30           15000.00

    1 SUPPLIER 123                                    66.67           60000.00

    3 SUPPLIER 105                                   100.96           52100.00

    1 SUPPLIER 271                                    33.33             150.00

                                                                             

GRAND TOTAL                                           70.85          127250.00

 

 

 

 

7.14.7.       Part of fields/other files.

 

   Group totals may be defined a part of a field: e.g. #7(3,4), from the 3rd to the 4th character of field number 7.

 

   Further more you may use fields from other files to control the groups, e.g. KU#7, or even part of these, e.g. KU#7(3,4).

 

   Calculated free fields may also be used to control the groups.


7.           Defining a letter and amendments to reports/letters.

 

   A letter is a report where only one page is printed on screen for a file. 

 

   In a letter you may define selections, sorting and calculations e.g. print letters to selected customers, sorted by postcode. Totals cannot be defined on a letter.

 

    Examples include:

                     ‑ Letters of all types

                     ‑ Labels of all types

                     ‑ Checks

 

8.1.         Defining a letter

 

   A letter is defined by selecting Function 6.

 

   It is then possible to enter the main information of the letter in exactly the same way as a normal report, Function 1.

 

   Initially you will have a blank screen, where you may position fields and text. In this way you can edit a letter with, for example, a name and address from a file, and a letter text and/or fields from other files.

 

   Because the paper may be both larger and wider than the screen, you may, using commands, move the screenpage to any position on the paper. The screen may be used as a window through which you can see the letter or a part of the letter.

 

8.3.         Screen‑inquiry program.

 

   A letter type of report, printed on a screen, may be used as an inquiry program. Only 80 characters and 24 lines of a letter are shown on the screen.

 

   When a record is shown on the screen you are asked to press CR. to get the next record, or you may enter the number e.g. customers no., and customer information will appear on the screen. In this way you may use the program as inquiry program.

 

   Entering PRINT will print the screen image on the printer. This makes it possible to print letters to selected customers.

 

   Entering END will terminate the inquiry function. 

 

8.5.         Using function 6 and 7.

 

   A screen like this may be displayed:

 

Figure 48 Definition of a letter.

 

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

                                                                                1

                                                                                2

                                                                                3

                                                                                4

                                                                                5

                                                                                6

                                                                                7

                                                                                8

                                                                                9

           xxxxxxxxxxxxxxxxxxxxxxxx                                            10

           xxxxxxxxxxxxxxxxxxxxxxxx                                            11

           xxxxxxxxxxxxxxxxxxxxxxxx                                            12

                                                  London     ##.##.##          13

                                                                               14

                                                                               15

       CONCERNING YOUR ACCOUNT NO.xxx.                                         16

                                                                               17

                                                                               18

 LINE,POS: 17                                                                    

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

 CONCERNING YOUR ACCOUNT NO.#1 .                                                 

                                                                                 

 ACCORDING TO OUR BOOKS THE BALANCE IS #16                                       

                                                                                  

 

 

 

and the cursor will be placed in the lowerleft corner in the field, LINE,POS.

 

   The fields are shown on the screen with their formats. A row of x's indicates a textfield, and a row of #'s or ‑'s indicates a numeric field. You may select a line by entering the number of this or the linenumber, comma a position on the line.

 

   How this line and the two following lines will be shown is seen on the bottom lines of the screen, not with fieldformats but with fieldnumbers.

 

   The line may now be altered and when you press CR ‑ the line will be placed on the screen and fieldnumbers are converted to the fieldformats, and the cursor returns to LINE,POS. Only the number of characters you enter will be changed, If you wish to delete the line, you must fill the rest of the line with blanks. You may keep the same character by using the ­ key.

 

   The changes are ended by typing END or just press CR.

 

8.7.         Correcting a letter or report.

 

   Selecting Function 7 will allow you to change a letter in exactly the same way as it was defined. You have a screenpage at your disposal, where text/fields may be positioned as you wish.

 

   Selecting Function 7 on a report, defined in Function 1, you will also have the whole structure of the report displayed on the screen, and you may then change it.

 

Figure 49 Amending a report.

 

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

 DATE:##,##,##  * PRICE LIST *   AS OF ##.##.##   PAGE:####                     1

                                                                                2

 NO     DESCRIPTION         SALE PRICE GROUP NO                                 3

                                                                                4

 xxxx   xxxxxxxxxxxxxxxxxxxx ######.##       ##                                 5

                                                                                6

                                                                                7

                                                                                8

                                                                                9

                                                                               10

                                                                               11

                                                                               12

                                                                               13

                                                                               14

                                                                               15

                                                                               16

                                                                               17

                                                                               18

 LINE,POS: PRINTER                                                                

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

 PRINTER NO.? 1       (CR=$LPT,1=$RPL4)                                          

 STARTPOSITION (CR=001) ?       END POSITION (CR=080) ?                          

 LINES ON FORM (CR=066) ? 72                                                     

 

 

 

      

 

   In this way you may change headings in more than one line, or add/remove fields in the report. You should note that REPGEN has numbered the lines when the report was defined, and this may not be changed. You are therefore not allowed to add or delete any lines.

 

   For a report defined with only one line containing data fields, it will be valid to say that line 1 to 4 is used for headlines, and line 5 as the line which is printed for each record in the file.

 

   Deleting all the fields from line 5, causes the program to print a blank line for each record in the file.

 

   Using the command PRINTER it is possible to change the printer assignment or the page height of a report. You may wish to place fields in the heading of a report, because the heading is printed together with the first record in a file.

 

8.9.         Using commands in function 6 and 7.

 

   You may at LINE,POS use the following special commands:

 

8.10.1.       Lineno.

 

   If a linenumber is entered, the line is shown on the screen. The screen will scroll up/down if the chosen line is not in the range of the actual linenumber interval shown on the screen.


8.10.3.        position.

 

   As above, the line may be corrected from the entered position.

 

8.10.5.       CR.

 

   The screen will scroll one line up.

 

8.10.7.       End or CR.

 

   Function ended.

 

8.10.9.       HLP command.  

 

   You can see the fields in this or in other files. See the description of the help function in the multi file function.

 

8.10.11.       POS set start position of the screen.

 

   Using this you may move the screen to another start position of the report, if this is wider than 80 characters.

 

8.10.13.       PRINT‑printout on printer.

 

   The lay out of a report is printed on the printer, related to the report. This is very usefull when changing a preprinted form.

 

8.10.15.       Top of form.

 

   Will perform a paper feed up to next form.

 

8.10.17.       PRINTER define the printer assignment and page height.

 

   Using this command, you may direct the report to a specific printer. (This must be defined when installing the program, normally TAMOS printer assignment is used). You may also change the first and the last Printer Position in the lines, which means move the reports left margin to the right. And the page height (number of lines per page) may be changed in letters and other reports.

 

8.10.19.      MASK turn the print raster on/off.

 

   When you enter the RASTER command for the first time, the function is turned on, and the next time turned off. When the raster is active a marking of the positions is shown on the whole screen. In this way it is easier to identify the specific textfield position, and the raster may also be printed, if you use the PRINT command.

 

 

Figure 50 The MASK command activated.

 

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,....1

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,....2

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,....3

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,....4

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,....5

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,....6

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,....7

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,....8

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,....9

 ....,....!xxxxxxxxxxxxxxxxxxxxxxxx,....!....,....!....,....!....,....!....,...10

 ....,....!xxxxxxxxxxxxxxxxxxxxxxxx,....!....,....!....,....!....,....!....,...11

 ....,....!xxxxxxxxxxxxxxxxxxxxxxxx,....!....,....!....,....!....,....!....,...12

 ....,....!....,....!....,....!....,....!....,....London....!##,##,##.!....,...13

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,...14

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,...15

 ....,.CONCERNING.YOUR.ACCOUNT.NO.xxx...!....,....!....,....!....,....!....,...16

 ....,.ACCOUDING.TO.OUR.BOOKS.THE.BALANCE.IS.‑‑‑‑‑‑‑‑‑#.##..!....,....!....,...17

 ....,....!....,....!....,....!....,....!....,....!....,....!....,....!....,...18

 LINE,POS:                                                                       

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

                                                                                  

                                                                                 

                                                                                 

                                                                                  

 

 

 


8.10.21.

7.5.11.      MODE shows field formats and numbers or names.

 

   Using the MODE command, you may define how the fields should be displayed on the screen, and when using the PRINT command:

   

            0 = Show fieldnumbers.

            1 = Fieldnumbers are not shown.

            2 = Fieldnames are shown if there is room for this.

            3 = Fieldformats are shown.

 

 

Figure 51 The command MODE 0 with fieldnumbers.

 

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

                                                                                1

                                                                                2

                                                                                3

                                                                                4

                                                                                5

                                                                                6

                                                                                7

                                                                                8

                                                                                9

           #2                                                                  10

           #3                                                                  11

           #4                                                                  12

                                                  London     #DD               13

                                                                               14

                                                                               15

       CONCERNING YOUR ACCOUNT NO.#1 .                                         16

       ACCORDING TO OUR BOOKS THE BALANCE IS #6          .                     17

                                                                               18

 LINE,POS:                                                                        

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

                                                                                 

                                                                                  

                                                                                 

                                                                                 

 

 

 

Figure 52 The command MODE 2 with fieldnames.

 

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

                                                                                1

                                                                                2

                                                                                3

                                                                                4

                                                                                5

                                                                                6

                                                                                7

                                                                                8

                                                                                9

           NAME                                                                10

           ADDRESS                                                             11

           TOWN                                                                12

                                                  London     DATE              13

                                                                               14

                                                                               15

       CONCERNING YOUR ACCOUNT NO.SUP.                                         16

       ACCORDING TO OUR BOOKS THE BALANCE IS BALANCE     .                     17

                                                                               18

 LINE,POS:                                                                       

 1...;....10...;....20...;....30...;....40...;....50...;....60...;....70...;....8

                                                                                 

                                                                                 

                                                                                  

                                                                                 

 

   


8.10.23.      IL or LI inserting a line.

 

   Using one of these commands you can insert a line before a specific linenumber, causing the rest of the lines to move down.

 

8.10.25.

7.5.13.      DL or LD deleting a line.

 

   Using one of these commands you can delete a specific line, causing the lines to move up.

 

8.10.27.      FORMAT changing the format for the free field.

 

   The first time you use one of the 20 free fields you will be asked to type a name and a format for the fields. (See the chapter on definition of a report). If you should later wish to change the format of such a file, this may be done using the format command, you will then be asked to type:

      

     Fieldnumber:              New format:

 

   The function may only be used on the 20 free fields, not on the fields of the file, and if a free field has been given an alphanumerical format, this may not be changed. If necessary, you can instead use another free field.

 

   The format for a field in a file can only be changed for this report by moving the field to one of the free fields. In this way may 30 characters name be printed just as 20 characters.


8.11.         Special fields in a letter/report.

 

   In addition to the normal fields: 

                #xx = fieldnumber xx from the mainfile

              KK#xx = fieldnumber xx from the file KK

you can use the following special fields.

 

8.12.1.       #DD todays date.  

 

   Entered at the beginning of a report (##.##.##).[17]

 

8.12.3.       #PD per date.

 

   Entered as the secondary date when starting the report (####).[18]

 

8.12.5.       #PP pagenumber.

 

   Is automatically assigned during pageshift (####).[19]

 

8.12.7.       #KA filenumber.

 

   May only be used for special fields where the filename contains ? (see installation), (####).[20]

 

8.12.9.       #SN systemname.

 

   May be used if Repgen is installed with multiple systems e.g. different companies/files sets). It is collected as fieldnumer 1 from DMS.REPGEN.SYS, which means set up when installing the program (xxx‑‑‑‑‑‑‑‑‑).[21]

 

8.12.11.       #SY systemnumber.

 

   As #SN, returns the number of the actual system (xxx).[22]

 

8.12.13.       #TI system clock.

 

   Returns the value of the machines built‑in clock.[23]

 

8.12.15.       #NO programno.

 

   The programnumber of the report, e.g. for reportnumber 15 is this 1015 (####).[24]

 

8.12.17.       #SC screennumber.

 

   The number of the screen which has started the report (##).[25]

 

8.13.         Special characters (quotation marks etc).

 

   The text in a report may not contain quotation marks ("") or upwards arrow, because these characters are special Basic characters, and would cause an error when generating the programme. Use a single quote instead of quotation marks.

 

   A text may not be placed immediately to the left of a field because Repgen will see this as a reference to another file e.g. SALDO#7 will be seen as field 7 from the file DO, therefore write SALDO #7 instead.


8.15.         Letters in more versions.

 

   This facility in the Repgen is normally left out because it may only be used on systems which are installed without the optimizing code, i.e not in connection with multiple files.

 

   If you wish to use this you may have a special Repgen system installed on the same machine.

 

   When creating a new letter using Function 6, Repgen will ask wether you wish to define several different versions of the letter and if you answer yes the repgen will ask you how many versions you wish and in which fieldnumber you wish to control these versions.

   

 

Figure 53 Definition of a letter with multiple versions.

 

 DMS.RAPGEN     5 LETTER                              6....DEFINE NEW LETTER     

 GR.... ARTICLE GROUPS FILE                                                      

 KU.... CURRENCY FILE                                                            

 LE.... SUPPLIER FILE                                                            

 VA.... ARTICLE FILE                                                             

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

 FILE SHORTNAME ? LE......SUPPLIER FILE                                          

                                                                                 

 REPORT NAME (FOR SELECTOR ) ?        LETTER                                     

                                                                                 

 LINES ON FORM         (CR=66)    ?   72            USER NAME ? XXX              

                                                                                  

 SEVERAL VERSIONS (LANGUAGES) OF THIS LETTER (Y/N) ? Y                           

 HOW MANY MORE VERSIONS ? 2                                                      

 THE REPORTS: 6 7  ARE DEFINED AS VERSION 1.2....                                

 CALCULATIONS ETC.MUST BE DEFINED ON THIS REPORT.                                

 WHICH FIELDNO.SHOULD CONTROL THE VERSIONS ? 5                                   

 

 

 

 

   After this you define the letter in the normal way, and this will be the basic version.

 

   Repgen will store a copy of this basuc version in the following reports, equalling the stated number of versions. These report numbers must thus be free when a letter with multiple versions is defined.

 

   You may now change the different versions with function 7, correcting a report. For example, translating these to different lanquages or having a reminder increase in severity.

 

   The field that controls the version should be a code with the value 0,1,2  etc., in such a way that the primary version of the letter is printed for code 1, version 2, for code 2 etc.

 

    If the code is not within a defined version the basic version is printed. The control field may be a calculated field.

 

    Only the basic version of the report can be started because calculations, selections and sortings must be defined on this.

 

    The other versions are only sub versions, which are controlled by the  basic version and cannot be treated separatly.

 

    There may be defined max. 9 versions in addition to the basic versions.

 

    Each version can be related to a separate printer "Bank Giro's" and cheques can in this way be printed in the same run, if you have two printers available.

 

8.17.         Useful lines and positions.

 

   One A4 page is 72 lines high and 80 characters wide, avoid writeing in position 80 as this will cause double lineshift.

 

   A normal print page is 132 characters wide and 66 lines high.

   Giro form is normally 24 lines.

   Labels are normally between 8 and 12 lines.


8.           Copying ‑ Deleting and documentation.

 

9.1.         Copying a report.

 

   A report may be copied by using Function 10, where you enter:

   

              From report no.

              To report no.

              New report name.

              New username.

 

The report is then copied. The first time the new report is printed, the BASIC program will be generated. The copy function may be used to make a copy of a report which you want to extend, without changing the original. You can then extend the copy.

 

Figure 54 Copying a report.

 

 DMS.RAPGEN                                          10.....COPY REPORT          

   1 PRICE LIST                                                                  

   2 STOCK VALUE                                                                 

   3 MARGIN LIST                                                                 

   4 PRICECALCULATIONS                                                           

   5 VENDOR LABELS                                                               

   6 VENDOR BALANCE                                                              

   7 STOCK LIST                                                                  

   8 GROUP LIST                                                                  

   9 SUPPLIER LIST                                                               

  10 CURRENCY LIST                                                               

  11 ITEMS BY SUPPLIERS                                                          

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

 REPORT NUMBER ? 2    TO REPORT NO.? 12                                          

 NEW REPORT NAME ? WEIGHTED STOCK VALUE   NEW USER NAME ? YYY                    

 

 

 

        

9.2.1.       Copying a report between systems.

 

   A special facility is implemented for copying between different Report generator systems. This may naturally only be used if the report generator is installed with multiple systems where the files of these systems are alike, for example where you have more than 88 reports. You must be in the system you wish to copy a report FROM. At the 'Report to' prompt you may enter the system number, the reportnumber. For example 10,2 will give you system 10, report number 2.


9.3.         Delete a report.

 

   With Function 5, you can delete a report, although you have to answer yes when the system asks you the question DELETE Y/N, in order to avoid deleting a report by mistake.

 

   Deletion may also be used in another way. If you type 'N' at the question DELETE Y/N, you will not delete the report definitions, but only the generated Basic program for the report. The Basic program will then be regenerated at printout time and so any changes in the standard routines or read‑statements are activated in the new generated program.

 

   You have to be aware that read statements for other files could be connected to the report if the calculation‑line involves READ(xx) commands. A copy of these statements is stored in the textfile DMT10xx. To get new versions of these into a report you have to select Function 4, Calculations, and then accept all calculation lines. This is done by typing 99 at OK(Y/N/I).

 

Figure 55 Deleting a report.

 

 DMS.RAPGEN                                           5.....DELETE REPORT        

   1 PRICE LIST                                                                  

   2 STOCK VALUE                                                                 

   3 MARGIN LIST                                                                 

   4 PRICECALCULATIONS                                                           

   5 VENDOR LABELS                                                               

   6 VENDOR BALANCE                                                              

   7 STOCK LIST                                                                  

   8 GROUP LIST                                                                  

   9 SUPPLIER LIST                                                               

  10 CURRENCY LIST                                                               

  11 ITEMS BY SUPPLIERS                                                          

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                 

                                                                                 

                                                                                 

                                                                                  

                                                                                 

 REPORT NUMBER ? 10 CURRENCY LIST   DELETE (Y/N) N                               

                                                                                  

 

 

 

       

9.5.         Documentation of report definitions.

 

   Using Function 8, it is possible to print documentation of the report definitions for one or more reports. You will be asked to enter the report number. You will also have the option to enter a sequence of reports, where each report number is separated by a comma, or a range of reports separated by a hyphen between minimum and maximum number.

 

   E.g. 5,10‑13,7 will printout the reports 5,10,11,12,13 and 7.

   

 

Figure 56 Print of report definitions for the reports 1,2 and 12.

 

 DMS.RAPGEN                                           8.....PRINT OF DEFINITIONS 

   1 PRICE LIST                                                                  

   2 STOCK VALUE                                                                 

   3 MARGIN LIST                                                                 

   4 PRICECALCULATIONS                                                           

   5 VENDOR LABELS                                                               

   6 VENDOR BALANCE                                                              

   7 STOCK LIST                                                                  

   8 GROUP LIST                                                                  

   9 SUPPLIER LIST                                                               

  10 CURRENCY LIST                                                               

  11 ITEMS BY SUPPLIERS                                                          

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

 REPORT NUMBER ? 1‑2,12  PRINT FIELD‑DEFINITIONS (Y/N/S) ? Y                     

                                                                                  

 


When you have entered the report/reports, and wish to print the document, you must answer the question:

 

    Print Field Definitions (Y/N/S)?        The possible responses are as follows:

   

        N = Report definitions with no print of field definitions.

        Y = One page per referenced file, including all fields.              

        S = As for Y, but also giving the names of the Basic variables used.   

        D = As for S, but following the print of the field definitions the generated Basic program is listed.

              This function would normally only be used for error investigation.

 

Figure 57 Report definition for weighted totals.

 

DMS.RAPGEN        REPORT NO.12  WEIGHTED STOCK VALUE     JAN 14, 1987 11:34:03

                                                                             

PRINTER:$LPT   STARTPOSITION:001   LINES ON FORM:66                          

                                                                              

FILE: 1 VA     ARTICLE FILE              8/CH.VAKA#                          

                                                                             

  1...,....10...,....20...,....30...,....40...,....50...,....60...,....70...,.

1:DATE:#DD           * WEIGHTED STOCK VALUE *     AS OF #PD           PAGE:#PP

2:                                                                           

3:NO     DESCRIPTION         COST PRICE    BALANCE   STOCK VALUE      WEIGHTED

4:                                                                           

5:#1     #2                   #4           #8      #11               #12     

  1...,....10...,....20...,....30...,....40...,....50...,....60...,....70...,.

                                                                             

SELECTIONS:                                                                  

                                                                             

CALCULATIONS:                                                                 

   #11=#8*#4                    STOCK VALUE=STOCK BALANCE*COST PRICE         

   #12=#11%#13                  WEIGHTED=STOCK VALUE%TOTAL VALUE             

   #12=FNR(#12)                 WEIGHTED=FNR(WEIGHTED)                       

                                WHEN 10   FIRST PASS ONLY   ALWAYS           

   #13=#13+#11                  TOTAL VALUE=TOTAL VALUE+STOCK VALUE          

                                                                              

THE FILE MUST BE READ BEFORE PRINTING STARTS TO CALCULATE TOTALS.            

TOTAL LEVELS                                                                 

                                                                             

 SORTING (Y/N) ? N                                                           

                                                                             

 TOTALS IN AN EXTRA INITIAL PASS (Y/N) ? Y                                   

                                                                             

 TOTAL‑LEVEL: FIELDNO.? 1(1,2) ARTICLE NO   TOTAL LEVEL (Y/N) ? Y            

                               TOTAL NAME ? ARTICLE GROUP   FORMFEED (Y/N) ? N

                                                                             

 CALCULATE TOTALFIELDS BEFORE PRINT (Y/N) ? N                                

                                                                              

 FIELDS TO BE TOTALLED:                                                      

    #11   STOCK VALUE                                                        

    #12   WEIGHTED                                                            

                                                                             

 

 

 

Figure 58 Field definitions printed by documentation of a report.

 

FILE:VA   ARTICLE FILE                  8/CH.VAKA#                           

  1 ARTICLE NO                 4     AAAA                                    

  2 DESCRIPTION               20     AAAAAAAAAAAAAAAAAAAA                    

  3 SALE PRICE                6,2    ######.##                               

  4 COST PRICE                6,2    ######.##                               

  5 DATE LAST PURCHASE        ,6,    ##,##,##                                

  6 SUPPLIER NO                3     AAA                                     

  7 ARTICLE GROUP NO          2,     ##                                      

  8 STOCK BALANCE             ‑6,    ‑‑‑‑‑‑#                                 

  9 ALTERNATIVE SUPPLIER      3,     ###                                     

 10 FREE FIELD                ‑6,2   ‑‑‑‑‑‑#.##                              

 11 STOCK VALUE               ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                           

 12 WEIGHTED                  ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                           

 13 TOTAL VALUE               ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                           

 14 @FREE                     ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                           

 15 @FREE                     ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                           

 16 @FREE                     ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                           

 17 @FREE                     ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                           

 18 @FREE                     ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                            

 19 @FREE                     ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                           

 20 @FREE                     ‑9,2   ‑‑‑‑‑‑‑‑‑#.##                           

 21 @FREE                     ‑6,    ‑‑‑‑‑‑#                                  

 22 @FREE                     ‑6,    ‑‑‑‑‑‑#                                 

 23 @FREE                     ‑6,    ‑‑‑‑‑‑#                                 

 24 @FREE                     ‑6,    ‑‑‑‑‑‑#                                 

 25 @FREE                     ‑6,    ‑‑‑‑‑‑#                                 

 26 @FREE                     ‑6,    ‑‑‑‑‑‑#                                 

 27 @FREE                     ‑6,    ‑‑‑‑‑‑#                                 

 28 @FREE                     ‑6,    ‑‑‑‑‑‑#                                 

 29 @FREE                     ‑6,    ‑‑‑‑‑‑#                                 

 30 @FREE                     ‑6,    ‑‑‑‑‑‑#                                 

 


   The documentation will normally be printed on the printer related to the screen, ($LPT), but in the question about Field descriptions you may select another printer, as follows:

 

   n,$ORDP will cause the printout to take place on printer $ORDP, where n=Y/S/D.

 

   n;001131080,$ORDP will also adjust the printer‑open parameters. Printer parameters may be found in either TAMOS or BASIC manuals. If testing, turn on lamp 4 (R4) and the documentation will be shown on the screen.

 

9.7.         Other functions.

 

   Besides the normal functions 1 to 10 for maintainance of reports, you may use a number of special functions for communication with printers, the operating system, etc.

   

 

Figure 59 DMS.REPGEN main selection module.

 

 REPORT GENERATOR     REPORT GENERATOR     REPORT GENERATOR    # 3 87.09.21/11:28

                                                                                 

                                                                                 

                                                                                 

                      DMS.RAPGEN                                                 

                                                                                  

                      1 ... DEFINE NEW REPORT                                    

                      2 ... DEFINE SELECTIONS                                    

                      3 ... DEFINE SORTING AND TOTALLING                         

                      4 ... DEFINE CALCULATIONS                                  

                      5 ... DELETE REPORT                                        

                      6 ... DEFINE NEW LETTER                                    

                      7 ... AMENDMENTS TO A REPORT/LETTER                        

                      8 ... PRINT OF DEFINITIONS                                 

                      9 ... START AND GENERATE REPORT                            

                     10 ... COPY REPORT                                          

                                                                                 

                     ENTER CODE:........                                         

                                                                                 

                                                                                 

                                                                                 

                                                                                 

                                                                                 

 MESSAGE  :                                                                      

 

 

 

 

9.8.1.       F Formfeed.

 

   F causes 2 formfeeds on the printer ($LPT) related to the screen. F1,F2,F3,F4,F5 causes paper linefeed on the printers 1 to 5 according to definitions in DMS.REPGEN.SYS.

 

   TOFx causes x pages formfeeds on the printer ($LPT) related to the screen.

 

9.8.3.       End ‑ return to main selector.

 

   End causes return from the report generator selector to the normal selector, set up in chain parameters in DMS.REPGEN.SYS.

 

   Typing CR in the functions will also cause an end.

 

9.8.5.       System ‑ shifting to another system.

 

   Entering the command 'system' will give a view of all the different systems installed on the machine, and you may select the system you wish  to use.

 

   This command is normally only used if the report generator is installed with multiple systems, for example to allow more than 88 reports from a set of files.

 

   The report generator will move the selected system, set up using DMS.REPGEN.SYS, from the record in question in the file 0/CHSYSTEM to the common area.


9.8.7.       Stop ‑ Stopping the background port.

 

   Using this command, you may stop a report running in the background (phantom) port.

 

   You must be very carefull using this command, bacause it is possible to stop any program, even if it is not a report generator program. It is even possible to stop a screen that is running in another program.

 

   STOP CTL E X CTL E stops any program that might run on port number P. This command is normally only used in connection with big installations, where multiple background ports are used.

 

   Please note that before a background port can even be used after the system has been started (IPL), this must be stopped. This is normally done in in connection with the normal start of day, but you may do it with the stop command. Typing CR in the functions will also cause an end.

 

9.8.9.       Jobqueue.

 

   The Q command makes it possible to shift to the DMS.JOBQUEUE, although only if this is installed on the machine. (The DMS.JOBQUEUE is not the same as the TAMOS jobqueue). Reports can be queued up using the Q command in connection with the start of a report (Function 9), at the question START (Y/S/P/N).

 

9.8.11.       # ‑ Scope and systemprograms.

 

   # causes chain to Scope, if this is allowed for the password used.


9.           Starting a report.

 

10.1.         The use of Function 9.

 

   When Function 9 is used for starting a report, you will see the following display:   

 

 

Figure 60 Start of report.

 

 DMS.RAPGEN     1 PRICE LIST                   9.....START AND GENERATE REPORT   

                                                                                 

                                                                                 

     TODAYS DATE (DDMMYY) ?    060187                                            

                                                                                  

     AS OF  DATE (DDMMYY) ?    060187                                            

                                                                                 

     START FROM ?                                    INDEX:                      

                                                     1:ARTICLE NO                

     STOP  AT  ?                                     2:SUPPLIER NO               

                                                                                 

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

 MINIMUM TOTAL LEVEL TO BE PRINTED (0‑ 1 , 0=WHOLE LIST) ? 0                     

 START:( Y=PHANTOM , S=SCREEN , P=PRINTER , N=NO) ? P                            

 TESTPRINT (Y/N) ? N                                                             

                                                                                 

                                                                                  

 

 

 

 

   Enter the start information and decide whether the report should be run on the screen or the printer.

 

   After starting the report for the first time you will have to wait approximately 30 seconds, while the report generator generates and saves a Basic program. Changing the report definitions will cause DMS.REPGEN to delete the Basic program and then generate it again.

 

   During program generation, DMS.REPGEN will test all calculation lines and also test that the Basic syntax is correct. If you receive an error message, you must correct the definitions before the report can be started.

 

   This control is performed by the Basic interpreter of the machine, so DMS.REPGEN automatically builds in future expansions in the BASIC lanquage.

 

   If DMS.REPGEN has been run on a printer, you will be asked to press CR. at the end of the report.

 

   If the report is running in background (phantom port), you will have a message displayed on the screen when the printout is ended, even if you are not still in the report generator system. A report can be started before you have defined all of it. In this way you may define it in the order you wish, for example setting the layout before you define calculations or time consuming sorts. It is wise to run a small test on a newly defined report on a range of your data.

 

   If no lines are printed then make sure that the section of the file selected does contain your selection criteria.

 

   The start parameters are explained below:

 

10.2.1.       Todays date.

 

   The fields for both todays date and 'as of' date are normally written on the first heading of the report, and are not used for anything else unless you have defined calculations or selections on these.

 

   If you press CR. in this field, you will get the date from the clock of the machine.

 

   Normally, this date will be used in the form YYMMDD.

 

   There will not be any date validation so you may enter the date in the format you wish, e.g. YYMMDD, DDMMYY.


10.2.3.       'As of' date.

 

   This is entered as described above.

 

    'As of' date, is typically used if you wish to define calculations or selections on a date field.

 

10.2.5.       Start from and stop at.

 

   In the fields,'Start from' and 'Stop at', you may enter the range of records a report is to include, e.g. FROM 1000 to 2000.

 

   If you press CR. in the fields 'Start FROM/STOP at', the report will include all records in the file.

 

   You may enter only part of a number, because the printout will always start from the key higher or equal to the value entered, and stop when the key of the file becomes greater than the stop value.

 

   It is necessary to know a little about the key structure of your files before entering start and stop values. For instance, depending on whether a customer number with 5 digits contains leading zeroes or not, the start/stop function may not work correctly. In the field START you may enter:

 

10.2.6.1.     Selecting an index at START FROM:

 

   If you are using a file with several indexes, you may enter for example 2:4711  in the field 'START'. This causes the report to be printed from index 2 starting from number 4711.'STOP AT' can be entered without an index number.

 

   For DATAMASTER files, DMS.REPGEN will display the possible indexes of the main file to the right of the field 'START AT'.

 

   The installer has the option to use a comparative facility for the other files of the system.

 

10.2.6.3.     SORT‑use a previous sort.

 

   When you start a sorted report, a sort file will be built before the printout itself is started. This will naturally take some time if a large file has to be sorted.

 

   If you wish to print the same report again later or print another report using the same sortfile, you may save sorting time by entering SORT in the field START FROM and nothing in STOP AT. This causes DMS.REPGEN to use the existing sort file, although remember that this may have been rebuilt in the interim.

 

   It is up to the user to make sure that the sort file is usable, otherwise Basic Error 51 may occur.

 

   Note that selections are completed before the sort file is built. If the report that built the sort file is selected again, then the next report that is started with sort will only contain the records that meet the first report selections criteria.


10.2.7.       User defined data field at start.

 

   If you have used one or more of the fields #D1 to #D7 or #DA1 to #DA7 in   calculations or selections you will be asked to enter the values of these fields at the start of the report.

   

 

Figure 61 DATA by start of a report.

 

 DMS.RAPGEN     1 PRICE LIST                   9.....START AND GENERATE REPORT   

                                                                                 

                                                                                 

     TODAYS DATE (DDMMYY) ?    060187                                            

                                                                                 

     AS OF  DATE (DDMMYY) ?    060187                                            

                                                                                  

     START FROM ?                                    INDEX:                      

                                                     1:ARTICLE NO                

     STOP  AT  ?                                     2:SUPPLIER NO               

                                                                                 

     FROM GROUP:               1                                                 

     TO   GROUP:               5                                                 

                                                                                 

                                                                                 

                                                                                  

                                                                                 

                                                                                 

                                                                                  

                                                                                 

 MINIMUM TOTAL LEVEL TO BE PRINTED (0‑ 1 , 0=WHOLE LIST) ? 0                     

 START:( Y=PHANTOM , S=SCREEN , P=PRINTER , N=NO) ? P                            

 TESTPRINT (Y/N) ? N                                                             

                                                                                 

                                                                                  

 

 

 

 

This function is often used to change the selections or used for changing constants in calculations, for example interest rates, currency rates, etc.

 

   You may relate a text to a field by using one of the free fields #D1TEXT. This text will then replace the text DATA1 and help the user.

 

10.2.9.       Warning concerning sorting/weighted totals.

 

   If a report is sorted or uses weighted totals, a warning concerning this is given when the report is started, because it make take a while before the printout will start.

 

    Even if only 2 records have been sorted in a report, a cleanup of the sortfile has to be carried out.

 

    If this contained 10.000 records it may take a few minutes. You may only start one sorted report at a time.

 

10.2.11.       Lowest total level 9.

 

   Normally you will just press CR. This causes the whole report to be printed. It is possible to define that only the totals/sub‑totals of a report should be printed, so that the detail lines are suppressed.

 

    1 refers to the first subtotal level, 2 refers to the second and so on. If there are no subtotal levels in a report, 1 will cause only the final total to be printed.

 

10.2.12.1.     Suppression of printout.

 

   This is normally for DMS.REPGEN programmes which are updating files (DATAMASTER). Entering the lowest total level will cause the program to be executed without any printout, but updating will be performed.

 

10.2.13.       Filenumber.

 

   This question will normally only occur in installations with many different versions of the same file on the same account. If the installer has defined a filename containing "?", the user will be asked to enter a filenumber when starting up the system.

 

    The entered value will replace "?" when the file is opened. Using this facility, the same report and system may be run on many different versions of the same file.


10.2.15.       Starting on screen/printer/backgroundport.

 

   Here you define if the report is to be printed on screen or printer.

   

        Y   = Yes, the report should be printed on the background port (phantomport).

        S   = Screen, the report is displayed on the screen.

        1‑3 = As Y, the report will be started on the entered background port.

        Q   = Put in jobqueue, the report is put into the TAMOS‑jobqueue if this is activated.

 

10.2.17.       Test print.

 

   If you answer 'Y' to PRINTOUT OF TESTPRINT, one page of the report will be printed on the printer. In this way, you can adjust preprinted forms. The question about test print will be repeated until the form is adjusted.

 

   The report print out will start when you answer 'N' to testprint.

 

   On systems with small partitions, a testprint of larger letters will not be possible.

 

10.3.         Generation of the program.

 

   The first time a report is started, a Basic program is generated. (See chapter 9.1 for further details).

 

   The generation is made in the following steps.

   

            Program is generated

            Program is optimized

            Program is loaded

            Program is started

 

During the generation phase, the users report definitions such as calculations are combined with the routines of the reportgenerator into one basic program.

 

   During the optimizing phase, printlines of the report are generated, and all parameter controls in the report are deleted to make the program run faster. 

 

   This phase may be omitted, depending on a parameter in the DMS.REPGEN system file.

 

   Saving the program is taken care of by the Operating System, which controls all calculations and saves the program on the disc, if the program contains no errors.

 

   When the report is started, the BASIC‑program is called, and the installed files are opened in a special startup module. (DMS.RAPGEN.99).


10.5.         Controlling the background ports (phantomports).

 

   A background port works like a hidden screen on which the report may be started so the users screen will be free for other use.

 

   Normally there will only be one background port on the system, and this will be Port number 1.

 

   The installer may configure several background ports, with each REPGEN system installed with its own background port, where the printout will start when you type 'Y' to start.

 

   You may also direct the printout to a specific port by typing the number of the background port instead of Y.

 

   If a program is already running in the background port you will be informed that the background port is occupied and you will be asked if you wish to try again.

 

   This means you will have to wait until the program is ended, or interrupt the start by pressing ESCape.

 

   A program which runs in a background port may be interrupted using the STOP command, or the TAMOS command.

 

   When the background program has stopped you will receive a message on the screen which started the program.

 

10.7.         Latch‑key functions.

 

   When a report is run on the screen, you have the option to use the following latch‑keys.:

   

     R1 = lamp 1: The filekey that is handled at the moment is displayed at the bottom of the screen.

    

     R2 = lamp 2: You will be asked to enter the next key.

 

   By pressing the R1 key during sorting you can see how far this has proceeded. This function may be also be used if you do not know the key structure of a file.

 

   By activating R2 you may select records in a file for printout. This function is mostly used for tests.


10.          Messages

 

11.1.        Error Messages.

 

11.2.1.      Printer not ready.

 

   The specified printer is not on‑line or the paper/ribbon is missing. The printer may also be in use by another user.

 

   The printer is defined by TAMOS printer assignment, which may be missing (especially for the phantom port no.1) or not correctly defined.

 

   The error can also occur if you try to print longer lines than the printer is able to, typically 132 characters on a 80 characters printer.

 

11.2.3.      This program is not defined.

 

   A report must be defined with function 1 or 6 (letter) before you can use any of the other functions.

 

11.2.5.      This report is not defined.

 

   A report must be defined with function 1 or 6 (letter) before you can use any of the other functions.

 

11.2.7.      This report is defined already.

 

   You cannot define a report with function 1 or 6 (letter), if the report number is in use.

 

   If desired, the old report can be deleted using function 5 before defining a new report with this number.

 

   It is also possible to copy to a report already defined using function 10.

 

11.2.9.      There are no free reports.

 

   The total number of reports for each system is defined at installation, maximum is 88 due to screen width.

 

   When a report is deleted using function 5, space is free for use because the old report definitions are removed.

 

   The number of reports can be extended with the installation program DMS.RAPGEN.SYS or you can create up to 100 different systems with 88 reports each.

 

11.2.11.      This report is not defined with this report generator.

 

   The report definition is too old to be handled by this version of DMS.RAPGEN. This message can occur only by upgrading of systems to new version, if the old version is installed before 1/1‑1978. All newer versions are downwards compatible.

 

11.2.13.      This is not your report.

 

   When you create a report using function 1 or 6 (letter) or by copying a report using function 10, you are able to set a password on the report.

 

   This password has to be given before any amendments to the report can be  made. If you have used control E before and after the password, the start of the report will also be password protected.

 

   The messages indicates invalid password (user name) specified.


11.2.15.      This report is in use by another screen.

 

   Another screen is currently defining this report, hence it is not possible to select the report.

 

   If you use ESCape during definition of a new report, the report number will remain reserved for your screen and cannot be released in other way than defining a new report from the same screen and possible then deleting this.

 

   Any extension/contraction of the report file using DMS.RAPGEN.SYS will clear such reservations, it is assumed that the system is closed for all users during this operation.

 

11.2.17.      Invalid system no.

 

   The command SYSTEM allows you to change reportgenerator system, the given system number is not defined by DMS.REPGEN.SYS.

 

   The message can also occur when copying a report to another destination system using function 10, the destination report number can be given as systemnumber, reportnumber.

 

11.2.19.     The reportgenerator is in use by another user.

 

   During installation of the reportgenerator DMS.REPGEN.SYS will create a specified number of workfiles (up to 9).

 

   Each screen requires one of these workfiles.

 

   Use DMS.REPGEN.SYS to extend the number of workfiles (requires approximately 100 sectors each) or wait for another user to finish the session.

 

11.2.21.

10.1.11.     Please call your local Nixdorf consultant.

 

   This message can occur only in earlier versions of DMS.REPGEN by inconsistent between the disc adress of the reportgenerator (RDA of HBA for DMS.REPGEN) from installation.

 

   The error message is removed by running DMS.REPGEN.SYS on the involved systems.

 

   The error can occur by unauthorized copying of the report generator or by CLEANUP.

 

11.2.23.     Please call your local Nixdorf consultant.

 

   The expiry date specified in DMS.REPGEN.SYS is exeeded. You are recommended to set this date to 999999 unless for test installations or a time limited contract.

 

11.2.25.

10.1.13.     File not found.

 

   You have tried to define a report on, or define a connection to, a file which is not present.

 

11.2.27.     This file is not implemented.

 

   You have tried to define a report on a file which is present and defined in the system but not allowed for use by the reportgenerator. (The utility code in DMFILES must be set to 999 by installation to allow use of DMS.REPGEN).

 

11.2.29.     This file is not implemented (READ missing). 

 

   The textfile containing READ statements is not present (or for old operating systems: protected against use from this account).

 

   This textfile is created during installation and must be present on the same lu as DMFILES with one of the following names (checked in the given order):

 

   filename.READ, DMREAD.xx or READ.xx, where DM is the prefix for DMFILES and xx the file shortname.


11.2.31.     This file is not implemented (DRN missing).

 

   This file is not property implemented for the reportgenerator, the field definition number (DRN) is missing in DMFILES even if both the utility code is set and read statements are present.

 

11.2.33.     This report cannot be started.

 

   The textfile DMT10xx is not present, the program cannot be generated.

 

11.2.35.     This report file is full.

 

   There is no continuous space in the report file DMREPORT to store this report. The message can occur when defining large letters or if the number of records  in DMREPORT is too small in relation to the number of reports (items). (This should normally be 4 times the number of items).

 

   The report file has to be extended by use of DMS.REPGEN.SYS which will perform a CLEANUP during this operation maling all free space from deleted reports continuous.

 

   You cannot be sure that deleting reports will solve your problem, because the free space is not necessarity continuous.

 

11.2.37.     Invalid character in numeric field.

 

   Can occur only in earlier versions of DMS.REPGEN when defining selections on a numeric field and using alphabetic characters in minimum/maximum. In this version,the minimum/maximum can be given as calculations and this check is not performed.

 

11.2.39.     Invalid report number.

 

   The installation is not defined with this number of reports.

 

   You can extend the file DMREPORT using DMS.REPGEN.SYS or define more systems, each system is limited to 88 reports due to the screen width.

 

11.2.41.     Sorting cannot be performed during definition of sort.

 

   You are running a sorted report from another screen and this report has locked the sort workfile DMSORTWORK so that this file cannot be destroyed by another sorted report in the same time.

 

   Due to this, sorting cannot be defined before the report is finished, the definition program requires access to the sortworkfile to determine the maximum keylength of this file.

 

11.2.43.     Sorting is not implemented.

 

   The file DMSORTWORK is missing. Possibly this file was not created during installation due to lack of disc space.

 

   This file can be created using BUILDXF with a keylength of 10‑15 words, recordlength 2 and number of records = the maximum number of records to be sorted in one run.

 

   Possibly the file is protected against use from your account (old operating systems only).

 

11.2.45.     Invalid fieldno.

 

   The file is not defined with this number of fields.

 

11.2.47.     Invalid number.

 

   When you define group totals, the number of possible code values in the group must be larger than 0.


11.2.49.     The program will become too large.

 

   This message occurs typically when defining reports with many total fields, subtotal levels and large group totals.

 

   The maximum size is defined by the active file size (partition size) given for the system by DMS.REPGEN.SYS. You must cut down the number of fields to be totalled, the number of subtotal levels or the number of code values in the group totals.

 

   It can help to specify less precision on the total field array, this is by default the highest precision e.g. 14 digits in 4 word variables. This is done by entering either 3% (10 digits) or 2% (6 digits) in FIELDS TO BE TOTALLED:FIELDNO:

 

    If the number of digits is exceeded in a total field the least significant digits will be printed as zero but the total will still be relevant.

 

    Note that 'undefined' group totals are rather space consuming.

 

11.2.51.     This field is totalled already.

 

   You have tried to define the same field to be totalled twice.

 

11.2.53.      Retry (Y/N)?

 

   It is not possible to start the report on the phantomport because another program is running. Wait until this program is finished and enter Y or reject the start by pressing ESCape and run from screen instead.

 

   Note that after each start of the machine (IPL), NIROS will require a STOP of the phantomport before any program can be started, this command should be placed in the system start of day routine.[26]

 

   Also you can use the reportgenerator command STOP in the main selector, but be carefull not to stop any running program by mistake.

 

11.2.55.     Line too long.

 

   The maximum line length is 175 characters or less, dependent on the selected printer.

 

11.2.57.     BASIC ERROR NO.xxxx IN LINE NO.xxxx.

 

   Refer to the list of basic errors on the following pages.

 

   The message will normally be followed by the calculation line, in which the error occured, so it is easy to find and correct the error. The syntax checking of the calculations etc. is not performed during definition but on starting the report and generating the basic program, hence error messages are given at this point.

 

11.2.59.     BASIC ERROR NO.xxxx IN LINE NO.xxxx IN DMS.REPGEN.xxx.

 

   Refer to the list of basic error on the following pages.

 

   Check the installation, especially that the given coresize in DMS.REPGEN. SYS is not larger than the partition size, and that the number of data files in SYSMOD is large enough (14). If these points are OK, the error must be reported to your Nixdorf branch with proper documentation.

 

11.2.61.     Sorry ‑ not enough core for testprint.

 

   Testprint requires more space than the report itself during print, especially for large letters.

 

   Either do not use the testprint facility for this report or enlarge the partition size with SYSMOD/DMS.REPGEN.SYS.


11.2.63.      STATUS=x.

 

   An error has occured during insert of a sortkey in the sortworkfile DMSORTWORK, the given status is the return status code from the search operation.

 

   Typically this error occurs when this file is to small, giving a status code of 2 or 3. You have to define selections or give a smaller start range for the report, if you do not want to enlarge the sort workfile (BUILDXF, recordlength = 2, keylength = e.g.10).

 

   If subsequent sorting returns either status 5 or gives Basic error 79, you have to rebuild the sort workfile before sorting can be performed.

 

11.2.65.     Function x cannot be performed on this report.

 

   Occurs if you try to define selections, calculations or sorting on a subversion of a letter defined in several versions. The definitions must be done on the main version of the letter.

 

   The message occurs when the textfile DMT10xx for the report is not present.

 

11.2.67.     These reports are not free for use.

 

   When you define a letter with more versions the next report numbers have to be free, e.g. if you define reportnumber 10 as a letter with 4 versions, the reportnumbers 10‑14 must be free.

 

11.2.69.     Invalid format.

 

   The format definition for one of the 20 free fields is not given with the correct syntax. Alphafields are defined as e.g. 10 and numeric fields as e.g. 3, 8,2, ‑8,2 or ,8,2.

 

11.2.71.      must be between 1 and xx.

 

   Invalid fieldnumber entered.

 

11.2.73.     Totals cannot be defined on letters.

 

   You have tried to define totalling on a report defined with function 6 as a letter. Totalling is only implemented on the normal list type of report defined using function 1.

 

11.2.75.     Sortkey translated to xx characters.

 

   If you define sorting using a name field containing 32 characters the sortkey will be truncated to 27 characters. The sorting will be performed correctly but only using the first 27 characters. The maximum length of the sortkey is determined by the keylength of the sortworkfile DMSORTWORK minus 3 characters.

 

11.2.77.     DMS.REPGEN is not installed.

 

   (ERROR #xx AT xxxx FILE: xxxxxxxx).

 

   Error during the open of one of the reportgenerator system files on start the reportgenerator, e.g. the file or the field definition files. The reportgenerator cannot be used until DMS.REPGEN.SYS is corrected.


11.3.        Save error numbers.

 

   Save errors can occur when the reportgenerator tries to store the generated program on the disk, typically because of lack of disc space.

 

11.4.1.      Save error number 104.

 

   Save errors are also described in your Basic Manual. Save error 104 indicates invalid cost or protection and will normally occur only when upgrading old releases of the reportgenerator to new operating systems (5.0 etc.) where it is not allowed to save a program with partition size 0.

 

   Upgrade the reportgenerator to new release.

 

11.4.3.      Save error number 108.

 

   There is not enough disk space avaiable to save the generated program, in case of old operating system (below 5.0) the discspace allocated in UTILITY for the given account is insufficient. The best thing to do is to get the required diskspace but deleting an used reports can help you for the time being. Also you can select the function 5 for deletion but answer N to delete the reports which will cause the generated program to be killed, but the report definitions to be kept.

 

   Possibly, the number of saved reports in DMS.REPGEN.SYS can be decreased causing reports above a certain number to be regenerated by each start although this will make the system run a little slower.


                                                                            Figures

Figure 1  DMS.REPGEN main selection module.......................................................................................................................................   6

Figure 2 Article file.......................................................................................................................................................................................   8

Figure 3 Supplier file.....................................................................................................................................................................................   8

Figure 4 Currency file...................................................................................................................................................................................   8

Figure 5 Article group file............................................................................................................................................................................   8

Figure 6  Keys used in DMS.RAPGEN......................................................................................................................................................   9

Figure 7  Report overview.........................................................................................................................................................................   11

Figure 8  Files..............................................................................................................................................................................................   12

Figure 9  Report main information............................................................................................................................................................   12

Figure 10  TAMOS selector definition....................................................................................................................................................   13

Figure 11  Definition of report lines.........................................................................................................................................................   14

Figure 12  The defined report....................................................................................................................................................................   14

Figure 13 SUPPLIER LIST,only balances over 500 are printed............................................................................................................   18

Figure 14 Defining selections...................................................................................................................................................................   18

Figure 15 Definition of calculations.........................................................................................................................................................   21

Figure 16 Entering a calculation line........................................................................................................................................................   22

Figure 17 Amending a calculation line....................................................................................................................................................   22

Figure 18 File menu by use of the HELP function.................................................................................................................................   34

Figure 19 HELP for a single file.................................................................................................................................................................   35

Figure 20 Extended HELP for a single file...............................................................................................................................................   35

Figure 21 Supplier balance sheet with currency calculation................................................................................................................   37

Figure 22 Calculation of new sale price from rate and price factor......................................................................................................   38

Figure 23 Reading the same file multiple times.......................................................................................................................................   39

Figure 24 Reading the name of group totals...........................................................................................................................................   40

Figure 25 Total stock value collected with START/NEXT/REPEAT.................................................................................................   40

Figure 26 The report definition for collection total stock value..........................................................................................................   41

Figure 27 Suppliers not used since 30/6‑1986........................................................................................................................................   42

Figure 28 Articles by supplier defined with READH and LINE commands.......................................................................................   43

Figure 29 Selection of article group > 0...................................................................................................................................................   44

Figure 30 Totals in connection with START/NEXT/REPEAT............................................................................................................   44

Figure 31 Definition of a sort‑key.............................................................................................................................................................   46

Figure 32 Sorted list with subtotals.........................................................................................................................................................   47

Figure 33 Articles sorted by normal and alternative supplier..............................................................................................................   48

Figure 34 Definition of a subtotal‑level...................................................................................................................................................   49

Figure 35 Report containing sub‑totals...................................................................................................................................................   49

Figure 36 Report with sub‑totals only.....................................................................................................................................................   49

Figure 37 Report with weighted totals.....................................................................................................................................................   50

Figure 38 Report definition for weighted totals.....................................................................................................................................   51

Figure 39 Subroutines in the generated program. .................................................................................................................................   52

Figure 40 The report without calculated totals, margin % is wrong...................................................................................................   53

Figure 41 The report with calculated totals, total value is wrong.......................................................................................................   53

Figure 42 The report with calculated totals and WHEN calcula­tions.................................................................................................   53

Figure 43 The report definition for calculated totals.............................................................................................................................   54

Figure 44 Definition of fields to be totalled............................................................................................................................................   55

Figure 45 Example of group totals............................................................................................................................................................   56

Figure 46 Definition of group totals.........................................................................................................................................................   56

Figure 47 Example of more groups, the last group 'undefined'............................................................................................................   57

Figure 48 Definition of a letter..................................................................................................................................................................   58

Figure 49 Amending a report....................................................................................................................................................................   59

Figure 50 The MASK command activated..............................................................................................................................................   60

Figure 51 The command MODE 0 with fieldnumbers............................................................................................................................   61

Figure 52 The command MODE 2 with fieldnames................................................................................................................................   61

Figure 53 Definition of a letter with multiple versions..........................................................................................................................   64

Figure 54 Copying a report........................................................................................................................................................................   65

Figure 55 Deleting a report........................................................................................................................................................................   66

Figure 56 Print of report definitions for the reports 1,2 and 12............................................................................................................   66

Figure 57 Report definition for weighted totals.....................................................................................................................................   67

Figure 58 Field definitions printed by documentation of a report.......................................................................................................   67

Figure 59 DMS.REPGEN main selection module....................................................................................................................................   68

Figure 60 Start of report.............................................................................................................................................................................   70

Figure 61 DATA by start of a report.......................................................................................................................................................   72

                                                                            Keyword index

 


#DD.............................. 21, 22, 24, 34, 35, 41, 51, 54, 61, 63, 67

#KA......................................................................................... 63

#LEVEL........................................................................ 25, 40, 52

#NO.......................................................................................... 63

#OK.......................................................................................... 25

#PD........................ 21, 22, 25, 31, 34, 35, 41, 42, 51, 54, 63, 67

#PP............................................................. 25, 41, 51, 54, 63, 67

#SC..................................................................................... 25, 63

#SN.......................................................................................... 63

#SY........................................................................................... 63

#TI............................................................................................ 63

ABS.......................................................................................... 28

Account...................... 15, 28, 37, 43, 58, 60, 61, 72, 76, 77, 80

BUILDXF.......................................................................... 77, 79

Checks..................................................................................... 58

CHSYSTEM...................................................................... 10, 68

CLEANUP................................................................... 72, 76, 77

Core.......................................................................................... 78

Coresize................................................................................... 78

Cost................. 7, 8, 14, 18, 21, 22, 35, 41, 46‑51, 54‑56, 67, 80

DATAMASTER...................... 7, 10, 12, 20, 33, 36, 45, 71, 72

Division................................................................................... 23

DL............................................................................................. 62

DMFILES.......................................................................... 76, 77

DMREAD.......................................................................... 33, 76

DMREPORT........................................................................... 77

DMS.RAPGEN.SYS......................................................... 75, 76

DMS.RAPS....................................................................... 30, 31

DMSORTWORK....................................................... 47, 77, 79

DRN......................................................................................... 77

ESCape.................................................................... 9, 74, 76, 78

FNA......................................................................................... 27

FNB.......................................................................................... 27

FND........................................................................ 27, 31, 42, 45

FNH.......................................................................................... 27

FNR............................................................ 27, 37, 38, 51, 54, 67

FNU.......................................................................................... 28

FNV.......................................................................................... 28

Format...................... 7, 14, 16, 17, 21, 27, 31, 32, 37, 62, 70, 79

GOSUB............................................................................... 30‑32

HBA......................................................................................... 76

IL.............................................................................................. 62

INT........................................................................................... 28

Interval........................................................................ 31, 37, 59

IPL...................................................................................... 69, 78

Labels......................................................... 11, 13, 15, 58, 64‑66

Layout..................................................................... 7, 11, 15, 70

LD............................................................................................. 62

LEN.......................................................................................... 29

LI.............................................................................................. 62

LOAD................................................................................. 30‑32

LPT............................................................. 41, 51, 54, 59, 67, 68

LU............................................................................................. 76

MODE...................................................................................... 61

Modulus.................................................................................. 31

NIROS................................................................................ 10, 78

NOT.......................... 6, 10, 12, 13, 15‑17, 19, 20, 23‑36, 38‑45,

                                                         47‑49, 51, 52, 53‑55, 57, 59,

                                                                 61‑64, 66, 69‑71, 73‑80

Ocr          21, 31

over................................................................................ 6, 18, 42

Overflow.................................................................................. 16

Partition................................................................. 10, 55, 78, 80

Pass............................................................ 30, 40, 50‑52, 54, 67

Password......................................................... 12, 13, 33, 69, 75

Phantomport..................................................................... 73, 78

POS............................................................................... 17, 58‑61

Protection.......................................................................... 33, 80

QUICK............................................................................... 20, 51

RASTER.................................................................................. 60

RDA......................................................................................... 76

REM......................................................................................... 26

S9$................................................................................ 24, 26, 40

SAVE..................................................................... 45, 55, 71, 80

SCOPE..................................................................................... 69

Search................................................................................ 36, 79

SGN.......................................................................................... 28

SORT.............................................. 21, 32, 43, 46‑50, 71, 77, 79

SQR.......................................................................................... 28

Status................................................................................. 25, 79

STOP.......................................................... 22, 32, 69‑72, 74, 78

Subtotal......................................... 25, 44, 46, 49, 55, 56, 72, 78

SYSMOD................................................................................. 78

T2$....................................................... 26, 29, 31, 32, 37, 39, 63

T3....................................................................................... 26, 31

T3(1)................................................................................... 26, 31

T9$..................................................................................... 26, 31

TAMOS........................................... 9, 10, 13, 60, 68, 69, 73‑75

Testprint................................................................ 70, 72, 73, 78

Utility........................................................................... 76, 77, 80

 



     [1]The date is held in variable x(7).

     [2]This date is held in variable x(8G.

     [3]These fields are held in variables Q(xL.

     [4]Field x is held as X0$(25*(x‑1L+1,25*x).

     [5]Page number is held in variable X0(13K.

     [6]Read status is held in variable R4.

     [7]Screen number is held in variable x(10L.

     [8]the level is held in variable P8.

     [9]#Group is held in variable P6.

     [10](Programmers note: Generated subroutine 5100).

     [11](Programmers note: Generated subroutine 5200).

     [12](Programmers note: Generated subroutine 5300).

     [13](Programmers note: Generated subroutine 5150).

     [14]T2$(101G = Christian name, Surname.

     [15]T2$(201G = Christian name, Surname.

     [16]T2$(3017 = Surname.

     [17]Programmers note: #DD is held as x(7).

     [18]Programmers note: #PD is held as x(8).

     [19]Programmers note: #PP is held as x0(13).

     [20]Programmers note: #KA is held as T8$(189,192).

     [21]Programmers note: #SN is held as T8$(155,188).

     [22]Programmers note: #SY is held as T8$(155,197).

     [23]Programmers note: #TI is returned in T2$(15,22) by CALL 99.

     [24]Programmers note: #NO is held as X(1).

     [25]Programmers note: #SG is held as x(10).

     [26]CALL 98 using programname ¬337¬.