Features of the SUPRA interface
Here
are some of the features of the ULTIM language that apply to the processing of SUPRA databases. Some are shown in the example below.
- Relationships between files described in the LINKS statements of the dictionary.
- Automatic management of the link protocols to the databases.
- Additional keyword of the PROCESS statement to process the files in REVERSE order.
- Variable files read automatically within the set described in the LINKS
statement. Therefore, in the example, only the records of
the NAMEADDR variable file to which points the CUSTOMER master file will be read.
- Ability to directly access a master file by its key.
Example of dictionary coded in ULTIM, with some fields definitions in COBOL
./*
Information about the divisions
./ SUPRA DIVISION, PROD, FDIV, 18, DIVKEY ./ ELEMENTS DIVCTRL, VAL DIVKEY (1, A, 6)
VALUE (9, N, 8.2, 10,
@ED:$)
./*
Basic customer information
./ SUPRA CUSTOMER, PROD, FCLI, 30, ACCOUNT-NBR
./
ELEMENTS NO, DIV, DUE, LPAY
ACCOUNT-NBR
(1, N, 7)
DIV
(8, A, 6)
BALANCE (14, N, 8.2, 10,
@ED:$) LAST-PAYMENT (22, N,
8, 10, @ED:@DATE)
./*
Name and address of the customer
./ SUPRA NAMEADDR , PROD, FNAM, 105
./
LINKS FNAMLKPC
; Link between the FCLI and FNAM files
./ ELEMENTS NAME, ADD1, ADD2, ADD3
./
COBOL
./ COPY DESC (CUSTNAME)
./* COBOL fields from CUSTNAME translated to ULTIM
* NAME (1,A,15) * ADDR-1 (16,A,30) * ADDR-2 (46,A,30) * CODE (76,N,7)
Example
of
program
BEGIN
DEMO.
* Reading of the data
PROCESS
EACH CUSTOMER WHERE LAST-PAYMENT < 20150301 AND BALANCE > 0.
PROCESS GET DIVISION WHERE DIVKEY = CUSTOMER:DIV. ; Read DIVISION with key = DIV
CRITERIA VALUE < 125000.
; Process if the value is less than 125000
PROCESS GET NAMEADDR. ; Name and address corresponding to CUSTOMER only
* Report to be produced
OPTIONS
HEADING=AUTO, SPACING = 5.
REPORT
DIV('DIVISION'), NAMEADDR:NAME, ACCOUNT-NBR, BALANCE(12,TOTAL), LAST-PAYMENT.
TITLE ACCOUNTS OUTSTANDING FOR MORE THAN 2 MONTHS AS OF MAY 1, 2015
CONTROL
SUBTOTALS=1.
END
Tabulated report produced by REPORT, TITLE and CONTROL statements
MAY 6, 2015 PAGE 1
ACCOUNTS OUTSTANDING FOR MORE THAN 2 MONTHS AS OF MAY
1, 2015
DIVISION ------NAME----- ACCOUNT
NBR BALANCE LAST PAYMENT
N-EAST LLOYD &
SONS
2369108
$34.94 2015/02/21
THE LAMP
SHOP
3246538
$199.00 2014/12/15
THE
LIGHTHOUSE
1071638
$2,189.10 2015/01/06
........................................... $2,423.04
N-WEST MVC
INC.
1387
$4,189.95 2015/01/28
PLANT
LIGHTING
9066489
$1,450.49 2015/02/12
QUALITY
SWITCH
9193257
$469.20 2015/02/16
ZEUSS
DISCOUNT
1479380
$964.99 2015/02/01
ZIGGER'S
2102981
$2,849.59 2014/11/01
........................................... $9,924.22
S-EAST ACME LITE
LTD.
843896
$360.47 2015/02/11
ELECTRIC
SHOP
2225751
$194.90 2014/12/21
LIGHTNING
LAMP
3178456
$475.20 2014/12/05
RUSSELL &
SONS 386660
$895.45 2015/01/12
TOP
SERVICES
3143486
$10.00 2015/02/01
........................................... $1,936.02 ........................................... $14,283.28
|