Setting Up Query Managers |
One sample program is provided to create SAS Query Manager tables. This program can be run from Query and Reporting or from outside Query and Reporting, either from the Program Editor window or in batch. The program is located in SASHELP.QASSIST.SASQM.SOURCE. By default, the program generates Query Manager tables for all available SAS data libraries except SASHELP and MAPS. The Query Manager tables are stored in a library defined by the Query Manager definition. The program can be edited to exclude more libraries and to store the Query Manager tables at a different location. See Creating Public SAS Query Manager Tables for an example of customizing and using this program.
The Query Manager tables are described in the next sections.
_SACOLS Table |
The _SACOLS table contains one row for each column in the available SAS tables.
Column Number | Column Name | Column Label | Column Type | Column Length | Index Type | |
---|---|---|---|---|---|---|
1 | LIBNAME | Library Name | CHAR | 8 | SIMPLE | |
2 | MEMNAME | Member Name | CHAR | 8 | SIMPLE | |
3 | MEMTYPE | Member Type | CHAR | 8 |
|
|
4 | NAME | Column Name | CHAR | 8 | SIMPLE | |
5 | TYPE | Column Type | CHAR | 4 |
|
|
6 | LENGTH | Column Length | NUM | 8 |
|
|
7 | NPOS | Column Position | NUM | 8 |
|
|
8 | VARNUM | Column Number in Table | NUM | 8 |
|
|
9 | LABEL | Column Label | CHAR | 40 |
|
|
10 | FORMAT | Column Format | CHAR | 16 |
|
|
11 | INFORMAT | Column Informat | CHAR | 16 |
|
|
12 | IDXUSAGE | Column Index Type | CHAR | 9 |
|
|
13 | INDEX | Index | CHAR | 1 |
|
|
14 | F_LIB | First library | CHAR | 1 | SIMPLE | |
15 | F_MEM | First member | CHAR | 1 | SIMPLE |
The following list describes the columns in the _SACOLS table:
contains the name of the SAS data library for the SAS table containing the column.
indicates whether the column is part of an index (simple/composite/both).
indicates whether the column is part of an index or is blank.
contains a quoted flag 1 for the first column for a given library; otherwise, it contains 0.
contains a quoted flag 1 for the first column for a given table; otherwise, it contains 0.
_SAINDX Table |
The _SAINDX table contains information about SAS indexes that are defined on columns in tables in the _SACOLS table. The _SAINDX table contains one row for every column that is part of an index. The _SAINDX table is not required by the Query Manager, but users often find this information helpful.
Column Number | Column Name | Column Label | Column Type | Column Length | Index Type |
---|---|---|---|---|---|
1 | LIBNAME | Library Name | CHAR | 8 | SIMPLE |
2 | MEMNAME | Member Name | CHAR | 8 | SIMPLE |
3 | MEMTYPE | Member Type | CHAR | 8 | |
4 | NAME | Column Name | CHAR | 8 | |
5 | IDXUSAGE | Column Index Type | CHAR | 9 | |
6 | INDXNAME | Index Name | CHAR | 8 | |
7 | INDXPOS | Position of Column in Concatenated Key | NUM | 8 | |
8 | NOMISS | Nomiss Option | CHAR | 3 | |
9 | UNIQUE | Unique Option | CHAR | 3 | |
10 | IXFIELDS | Column name(s) in index | CHAR | 200 |
The following list describes the columns in the _SAINDX table:
contains the name of the SAS data library for the SAS table containing the column.
indicates whether no missing values are allowed (yes/blank).
contains the names of all columns that are part of the index. They are separated by commas and listed in column order.
_SARELS Table |
The _SARELS table contains relations between SAS tables. This information is used to join tables automatically. The relation information either must be entered manually or saved from the Join Manager window within Query and Reporting. The _SARELS table has one row for every column that is part of a relation.
Column Number | Column Name | Column Label | Column Type | Column Length | Index Type |
---|---|---|---|---|---|
1 | RELNAME | Relation name | CHAR | 8 | |
2 | RELDESC | Relation description | CHAR | 30 | |
3 | TABLE | Table name | CHAR | 27 | |
4 | RTABLE | Referenced table | CHAR | 27 | |
5 | NAME | Foreign key column | CHAR | 18 | |
6 | RNAME | Primary key column | CHAR | 18 | |
7 | COLSEQ | Position within foreign key | NUM | 8 | |
8 | COLCOUNT | Number of columns in foreign key | NUM | 8 | |
9 | ORIGIN | Keep track of relation-originator | CHAR | 3 |
The following list describes the columns in the _SARELS table:
Contains the name of the column in the table from the TABLE column in the relation.
Contains the name of the column from the table in the RTABLE column in the relation.
Describes where the relation was created (from the Join Manager window in Query and Reporting or manually).
_SATAB Table |
The _SATAB table contains one row for each SAS table that can be queried with the Query Manager.
Column Number | Column Name | Column Label | Column Type | Column Length | Index Type |
---|---|---|---|---|---|
1 | LIBNAME | Library Name | CHAR | 8 | SIMPLE |
2 | MEMNAME | Member Name | CHAR | 8 | SIMPLE |
3 | MEMTYPE | Member Type | CHAR | 8 | |
4 | MEMLABEL | Dataset Label | CHAR | 40 | |
5 | TYPEMEM | Dataset Type | CHAR | 8 | |
6 | CRDATE | Date Created | NUM | 8 | |
7 | MODATE | Date Modified | NUM | 8 | |
8 | NOBS | Number of Observations | NUM | 8 | |
9 | OBSLEN | Observation Length | NUM | 8 | |
10 | NVAR | Number of Variables | NUM | 8 | |
11 | PROTECT | Type of Password Protection | CHAR | 3 | |
12 | COMPRESS | Compression Routine | CHAR | 8 | |
13 | REUSE | Reuse Space | CHAR | 3 | |
14 | BUFSIZE | Bufsize | NUM | 8 | |
15 | DELOBS | Number of Deleted Observations | NUM | 8 | |
16 | INDXTYPE | Type of Indexes | CHAR | 9 | |
17* | SCREEN | FSEDIT screen name | CHAR | 35 | |
* Optional. |
The following list describes the columns in the _SATAB table:
contains the name of the SAS data library containing the table.
contains the name of a PROC FSEDIT screen for browsing and editing SAS tables (optional column).
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.