TOCPREVNEXTINDEX

AcuODBC User's Guide
Version 6.0

6.3.9 READ-ONLY Directive

The READ-ONLY directive allows you to make some fields (or columns) of data read-only, while preserving normal access to other fields/columns. When placed immediately before a data item in an FD, this directive assigns the read-only attribute to the item. The read-only attribute applies only to the next data item with a picture clause and not to group items. Subsequent data items return to normal read-write access.


Note: This directive applies only to read-write versions of AcuODBC. It is ignored by read-only versions as well as by other products that use the XFD files, such as alfred.

Syntax

    $XFD READ-ONLY   

or

    *(( XFD READ-ONLY ))   

In the code creating the "animals" table, the "owner" data item has been designated as read-only. The code is:

           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.   
                   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.   
          $XFD DATE=MMDDYYYY   
                   05  date_paid                   pic 9(8).   

In the database table, the "owner" column looks the same as the other columns. However, if the data is linked and users attempt to make changes to any of the items in the "owner" column, they receive a message telling them that the update on a linked table failed.

If you add this directive to the FD, you should use the xfdcrypt utility included with AcuODBC to encrypt your data dictionaries. Otherwise, users can edit the ".xfd" file to gain access to the read-only fields. See section 6.4, "Encrypting XFD Files," for more information.

Making Entire Tables Read-Only

To make an entire table read-only, you can embed the following statement below the top-level description (containing group item) of the table in the FD. This directive must be placed before the data item that you want mapped to a column in the table.

    $XFD READ-ONLY TABLE   

or

    *(( XFD READ-ONLY TABLE ))   

For example:

           01  qa_record.   
          $XFD READ-ONLY TABLE   
               03  animal_info.   

Note that if there is another READ-ONLY or HIDDEN directive within a containing group item, place the READ-ONLY TABLE directive before the next line (data item) that does not have a READ-ONLY or HIDDEN directive associated with it.


Acucorp, Inc.
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.
TOCPREVNEXTINDEX
1988-2003 Acucorp, Inc.
All rights reserved.