RANGE
lb : ub
In System 1032, Numeric and Date-Time attributes can be automatically constrained
to a contiguous set of values. When you define a RANGE quality, it has two
boundary parameters, lower and upper, separated by a colon, that denote
the inclusive endpoints of the valid values. Text and Binary Varying attributes
are excluded from RANGE operations. Other data types have a default range
comprised of all allowed values for that data type. Specification of the
RANGE option allows a restriction of the default range.
In a study of this
topic, I found the break-even point to be around the 80-character mark.
If your text values are 80 characters or fewer, just use fixed-length Text
for your data, instead of incurring the overhead of Text Varying.
PRECISON
units
The PRECISION quality controls the granularity of the data values stored.
For Decimal and Real attributes, you can specify an integer for the number
of significant digits for the value. For date-time attributes, the PRECISION
setting controls the least significant element of the date and/or time to
be stored--in descending order: years, months, days, hours, minutes, seconds,
milliseconds, microseconds.
MISSING
value
System 1032 supports the statistical concept of no-data-specified--not
zero or blank, but not there, at all. You can use the MISSING quality
to specify a value that represents the missing value during data entry
or bulk operations. MISSING has one parameter of appropriate data type.
If you specify RANGE for an attribute and you do not specify a MISSING
value, System 1032 automatically decreases the lower range value by one
unit and enters it for the MISSING value.
INITIALLY
value
The INITIALLY quality specifies a default value for the attribute. Initially
has one parameter of the appropriate data type, or the MISSING keyword.
Structural
Quality Defaults
The following chart
details the defaults for the MISSING, RANGE, and PRECISION values for
the System 1032 data types. Note that the MISSING value is always included
within the default range, and is the lower boundary. Some data types use
invalid values internally to serve as the missing value. Also, the precision
of the Integer Double and Real Double have been truncated for this example.
See the original chart on page 50 of the System 1032 Programmers
Reference: Module 2 for the full precision of these data types.
| DataType |
Missing
Value |
Range |
Precision |
| Binary
Varying |
<255> |
N/A |
N/A |
| Date_Time |
JAN/01/0000 |
JAN/01/0000:JAN/01/9999 |
Minutes |
| Date |
JAN/01/0000 |
JAN/01/0000:JAN/01/9999 |
Days |
| Decimal |
internal
value |
-9999999999.99:9999999999.99 |
12 |
| Integer
|
-2147483648
|
-2147483648:2147483647 |
N/A |
| Integer
Double |
-9.22337E+18 |
-9.22337E+18:
9.22337E+18 |
N/A |
| Logical |
internal
value |
TRUE
or FALSE |
N/A |
| Real |
internal
value |
-1.7014E38:1.7014E38 |
7 |
| Real
Double |
internal
value |
-1.7014E38:1.7014E38
|
16 |
| Text |
<255> |
N/A |
N/A |
| Time_Span |
-29227
years |
-29227
years:29227 years |
Minutes |
| Time |
-00:01:00 |
-00:01:00
: 24:00:00 |
Minutes |
Usage Qualities
The Usage qualities
control how attributes behave within certain PL1032 commands. You can modify
these qualities after you define and use attribute definition, if you wish.
Usage qualities include: OR, COLUMN, LENGTH, COMMENT, DEMAND, PROMPT, Summaries,
TITLE, FORMAT, and UPDATE.
OR
name
The OR quality provides one or more alternate names for the attributeup
to 126 other names. Often, the primary name of an attribute is very descriptive
and long. Repeatedly entering a long name can become tiring, so defining
a short alternate name, or names, can be helpful. In addition, there are
efficiency considerations in using a short name as the primary attribute
name, and then using the long descriptive name as one of the alternate names.
COLUMN
col1 col2
The COLUMN quality predefines the location of the attribute data location
in the dataset Record Descriptor (RD). The COLUMN quality has two integer
parameters to denote the starting and ending column position of the data
in an external file. Specify COLUMN when the order of the data in the external
file does not match the attribute order. COLUMN is mutually exclusive with
LENGTH.
LENGTH
n
The LENGTH quality denotes the number of characters of the attribute data
in an external file. Specify LENGTH when the attribute is arranged sequentially
within the external file. The LENGTH quality has an integer parameter. Although
you cannot use LENGTH and COLUMN on the same attribute, individual attributes
in the same dataset can use LENGTH or COLUMN, depending on the order of
the data values within the external record.
COMMENT
text
The COMMENT quality is often used by the dataset designer to describe the
use or purpose of the attribute. Some sites have completely documented the
value distribution of an attribute in an extended comment. The COMMENT quality
takes a single text parameter. The delimited text type code (#TD/
/)
is often used with the comment option to enable multi-line comments to be
specified.
DEMAND
The DEMAND quality is used by the ADD command to insist that a data entry
user specify a value for this attribute during interactive data entry.
PROMPT
text
The PROMPT quality specifies a text string that is used as prompting text
during interactive data entry. The PROMPT quality has a text string parameter.
Summaries
Summaries can include MINIMUM, MAXIMUM, AVERAGE, TOTAL. When you specify
an attribute with a Summary quality within a PRINT command item list, the
attribute quality displays one or more automatic summary conditions for
the attribute. If summary types are specified, they are automatically calculated
and displayed whenever the attribute is printed.
TITLE
text [position]
The TITLE quality is a text string for the column title that is displayed
during PRINT operations. The TITLE quality also provides an optional position
keyword for title position: LEFT, CENTERED, RIGHT. For a multiple line title
you can use a backslash character (\) within the title string.
FORMAT
fmtspec
The FORMAT quality specifies how an attribute value is displayed. Numeric
formats control the number of digits, the placement of a decimal point or
sign, exponentation and thousands quoting. Date-Time formats control the
physical output representation of the date and/or time. Text formats control
number of characters, line/character wrapping and non-printing character
disposition. The FORMAT quality requires a text parameter. (Because the
formatting possibilities are extensive we will cover them in depth in an
upcoming article.)
Examining
Attribute Qualities and System 1032 Defaults
In Figure A a simple
dataset with three attributes is created specifying only the minimum required
syntax for the attributes.
Figure
A. Creating dataset TMP1 with three attributes
1032> create dataset tmp1
1032 Data Definition Language DDL> attribute one text 1 keyed DDL_ attribute two integer keyed DDL_ attribute third_one date DDL_ end
|
|
Figure B is a SHOW
ATTRIBUTE FULL command that displays the complete attribute definitions
that includes the System 1032 defaults for attributes. Note the default
title and prompt are both based upon the primary name of the attribute.
Figure
B. Examining the system generated defaults for attribute qualities
1032> show attribute full
Attribute ONE Text 1 Title Centered "ONE" Format A1 Prompt "ONE" Missing System_Default Initially Missing Column 1 1 Keyed Ignore_Case No_Multinational; Attribute TWO Integer Range -2147483647 : 2147483647 Title Centered "TWO" Format N10 Prompt "TWO" Missing 2147483648 Initially Missing Column 2 12 Keyed; Attribute THIRD_ONE Date Range '01/02/0000' : '01/01/9999' Precision Days Title Centered "THIRD_ONE" Format D3 Prompt "THIRD_ONE" Missing '01/01/0000' Initially Missing Column 13 22;
|
|
In Figure C a series
of attribute qualities are defined for the same attributes in TMP1, including
COLUMN qualities to pick up data from an external file not in defined attribute
order.
Figure
C. Examining an attribute with more than two names
1032> create dataset tmp3
1032 Data Definition Language DDL> attribute one text 1 column 10 10 title "First/Attribute" DDL_ Missing "Z" DDL> attribute two integer column 1 4 title "Only/An/Integer" DDL_ Missing -1 Range 0:100 DDL> attribute nxt or third_one date range '1/1/1900':'1/1/2033' DDL_ title "A Date" precision months column 11 20 DDL_ end_dataset
|
|
Compare Figures C and
D. Note that NXT has become the primary name for the original attribute
THIRD_ONE. Because NXT is first name defined, it is now the primary name.
NXT is now the Prompt value for that attribute and will be the column heading
in PRINT command processes.
Figure
D. Examining the RANGE quality and System 1032 default handling
1032> show attribute full Attribute ONE Text 1 Title Centered "First/Attribute" Format A1 Prompt "ONE" Missing "Z" Initially Missing Column 10 10; Attribute TWO Integer Range -1 : 100 Title Centered "Only/An/Integer" Format N3 Prompt "TWO" Missing -1 Initially Missing Column 1 4; Attribute NXT or THIRD_ONE Date_Time Range '01/01/1900' : '01/01/2033' Precision Months Title Centered "A Date" Format D3 Prompt "NXT" Missing '12/01/1899' Initially Missing Column 11 20;
|
|
Again compare Figures
C and D, this time looking at both RANGE and MISSING qualities. For Attribute
TWO we defined a RANGE of 0 to100 and MISSING as 1, which is one less
unit (an integer) outside the range. Because we defined the MISSING value,
System 1032 increased the RANGE value to include the MISSING value.
However, for attribute
NXT we defined a RANGE of 01/01/1900 to 01/01/2033, but we did not define
a MISSING value. So System 1032 set the MISSING value to one less unit (a
month) than the RANGE value, but did not change the RANGE values themselves.
In
Summary
As in the last article,
the ability to store and represent data is the purpose of a DBMS. System
1032 attributes and their qualities lets you accurately represent and present
your data values.
Model
204
USE
OF AND ACCESS TO PRODUCTS AND FEATURES ARE IN ACCORDANCE WITH THE TERMS
AND CONDITIONS OF THE USERS SOFTWARE LICENSE. THE PRESENTATION OF
MATERIAL HEREIN DOES NOT, IN ANY MANNER, MODIFY SUCH TERMS AND CONDITIONS.
By
James Damon
MONITOR
SERV - Tracking Servers in a Model 204 Online
Prior to V5R1, you could not conveniently determine server sizes defined
in a Model 204 Online system. The VIEW NSERVS command gives the number
of servers defined, but the only way you know the size of each server
is to examine the CCAIN stream. Also, without a programmatic analysis
of CCAAUDIT or of the output from a number of MONITOR commands it is difficult
for you to know whether each server is being used or whether defined server
sizes are sufficient.
In V5R1 we introduced
the MONITOR SERV command that provides enhanced monitoring and tracking
of servers in an Online environment. The MONITOR SERV command provides
information similar to the MONITOR command, but it provides detail on
servers defined, the size of each server, the amount of space currently
in use and the servers status. Figure 1 is an example of the output
produced by a MONITOR SERV command.
Figure
1. Sample output of a MONITOR SERV command
USER SVR BUF FLS PCPU SMPLS RUNG REDY BLKI WTSV BLKO SWPG 152 1 59988 130 0.665 30 0.766 0.466 95.566 0.000 0.000 0.000
USER SVR USERID SERVSIZE LSERVER FUNC CNCT CPU SEQIO QUE WT FLGS 44 1 ARWEN 800000 290816 EVAL 512 0.116 31 BLKI 3 67 2 800000 290816 WTUS 29 3 HARPO 650000 352256 EVAL 16 0.085 23 REDY 33 4 LEGOLAS 650000 143360 EVAL 771 0.268 67 RUNG 48 5 DEWEY 650000 290816 EVAL 102 0.059 21 BLKI 3 67 17 6 PARIS 650000 282624 EVAL 3877 1.064 227 BLKI 3 67 7 425000 221184 WTUS 69 8 MUSTAFA 425000 290816 EVAL 1202 0.615 165 BLKI 3 67 101 9 SAMWISE 425000 290816 EVAL 6853 28.980 962 BLKI 3 67 31 10 CHER 425000 290816 EVAL 2359 3.116 145 BLKI 3 67
|
|
In Figure 1, NSERVS=10
and three different server sizes have been defined. Servers are displayed
in the order in which they were defined in CCAIN. Only servers are listed,
although there may be many users logged in and a number of pseudo subtasks
active. In Figure 1, server numbers two and seven have no logged-in users
and are in the waiting for user (WTUS) queue. The other servers are occupied
and User 33 is in the running (RUNG) queue, indicating that this user
issued the MONITOR SERV command.
Examining
the LSERVER size
If User 33 issues a VIEW UTABLE command, as shown in Figure 2, the LSERVER
row shows the number of bytes currently required for User 33, which is
determined by the sum of all table sizes set by (or for) User 33.
Figure 2.
VIEW UTABLE output
VIEW UTABLE
LIBUFF 4000 LENGTH OF INPUT BUFFER LOBUFF 256 LENGTH OF OUTPUT BUFFER LPDLST 12000 LENGTH OF USER PUSH DOWN LIST LHEAP 0 LENGTH OF HEAP LQTBL 500 LENGTH OF QTBL LNTBL 100 LENGTH OF NTBL LSTBL 70000 LENGTH OF STBL LTTBL 500 LENGTH OF TTBL LVTBL 500 LENGTH OF VTBL LGTBL 504 LENGTH OF GLOBAL VARIABLE TABLE LFTBL 1000 LENGTH OF FTBL LXTBL 96 LENGTH OF XTBL LITBL 104 LENGTH OF ITBL LOUTPB 6104 LENGTH OF OUTPUT PAGE BUFFER LFSCB 6000 LENGTH OF FULL SCREEN BUFFER NORQS 50 NUMBER OF REQUESTS PRESERVED HTLEN 132 MAX LENGTH OF EACH HEADER OR TRAILER MAXHDR 5 MAX NUMBER OF HEADERS MAXTRL 5 MAX NUMBER OF TRAILERS LSERVER 143360 SERVER SIZE REQUIREMENT FIXSIZE 15128 FIXED SERVER SIZE REQUIREMENT SERVACTV 180224 CURRENT SIZE OF THIS SERVER
|
|
Given the table sizes
for User 33, the current number of bytes required to accommodate the current
table settings is LSERVER = 143360. If you allocate CCASERVR in a dataspace
or hiperspace, the value of LSERVER is an integer multiple of 4096 bytes.
Using a dataspace or hiperspace allows server swaps to use the page oriented
MVPG (Move Page) instruction which moves 4096 bytes per execution. This
provides superior performance to the byte-oriented MVC (MoVe Character)
or MVCL (MoVe Character Long) instructions. (For more discussion about
CCASERVR in a dataspace or hiperspace, see the December
2003 edition of CCAPRINT.)
Since
Last Statistics displayed with MONITOR SERV SL
You can also display additional Since Last detail information by issuing
a MONITOR SERV SL command or, for individual servers, a MONITOR (n,n,n,
)
SERV SL command. The MONITOR SERV SL output also includes the SERVSIZE
and LSERVER settings. Figure 3 shows the output from a MONITOR (7) SERV
SL command.
Note that with CCASERVR
allocated as a dataspace or hiperspace, the maximum server size defined
is limited only by the maximum size of the dataspace or hiperspace which
is currently two gigabytes. When CCASERVR is allocated on DASD (3380,
3390) the maximum server size which you can define is limited to the cylinder
capacity of the device type used: for 3380s, 712,140 bytes; for 3390s,
849960 bytes. In Figure 3, for example, User 20 has a SERVSIZE setting
of 2.6 megabytes and provides indirect evidence that this online has CCASERVR
allocated in a dataspace or hiperspace.
Figure 3. MONITOR
SERV SL output
04.247 SEP 03 19.06.03 PAGE 10 USER SVR BUF FLS PCPU SMPLS RUNG REDY BLKI WTSV BLKO SWPG 9 1 643 4 0.253 30 0.000 0.000 9.933 0.000 0.000 0.000 USER SVR USERID SERVSIZE LSERVER FUNC CNCT CPU SEQIO QUE WT FLGS CPU DKRD DKWR UDD OUT SLIC FINDS RECDS PCPU RQTM SCRN SVRD SVPAGES SUBSYSTEM PROC-FILE PROC COMMITS BACKOUTS UPDTIME(MS) LNGUPDATES LNGUPDTIME(MS) 20 7 PSDAMON 2666000 143360 EVAL 76 0.193 43 BLKI 0 08 0.178 457 1 0 1 0 1 419 0.026 7386 0 0 0 DEBCPROC UPDATE.2000 0 0 0 0 0
|
|
In
Summary
The MONITOR SERV command
sometimes sheds more light on the activity in a Model 204 Online because
it is an abbreviated display: of all logged-in users, only those currently
in a server are displayed. If some servers are empty and in the WTUS queue,
that could be an indication of unused servers--unused because they are
too small. In an active system, MONITOR SERV output generally displays
the most active users and the ones of most interest when monitoring system
performance for potential performance problems.
Copyright ©
2008 Computer Corporation of America.
All right reserved. Published
in the United States of America.