Features of the IMS interface
Here
are some of the features of the ULTIM language that apply to the
processing of IMS databases. Some are shown in the example below.
- Ability to dynamically call the IMS DBMS and to release it as soon as the required data is extracted.
- Automatic management of the link protocols to the databases.
- In the PROCESS statements common to all types of files, additional
keywords allowing to start over the reading of a segment type from FIRST,
LAST or FOLLOWING.
- Relationship between the processed segments automatically established, as shown in the following example.
- Choice of either sequential reading or direct reading by key.
Example of IMS dictionary coded in ULTIM or which the definitions of fields are in COBOL
./ OPTIONS PSB = MYPSB ; PSB giving access to the DB
./*
Basic customer information ./ IMS CUSTOMER, DBPROD, SEGCUST, 102, CUSTKEY
ACCOUNT-NBR
(16, N, 7)
DIVISION
(73, A, 6)
BALANCE (79, N, 8.2, 10,
@ED:$) LAST-PAYMENT (87, N,
8, 10, @ED:@DATE)
./* Name and address of the customer ./ IMS NAMEADDR, DBPROD, SEGNAME(SEGCUST), 105, CUSTNAME
./ COBOL
./ COPY DESC (CUSTNAME)
./* COBOL fields from CUSTNAME translated into 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 NAMEADDR. ; Name and address corresponding to CUSTOMER only
* Report to be produced
OPTIONS
HEADING=AUTO, SPACING = 5.
REPORT
DIVISION, 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
|