CA-Datacom DB ESSENTIALS
CA-Datacom DB ESSENTIALS
CA-Datacom DB ESSENTIALS
CHAPTER
2
CA-DATACOM/DB Essentials
Introduction 7
CA-DATACOM/DB and CA-DATADICTIONARY Software 7
CA-DATACOM/DB Databases 8
Database Names 9
Tables 9
Fields, Keys, and Elements 10
Data Types 10
Numeric Data Types 11
Character Data Types 11
Nils–Missing Values 11
CA-DATACOM/DB Indexing 12
Selecting a Subset of Data 12
Sorting Data 12
Security Features 13
CA-DATACOM/DB Execution Environments 13
Introduction
This chapter introduces SAS System users to CA-DATACOM/DB. It focuses on the
terms and concepts that will help you use the SAS/ACCESS interface to
CA-DATACOM/DB. It includes descriptions of the following:
3 CA-DATACOM/DB and CA-DATADICTIONARY software
3 CA-DATACOM/DB databases, tables, records, and fields
3 CA-DATACOM/DB data types
3 CA-DATACOM/DB security features
3 CA-DATACOM/DB indexing.
If you want more information than this chapter provides on a CA-DATACOM/DB
concept or term, see the appropriate CA-DATACOM/DB documentation. For more
information on CA-DATACOM/DB considerations, see Appendix 1, “Information for the
Database Administrator,” on page 105 and Appendix 2, “Advanced User Topics,” on
page 117.
CA-DATACOM/DB Databases
A CA-DATACOM/DB database is a collection of CA-DATACOM/DB tables, organized
within certain CA-DATACOM/DB areas and files. Each table consists of records that
have one or more FIELD entity-occurrences.
CA-DATACOM/DB Essentials 4 Tables 9
You need to know about several types of CA-DATACOM/DB entity-types to use the
SAS/ACCESS interface to CA-DATACOM/DB. The most important entity-types are
databases and records, which contain fields. Fields contain the actual data values,
which are either character or numeric type.
You can define a field as a simple field or a compound field. Fields can also become
keys, and two special keys, the Native Key and the Master Key, are required for each
table. CA-DATACOM/DB generates an index for each key field. Knowing about the
Native Key and the indexes can help you minimize CA-DATACOM/DB processing time
for your view descriptors. In addition, fields can repeat. For more information about
fields, see “Fields, Keys, and Elements” on page 10.
Typically, a database is organized according to the types of data and how you want to
use the data. You must understand and be familiar with your database’s organization
in order to retrieve and update information accurately and efficiently. And you must be
familiar with the organization and contents of the database to create descriptor files for
the SAS/ACCESS interface.
The following sections describe the various CA-DATACOM/DB entity-types that
pertain to the SAS/ACCESS interface to CA-DATACOM/DB.
Database Names
Each DATABASE entity-occurrence in the CA-DATADICTIONARY database has a
unique name, from 1 to 32 characters long. A database also has a status (TEST or
PROD) and version associated with it.
Tables
A table consists of some number of records, each having one or more fields. The table
name is the name of a RECORD entity-occurrence, up to 32 characters long. Data
records in the table are ordered by the values for an assigned field called the Native
Key. CA-DATACOM/DB permits up to 240 tables in a database. The tables can be
spread across one or more CA-DATACOM/DB areas. When you define a record for a
table, you must define at least one field, one key, and one element for that record.
To create descriptor files for the SAS/ACCESS interface, you must know the name of
the RECORD entity-occurrence (table) and the userid and optional password for
CA-DATADICTIONARY. An access descriptor and its associated view descriptors
pertain to only one table.
Output 2.1 on page 10 illustrates four fields from the table CUSTOMERS. Field
names are shown at the top of the columns. Each row represents the values in a record.
The first field, CUSTOMER, is the Native Key in this table, which causes the records to
be maintained in order by customer number.
10 Fields, Keys, and Elements 4 Chapter 2
Data Types
A CA-DATACOM/DB field can be any one of a variety of data types; they are all
basically type character or type numeric, as discussed below.
When you create a view descriptor, the ACCESS procedure assigns SAS formats,
informats, and so on, in addition to SAS column names from the CA-DATACOM/DB
CA-DATACOM/DB Essentials 4 Data Types 11
field names. See “ACCESS Procedure Data Conversions” on page 99 for the default SAS
column formats and informats for each CA-DATACOM/DB data type. You can change
the default formats and informats.
Note: CA-DATACOM/DB does not support date types. If you store dates in a
CA-DATACOM/DB numeric field, identify the representation with a SAS date format in
the DB Content field in your descriptor files. 4
Nils–Missing Values
Missing values in a CA-DATACOM/DB table are referred to as nil values or simply
nils. Nil values for both character and numeric type data are blanks, that is, HEX
(40)s. All fields of a key must contain blanks for a value to be nil. There are no valid
packed decimal or zoned decimal nil values. Optionally, you can specify binary zeros for
nils (see “System Options” on page 115).
In the SAS System, nils are referred to as missing values. CA-DATACOM/DB and
the SAS System handle missing values differently, but the interface view engine takes
care of the differences. See “Missing Values (Nils)” on page 121 for a discussion of the
differences.
12 CA-DATACOM/DB Indexing 4 Chapter 2
CA-DATACOM/DB Indexing
An Index Area is required for each CA-DATACOM/DB database. CA-DATACOM/DB
creates an index entry for each key value in each record. The indexes allow you to
retrieve records quickly based on the record’s contents.
Sorting Data
Records in a CA-DATACOM/DB table are maintained in order by values in the
specified Native Key. In a SAS/ACCESS view descriptor, you can provide a different
Default Key for the view, and the records will then assume the order of your specified
Default Key. You can also specify a SORT clause, which consists of the keyword SORT
followed by one or more field names, separated by commas. You can specify ascending
or descending order for each sort key; the default is ascending order. For example,
sort state, city, lastname desc
In addition, you can specify data order in a SAS program using a SAS BY clause.
Note, however, that a SAS BY clause overrides a SORT clause stored in a view
descriptor unless the SAS procedure includes the NOTSORTED option. In this
situation, the SAS BY clause is ignored, and the SORT clause in the view descriptor is
used.
For more information on SORT clauses, see “SORT Clause in a View Descriptor” on
page 97.
CA-DATACOM/DB Essentials 4 CA-DATACOM/DB Execution Environments 13
Security Features
The CA-DATADICTIONARY database is protected by userids, passwords, and locks.
You must give the correct userid and optional password to the SAS ACCESS procedure
so the procedure can obtain CA-DATADICTIONARY information for creating an access
descriptor. CA-DATACOM/DB also has security interfaces to packages such as RACF.
In addition, you can develop your own security program through a user exit in the
interface view engine.