AcuODBC User's Guide
6.3.10 USE GROUP Directive
Generally, only elementary data items correspond to fields. The USE GROUP directive indicates that the following group item is to correspond to a field as if it were an elementary item of the same width. This is necessary if the item is stored in your Windows application as a group, rather than as individual fields.
By default, the USE GROUP directive implies that the consolidated field is alphanumeric. If you want a numeric field, add the word NUMERIC at the end of the directive.
Grouping data items in this way is efficient if the groups are usually processed as units.
Syntax$XFD USE GROUP
or*(( XFD USE GROUP ))
You might use this directive with fields like multi-part account numbers or department numbers, or keys that are referenced as a unit but not by their individual pieces. In the sample file, you can group the "year" and "seq_no" fields to make a single account number ("acct_no") as shown below:FILE SECTION. FD qa-file. $XFD COMMENT This is a sample file demonstrating directives. 01 qa-record. 03 animal-info. *((XFD NAME=PATIENT, NUMERIC )) 05 patient-id pic x(5). 05 atype pic x. 05 ctype redefines atype pic x. 05 dtype redefines atype pic x. 05 otype redefines atype pic x. 03 owner-info. 05 phone pic x(8). *(( XFD READ-ONLY )) 05 owner pic x(30). 03 financial. $XFD USE GROUP 05 acct_no. 10 year pic x(2). 10 seq_no pic x(4). *(( XFD DATE=YYYYMMDD, USE GROUP )) 05 last_visit. 10 yyyy pic 9(4). 10 mm pic 9(2). 10 dd pic 9(2). $XFD HIDDEN 05 fee pic s9(5)v99.
The resulting table looks similar to this:
If you are using an existing database in which certain fields are grouped, they must also be grouped in your COBOL FD.
If the database does not yet exist, keep in mind that combining fields into groups typically improves execution speed. Whether to group fields or not also depends on how you want to process them. Do you always store and use the fields together? Someone who really knows how the data is being used might help to identify groups of fields that can be combined to speed processing.
Voice: (800) 262-6585 (U.S.A. and Canada)
Voice: (858) 689-4500
Fax: (858) 689-4550
Please share your comments on this manual
or on any Acucorp documentation with the
Acucorp Communications Department.
|© 1988-2003 Acucorp, Inc.|
All rights reserved.