Exploring The PICK Operating Sys
Exploring The PICK Operating Sys
Exploring The PICK Operating Sys
Exploring the
PICK
Operating System
Jonathan E. Sisk
Steve VanArsdale
Exploring the PICK
Operating System
HOWARD W SAMS ^COMPANY
HAYDEN BOOKS
Related Titles
For the retailer nearest you, or to order directly from the publisher,
call 800-428-SAMS. In Indiana, Alaska, and Hawaii call 317-298-5699.
Exploring the PICK
Operating System
Second Edition
HAYDEN BOOKS
A Division of Howard W. Sams & Company 4300 West 62nd Street
Indianapolis, Indiana 46268 USA
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by
any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission
from the publisher. No patent liability is assumed with respect to the use of the information contained
herein. While every precaution has been taken in the preparation of this book, the publisher and authors
assume no responsibility for errors or omissions. Neither is any liability assumed for damages resulting
from the use of the information contained herein.
Trademark Acknowledgments
All terms mentioned in this book that are known to be trademarks or service marks are listed below. In
addition, terms that are suspected of being trademarks or service marks have been appropriately
capitalized. Howard W. Sams & Company cannot attest to the accuracy of this information. Use of a term
in this book should not be regarded as affecting the validity of any trademark or service mark.
ADDS Mentor is a trademark of Applied Digital Data Systems, a division of NCR. ALL is a trademark of
McDonnel Douglas Corporation.
Apple is a registered trademark of Apple Computer, Inc.
DATA/BASIC is a trademark of Microdata Corporation. dBASE is a registered trademark of Ashton Tate
Company. DEC is a registered trademark of Digital Equipment Corporation. IBM and IBM AT are
registered trademarks of International Business Machines Corporation.
Intel is a trademark of Intel Corporation.
MS-DOS is a registered trademark of Microsoft Corporation.
PICK is a registered trademark of Pick Systems, Inc.
UNIX is a registered trademark of AT&T.
This book is dedicated to the thousands of PICK System users
who “kept the faith ” over the years . . .
to Henry Eggers, whose wisdom kept this book on track . . . to
Barbara VanArsdale, whose patience made it possible . . .
to the memory of Ken Simms, the author o/PICK/BASIC
whose friendship and input will be missed . . .
and to all those who will take a tour through the PICK world
in the years to come.
Overview
Preface xix
vii
Exploring the PICK Operating System
viii
Content
s
The COPY Command 52
The DELETE Command 54
The CREATE-ACCOUNT Command 55
The PASSWORD Command 57
The LOGTO Command 59
The CREATE-FILE Command 59
Creating the Tutorial Files 60
The CLEAR-FILE Command 61
The DELETE-FILE Command 62
Selecting File Sizing Parameters 62
The “P” Command 63
And Finally, Some Fun: CHOO-CHOO and SNAKE 64
ix
Exploring the PICK Operating System
xi
Exploring the PICK Operating System
7 PICK/BASIC:
The Programming Language 177
About PICK/BASIC 178
If You Have Worked on Other Systems 179
Terminology of the PICK/BASIC Language 181
Statements 181
Constants and Literals 181
Variables 182
Assignment 183
Functions 183
Operators 185
Expressions and Arguments 186
Nuclear Tokens and Functions 187
Standards and Conventions 187
Summary 188
The PICK/BASIC Tutorial 189
Creating Your Work Files 189
Preparing the Source File 189
The ED Command and HELLO Program 190
Notes on Program Names (Item-Ids) 190
Compiling Programs: The BASIC Command 191
Activating the Program: RUN and CATALOG 191
If It Didn’t Work 192
xii
i
Exploring the PICK Operating System
xiv
Content
s
Attaching Media to a Process (T-ATT) 211
Detaching Media from a Process (T-DET) 212
The Logical Structure of Media 212
The Label 212
Rewinding the Media (T-REW) 213
Preparing Media for the Tutorial 213
Moving Backward on the Media (T-BCK) 214
Moving Forward on the Media (T-FWD) 214
Moving to the End of Recorded Data (T-EOD) 214
Reading the Media (T-READ) 215
Reading the Media Label (T-RDLBL) 216
Completing the Session 216
The PICK Spooler 217
Types of Spooler Entries 217
Spooler Control Commands 218
Restarting the Spooler (:STARTSPOOLER) 218
Starting Printers (STARTPTR1) 218
Displaying Spooler Entries (LISTPEQS2) 219
Displaying Printers (LISTPTR3) 221
Displaying Current Assignments (LISTABS4) 222
Displaying Spooler Status (SP-STATUS) 223
Changing Spooler Assignment (SP-ASSIGN) 223
Accessing Spooler Entries (SP-EDIT) 226
Stopping Spooler Output (SP-KILL) 228
xv
Exploring the PICK Operating System
xvi
Content
s
Step 2—Analyze the User’s Views 273
Step 3—Reassemble 274
Process Design 274
Transaction Analysis 275
Prototyping—Designing in Clay 276
The End of the Tour 277
A Lists 291
B ASCII Codes 303
C Verb Formats 311
D Conversion/Correlative Reference 315
Format of Attribute-Defining Items 316
Conversion and Correlative Codes 317
The A Correlative 318
The C Correlative 321
The C Associative 322
The D Associative 322
The D Conversion 322
The F Correlative 323
xvi
i
Exploring the PICK Operating System
Glossary 335
Index 339
xvii
i
Preface
xi
x
Exploring the PICK Operating System
kept alive by the persistent efforts of a dedicated group of unsung users, who
sometimes sacrificed their careers insisting that the system was worthy of
attention.
One day in 1984 we agreed to do something about the lack of public
information on the PICK System. We decided to write a book. So we did, and
this is it.
xx
Prefac
e
is different from traditional approaches to data processing. That terminology is
demonstrated in six chapters of tutorials, in chapters 3 through 8. These
chapters cover creating files, editing items within those files, accessing the
files and creating reports, programming the PICK System, and handling
peripheral devices such as printers.
Throughout the book, there is a simple analogy that the PICK System is
more like a place, or an “environment” for work, rather than a computer
system with specific, limited capabilities. The book takes you to that PICK
world for a close up look.
Chapter 9 leads you into the core of the system, for a strictly non-
technical discussion of the internal processes that make the PICK System work
the way that it does. We explain that there are three “views” of the PICK
environment:
■ The user's view, from the surface
■ The physical view, or how the system relates to the hardware
■ The logical view, created by the system itself
In chapter 10, you can observe how the system is used by the people
who work there, day after day, all over the world. By considering the appli-
cations of these thousands of business and computer professionals, you can
learn from their experience.
In chapter 11, we explain why the system is particularly well suited to
the advanced techniques of structured analysis, design, and, of course,
programming, despite the fact that the PICK System pre-dates most of these
techniques by nearly half a decade.
The last chapter is a kind of farewell. As you leave the PICK world, we
spend a few pages speculating on where that world is headed. After that, the
appendixes provide the reference material that would fill other books more
concerned with the how than the why.
What We Hope
Exploring the PICK Operating System is the first PICK book ever published in
the popular market. We’ve tried to include everything that has amazed,
delighted, or disappointed us. Yet thoroughout this book, you will find an
unbiased admiration for this system, from two who prefer to work with it over
all of the other systems that we’ve seen. We are grateful as well to the
thousands who work with us in the PICK World . . . and to you for having
picked up this book.
At a speaking engagement recently in Illinois, we were pleased to hear
Mr. Richard Pick of Pick Systems, Inc. refer to his personal creation as the
“PICK Operating Environment.” That’s just the way we see it. So, it is our
hope that this book is in the hands of a reader who doesn’t know yet about the
PICK System “environment,” and we are grateful to any and all who will pass
this book along.
xx
i
7 An Introduction to the PICK
System
Not long ago a local computer consultant attracted attention in the trade papers by
revealing one of the secrets of his successful consulting practice. It seems he starts
by having his clients get rid of their computers. Some of his clients immediately get
along better without them, and the people who run them.
This is distressing, but not altogether surprising. Since the early 1970s there
has been a growing awareness among data processing professionals that computers
often hinder the attainment of business goals. It started when computers made it
necessary for a business person to become, or hire, a data processing specialist, in
order to use the computer effectively. Management was forced to limp along with
the business decisions of computer managers who knew little about the business.
Today many companies use systems that demand specialized technical
expertise. But managing the data of the business is inevitably done better by the
business manager. So it is clear: to be useful to the management team, systems have
to be less specialized, more business-oriented, and a lot more convenient. This is
the only way in which data processing can become an aid rather than an obstacle to
management.
The situation is improving, and the computers themselves are part of the
improvement. The computer industry has focused on “user-friendly” systems. A
true user-friendly system relates to the user's way of working with the data. This
certainly includes “easy-to-learn” and “easy-to-use,” the popular definitions of
“user-friendly.” But it also includes providing
1
Chapter
1
data in a form that the user can use immediately, in a tailored “user’s view.” With
this type of system the business user can concentrate more on the business problem
and less on the computer.
This concept was the basis for a radical computing approach in the late
1960s. In 1968, a system was developed for the U.S. Army that performed all
data management automatically, letting the user store and retrieve information
by name. The user worked interactively with the computer, using simple
sentences on a CRT screen. The software itself was independent of the
hardware, and designed to run efficiently on computers that shared expensive
computer memory and printers. The system allocated space, handled files, and
organized and reorganized disk space dynamically, so that users could
concentrate on the data instead of on the data processing system. And today,
nearly twenty years later, that system is still doing those things, only now on a
wide variety of computers, from laptops to mainframes. That system is PICK.
But the PICK System is more than an operating system that spans two
decades; it is a system that changes the way data is perceived and manipulated.
Moreover, this user environment, with its virtual memory relational database,
represents a milestone in this generation of computers.
The PICK Legacy For over twenty years the computer marketplace has been flooded with one new
system after another. The PICK System was born at the very beginning, ages
ago in computer terms. While the average life span of a computer is about
three years, the popularity of a software system is sometimes measured in
months. Yet today the PICK System remains a very productive general-
purpose computer environment; it is capable of making even the lowly
personal computer a multiuser system, for less than the cost of a CRT
terminal.
How can PICK do this? Over the years, technical advances have pro-
vided vast amounts of main memory. Consequently, techniques for using
Introduction to PICK
main memory efficiently have not advanced much. PICK was developed at a
time when memory was expensive. At its core was a virtual memory
management scheme that used available memory to its maximum efficiency. It
was not uncommon for as many as eight PICK users to work together in 64K
of main memory, or even four users in only 16K of main memory. Since the
PICK virtual memory scheme uses RAM more efficiently than any other
approach, it uses today’s larger memories that much more efficiently and thus
remains in the forefront of the price/perfor- mance technical tide.
But there is more than mere efficiency behind the PICK System’s lon-
gevity. The original concepts underlying the PICK System were user-oriented
instead of hardware-oriented. The resulting data structure and user tools are
intrinsically different from any approach born of hardware orientation. PICK
represents a totally different “user-oriented” approach; consequently, it
supports processes that are inherently beyond the reach of other systems.
PICK and the Users The technical tide making computers easier to use does so partially by educating
the users. As advances bring the size and cost of equipment down, computer
systems become directly accessible to more users. Users learn what works and
what doesn’t, and contribute to still further advances with their dollars. As the
pace of innovation accelerates, the users become more knowledgeable with
each round of advances.
But a knowledgeable user community demands features for the user
rather than the technician. The PICK System, with its user orientation, is
especially attractive to users because it offers many of the most sought- after
features.
From the beginning, PICK was and is a multitasking, multiuser system
with none of the complexities of other systems. Its conceptual role is to relieve
and even isolate a nontechnical user from considerations about the hardware
and the computer. It has an easy-to-learn user interface and a report language
similar to spoken English. It has an integral database manager that supports
flat files, databases, or relational databases with minimal user involvement.
The system includes an advanced database version of the popular BASIC
programming language, with automatic linkediting, a simple compiling
command, and interactive debugging software. The system’s printers, tape,
and diskette drives are managed by the system, and are made available to each
and every user. Finally, there is a “naturalness” to the way these features are
integrated together on all levels. The PICK user processes are consistent, by
virtue of a consistent data structure.
The PICK Data We refer to the PICK System data structure as a “variable length ASCII Structure
record with built-in delimiters, with a dual dictionary/data file arrangement.” In operation, the data
structure enhances every process to provide new capabilities to end user computing. For example,
special system-resident access methods, in combination with virtual memory, provide on-
3
Chapter
1
the-fly indexing. That ensures index accuracy with no overhead for index maintenance. This service
is provided to the user as part of a logical computer that masks the complex processing usually
associated with relational database virtual machines. Users can work with data in much the same
way that they perceive their work, concentrating only on the “attributes” of the data (the PICK
equivalent of fields) that are appropriate to their “view.” This approach enhances user productivity
by masking the complex computer processing with a “logical” computer environment.
The PICK System, therefore, lowers the traditional barriers between the
user and the computer. Users can work independently, without relying on
technicians between them and the data. The system is often used con-
ventionally at first, with operators running applications with transaction files
and batch processing. These approaches work well enough, and PICK
accommodates them easily. But then PICK users tend to evolve. With daily
exposure to the logical computer created by the PICK System and the rela-
tional database processes, the users begin to develop sophisticated applications
themselves. Most users don’t realize the transition they have made. They think
they are simply doing more with the machine. In actuality, they have become
“superusers,” or data processing specialists creating and manipulating data
within their own departments. Such a transition is impossible in any other
computer system without years of training for the business-person-turned-data
processor.
Because the PICK System does not require much technical background
(it can even be a hindrance), PICK superusers rarely need much technical
training. These users retain their business perspective and see beyond the data
processing to the purpose for which the data is being processed. They increase
productivity while acquiring a new enthusiasm for the business at hand, and a
new sense of self-esteem in place of the frustration and dependence that goes
with other computing systems. When PICK superusers realize what has
happened, they usually become enthusiastic about the system as well, creating
a healthy relationship between the business and the business use of data
processing.
This is that next era of computing, about which we often hear more than
we actually see. It has quietly occurred in hundreds of thousands of PICK
System installations around the world, with little or no notice by the traditional
data processing community. For example, did you know that at this writing,
nearly two billion dollars worth of PICK-based computer equipment is in use,
and more is being installed each day?
Don’t Bother to But the transition toward PICK-like processing has hardly been explosive. Stand
Back There has been a gradual change toward more user oriented features that appears likely to
continue for the foreseeable future. The existing approaches are embedded in both the hardware and
the technicians who provide today’s advice. Advances in computing machinery are providing an
abundance of processing power; our personal computers have several times the number of CPU
cycles of the giant mainframes of just a few years ago. This additional processing power makes the
new technician more likely to take a user-oriented approach. As the technicians change,
Introduction to PICK
the techniques for using the hardware will change: from the inward “ori- entation-for-efficiency” of
the last era to an outward user-oriented philosophy like PICK’S.
However, “change” does not mean an evolutionary swing to the PICK
System itself, but rather to PICK-like processing. The market for business
computing tends to follow the highly visible hardware and software products.
Technicians tend to recommend only what they know, and most of them have
barely enough time to learn what they claim to know from the advertising.
Furthermore, some limitations of the generic PICK System in areas such as
graphics and communications are serious deficiencies, compared with the better-
known UNIX and DOS systems. But as the demand for PICK-like processing
grows, PICK will adapt. It now runs as a guest or in emulation on all the more
popular operating systems in the marketplace. The demand for PICK-like
processing is increasing steadily, and PICK’S consistency therefore contributes to a
standardization of the user-oriented philosophy.
The Evolving Standardization in computer systems occurs as commonly used techStandards ñiques
are established in the marketplace; it is not imposed by any one system. We hear claims that the
ultimate system is here already. Some say it is OS/2; others say it is one of the incarnations of UNIX.
Yet for all the clamor, no approach appears to be sweeping the rest out of the market. It is likely that
the seeds of the new standard systems are growing in several places.
It is also likely that one important seed for the universal system will be
PICK. Many aspects of this system that were implemented during the early
seventies are virtual standards today, such as multitasking and simple serial
interfaces to terminals and printers. Other aspects are gradually becoming standards
—for example, PICK’S virtual memory, database dictionaries, and natural
languages. PICK will contribute these aspects to the universal system as by-
products of that fundamental data structure.
As for future standards, because personal data processing is coming to more
computer users and these users are becoming the computer buyers, we can expect
them to exert influence on any future standards.
■ As technical advances make the machines more powerful, the PICK
System’s internal architecture will become even more effective at multiuser
processing, bringing in more users.
■ As the users become more knowledgeable, they can be expected to favor
user-oriented approaches to processing.
■ As the users become the buyers, user-oriented features are likely to become
the standards.
PICK’S approaches were originally oriented toward the demands of the end
user and are likely to remain so, because the PICK System itself is designed to
impose and maintain a user first processing approach. For example, the PICK
System enjoys a reputation for large-scale applications such as insurance and utility
billing, yet all PICK billing processes occur in
5
Chapter
1
the foreground, because the system is designed without a background for running
batch tasks. The batch tasks are users, just like all interactive users, and the system
balances the demands of each to provide appropriate throughput to each task. This
self-regulating efficiency is fundamental to the PICK approach, and predates
resources management in other systems by at least a decade.
By examining what has evolved in PICK up to the present, perhaps we
can anticipate what will be available in the universal system of tomorrow.
1971: About this time Dick Pick signed a license agreement with a local
defense contractor, the Microdata Corporation, to put the PICK System on the
Microdata 800 CPU. The 800 is rumored to have been an erratic fire control
system for the navy prior to becoming a business computer (like a retired admiral
who has gone into the private sector).
1972: Pick & Associates incorporated in Irvine, California, amid growing
disputes with Microdata regarding the ownership of rights to the new system. Pick
and his associates quietly continued development work on a Honeywell, which
they smuggled into a Newport Beach condominium, disguised as a refrigerator.
1973: The BASIC language was added to the system as the primary
programming language, in a miraculous simultaneous development by a wizard
named Ken Simms and the staff at the Microdata Corporation. Tired of waiting for
a language to reach the heartland, a software house in Chicago cheerfully
implemented a language of its own, called SMILE (later to become the Real Time
Programming Language, or RPL).
1974: Microdata announced the REALITY series of computers using the
operating system implemented by Pick & Associates. As he later testified, Donald
Fuller, the chairman of Microdata, had the PICK System “reverse compiled . . . to
protect Microdata’s interest” in the new system. Shortly thereafter, Pick &
Associates initiated a protracted legal and personal battle with Microdata and
Fuller.
1975: On the advice of a legal maven from Century City, Pick & Associates
independently offered the PICK System to other computer manufacturers at the
whopping price of $1 million in fees and royalty guarantees. Combined with the
legal battles, this price ensured that there would be little interest in the system for
years to come.
1978: Pick & Associates went offshore. The first commercially available
“port” of the PICK Operating System was announced; it was implemented on the
Evolution Computer System, based on the French “Intertechnique” computer. It
should have been named “Lafayette”; like that friend of the Americans, the
Intertechnique company was destined to be a stalwart ally of the PICK System in
the turbulent years ahead.
1979: Seattle-based Devcom Corporation began development of an
unauthorized emulation of PICK called Information, which ran on computers built
by the powerful Prime Corporation. Development was completed in 1979 and soon
Information contributed as much as 20 percent to the Prime revenues, but the
smoldering dispute with Pick wasn’t settled until late in the eighties.
1980: Pick & Associates finished the implementation on the Honeywell
Level 6 machine, to be called the Ultimate Computer. That name was the work of a
marketing genius named Theodore Sabarese, an exMicrodata dealer who had just
lost his business and his home to Microdata, and had decided to get back in the
game with a machine of his own.
1981: The first deliveries of the Ultimate, using the PICK Operating System
on Honeywell computers and later on Digital Equipment (DEC), started a
marketing effort that made Ultimate one of the nation’s most successful
corporations by the mid eighties, and Sabarese a wealthy man at Microdata’s
expense (success is the best revenge).
7
Chapter
1
1980: Pick & Associates implemented the system on the ADDS Mentor,
a Z8000-based machine from Applied Digital Data Systems, a division of
NCR. This implementation of a multiuser relational database on a personal
computer chip was years ahead of its time, yet went completely unrecognized
by the traditional data processing community. It was the beginning of a
mysterious “big chill.”
1981: Implementation began on the IBM Series/1 for Computer Dis-
tributors, Inc. (later called CDI Information Systems, now called Seattle
Operating Systems). The objective was to penetrate the IBM market by in-
dependently implementing the PICK System on IBM’s computers. The only
noticeable result was a complete lack of interest on the part of Big Blue.
1981: Pick & Associates and ADP (Automatic Data Processing)
completed an implementation on the Hewlett-Packard 3000 computer. The
system was put on the shelf and never used; it was sought by ADP solely as a
bargaining chip in negotiations with Microdata Corporation.
1982: Pick & Associates changed its name to Pick Systems, Inc. About
that time, melodramatic power struggles began within the firm, starting a
“revolving door” policy. Maintaining good people at Pick Systems, Inc. has
traditionally been the firm’s biggest shortcoming and, consequently, the
system’s shortcoming as well.
1982: Court actions between Pick Systems and Microdata were re-
solved; nobody won. Pick got one dollar; Microdata got a paid-up license (and
got gobbled up by the giant McDonnell-Douglas Corporation). Pick Systems,
Inc. now had a free hand, and implementations on various computers began.
Licenses were established for the following companies:
Altos—ACS 8600
ADDS—Mentor 3000, 5000
Systems Management, Inc.—IBM CS 9000 and PICK-370 under VM
Datamedia—932 (first system based on Motorola’s MC68000)
General Automation—Zebra Series (also MC68000)
Pertec Computer Corporation—Sabre Series (included the first “shell”
for the PICK System, a unique enhancement that seemed to drive its
owners bankrupt)
1983: By now, most implementations begun in 1982 were ready for the
market, while several important new offshore licenses were signed. The new
licensees included:
Itoh, this implementation was distributed by, and nearly owned by, a
Southern California company known as CIE.
1983: PICK Systems announced the PICK System for the popular IBM PC
XT. This was the first and only true multiuser system for this popular personal
computer—the potential was staggering. Not surprisingly, Pick Systems, Inc.
decided to market the system itself. Not surprisingly, the other PICK licensees
resented the competition. Not surprisingly, the traditional DP market continued to
ignore the tumultuous PICK community. Surprisingly, Pick Systems, Inc. still
made a lot of money on the XT and later AT implementations. Years later, it would
be said that the decision to keep the personal computer versions in-house saved the
firm from extinction.
1984: Pick Systems, Inc. announced price reductions on the PICK System
for the IBM PC XT, in an effort to penetrate the popular market and compete with
an emulation known as Revelation. Revelation was an unauthorized system
designed to look and act like PICK, developed by a company named COSMOS.
REV was a database management system that faithfully imitated PICK-type
processing while running in MS-DOS in much the same manner as the original
GIM ran on the IBM 360. Despite inefficiencies, Revelation included a report
generator (R/LIST), a screen generator (R/DESIGN), and a programming language
known as R/BA- SIC. It offered some of the advantages of PICK to personal
computer users, without the esotérica of the little-known PICK System. Within a
year, single-user REV outsold the true PICK multiuser system nearly five to one.
When Pick sued, COSMOS settled and bought a license. The competition was then
more balanced, with Pick Systems, Inc. getting its piece of the market on both
sides. However, as most Revelation users grew to multiuser size, COSMOS sold
the company.
1985: Fujitsu MicroSystems of America, another major player attempting to
differentiate its computer products in the U.S., became a PICK licensee. The
company would soon lead in the area of networking PICK with MS-DOS
computers.
1986: Nixdorf Computer Corporation became a PICK licensee for its
version of VM; however, Nixdorf quietly put it on the shelf, perhaps because of its
inconsistent performance. As of this writing, the implementation is not actively
marketed in the United States.
1987: PICK Systems delivered initial versions of Open Architecture, a new
PICK System with significant enhancements. These included unlimited record
sizes, an extraordinary full screen editor, and various technical improvements. It
also included another repressive pricing arrangement. OA received a less-than-
enthusiastic reception by even PICK users and manufacturers. Pick Systems, Inc.,
however, decided to sell no more wine after its time; all new licenses were for
Open Architecture only.
About this time, a manufacturer/licensee group known as SMA sprang into
existence, to bring about standardization for all PICK Systems. It is interesting to
observe that their proposed standards would have effectively nullified the new
Open Architecture features. Nonetheless, by 1987 there were over a dozen
licensees for OA versions 1 and 2.
1986: Recognition of the PICK System by UNIX resellers occurred
with another unauthorized emulation. A company in Massachusetts
named V-Mark announced Uni-verse. This was another flattering imita-
9
Chapter
1
tion of PICK, this time running as a process on UNIX. Uni-verse offered a
bridge for the PICK user to the UNIX world, while providing some relief
from the distressing lack of software there. The Pick lawsuit resulted in a
settlement through which Dick himself became a stockholder in V-Mark,
continuing the precedent of his overriding claim to all PICK-type process-
ing. The settlement marked the beginning of an uneasy detente between
the legions of PICK and the daemons of UNIX.
1988: Pick Systems, Inc. delivered the IBM PC AT version of the
system for the Intel 80286 processing chip. This added all Intel-based per-
sonal computers and compatibles to the implementation list. Once again,
this implementation was and is still sold solely by Pick Systems, Inc. Once
again, the company made and is still making a lot of money. The system is
priced under $1,000 and appears to be positioned to satisfy the swelling
demand for a true multiuser system on the powerful 80286 and 80386
microcomputers. But the PICK System is an exceptional transaction proc-
essor; it doesn’t support the graphics necessary for the Flight Simulator
game, and “all bread and no fireworks” seems to have little appeal in the
microcomputer marketplace. Yet the issue remains clear: PICK is the
most functional multiuser business system for any MS-DOS
microcomputer in the business world.
1987: In the mini and supermini market, the marriage of PICK with
UNIX became a trend. Several other manufacturers got on the band-
wagon, implementing versions of the PICK System under UNIX. Notable
among these new licensees were Sequoia, Toltec, and a triple-switch-hitter
named ICON, which ran PICK, UNIX, and MS-DOS all at the same time.
The PICK/UNIX synergy appeared to be a classic blend of software func-
tionality and hardware capability; great hopes were pinned on the antici-
pated market response.
1987: Dick Pick himself threw off technician’s garb and entered the
game. In a widely praised and well-timed campaign, Pick Systems, Inc.
began national advertising with demonstrations at the annual data pro-
cessing conventions. At the same time Dick Pick embarked on a round-
the-world tour to promote his new Open Architecture system. Today,
Dick’s charm and candor make new friends, while the SMA group of
licensees continue to discuss standardization among themselves and criti-
cize Dick Pick in the press.
As of this writing, the drama continues. It cannot be overlooked
that the PICK System has been successfully satisfying business needs for
nearly two decades. There must be something special inside, and that’s
what the rest of this book is about—the special PICK approach to
processing data.
1
0
Introduction to PICK
surface, equipped with tools for the novice and experienced visitor. But
beneath the surface are distinct levels, each with special processes designed for
the users and technicians who work there. There are even processes for
moving between the levels and into the core of the PICK System, where a
powerful nucleus of virtual memory management software exists.
The nucleus is called the ABS. It silently supports all of the various
levels, as well as scores of application systems spinning along on the surface.
At any moment, dozens of users can work simultaneously, each with his own
view of the system, like personal computing within a multiuser system.
Processes within Any good tour begins with an orientation. In practice, the PICK world Processes
behaves as if it is structured in layers. The user is positioned at a CRT screen, which acts as a
window to the TCL “surface” at all times. When the user keys a command, the command seems to
penetrate the surface and activate processes in a level below (see figure 1-2). The result, as well as
all messages regarding the process, is displayed on the surface where the user is watching.
1
1
Chapter
1
Figure 1-2 The PICK System has “depth” in its integrated processes.
The first level of the PICK world is called TCL, or the Terminal
Control Level. It is here that the user enters the commands that are valid
for his or her particular environment, or “view” of the PICK world. Some
of these commands may be report commands, such as LIST or SORT;
these commands work just beneath the surface, in the ACCESS level.
ACCESS commands activate processes that reach down into the
DATABASE level and construct the user’s “view” of the data. The result
is displayed at the surface on the CRT screen, or sent off to the satellite
process called the SPOOLER for one of the printers controlled by the
system. In this way, the user is relieved of the administration of the
printing facilities, and allowed to continue his or her session without
regard for the printing hardware.
In the PICK world, a user can create personal processes by storing a
series of keystrokes as a PROCedure. The procedure is activated by
typing the name of the PROC at TCL. This causes the system to execute
the procedure. PROCs are typically used to display menus at TCL,
activate processes on the ACCESS level, or start lower-level BASIC
processes.
Between PROC and BASIC is the DATABASE level. Here all of the
system’s information, user programs, PROCs, and even commands are
neatly stored in files and dictionaries, along with a set of pointers that
show the system exactly where everything is located. In practice, it is like
an automated library, with vast corridors of information arranged and
maintained by silent processes from deep within the system.
The BASIC level is a completely new world. Here it is possible to
view the data stores from beneath the dictionaries, and manipulate the
Introduction to PICK
data as pure values. BASIC processes retrieve the data and present it in
any way imaginable, with intrinsic database capabilities further
augmented by all of the ACCESS commands.
The lowest user level of the PICK world is the ASSEMBLY level.
Here processes directly control peripherals such as printers, tape drives,
communication ports, and graphics devices. PICK assembly language
programs are very powerful, and can reach into the core as well to shape
the way in which PICK itself operates.
The core of the PICK world is called the ABSolute Code, or ABS.
This is a large library of PICK assembly language code designed to per-
form all of the tasks required of a multiuser, multitasking system. These
routines are the tools of a small program that runs continuously at the
heart of the system. This program, known as the Monitor, maintains the
PICK world. It is written in the language of the computer hardware and is
the center of the ABS, maintaining continuous communication between the
real hardware and all of the logical levels above.
In the next few chapters you’ll learn how to get around in the PICK
world. We begin by discussing the terminology. Then we take you on a
guided tour through several chapters of tutorials. In chapter 9 we discuss
the nucleus and how it works. In chapters 10 and 11 we discuss what you
can do with such a system, and in chapter 12 we speculate on where the
PICK world is headed. Before you leave, you’ll want to shop in the appen-
dixes for mementos of your visit.
So, let’s learn a few words of the language.
The View from the When a user logs on, the PICK System locates the user’s account by locat-
Surface ing the appropriate Master Dictionary, or MD. The user’s Master Dictionary contains,
among other things, items that enable the system to locate the dictionaries of the account’s data
files. These dictionary files contain items that describe the data items contained in the data file.
Every item in the PICK environment—whether in a data file, dic-
tionary, Master Dictionary, or SYSTEM file—is composed of separate
fields called attributes. These attributes can be converted, combined, asso-
ciated, or translated according to the specifications recorded in the data
file’s dictionary. Furthermore, an attribute can contain separate and inde-
pendent values, which can have separate and independent subvalues.
Items, attributes, values, and subvalues are delimited by special
characters recognized by all PICK System processes. These delimiters allow
the PICK System to perform all data storage, retrieval, and conversion
automatically, without the user necessarily being aware of any of the above
components.
Figure 1-3 shows an alternative way of looking at the PICK world.
Within the PICK world there are separate areas or “accounts” in which the
user works, which might be thought of as buildings on the PICK surface.
Within each building are file rooms that contain the data. There is a
directory of the rooms within each building, called the Master Dictionary.
You’ll discover many other things there as well. For now, think of the Mas-
ter Dictionary as the directory of all file rooms in the account building.
1
3
Chapter
1
ACCOUNT FILE ROOMS
Figure 1-3 The PICK world has separate locations where users work.
These rooms represent PICK files, and each room is actually two
rooms. The first room is called a dictionary', it is where you go when you
request data to be retrieved. The dictionary room contains descriptions of
the data to be found in the data file room. The dictionary makes it possible
to ask for a particular piece of data by its defined name, while the second
room actually contains the dozens or hundreds or even thousands of data
items.
Each data item can be thought of as a folder, as shown in figure 1-4.
Each folder has a unique name, called an item-id, which is a string of letters
and/or numbers in any combination.
Figure 1-4 A PICK “item” can be much more than a simple record.
1
4
Introduction to PICK
The items in the outer room, the dictionary file, tell how to read and
display each sheet or attribute in the folder/item. For example, the dictionary
may indicate that the value in a particular attribute is to be converted into
uppercase letters. Or perhaps all of the values in an attribute— such as dates or
times—are to be converted into a particular format. Maybe the dictionary item
will define the attribute as a formula, using the values in a calculation. The
values in an attribute could even be “translated” through other folders in other
rooms, to produce a consistent new value every time the data is referenced.
This special conversion and correlation processing prepares the user’s view
of the data attributes. Since the conversion or correlation specification is always
stored in a consistent way in the data file’s dictionary, the work is performed
automatically whenever the user requests data via the dictionary. The user sees
only the proper information, converted, correlated, translated, or perhaps all
three, whenever the folder/item is displayed.
These are the working definitions for file, dictionary, item, attribute,
value, subvalue, conversion, and correlation in the PICK world. Sometimes it
can seem like magic. But no matter how you look at the process, the PICK
System performs this magic in the blink of an eye . . . because the PICK “world”
was precisely structured to perform in this manner.
1
5
Getting Around in the
PICK World
One of the more unique aspects of the PICK world is its internal architec-
ture. The system stores its structure as data within the database. This ele-
gant application of the PICK item allows the system to navigate itself by
using the same logic with which it accesses and manipulates data for the
user. As a result PICK is unusually efficient and flexible, servicing
multiple users in computers that are limited for even one person under
any other system.
The Pointer System: Pointers show the PICK system the way to find and retrieve information
The PICK Roadmap in the database level. They might be considered the roadmap of the PICK
world. Whenever the user calls for something to be delivered (like a
pizza), the pointers are used, but the actual process is invisible to the user
(just as the pizza delivery route is not apparent, only the result). The difference is that the PICK
system delivers the goods “hot.” The file pointer system is created by and used exclusively by the
1
7
Chapter
1
system, which can connect the pointers and make the access in a fraction of a second.
Although all PICK files are actually data files, the pointer system
maintains four levels of files, as shown in figure 2-1. The topmost
category, SYSTEM, contains pointer items to those files that are shared
by all users. Most of the files in this category are all but invisible to users,
because they are used almost exclusively by the PICK System. The most
notable of the files in this category is appropriately named the SYSTEM
file.
The SYSTEM file contains items that point to account Master Dic-
tionaries, or MDs. These items are stored under an item-id, which is the
logon-id that the system will recognize. Here is how it works.
When the system prompts with Logon Please, a logon program is
running in a loop. The user keys in a logon-id. The program looks in the
SYSTEM file for what has been keyed. When it finds an item that exactly
matches the item-id the user has keyed, the program uses that item to
point the TCL program to the appropriate Master Dictionary. The user
appears to have been let in and deposited on the PICK surface with his or
her own MD of commands and files.
The Master Dictionaries belong to the ACCOUNT category of files
in the system. They are files reserved for items that define the commands
that the user can use and that the system will recognize. Also stored in
this file are the pointers, or file-defining items, that point to the third
category of files, known as the file dictionaries.
Each dictionary contains attribute-defining items, which define the
fields or attributes to be found in the data files. These are optional and
are created by the user. However, there is always one item in the
dictionary that points to the data file. This pointer, or file-defining item, is
the last link in the chain by which the PICK System can always locate a
file.
When a file is requested, the system looks first in the Master Diction-
1
8
Getting Around
ary. There is found the dictionary pointer, which the system uses to locate the
data file pointer. The system uses this item to locate the beginning of the data
file.
By being embedded in the data files, the pointer items are used exclu-
sively by the system to access the files. Special techniques used to make the
accessing method efficient thereby benefit the entire system. One of the most
remarkable things about the PICK System is that it is capable of supporting
multiple users, all simultaneously accessing files, in the amount of real mem-
ory found in a good watch. There are systems in use today with as many as
eight users working interactively in only 64K of RAM, while one of the first
PICK computers actually supported four interactive users in only 16K.
Things That Go Pointers exist as data items all over the system, and it is likely that the user Bump
in the MD will bump into them from time to time. Let’s examine these special items more closely,
beginning with those found in the Master Dictionary.
All file-defining items have thirteen attributes, which are listed below
and explained in the next section.
000 Filename. The name of the file is the item-id of a file-defining item
in the Master Dictionary.
001 D/CODE, usually a D. Special backup handling is available for files
with a DC, DY, or DX here.
002 Base FID—the first frame or group of frames reserved for the file.
003 Modulo—the number of frames (or groups) of data items in the
file.
004 Separation—the number of frames per group, normally 1.
005 Retrieval Code. This is a security code providing read only access
to the file.
006 Update Code—a security code providing read/write protection to a
file.
007 Not used in Master Dictionary or data level file-defining items; this
field is used only in the SYSTEM file.
008 Also not used in file-defining items; used only in the SYSTEM file.
009 Justification—defines how item-ids are to be presented. May be L,
R, T, or U, for Left, Right, Text, and an optional format called
Unconditional Left.
010 Column Width. Simply indicates the width of the report column
that contains the data file item-ids on output.
011 Once contained the minimum column width of the report column
containing the data file item-ids; no longer used in any known PICK
System.
012 Unused
1
9
Chapter
1
013 Reallocation parameters called “modulo and separation”; if
present here, these parameters are used if the file is restored
from magnetic media such as tape or disk
Let’s examine the format and this new terminology in more detail.
2
0
Getting Around
The fifth and sixth attributes of the file-defining item are optional security
codes. If the file-defining item has a value in the fifth attribute, then a user
must have the same value in the fifth attribute of his or her logon item in the
SYSTEM file, in order to access the file. This fifth attribute is called the Lock
Retrieval Code in both the file-defining item and the logon item. If the file-
defining item has a value in the sixth attribute, a matching Lock Update Code
attribute in the logon item is required to update or change the file. These
security features apply equally to all PICK System levels, including BASIC
programs.
The seventh and eighth attributes are used only in a file-defining item located
in the SYSTEM file, in pointers to account Master Dictionaries. Here the
seventh attribute is used to store an encryption of an optional password for
the account defined by the item. A PASSWORD command is usually stored in
the SYSPROG account Master Dictionary for altering a user’s password.
Likewise, the eighth attribute is usually not used in Master Dictionary
and dictionary file-defining items. It is used, however, in the SYSTEM file, for
storing the privilege level of the user. The privilege level automatically restricts
a user’s ability to execute certain PICK commands. There are three privilege
levels in the standard PICK System.
SYSO System Privilege 0 (zero). This is the lowest privilege level.
Users with this privilege level are limited to simple TCL
processes and the application software. They are barred from
creating or changing items in their Master Dictionaries, from
activating the tape drives or disk drives, or any
2
1
Chapter
1
The ninth and tenth attributes of file-defining items are used only for for-
matting reports on the contents of files. Attribute 9 controls the justifica-
tion, and attribute 10 dictates the width of the column that contains the
data item-ids whenever the file is listed on the screen or printer. The alter-
native entries into the ninth file pointer attribute are:
L Left-justify the column of output (the default value placed in the
file pointer by the CREATE-FILE command).
R Right-justify the column of item-ids.
T Text-justify. This code is typically not used in file-defining items,
where it would refer to the output of item-ids. It indicates that
the output data should be split on a blank rather than in the
middle of a word, and item-ids should never contain blanks.
Getting Around
The last attribute in a file-defining item, attribute 13, is used by the PICK
System backup and restore processes. Highly active files in a PICK System
link together a number of scattered frames. This is not particularly serious
unless the linked frames are widely separated on the physical disk surface.
In this case, any processing that involves all the items in a file will be notic-
ably slower. The FILE-STATS report produced by the save process can be
used to confirm this condition. Fragmented PICK files should be deleted
and collectively restored from tape. Periodically restoring from backup
tapes improves system performance and provides early warning when a
backup tape is bad.
A widely used program is available to calculate new file parameters.
During the backup process, the program calculates a new parameter for
every file with a D or DC code in the first attribute of the file-defining item,
and stores these parameters in attribute 13 of that item. When the file is
restored, the PICK System automatically uses the new parameter to re-
allocate the file.
File-defining items are created by the CREATE-FILE verb and used
as a kind of road map of the database. Users can, however, create short cuts
of their own with file-defining items called Q-pointers.
The Secret Routes: Any tour of file-defining items would not be complete without discussing Q-
Pointers one of the secrets of the PICK world. Experienced PICK users often speak of the Q-
pointer. This is a Master Dictionary file-defining item that does not contain a D in the first
attribute, nor does it contain a frame-id. Instead, it has a Q, which marks it as a synonym that
merely points to a real
2
3
Chapter
1
file-defining item, and can provide a user with access to a file that is located in another user
account.
A Q-pointer item in a Master Dictionary has the following format:
000 Alternate Filename. This will become the new name of the file.
001 Q in place of the normal D, DC, DX, or DY code.
002 Account name where the file actually resides.
003 Filename of the real file that is being accessed.
004 Unused; should be null.
005 Optional Retrieval Security code.
006 Optional Update Security code.
007 Unused
008 Unused
009 Justification of item-ids on output reports (optional).
010 Column width for item-ids (optional).
Oil Unused
012 Unused
013 Unused
Occasionally a Q-pointer is used to point to a file within the same
user account, to establish a different name for the file. More often, it is
used to point to a file located in another account, whose file-defining item
is located in that account’s MD. Q-pointers are special file pointers that
allow the PICK System to provide access to files outside the user’s ac-
count. They make it possible to add a file to a user’s “view” of the system,
without duplicating any of the data.
It is important to note that security features still apply to Q-
pointers. In order for a Q-pointer to function, the user must have the
appropriate privilege level and Retrieval/Update codes, or the access will
fail with the following message: [210] FILE (filename) IS ACCESS
PROTECTED.
ITEM-ID ATTRIBUTE 0
ATTRIBUTE 1
ATTRIBUTE 2 ATTRIBUTE 3
Figure 2-2 The item has a logical view (ours) and a physical view seen
only by the system itself.
2
5
Chapter
1
ASCII
Code
Hexadecimal Symbol Name and Function
254 FE A
Attribute mark. Used to indicate the end of
the previous attribute and the beginning of
the next. Its ASCII representation looks like
a A character, which is usually called a
“caret” or “wedge up.” Although commonly
used for ASCII 94, the caret is also used by
the PICK System to represent ASCII 254.
253 FD 1 Value mark. Used to separate logical subdi-
visions of an attribute. Its representation is
usually the ], or right square bracket.
252 FC \
Subvalue mark. The special character used to
separate logical subdivisions of a value. Its
symbol is the backslash.
255 FF Segment mark. Used to mark the end of an
— item. Usually represented by the underscore
character.
Item Storage: Items are stored with a unique item-id, which is a string of characters em-
“Look Ma, bedded in the data itself. Yet this string is all that is needed for the PICK No
Keys” System to locate the item. By using a unique item-id, the system requires no record
keys or index files for retrieval.
The PICK System stores items within groups. An item’s group is
determined by a special mathematical formula called a hashing algorithm.
The PICK System passes the item-id through the hashing algorithm to de-
termine the appropriate group for the item. Then, the system determines
the location of the group, relative to the beginning of a file (the Base-FID).
The formula for the hashing algorithm is stored deep within the PICK
System, and reportedly works as follows:
Each character in the item-id is converted to a number in a format
known as binary. Each binary number is added to the next number in se-
quence, with the sum being multiplied by 10 at each addition. The
resulting
2
6
Getting Around
A similar process is performed when the system retrieves an item. First the system uses the item-id
Item Accessing: in the hashing algorithm to locate the item’s group, then each frame in the
“Just the Id, group is paged into memory and examined, until the requested item has been
Ma’am” found. The PICK System uses special memory mapping techniques and
dedicated address registers for efficiency, and in some cases the system
actually gets faster as more items are retrieved.
The importance of this approach cannot be overemphasized. It is a
fundamental feature of the PICK database. The PICK System provides
essentially unlimited storage capacity without the use of indexes or record
numbering of any kind. All disk storage is virtual, dynamic, and readily
accessible by the name of the data element. This characteristic sets the PICK
System apart as a highly optimized database system to its very core: a
“virtual machine.”
The same applies to accessing the attributes within items. Now that you
know how the file-defining items and item-ids tell the PICK System “where
everything is,” we’ll discuss the attribute-defining items that tell PICK “what
everything means.”
What They Are The ability to locate items by item-id is only one aspect of data retrieval. Most of
the time, an item or set of items is accessed by one or more attributes of the
data. Within the PICK System, such access is handled by means of the
dictionaries, where attribute-defining items are stored. An illustration of the
relationships of dictionaries and their data files is shown in figure 2-4.
An attribute-defining item, as the name implies, is an item that contains
information about one of the attributes in the data file. These defin-
2
7
Chapter
1
THIS ITEM
POINTS TO
DATA FILE;
USED FOR
FILE
ACCESS
Figure 2-4 The dictionary is the outer room; the data file is the inner room,
where the data is actually stored.
ing items are found in the dictionary of a file and have the following
format:
000 Attribute name. This is the name that is used to refer to the
particular data item attribute.
001 Attribute definition type: A—Attribute definition S—Synonym
attribute definition X—Protected attribute (not widely used
these days)
002 Attribute Mark Count (AMC), or position of the attribute
within the item. Note that an AMC of 0 (zero) is valid and
refers to the item-id. Furthermore, an AMC of 9999 auto-
matically refers to the actual size of the item in bytes on most
PICK System implementations.
003 Optional column header on output reports containing this
attribute.
004 Associative Specification. Defines a multivalued attribute, which
is always to be “associated” with another attribute within the
data item, such as a series of purchase dates associated with a
series of quantities purchased.
005 Unused; thought to be reserved for an attribute-level security
code for restricting retrieval.
006 Unused; similarly the site for an attribute-update restriction code.
007 Conversion; a reformatting of the attribute value or values to be
performed after the selection and sort of the item.
2
8
Getting Around
Dynamic Indexing As discussed earlier in this chapter (The PICK Files), file-defining items that are
used by the virtual memory management software in PICK are created
automatically by the CREATE-FILE command. However, attribute-
defining items are created by the user with the system’s Editor. They are
not actually required by the PICK System.
Attribute-defining items are optional because the use of data by its
name is optional. The PICK System supports flat files, in which the dic-
tionary contains nothing but the pointer item to the data file. These files,
however, must be read sequentially or indexes must be created and main-
tained by the user, just as in other computer systems such as UNIX, MS-
DOS, or MVS and their database managers, such as ORACLE, dBASE, or
IMS.
PICK files with attribute-defining items, on the other hand, are
indexed by the PICK System whenever requested, and there is no
requirement for maintaining index files solely to provide access to data.
PICK’S unique scheme for data access is described by its developers
as a “hashed open bucket” access method, which groups items according
to their unique item names. The PICK accessing method should not be
confused with an index-imposed accessing scheme such as an Indexed Se-
quential Accessing Method (ISAM) or KSAM, or even VSAM. These ap-
2
9
Chapter
1
proaches require index files between data files, with data records in the
index file that point to data records in the data file. But such indexes are
created by the user application and therefore must be maintained. In any
active system, the index file is constantly vulnerable to error; such files
are always redundant (repeating data that is stored elsewhere in the
system) and are therefore susceptible to being incorrect in one place or
the other.
Dynamic indexing is an intrinsic function of the PICK System’s AC-
CESS selection feature. The ACCESS processes allow the user to select
items in a file by any combination of characteristics in any attribute. The
selection criteria can be as complex as necessary, allowing the user to
select items IF this or WITH that. Furthermore, ACCESS allows the use
of logical attributes as selection criteria. These are attributes that are
created only when the file is accessed—such as the product of multiplying
two real attributes, or the translation of an attribute through another file.
The result is a virtual indexing scheme that uses the data itself as index,
and can be relied upon for accuracy.
That completes our orientation to the PICK relational database.
Data is not actually stored in the PICK System; it is “held.” PICK is like
an automated warehouse of data, silently maintained and cross-refer-
enced by the system itself, and designed to support the user’s retrieval
processes up on the surface of the PICK world. We’ve discussed it from
examples and diagrams . . . now it’s time to land on the PICK world and
try it out.
3
0
The User Processes: TCL
Account Names Since it is likely that you do not have your own account name/user ID yet, we
will use the SYSPROG account for this explanation. The SYSPROG
account is provided with all PICK systems and is the account used for
most maintenance functions. We’ll talk about creating your own account
later in this chapter.
At the LOGON prompt, enter SYSPROG, followed by a <cr>. All
characters in the word SYSPROG must be uppercase.
You may be prompted for a password. If so, obtain the password and
enter it where prompted, followed by a <cr>. The password does not
appear on the screen as it is being entered. Here’s what the display
typically looks like when a password is requested:
A message appears, indicating the time of day that you are logging
on, and the (TCL) prompt character > appears on the leftmost column of
the screen. This character indicates that you are at the Terminal Control
Language, or TCL, the point from which all operations begin.
Note that the actual text of the “welcome” message may vary. This is
typically customized by each licensee and, subsequently, each user to suit
individual taste and marketing needs.
Prompt Characters The first thing that appears on the screen after logging on is usually the prompt
character. There are several prompt characters to become familiar with
while using the PICK System. The prompt characters are listed in table 3-
1.
Correcting Entry Commands must be entered in uppercase characters, with the exception of
Errors the Editor process. (Note that some new versions of PICK are “case insensitive,” meaning
that commands may be entered in either upper- or lowercase characters. Consult your manuals.)
If an error is made while entering a command, simply use the Backspace key to back up to where
the mistake was made. You may then correct the error prior to pressing the carriage return,
which submits your input to the system for processing.
3
3
Chapter
1
Table 3-1 Prompt characters in the PICK System
Prompt Character Meaning
★ PICK/BASIC Debugger
! System Debugger
Special Control Several special control characters alter the way TCL works. These charac-
Characters ters are shown in table 3-2.
<ctl-X>
Cancels the current input line and returns control to TCL. Also used at
the end of a page on any multipage display to return control directly to
TCL. Test this by typing in your name, followed by a <ctl-X>.
<ctl-W>
Backspaces one word (to the previous space) in a TCL command.
This may be tested by entering a short sentence then pressing < ctl-
W> until you “back up” to the > prompt character.
<ctl-R>
Retypes the current line. This is used to determine if the TCL input
line contains nonprintable (control) characters. If it does, the best bet
is to cancel the command with a <ctl-X> and start over. This is not to
be confused with a TCL command stack, which provides the ability to
retrieve and optionally re-execute previous TCL commands. While
the “generic” version of PICK does not provide a command stack, it is
easily implemented with a PICK/BASIC program.
<ctl-H> Backspaces one character. May be used in place of the Backspace
key.
<ctl-J> Performs a linefeed.
3
4
The User Processes:
TCL
Cursor Control Most terminals are provided with keys that are labeled with direction control
(“Arrow” Keys) arrows. In some application software packages, these keys may move the cursor
up, down, left, or right. In the PICK System, they are usually ignored. This
should not be understated. As an experiment, type your name at the TCL
command prompt:
>your name
Now press the left arrow key several times. If it moves to the left and
wipes out the character, then it is, in fact, a legitimate backspace and may be
used interchangeably with the Backspace key. If it moves left and does not wipe
out the character as it moves past, then it is not a “destructive” backspace.
What’s more, the terminal has probably sent a sequence of control characters to
the system, which is not good when entering data. Moral to this story: Use the
Backspace key, or a <ctl-H>. After testing this, and before pressing a <cr>,
issue a <ctl-X> to cancel this command and return to TCL.
Type-Ahead Buffers Most PICK systems provide a feature referred to as type-ahead buffers. This
feature allows characters to be entered while the system is currently working on
another process. For example, if you are performing a file SORT or SELECT,
you may “type ahead” the command that you want issued upon completion of
this current process.
The characters that you enter as subsequent commands or responses to
prompts are not displayed on the screen as they are entered. They will be
displayed when they are retrieved and executed by the system. Type-ahead
buffers vary in size according to the machine, and range in size from 16 to 128
characters.
If you have an entry in your type-ahead buffer and you break into either
the PICK/BASIC or the System Debugger, the type-ahead buffer is cleared and
reset to empty.
Suspending Online
The Break key generates a signal telling the system to suspend whatever
Program Execution
process is currently in effect. The <ctl> or Shift key may be required in
conjunction with the Break key on some terminals. Depending on exactly what
is happening when the Break key is pressed, an “interrupt” is generated and a
prompt character is displayed (either ! or *).
When either of these prompt characters appears on the screen, it is
referred to as being “in the debugger.” The only difference is which debugger;
the ! prompt character indicates the System (Assembly) Debugger and the *
prompt character indicates the PICK/BASIC Debugger.
There are two ways to get into the debugger. One is voluntarily. This
happens when you press the Break key. The second way into the debugger is
through some type of program abort, for example, trying to write to a diskette
that is still in its jacket. This usually provides a cryptic message such as
CROSSING FRAME LIMIT or REFERENCING ILLEGAL FRAME or, the
worst message of all, GROUP FORMAT ERROR. This message is not unlike
3
5
Chapter
1
shouting “FIRE!” in a crowded movie theater; it signals the fact that big trouble
is imminent. A whole book could be devoted to the discussion of these aborts,
but for now, just learn the standard responses to either of the debugger prompt
characters.
If you respond to either of the debugger prompt characters with END<cr>, the
Terminating a Process system terminates whatever process was in effect and returns to TCL. Here is a
sample of “ending” out of the system debugger:
break
16.178
!END<cr>
>
Logging Off through If you wish to go to the Logon Please screen, thereby logging off from this
the Debugger account, you may enter OFF <cr>, as in the following example. This is
generally used as a last resort to escape from someplace where you should
probably not have ventured.
break
16.178
!OFF<cr>
Logon Please
Control returns to the Logon Please screen, where you may enter your
user ID (account name).
Resuming a Process If you voluntarily enter the debugger, meaning that you simply press the Break
key, you may enter a 6<cr>, which tells the system to “Go” or resume
execution of whatever process was being executed. For example:
break
I 6.178
! 6<cr>
Note that if your terminal has a Linefeed key, it does the same thing as a G<cr>
in either debugger.
In all three examples of responding to the break, I 6.178 was displayed
on the line immediately before the ! prompt character. This line is called the
interrupt or execution address. This indicates the actual disk address of the code
being executed from the operating system. For instance, in this example, the 6
refers to ABS (See chapter 9) frame 6, which contains the code to handle
terminal input and output. The 178 refers to the
displacement into the frame, meaning the number of bytes (in hexadeci-
mal) from the beginning of the frame (in this case, frame 6) of the actual
3
6
The User Processes:
TCL
instruction being executed. Aren’t you glad you now know what this
means? The important thing to remember is that each time you break, you
are likely to get a different interrupt address.
The OFF It is suggested that you send the process back to the Logon Please screen
Command when you are done with the system. This prevents anyone else from inad-
vertently accessing or updating your files. To terminate the session, enter the OFF
command from TCL.
>OFF<cr>
< CONNECT TIME x MINS.; CPU x UNITS; LPTR PAGES x >
< LOGGED OFF AT 12:02:00 ON 12 DEC 1996 >
Logon Please
Note: If you just logged off, please log back on and catch up with the
group.
TCL Commands
Just like stocks, bonds, and magic spells, there are different classes of
TCL verbs. The first are TCL-I (“Tickle One”) commands. These
typically require only one word to be typed at the TCL prompt, followed
by a <cr>. Some of these TCL-I commands are trivial, such as displaying
the TIME or reminding one’s self WHO one is. Others are decidedly
nontrivial, such as VERIFY SYSTEM or CREATE-FILE. Here are a few
examples, along with an explanation of how they are used. Appendix C
contains a detailed explanation of how TCL verbs function.
TCL-I Verbs This class of command typically requires only the command followed by a
carriage return. However, in some cases, other data may be entered with a
TCL-I command. The only common denominator in TCL-I commands is
that a filename and an item-id specification are not required. Several sam-
ple TCL-I commands are provided in the following example.
>TIME<cr>
12:00:00 12 DEC 1996
>WHO<cr>
0 SYSPROG
3
7
Chapter
1
The TIME command displays the current system time and date on
the CRT. The WHO command displays the current port number and ac-
count name.
TCL-II Verbs A second class of TCL commands is known as TCL-II verbs. These com- and
Files mands typically act upon or with data that is in a user file or file dictionary.
Consequently, TCL-II verbs usually require a filename and a list of one
or more item-ids to process. In some cases, if the user does not enter what
the PICK System requires, TCL politely prompts for the missing
specifications.
The Calculator The first of these are the Calculator function commands. Although they
Function are not used very often, these commands are easy to use and occasionally
Commands very handy. The ADDD command adds two integer numbers:
>ADDD 15 15<cr>
30
The DIVD command divides the first integer number by the second
integer number.
>DIVD 39 4<cr>
93
>MULD 15 15<cr>
225
The SUED command subtracts the second integer number from the
first integer number.
>SUBD 65 37<cr>
28
3
8
The User Processes:
TCL
The LIST The next group of fundamental TCL commands contains the LIST com-
Commands mands, which provide information on the PICK System itself. Many of these
LIST commands allow you to direct output to the system printer. These commands are
illustrated in the default form and with the LPTR modifier used to send it to the printer.
Remember, use <ctl-X> to get out of a multipage display and back to TCL.
The LISTFILES command displays all of the file pointers from the current
account.
>LISTFILES<cr>
ERRMSG D 6319 1 1
FUNCKEYS D 5666 1 1
KEYBOARDS D 5604 1 1
NEWAC D 6399 1 1
PSYM D 5543 1 1
STAT-FILE D 5624 11 1
★★★
BP DC 5674 5 1
POINTER-FILE DC 5532 11 1
cont.
3
9
Chapter
1
SYSPROG-PL DC 6224 1 1
★ ★★
★★★
'k'k'k
The listing in example 3-1 was provided from the “generic” version of
PICK on the IBM PC AT, running what is commonly called Release R83.
Some files in the listing may not be on your account. That’s normal.
Licensees tend to add, move, or delete a few files to suit their own needs.
The following section discusses the “standard” PICK files, those provided
with every version of PICK. Those that are implementation specific are
noted.
The CURSOR File This file is unique to the PC version of the PICK.
It’s provided as part of a routine that allows users to define new terminal
types for use with the TERM command (discussed in chapter 8).
The DOC File This file is also unique to the PC version of the PICK.
It provides some additional documentation on new features and changes
added or made after the manuals were printed.
The ERRMSG File This file contains the text of most of the error
messages that the system produces.
The PSYMFile This file is called the Permanent SYMbol table. It is used
by the Symbolic Debugger to allow the user to refer to disk locations in the
user’s PCB and to process workspace areas by their respective names, rather
than their logical addresses. It would take a few hundred pages to adequately
explain the intricacies of this file, so just rest comfortably with the knowledge
that it will be a while before you need it.
The STAT-FILE This file is used to contain the statistics produced during
the ACCOUNT-SAVE and/or FILE-SAVE processes. It keeps track of
pertinent information on each file archived to magnetic media, including such
things as the name and number of the file, its base, modulo, and separation,
the number of items in the file, the total number of frames that the file
occupies, and the number of GFEs encountered in the file during the save. A
report on the data in the STAT-FILE is sometimes produced by the FILE-
SAVE or ACCOUNT-SAVE process itself, but may be produced manually
with the LIST-FILE-STATS command on the SYSPROG account.
The BP File While not every PICK System may have a BP file provided
by the licensee, you may still find one. It’s the common name for Basic
Program files. The PICK-on-the-PC version contains several useful programs
in the BP file. To review them, simply LIST BP at the > prompt. Usually, a
program can be activated by typing in its name at the TCL prompt; if that
doesn’t work, try the command: >RUN BP program name.
The ACC File This is called the Accounting history file. It is used to
record the time and date of each logon and the location of each terminal. Each
time a LISTU command is performed, the report that it
Virtually every TCL command or verb has its own set of options. An option is
usually a single character or sometimes several characters in combination that
modify the “normal” behavior of a command.
Perhaps the two most standard options in the PICK system are (P) for
Printer output and (N) for Nopage. Almost every command in the system
recognizes these two options.
For example, the previous TCL command we discussed was the
LISTFILES command. While it may be useful to look at this report on the
screen each time it is needed, it may also be useful to have a “hard” copy, or
printout. This may be accomplished as follows:
>LISTFILES (P)<cr>
or
>LISTFILES LPTR<cr>
4
2
The User Processes:
TCL
Note that the LPTR modifier is usually reserved for ACCESS commands and
some standard system PROCs. If the LPTR option does not work with the command,
try the (P) option; one or the other will normally work.
When any output is directed to the printer, it does not actually go directly to
the printer. Rather, it goes to the spooler, which subsequently directs the output to a
printer. Chapter 8 discusses the management of the spooler. Assuming that you have
a printer and it is ready (meaning, plugged in and “online”), the output from this
command should start printing about the same time that control returns to TCL.
The (N) (Nopage) directs the output continuously to the CRT screen without
waiting for a <cr> between each page of output. This is typically used when the
output to the CRT is being passed through to a slave printer attached to the auxiliary
port on the terminal. Otherwise, this option is pretty much unneeded.
The LISTVERBS command displays all of the verbs (commands) from the current
account.
>LISTVERBS<cr>
Example 3-2 shows an abbreviated form of the output from the LIST VERBS
command.
or
>LISTVERBS LPTR<cr>
The LISTU command provides a report showing who is currently using the
system. It displays the port number, account name, time, and date logged on,
and the locations of all users currently active on the system.
>LISTU<cr>
The CH# column indicates the port (channel) number. The asterisk (*) next to a
port number indicates “you are here.” The column labeled PCBF is the hexadecimal
address of the Primary Control Block for the port (don’t worry about this; you may
never need it). The NAME column indicates the account name being used. TIME and
DATE indicate the time and date when the account was logged on, and the
LOCATION column provides a reminder of where the terminal is physically located.
Make a note here that the “locations” are stored in the DICT (dictionary) level of the
ACC (Accounting History) file. The item-id for each location is the port number. Once
you have become proficient with the Editor, then you may use it to modify the existing
terminal locations.
Note: On some systems, the LISTUSERS command may be required instead of the
4
4
The User Processes:
TCL
LISTU command; on others it is an alternative method of displaying information
on current users.
The LISTCONN command displays all of the connectives (also called modifiers) from
the current account MD. Connectives are a special class of word used by the ACCESS
language. These are discussed in chapter 5. Following are sample uses of the
LISTCONN command:
>LISTCONN<cr>
>LISTCONN LPTR<cr>
>LISTCONN (P) <cr>
The LOGON Other terminals may be logged on from your terminal with the LOGON Command
command. This is accomplished by entering the command LOGON, followed by a <cr>. The prompt,
CHANNEL, NAME: will be displayed. Enter the port number and the account name in the form: port
number, account. If the account has a password, the form changes to port number, account, password. If
successful, the message LOGON SUCCESSFUL will appear on the CRT. Note that this verb is not
always provided to each account and therefore may have to be executed from the SYSPROG account.
4
5
Chapter
1
> LOGON <cr>
CHANNEL,NAME: 1,SYSPROG<cr> [533J LOGON SUCCESSFUL.
The number 533 indicates the item-id of the ERRMSG item that contains the
text for this message. If, after a minute or so, no message returns indicating
success at logging on this terminal, the user must break out of the process and
return control to TCL by entering END<cr>. (When the LOGON command
“hangs up” like this, it’s likely that there may be no terminal on the port. To
correct the problem, simply plug a CRT into the port.)
The LOGOFF
Command To log off or terminate a remote process on another terminal, the LOGOFF
command is entered followed by a <cr>. The system prompts for the line
number, at which point you enter the port number you wish to log off, followed
by a <cr>. The process will indicate successful completion if possible.
The MESSAGE Brief messages may be directed to other users currently logged on to the
Command system with the MESSAGE or MSG commands. The syntax for the message
command is the command MESSAGE or MSG, followed by one of several
possible routing indicators, which determines the port or ports to which the
message should be directed, followed by the text of the message and a <cr>.
Messages should be less than 70 to 80 characters, to reduce confusion when
they suddenly appear on the other user(s)’ terminal.
Sending a Message to a Specific Account
When an account name is provided as the routing indicator in the MSG command,
4
6
The User Processes:
TCL
all users currently logged on to that account receive the text of the message.
where:
MSG is the command.
SYSPROG gives the destination of the message.
WHAT KIND_____PRINTER is the text of the message.
In the previous example, the message is directed to a specific account. This means
that anyone logged on to that account receives the message. Messages may also be
routed to all users on the system. Be advised: Just as with the LOGOFF command,
this is not a good way to win friends and influence people. Whenever a message is
received, it appears at the current cursor position, possibly erasing information from
the screen, and puts the receiving process to sleep for a few seconds. Use this only
when absolutely necessary, for example, when the system is being taken down for
maintenance.
To transmit a message to all users, use the asterisk (*) in place of the account
name:
Messages may be directed to a specific line (port) number. The routing indicator in
this form is an exclamation point (!) immediately followed by the target port
number. Note: A list of active users and their port numbers may be obtained with the
LISTU command.
Messages being sent require only that the receiving user be logged onto the
machine. Don’t forget that if a user is in the middle of a process, such as a data entry
screen, the message unconditionally appears on his or her screen wherever the cursor
is currently positioned, which may upset whatever is currently on the screen. Keep
this in mind before sending mes-
4
7
Chapter
1
sages to everyone on the system, because it tends to upset others productively
engaged in the PICK world.
In the earlier example where the asterisk * was used to direct a message to all
users, it was mentioned that this went only to those who were currently logged
on. If a CRT is powered up, but at the Logon Please screen, then that terminal
does not receive the message. This final form of the message routing indicator
sends the message to every terminal attached to the system, including those that
are not logged on. Before the example is provided, it’s important to add that in
this form, the message is also directed to any serial printer attached to the
system:
The POVF command displays the available disk space, sometimes called the
The POVF (Display
overflow table. This overflow space is the pool from which frames are obtained
Available Overflow)
for attaching extra storage space to files, and for use by the spooler in
Command
producing reports. The output from this process will definitely be different on
your system.
>POVF<cr>
The WHO command is used to determine the current account name and port
number for the current account, another port, or every port on the system.
>WHO<cr> 0 SYSPROG
When used by itself, the output indicates your current port number and
the logon-id (account name). A port number may be supplied with the
command to determine the current account name for another port.
4
8
The User Processes:
TCL
usually indicated as “UNKNOWN,” unless there happens to be an account by
that name.
>WHO *<cr>
0 SYSPROG
1 UNKNOWN
2 UNKNOWN
*3 JES
4 JUDY
5 TRACY
6 MICHELLE
7 SRV
8 UNKNOWN
9 UNKNOWN
10 UNKNOWN
The BLOCKPRINT The BLOCK-PRINT command is used to display or print enlarged letters.
Command Example 3-4 shows how these banners may be directed to the CRT screen.
HH HH IIII
HH HH II
HH HH II
HHHHHHH II
HH HH II
HH HH II
HH HH IIII
(The output from this example was deliberately omitted. Examine the output
4
9
Chapter
1
from this example on your CRT to see how the PICK System handles spaces
and single quotes within double-quoted text strings.)
The output from the BLOCK-PRINT command may be directed to the
system printer by following the text with a (P) option enclosed in parentheses.
ENTRY n
When this option is used, the system printer will suddenly print a full-page
greeting.
Note: Don’t try these commands yet. Just read the following explanations;
you will get a chance to try them all later.
The Verb The verb may be any verb from the list below. By the way, the LISTVERBS
command provides a list of all verbs in an account. Any verb with a 2 in
attribute 2 (or in the second “column” of output on the screen or report) is
considered a TCL-II command. The following list gives the most common
TCL-II commands.
ED or EDIT
COPY
BASIC
QSELECT
The Filename The LISTFILES command is discussed earlier in this chapter. It is used to display
or print a listing of all files accessible from an account. Files come in two
flavors: local files, which are those file-defining items in the MD with a D,
DC, DX, or DY in attribute 1, and remote files, which have a Q in attribute 1.
Unless ACCESS and/or RETRIEVAL locks have been placed on files, both
types are equally available to any verb that affects a file.
Typically, each file created has two levels: a data section, where the actual
data resides, and a dictionary section, where the attribute-defining items reside.
This results in at least two valid ways to refer to a file in a fileprocessing
command. The first, and by far most common, is by simply referring to the name
of the file, which by default means the data level of the file. The following
5
0
The User Processes:
TCL
examples illustrate this form of filename specification:
There is one more valid form of filename specification, used only when a
dictionary has more than one data section. In this particular form the filename
consists of two parts: the name of the dictionary and the name of the data section,
with both separated by a comma. The following examples illustrate this form of
filename specification:
>LIST STAFF,EXECUTIVES
>COPY BP,SOURCE * (P)
The Itemlist The third, and final, element needed in a TCL-II command is a list of the item-ids
that are to be affected by the process. In its simplest form, one item-id may be
specified, as illustrated in the following examples:
5
1
Chapter
1
>ED STAFF 100 101 102 103 104 105 106
The next form is used when all items in a particular level of a file are to
be accessed by a TCL-II command. In this case, the asterisk (*) character
means all items.
> ED STAFF ★
> ED DICT STAFF ★
The final form of itemlist is a special exception that occurs when a TCL-
II command immediately follows a list-producing command, such as
SELECT, SSELECT, GET-LIST, or QSELECT. In this case, when a list is
present, the itemlist is omitted from the TCL-II command line. An example of
this form follows:
Note that if you do specify an itemlist when one is already present, the
one already there is ignored.
The COPY One of the more useful TCL-II commands is COPY. It allows items to be
Command copied to new item-ids, to different files, and to the CRT or printer. The next
example illustrates the general form of the COPY command.
>COPY filename itemlist options{cx}
The COPY command provides a (T) option to route output to the terminal
screen. This is illustrated in the following example:
COPY provides a (P) option to route output to the printer. The output does not
go directly to the printer, but is routed through the spooler.
An entire chapter is devoted to the spooler. The following is just an
example of routing output to the printer via the spooler:
The COPY command allows items to be copied to new item-ids. This is illustrated
in the following example:
1 *A1 TO TESTITEM
1 ITEMS COPIED
After telling the COPY command the filename and the item-id to be copied,
you press <cr>. The process then prompts you with the message TO: and awaits
your reply. At this point, you tell it where the item is to be copied. (If you hit a <cr
> here, it simply copies it to the screen.) By specifying TESTITEM, you cause it
to copy item *A1 to TESTITEM. Now there are two identical items in the MD
with different item-ids.
If TESTITEM had already existed in the MD, the COPY command would
have failed, because it is instructed to prevent copying over existing items without
permission. This is shown in the following example:
0 ITEMS COPIED
In the event that you want to unconditionally overwrite a duplicate item- id, the
(O) (as in Overwrite) option may be used. This is illustrated in the following
example:
1 *A1 TO TESTITEM
1 ITEM COPIED
The net effect is the same as the first time the command was issued: you still
have two identical items with different item-ids.
To “rename” an item, the (D) (Delete) option may be added.
5
3
Chapter
1
The “Delete” Option in the COPY Command
The (D) option is used to delete the original item after copying it to a new
item-id. It is generally used in conjunction with the (O) (Overwrite) option and
is illustrated in the following example:
1 TESTITEM TO ITEMTEST
1 ITEM COPIED
In the previous examples of the COPY command, items were copied within
the same file. They may also be moved to a different file, as shown in the
following example:
>COPY MD ITEMTEST<cr>
TO: (ERRMSG<cr>
1 ITEMTEST TO ITEMTEST
1 ITEM COPIED
The DELETE The DELETE command is used to remove an item from a file. It is illus-
Command trated in the following example:
Be careful with this command. It assumes that you know what you are
doing and tends to be rather unforgiving of mistakes.
The User Processes:
TCL
The CREATE- All of the upcoming tutorials require you to have created your own account, so let us
ACCOUNT now discuss the steps required to create an account using the CREATE-ACCOUNT
Command command. Prior to using this command, you must be logged on to the SYSPROG
account. The SYSPROG account contains special files used during the creation of
accounts, so new accounts should always be created from the SYSPROG account.
Essentially, the creation of a new user account causes a new account Master
Dictionary to be created and added to the SYSTEM file. The creation process adds
all of the “standard” MD items by copying them from a file named NEWAC, which
is sometimes located in the SYSPROG account. The NEWAC file contains four
types of items: common or shared file pointers, standard verbs (commands),
standard ACCESS items (often called modifiers and connectives), and common
PROCs (stored procedures).
Creating an Account
The process to create a new user account is initiated with the CREATE- ACCOUNT
command, shown in the following example:
>CREATE-ACCOUNT<cr>
The first prompt is for the new account name. The name of the account must not
already exist in the SYSTEM file. As with any item-id in the PICK System, the
account name may be virtually any combination of alphabetic, numeric, and/or
punctuation characters. Although any character may be used, certain characters
should be avoided in item-ids because they can cause problems later. These
characters include:
Single-quote mark (’)
Double-quote mark (")
Space or blank
“Up-arrow” or caret (A)
Backslash (\)
Parentheses ()
ANY control characters
5
5
Chapter
1
Retrieval Codes
The next prompt is for the retrieval codes to associate with the account.
Retrieval codes provide a means of adding file-level protection to prevent
reading and/or writing to and from the files in the account. For now, skip this
prompt by entering a <cr>:
Update Codes
The next prompt is for the update codes to associate with the account. These
codes function exactly like the retrieval codes and should be skipped for this
portion of the session by entering a <cr>.
L/UPD-CODE(S)?<cr>
Privilege Level
The next prompt is for the account privilege level. The privilege level de-
termines the capabilities (or restrictions) imposed upon the account, and are as
follows:
SYSO The lowest level. This prevents the use of magnetic media and
restricts the ability to update the MD and all of the SYS1
features.
SYS1 Prevents the use of the System Debugger, magnetic media, and
the Assembler.
SYS2 The highest level. Allows access to any function.
Some versions of PICK now offer SYS3 privilege levels. Consult your
manuals for changes to this feature.
For your account, enter SYS2 (the highest privilege level), as shown in
the following example:
PRIVILEGES? SYS2<cr>
The next prompt is for the modulo and separation for the new account MD.
This is the only place in the system that provides a default modulo if none is
specified. Enter a <cr> to use the default modulo and separation.
Modulo and separation are discussed in more detail later, but briefly, the modulo
is the number of groups of frames to allocate to the primary file space. Separation
is the depth of the groups, and is normally 1.
Press <cr > to accept the default modulo and separation for your new
account.
MOD, SEP?<cr>
5
6
The User Processes:
TCL
After pressing <cr> at the MOD, SEP prompt, the following appears on the
screen:
At this point, the new MD called CLASS (or whatever you called it) has
been added and updated with the items from NEWAC. Note that the BASE
indicated in the previous message above may be different from yours. Also, the
number of items copied depends upon the system you are using. The NEWAC file
has probably been modified on your system if a different number of items
appears. When the procedure is complete the following message appears:
PASSWORD?
Account Passwords
The next prompt is usually for the account password. This may be any
combination of alphabetic characters and/or numbers. If used, it will be requested
each time the account is accessed. Enter a <cr > to skip over (and omit) the
password. The next section in this chapter deals with adding, changing, and
deleting passwords.
PASSWORD?<cr>
FINISHED.
Your account is now created and ready for use. Before we leave SYS-
PROG, let’s investigate a few more TCL commands.
The PASSWORD To add or change a logon password to any account, you must be logged Command
onto the SYSPROG account. The PASSWORD command prompts you to enter the account name. At this
prompt, enter the account name for which you want to add or change the password, followed by a <cr >.
The system then asks for the new password, as shown in the following example:
>PASSWORD<cr>
ENTER ACCOUNT NAME? CLASS<cr>
ENTER NEW PASSWORD? RAMBO<cr>
You have two options at the NEW PASSWORD? prompt. You may
enter a new password, followed by a <cr>, or you may enter a <cr>, which
indicates that you want to remove the current password. If you choose to enter
a <cr> (indicating that you want to remove the password), the process will
prompt you to verify that you want to remove the existing password, to which
you respond with Y for yes or N for no, as illustrated in the following
example:
The PASSWORD command does not require that you know the old password
prior to changing it. To change your password, use the PASSWORD
command as illustrated in the following example:
>PASSWORD<cr>
ENTER ACCOUNT NAME? CLASS<cr>
ENTER NEW PASSWORD? RIO<cr>
If you just changed the password to your account, remove it prior to logging to
your account.
5
8
The User Processes:
TCL
ENTER ACCOUNT NAME? SYSPROG<cr>
ENTER NEW PASSWORD?<cr>
CONFIRM THAT YOU WISH TO REMOVE PASSWORD (Y/N)? Y<cr>
The account is now ready to be used. Use the LOGTO command to move
from the SYSPROG account to the CLASS account that you just created.
The LOGTO For the moment, we are done with the SYSPROG account. We will return to it
Command later. To log to your new account (CLASS):
>LOGTO CLASS<cr>
Verify that you are on the right account with the WHO command:
>WHO<cr> n CLASS
Note: “n” is your port number. You are now ready to create the files that
will be used throughout the rest of the tutorial.
The CREATE-
FILE Command The CREATE-FILE command adds a new file to an account. In most cases, it
is used to construct both the dictionary and data sections of a file
simultaneously. The prerequisite is that the name being used for the file does
not previously exist in your account MD. The CREATE-FILE command has
the general form:
>CREATE-FILE filename modulo{, separation} modulo{,sep} where:
modulo{, separation} is the dictionary level.
The term modulo refers to the number of groups (frames) to allocate for
the primary file space. Separation refers to the number of frames to allocate per
group. The default (and normal) separation is 1 (one). See the section in this
chapter called Selecting File Sizing Parameters for more information on this
process.
On most implementations of PICK, the separation is optional. If your
system reports an error message indicating that there is a “range error”
problem, try again with a separation of 1.
5
9
Chapter
1
Creating Dictionary-Only Files
A dictionary may have multiple data sections. This requires the following
general syntax:
> CREATE-FILE DATA filename, filename modulo{,
separation} where:
The first filename is the existing dictionary.
The second filename is the new data section.
The first line of the message indicates the location of the DICT (dic-
tionary) level of the STAFF file. The second line indicates the location of the
DATA level. In both cases, the location of a file is always determined by its
base, modulo, and separation. Note that the separation parameter may be
omitted and will usually default to 1. For the sake of brevity, the messages
displayed as by-products of the following commands are not included in this
text. All of these messages have the same meanings as the one described
above.
Now, finish creating your files using the commands in the following
example. If you have problems, you can use the DELETE FILE command in a
little while to remove any unwanted (or misspelled) filenames.
Your files are now in place and you are ready to proceed to the other file-
handling commands.
6
0
The User Processes:
TCL
The CLEAR-FILE The CLEAR-FILE command is used to empty a file of all items while reCommand
taining its primary file space. It has the following general forms:
> CLEAR-FILE DATA filename {ex')
> CLEAR-FILE DATA filename, filename {ex)
> CLEAR-FILE DICT filename{cx)
For our illustration, it is necessary to place some items into a file. This
may be accomplished with the COPY command as shown in the following
example:
1 WHO
2 TIME
3 POVF
4 ITEMS COPIED
The purpose of this example is to get some data into the file to illustrate
the rest of the file-handling commands. The file may now be reviewed to verify
that the items made it to the TEMP-FILE, using the LIST command as shown in
the following example:
>LIST TEMP-FILE<cr>
TEMP-FILE.
TIME
WHO
POVF
5 ITEMS LISTED.
Using the LIST command, you have just listed all of the item-ids in the
TEMP-FILE file. Now, use the CLEAR-FILE command to empty the file, as
shown in the next example:
>LIST TEMP-FILE<cr>
6
1
Chapter
1
The message [401 ] indicates that there are no items in the file and that
the CLEAR-FILE command worked as expected.
The DELETE-FILE The DELETE-FILE command is used to remove all items from a file and
Command to return all disk space used by the file to the overflow table. It is important to mention that
once the DELETE-FILE command is initiated, the Break key is disabled until the process is completed.
Moral: Always make sure you have the right filename before issuing this command! Using the same
filename as in the CLEAR-FILE example, delete the TEMP-FILE from your account, as shown in the
following example:
>DELETE-FILE TEMP-FILE<cr>
This verifies that the file is gone. Again: Be careful with the DELETE-
FILE command!
Selecting File Sizing When we created files in the preceding section, you used modulo (and default
Parameters separation) parameters that we provided. Choosing the proper modulo for files
requires some advance planning and techniques. Among the information
needed are:
■ the number of items in the file
■ the average item size
■ the growth factor
Once these pieces of data are collected, they may be placed into the
following three formulas.
1. NUMBER OF ITEMS X AVERAGE SIZE = STORAGE SPACE
REQUIRED
For example, suppose you have a file that will contain about 100 items,
each of which averages 250 bytes. The result is as follows:
100 X 250 = 25,000 bytes (storage space required)
Next, consider how much the file will grow. Although the system will
automatically link frames to the file as necessary, growth adjustment will
ensure future efficiency. The growth factor is the percentage at which the
file will expand prior to the next time the file is resized. For this
illustration, assume that the file will expand by 50 percent. The second
formula is as follows:
2. CURRENT STORAGE SPACE REQUIRED X GROWTH FAC-
TOR = TOTAL STORAGE SPACE REQUIRED
The result is as follows:
25,000 X 1.5 = 37,500 bytes (total storage space required)
6
2
The User Processes:
TCL
We have now determined the total number of bytes that the file may
contain. On most versions of PICK, each frame on the system is capable
of storing 500 bytes of data. Some newer versions use different frame
sizes. Consult your system manuals for further information on the size of
frames on your system, and substitute the appropriate number into the
following, and third, calculation.
3. STORAGE SPACE REQUIRED - FRAME SIZE (500) = NUMBER
FRAMES REQUIRED
The result is
37,500 500 = 75 frames
We now have the approximate number of frames that will be required to
store the data: 75. The modulo of a file should always be a prime number (a
number divisible only by itself and 1), to assure the best distribution of items.
For this reason, the result of our calculation should be increased to the next
nearest prime number, which is 79. This result may now be used in the
CREATE-FILE command. A modulo of 3 should be adequate for virtually any
dictionary level. The data section modulo for this illustration is 79. These two
modulos can now be used in the CREATE-FILE command.
The “P” Command The “P” command is left over from the early days of the system. It turns off all
terminal output as the result of a process, meaning that nothing displays on the
screen even though the command may have worked. Since it is simply a
toggle-type command, just issue another P to turn terminal output on again, as
illustrated in the next example:
>WHO<cr> 0 SYSPROG
>P<cr>
>WHO<cr>
>HELP<cr>
6
3
Chapter
1
>LISTU<cr>
>P<cr>
>WHO<cr> 0 SYSPROG
Long ago, a bored programmer put a couple of PROCs in the system that still
remain in some machines. One of these was CHOO-CHOO; the other was
SNAKE. Give these a try and see if they are on your system. By the way, you
And Finally, Some will have to BREAK out of the SNAKE PROC; otherwise it will run forever.
Fun: CHOO-CHOO
and SNAKE
6
4
The Editor: The Window
into the Processes
The Editor utility provided with the PICK System is used to enter or update
any item in the system, including PICK/BASIC source code, PROCs (stored
TCL commands called procedures), dictionary items, and even data items. It is
a process that the PICK user often takes for granted; yet it is a “window” into
every file on the entire system. As such, this powerful utility warrants close
examination and we will now take the time to do so.
Theory of Operation
The Editor has two modes of operation. The first of these is the Command
mode. This is always indicated by the period (.) prompt character. From this
point, any legal Editor command may be activated.
TOP
. <- The Editor Command mode prompt
6
5
Chapter
1 TOP
-Kcr>
001 + The Insert/Replace mode prompt
Mnemonic CommandsMost Editor commands are actually the first letter or first two letters of the
word that describes the command. For example, B is the Bottom of Item
command, FI is File Item, and EX is Exit Item. Editor commands are case
insensitive, that is, they may be entered as either uppercase or lowercase
characters.
The Editor Line The PICK Editor is line oriented, as opposed to full screen. As such, it
Pointer Concept maintains a line pointer that is manually controlled. Many line pointer po-
sitioning commands exist in the Editor for this purpose, and are subdivided
into two categories: direct, such as the command to “go” to a certain line
number, and relative, such as the command to move “up” to the line some
number of lines above the current position.
Line (Attribute)
While using the Editor, line (attribute) numbers are automatically displayed on
Numbers
the left side of the screen. This is a means of verifying exactly where data is
being placed within the item. These line numbers are not physically stored on
the system with the item; they are added (and recalculated) by the Editor
process each time it is activated.
When entering a new item, the line numbers continue to increase by one
with each line of text or data entered. At all other times, the Editor provides the
line number from which the add/change operation began, on each line of the
screen, until the item is “flipped.” (Flipping is discussed later in the chapter, in
the section titled The Editor File Buffers). After flipping, the line numbers are
adjusted for the latest changes in the item.
6
7
Chapter
1
in which the item does or will reside, and the item-id (or item-ids) that are to
be edited. The command has the following general form:
>ED filename item-id{cr}
This calls for one item to be edited in the designated file, as illustrated in
the following example:
Don’t bother doing this just yet; you will get a chance to do it in a little
while.
Editing Multiple Items The next form of this command allows multiple items to be edited in the file,
each of which is specifically requested using the following general form:
>ED filename item-id item-id . . . <cr>
There is no practical limit on the number of item-ids that may be
specified, but each item-id must be separated by a space. The following
example illustrates this form:
Again, don’t do this yet. While there is no practical limit on the number
of items that may be requested, there is, however, a limit of 140 characters per
TCL input line. This can generally be bypassed by issuing a line continuation
character prior to reaching 140 characters. The line continuation character is
generated by pressing <ctl-_> followed by a <cr>. The system prompts with a :
character, at which point another 140 characters may be entered.
Editing All Items in a In the third general form of the ED command, all of the items in the file may be
File edited by specifying an asterisk (*) as the itemlist. This is illustrated in the
following example:
>ED MD FLIP.TEST<cr>
NEW ITEM
TOP
- Kcr>
TOP
-2<cr>
002 THE PICK Editor UTILITY AND
.R/UTILITY/FUNCTION<cr>
002 THE PICK Editor FUNCTION AND
.1<cr>
001 THIS IS A TEST OF
. R/IS/WAS<cr>
SEQN?
The command 1<cr> moves the line pointer to attribute 1 of the item. The
message SEQN? (short for “sequence?”) means that changes are being attempted
on a line above one in which a change has been made. The change did not occur,
but could be done after a flip.
- F<cr>
TOP
-1<cr>
001 THIS IS A TEST OF .R/IS/WAS <cr>
001 THIS WAS A TEST OF . EX<cr>
•FLIP.TEST’ EXITED
There’s a moral to this exercise: get used to doing a lot of Flip com -
mands. The Flip command updates the copy of the item you are editing and
incorporates all changes made up to that point. It additionally recalculates the
attribute numbers of the item in case any have been added or deleted.
By issuing the EX (Exit) command, the Editor session was not actually
saved. The point of this illustration is that the Flip command is used often,
6
9
Chapter
1
normally after a series of changes and prior to reviewing them.
001 NAME The name of the staff member, in the form: last
name, first name
002 ADDRESS The street address
003 CITY The name of the city
004 STATE The two-letter abbreviation of the state
005 ZIP The ZIP OR POSTAL code
006 PHONE
The phone number, in the form of ten numbers. For
example: 7145551212.
007 HIRE.DATE Entered as a whole (random) number between
7000 and 8000
008 BIRTHDAY Entered as a whole (random) negative number
between —10000 and —2000
009 SALARY Entered as a whole (random) number between
100000 and 300000. (It represents the number of
pennies.)
Creating Your First The following example is the first of three steps necessary to construct and Data
Item execute an ACCESS command. In this first step, you will create the data (items) in the file. Later
(step 2), you will add items to the dictionary of the file, which define each of the attributes that will
subsequently be displayed with an ACCESS sentence in the third step.
Below is a sample item, and the actual process to enter it. Enter the
boldface characters exactly as they appear.
Congratulations. You just built your first data item in the STAFF file. If you
made mistakes, they can be corrected later.
The I (Insert) The I command places the Editor into Insert mode for entering new attribCommand
utes after the current attribute, or until a < cr > is entered at the first charac ter position of a line.
Remember that while in the Insert mode, the prompt character is the plus sign (+). If Editor
commands are issued, they are treated as text, rather than as commands. The period (.) is the Editor
Command mode prompt character.
The Insert command is only used when new attributes are needed in an item.
To change values in existing attributes, the Replace command is used. The only
time it is safe to insert new attributes is a) when the item itself is indicated as
being new, b) when adding attributes to the “end” of an item, and c) when you’re
absolutely, positively sure that you need to do it.
Here’s why you should be sure. Suppose you edit the existing item 100 in
the STAFF file and simply proceed to insert new attributes at the top, as shown in
the following example:
The net effect could be catastrophic. By inserting the new attribute at the
top of the item, all existing attributes are pushed down by one attribute. This
effectively corrupts the data. ACCESS will not have much fun later when it
tries to play with this item. Fortunately, by using the EX command, you didn’t
write the changed item back to the file.
The L (List) The L command actually has two functions. In this form, it is used as a Command
List command to display lines (attributes) within the current Editor item. Later, we will use it
with a slightly extended format as the Locate function.
The following illustration provides another example of the L(ist)
command.
>ED STAFF 100<cr> TOP . L22<cr> 001 MERTZ, FRED 002 128 W 12TH ST, APT 3B
003 NEW YORK 004 NY 005 10012 006 2125556789 007 6777 008 -8000 009 155000 EOI
009 .FI<cr> '100' FILED.
7
1
Chapter
1
In case you are wondering why we chose to list 22 lines, rather than the
9 that you knew existed in the item, it’s because 22 happens to be the number
of lines that can comfortably be displayed on a typical CRT. In fact, there is a
“prestored” command discussed later that is automatically defined to list 22
lines. It’s called P0, or P. For a preview of coming attractions, try the
following example:
Creating the Other Your next objective is to use the following examples to create a total of Staff File
Items seven data items for use later in the tutorial on ACCESS. Using the format shown earlier, you can
enter different names and addresses. The process is as shown in the following example:
This indicates that you wish to edit the six item-ids listed above into the
STAFF file. (Remember that you already added the first item, 100, to the
STAFF file.)
This means that item 101 is new to the STAFF file. (Each item in this
example will indicate that it is new.) You are now positioned at the top of the
item, where the first Editor command may be entered. Let’s put the Editor into
Insert mode to build the first item.
.I<cr>
001+FLINTSTONE, FRED<cr>
3. On attribute 3 (yes, line means the same thing as attribute) enter a city.
For example:
003+BEDROCK<cr>
7 6. Attribute 6 is the person’s area code and phone number, entered as a ten-
2
The
digit string of numbers. For example: Editor
006+7145558888<cr>
7. Attribute 7 is the date of hire. As you will learn in more detail, the PICK
System stores dates in an internal format, which represents the number of
days that have elapsed since December 31, 1967. What you are doing
here is actually entering the data in its internal format—something you
may never get a chance to do again. Normally, dates are entered into a
program in external format, the form that is meaningful to the user, and
are subsequently “converted” into their internal format. Pick a random
number between 7000 and 8000 for each of the items you enter. For
example: 007+7750 <cr>
8. Attribute 8 is also a date. This represents the person’s birthday. Pick a
negative number between —10000 and —2000, which indicates the
number of days before December 31, 1967.
008+-7800 <cr>
That’s all the data we need for each person right now, so you are done
with this item and ready to put it into the file and go on to the next item.
After having entered the salary amount on attribute 9, you should now be
positioned at attribute 10:
010+_ +- You are here
010+<cr>
TOP
This indicates that the Editor is ready for your next command. Note that the
line numbers appeared automatically. When the <cr> was pressed while positioned
at attribute 10, control returned to the Editor Command mode.
If your version of the Editor did not automatically flip the buffers, you will
need to use the F command to manually issue the flip. (Remember, you must flip
before you can see any changes to an item.) Just to be on the safe side, issue the
F(lip) command:
• F<cr>
TOP
7
3
Chapter
1
Prior to being written out to the STAFF file, the item may be displayed using
the L (List) command as follows:
- L9<cr>
This tells the Editor to list the first 9 lines of the item. The attributes you
entered should appear on the screen, to the right of their corresponding attribute
numbers:
001 Last name, first name 002 address 003 city 004 state 005 zip 006 phone 007 hire date 008
birthday 009 salary EOI 009
7
4
Chapter
1
The EO I 009 message indicates that the End Of Item occurs at line 9;
therefore the item has nine attributes. If your data contains mistakes, don’t
worry about them for now. You will get a chance to correct them later, using
the R (Replace) command.
Now we want to write the item to file and continue building the other
five items.
- FI<cr>
•10r FILED.
The FI command writes the current item to the file (STAFF) using the
item-id (101) previously indicated in the ED command. After filing an item,
one of two things typically occurs:
1. Control returns to TCL if there are no more items to edit, or
2. Control stays in the Editor on the next item-id requested.
102
NEW ITEM
TOP
Repeat this process for each item. After filing item 106, control returns
to TCL. If you need help, just repeat the steps in this section, starting from
where you last used the Insert command.
The FI (File Item) The FI command is used to file, or write, an item. This command leaves
Command the Editor after filing, unless there are more items to be edited. The next example illustrates
the command.
This indicates that the item has been written successfully to the file from
which it was retrieved, and that changes have been included with the item.
The
The FIO (File Item Occasionally, it will be necessary to write an item using a different item-idEditor and
Overwrite) than the original. This is effectively like performing a copy of an item from Command
within the Editor—it allows you to save the item being edited under a new or different item-id, while
leaving the “original,” or current, item intact and unchanged. The FI command provides the ability to
specify both a different item-id and, optionally, a different filename.
Here’s an example of saving an item under a different item-id:
This example wrote a copy of item 100 to the current file (STAFF) under
a different item-id, 108. They are now identical items with different item-ids. If
any changes had been made to the item, they would have been saved only in the
new item, 108.
The FIO command is used to overwrite if a duplicate item-id exists when
attempting to file the item under a different filename or item-id. If the item-id
108 already existed within the STAFF file, a message would indicate a problem
with the command, as in the following (deliberate) example:
The CMND? (Command?) message indicates that the operation did not
take place. Normally, this message appears when an invalid command is issued,
but it may also mean that duplicate item-ids exist. If you already knew that the
item existed in the file and that you wanted unconditionally to write over the
existing item, then the FIO command is used. The “O” in FIO is an instruction
to overwrite unconditionally. Attempting the same operation as before with the
“O” in the command results as follows:
■ FIO 108<cr>
’108’ FILED,
Filing an Item into The FI command may be used to write items out to a file other than the one a
Different from which the item originated and, optionally, under a different item-id, Filename as in the
following example:
7
7
Chapter
1
This format of the FI command requires the command, the left pa-
renthesis character, and the filename, with no embedded spaces. The right
parenthesis character is optional.
This operation writes a copy of the item under the same item-id (100) in
the STATES file, since a different item-id is not specified. If we want to
rename the item during the filing process, the format of the command is as
follows:
This indicates that the item called 100 in the STAFF file has been suc-
cessfully written to the STATES file under the item-id 108. The same re-
strictions apply regarding the pre-existence of items as previously covered in
the FIO command.
The FIK (File Item and The FIK command is used to file the current Editor item and to “kill” an active
Kill) Command item list of subsequent item-ids to edit. This command is illustrated in the
following example:
Note that control returned directly to TCL, as indicated by the > prompt.
Previously, we requested multiple items during the ED command, and each one
was accessed in turn, until all had been processed. Using FIK, the current item
is filed as usual, and the Editor process is terminated.1
The FS (File “Save” The FS command is similar to the FI (File Item) command in function, with the
Item) Command difference that after writing the item to the file, the FS command remains in the
current item being edited, rather than going to the next item or to TCL. This is
suggested as an alternative to the F(lip) command when you are going to spend
a long time within the same item. It’s a good idea to update the file every once
in a while, just in case the machine goes to lunch. By doing this occasionally,
you can recover data up to the last time you
‘Note for Ultimate users: At the time of this writing, this command is not available
on some Ultimate systems.
78
The
issued an FS command, rather than going back to the way the file wasEditor
before
you began editing it.
This example wrote a copy of the item to the (STAFF) file from which it
was retrieved, and remained in the Editor after writing.
The EX (Exit Item) The EX (Exit Item) command leaves the item without saving any changes that
Command may have been made. An example of this follows:
To review, you edited the item called 100, and changed the first oc-
currence of FRED to ETHELin the next 99 lines. The Editor displayed attribute
1, where the only change took place. You then exited the item, which meant
that the changes to the item were not saved. To prove this, examine the item
again:
Since attribute 1 still has FRED in it, this verifies that no changes have
taken place.
The EXK (Exit and The EXK command is used to exit the current Editor item without saving
Kill) Command changes and to “kill” any active item list of subsequent item-ids to edit (just
like the K extension discussed in the FI command). The next example
illustrates the use of this command.
7
9
Chapter
1
. EXK<cr>
'100' EXITED.
The FD (Delete The FD command is used to remove an item from a file. You must be cer- Item)
Command tain that the item should be deleted! There is only one chance to recover items deleted
with this command.3
1 ITEMS COPIED
The following steps illustrate the circumstances under which items may
be recovered after the FD command.
This example wrote a duplicate copy of item 100 to the same file
(STAFF), under the item-id 110, just to back up the item during the example.
Now we are ready to delete the item:
. FD<cr>
'100' DELETED.
2Note for Ultimate users: This command is called EXT on your system; there is no K
extension to the EX or FI commands.
3Many licensees have added the question “ARE YOU SURE?” when the FD com-
mand is issued, to prevent the accidental deletion of the item. Some versions take
this one step further; they assume you really meant it and don’t even provide the
RECOVER-FD command.
The
Control returns immediately to TCL because we requested onlyEditor
one item
during the initial ED command.
Recovering a One chance is provided to recover a deleted item. Recovery is based on the Deleted
Item condition that the deleted item was the last item to be edited. If another item was edited after this
item was deleted, there is no chance of recovery. In this case, since it is the last item, we can still
recover it using the TCL command RECOVER-FD, as illustrated in the following example:
>RECOVER-FD<cr>
The RECOVER-FD command is issued from the TCL prompt. It prompts the
user to enter the item-id of the item previously deleted with the FD command. This
process illustrates the successful recovery of an item, again because it was the last
item edited. The following steps illustrate what happens if the item was not the last
item edited.
>ED STAFF 110 100<cr> 110 TOP . FD<cr> ’HO’ DELETED 100 TOP . EX<cr> •lOO’
EXITED.
>RECOVER-FD<cr>
The prompt ENTER ITEM-ID reappears on the screen, indicating that the
requested item-id, 110, cannot be recovered. Moral of the FD command: Use with
caution!
Earlier in this tutorial, you used the FS command to write an item in the
STATES file. As an exercise, use the Editor and the FD command to remove that
item. Here’s a hint: the item-id is 108.
8
1
Chapter
5
Miscellaneous Editor Commands
The next three sections offer some Editor commands that you will find useful.
The ? (Display Info) The ? command displays the current filename, item-id, and line number within
Command the item. To test this command, enter the Editor by issuing the commands in
the following example:
The message displayed indicates that the filename is STAFF, the item-
id is 100, and the line pointer is currently positioned to line 0 (the top of the
item).
Remain in the Editor Command mode for the next example.
The S? command displays the current size of the item in bytes. An example of
The S? (Display Size)
this is provided in the following example:
Command
.S?<cr>
ITEM LENGTH IS 85 BYTES
The S (Suppress) The S command suppresses the display of line numbers along the lefthand side
Command of the screen, and the display of object code in Assembler programs. It is a
toggle command, and will enable or disable the function each time the
command is issued, as in the following example:
• S<cr>
SUPPRESS ON
This indicates that the line number display function has been sup-
pressed, and may be verified by entering the command in the following
example:
. L22<cr>
MERTZ, FRED
128 W 12TH ST, APT 3B
NEW YORK
To re-enable the function, issue the S command again, and verify that it
82
The
worked properly. Editor
. S<cr> SUPPRESS OFF . L22<cr> 001 MERTZ, FRED 002 128 W 12TH ST, APT 3B 003
NEW YORK 004 NY 005 10012 006 2125556789 007 6777 008 -8000 009 155000 EOI 009
Since you were already positioned at the bottom of the item when the L
(List) command was entered, the Editor automatically wrapped around to the
TOP of the item prior to the listing. It is unlikely that you will ever need to use
the Suppress command, because the line numbers are usually needed for use in
the Editor.
This command is provided primarily for the benefit of those who
program in the PICK Assembler language, because it turns off the display of
object code in Assembler source programs.
Again, remain in the Editor for the next example.
The G (Go To) The G (Go To) command positions the Editor line pointer at a specific line
Command (attribute) within the item currently being edited. This can also be accomplished by
entering only the line number, followed by a <cr>.
. G2<cr>
002 128 W 12TH ST, APT 3B
8
3
Chapter
5
The above example instructs the Editor to go to line 2 and display the
line. The line pointer is now positioned at line 2 and ready for the next
command.
.4<cr>
004 NY
This indicates that the line pointer is now positioned at line 0, or the
top of the item.
Note: We mentioned earlier that changes must be made from the top
down on the item being edited. The F (Flip) command also positions the
line pointer at the top of the current item. For this reason, it’s advisable to
use the F command rather than the T command when changes are being
made to an item.
The B (Bottom) command is used to position the line pointer at the bottom
The B (Bottom)
(or end) of the item, as in the following example:
Command
-B<cr>
EOI 009
This indicates that the bottom (end) of the item occurs at line (attribute)
9, and that the line pointer is now positioned at line 9. Remain here for the
next example.
• <cr>
TOP
001 MERTZ, FRED
84
The
• <cr> Editor
002 128 W 12TH ST, APT 3B
The first use of the <cr> command “wrapped around” to the top of the
item, since the previous example left the line pointer at the bottom (end) of the
item. The second time the command was issued, the next line relative to the
current one was displayed.
The U command decrements, or moves up, the line pointer relative to the
current line position, as in the following example:
. U1<cr>
001 MERTZ, FRED
The U (Up)
Command
Since we had previously left the line pointer at line 2, this command
caused the line pointer to move up one line, to line 1 of the item, and to display
the line.
The N (Next)
Command
The N (Next or Down) command increments, or moves down, the line pointer
relative to the current position within the item, as in the following example:
. FI<cr>
’100' FILED.
The R (Replace) The R (Replace) command is used to replace all or part of the data in an
Command attribute or in a series of attributes.
8
5
Chapter
1
Replacing an Entire Attribute
-R<cr>
In its simplest form, an entire line may be replaced by issuing the R command,
as shown in the following example:
> ED STAFF 100<cr> TOP -1 <cr> 001 MERTZ, FRED . R<cr> 001 RUBBLE,
BARNEY<cr>
You will eventually exit this item without saving changes, but for the
time being, go ahead and issue the F(lip) command and remain here for the
next example:
-F<cr>
TOP
If nothing is entered on the line while in the Replace mode, the line
remains unchanged.
> 1 <cr>
001 RUBBLE, BARNEY
-R/BARNEY/BETTY<cr>
001 RUBBLE, BETTY
The general form of the Replace command calls for three separate pieces of
information: the command (R), the string to be replaced (old string), and the string to
be used as its replacement (new string).
In order for the Editor to be able to distinguish the elements, each piece of
data is separated by a delimiter. This delimiter is any non-numeric character that
does not appear in the string being searched for or in the string being replaced.
The previous example used the slash (/) character as the delimiter. This has
traditionally been the character used in documentation. Other characters are equally
acceptable and sometimes even essential. For example, suppose the attribute you
wanted to replace contained a slash character:
003 NEIMAN/MARCUS
003 NEIMAN/MARCUS
.R/NEIMAN/MARCUS/NEIMAN-MARCUS<cr>
COL#?
This message means “Column Number?” and it is generated when too many
occurrences of the character assumed to be the delimiter are present. In this case, it
is necessary to use a different delimiter character, such as a period:
003 NEIMAN/MARCUS
.R.NEIMAN/MARCUS. NEIMAN-MARCUS<cr>
The R command may be followed by a number, which instructs the Editor that the
change should take place in the specified number of lines, as illustrated in the
following example:
8
7
Chapter
5
001 MERXZ, FRED
002 128 W 12 XH ST, APT 3B
EOI 009
. EX<cr>
'lOO' EXITED.
This command replaces the first occurrence of the letter T on each line
with the letter X, for the next 99 lines. The number 99 is greater than the
number of lines contained in the item, to ensure that every attribute of the item
is affected. Note that this form of the Replace command only affects the first
occurrence on each line of the string being replaced.
To affect all occurrences of a string in an attribute, the syntax changes
slightly. The RU form, which means to “Replace Universally (all
occurrences)” in the specified number of lines, is used in the following ex-
ample:
Occasionally, you may want to “undo” the last change you made to an item.
There is a command custom made for that purpose. It’s the X command. It will
“undo” the last Replace, Delete (covered in next section), Merge (covered
later), or Insert command. The next example shows how it works.
The X command must be used prior to F(lipping) the item, otherwise the
changes become semi-permanent. (They become permanent at this point if the item
is filed.) The only way to undo changes after flipping is to exit the item and start
88
The
over. Having to do this once or twice quickly teaches you to issue anEditor
FS (File
Save) command every once in a while.
The DE (Delete The DE (Delete Line) command is used to remove an entire attribute or Line)
Command range of attributes from the item being edited, and has the following general forms:
All by itself, the DE command deletes the current line, as shown in the following
example:
The line is not actually deleted until after the Flip command is issued.
Remain in the Editor for the next example.
The Delete command may be followed by a number, which specifies how many
lines to delete from the current position. It has the general form:
.DEn<cr>
This deletes the next “n” lines, starting with the current line, as in the
following example:
-1<cr>
001 MERTZ, FRED
-DE2<cr>
8
9
Chapter
1
.F<cr> TOP
. L2<cr> 001 NY 002 10012 . EX<cr>
The command, DE99/Y literally reads, “Delete, in the current and next
98 lines, any attribute that contains the letter Y.”
The ME (Merge) The ME (Merge) command is used to copy (as opposed to move) an attri-
Command bute, or a range of attributes, into the current item at the position of the line pointer. The
item from which the attributes are to be retrieved for the merge may be either
■ the current item
■ another item in the same file
■ another item in a different file
All three forms of the command are illustrated in the following sections. The
Merge command has the general form:
ME{number lines}/{item-id}/{beginning line number}
The
Editor
When any of the parameters in the general form are left out, the following
defaults apply:
■ The default “number lines” is one line.
■ The default “item-id” is the current item.
■ The default “beginning line number” is the first line.
Note that the / character is illustrated as the delimiter to separate the various
parameters within the command. Once again, any acceptable delimiter may be
substituted.
Additionally, as in the FI and FS commands, the parenthesis character ( has
a special meaning—it is used to indicate a different Rename.
For the first example, we’ll instruct the Editor to merge in 5 lines from the current
item:
This command merges the first 5 lines from the current item (indicated by
two successive delimiters), starting the merge from line 1. The Merge command
places the merged attribute (or attributes) at the current position of the line pointer.
In this example, we are positioned at line 5, so that is where the new lines are
placed.
Merging Lines from Another Item in the Same File
If you want to merge from a different item-id, the format of the command is as
follows:
9
1
Chapter
5
.ME{number lines}/item-id/{beginning line number}
In this form the item-id is not optional. Suppose there is an item in the
STAFF file under the item-id 101, and the first several attributes contain the
following data:
Now, suppose you want to merge, for some strange reason, the first two
attributes from item 101 into item 100. The following example accomplishes
this.
This merges 2 lines from the item-id 101, within the same file (STAFF).
Note that the beginning line number is specified, although it could be left out
and produce the same result. Because the line pointer is positioned at the top of
the item when the merge is issued, the new attributes “push down” the existing
attributes, just as earlier in this tutorial when you inserted new attributes at the
top of the item.
This technique of merging comes in particularly handy later in the
ACCESS tutorials when you are building dictionary entries.
When the item to be merged from resides in a different file, the format of the
Merge command changes. In this form, the Merge command requires that the
delimiter before the filename specification must be a left parenthesis character,
as in the following example:
This instructs the Editor to merge 99 lines from the item-id B100, within
the file called ERRMSG. Once again, because the beginning line number is left
out of the command, the merge begins from line 1 of B100, and the new lines
are again inserted at the top of the current item.
92
The
Editor
The Prestored Editor Commands
We have now covered all of the Editor commands. The last topic is the use of
the prestored commands. Prestored commands are simply a means of defining
a series of Editor commands that will execute automatically upon request, sort
of like “macros” in other text editors.
There are ten storage locations for prestoring Editor command se-
quences. Each location has a corresponding location number. The numbers
start with 0 and end with 9, so the available prestored commands are P0, Pl,
P2, P3, P4, P5, P6, P7, P8, and P9. Each of these storage locations may contain
up to 100 characters, representing almost any number of legally executable
Editor commands.
Remember the command L22 used earlier to list 22 lines? It is the only
default prestored command, and it is defined each time the Editor is activated.
All prestored commands except this one go away each time the Editor returns
control to TCL.
The next example shows how to use the one and only default prestored
command.
>ED STAFF 100<cr> TOP
.P<cr> 001 MERTZ, FRED 002 128 W 12TH ST, APT 3B 003 NEW YORK 004 NY 005
10012 006 2125556789 007 6777 008 -8000 009 155000 EOI 009 . EX<cr> '100’ EXITED.
The PD (Prestored The PD command displays the currently defined prestored commands.
Display) Command
>ED STAFF 100<cr> TOP
-PD<cr> P0 L22 . EX<cr> MOO' EXITED.
9
3
Chapter
5
Defining Prestored
Commands
There are two phases to prestored commands. The first phase is the process of
defining, or loading, the commands to execute. Defining single commands as
prestored commands is simple, and has the following general form:
.PM Editor-commandicr}
-PI RU999/FRED/BARNEY<cr>
94
The
Activating Once any prestored command has been defined, it may be activated Editor
by issuing
Prestored a P command, immediately followed by the number of the command to
Commands execute.
In the previous example, you defined Pl as a
Replace command. The next time you use the Pl command it will issue the
command to replace, in the next 99 lines, all occurrences of FRED with
BARNEY. This command will remain intact until it is redefined or the Editor is
exited.
Complex Prestored You have now seen the easy stuff. Here’s where it gets useful. You saw that
Commands any legal Editor command may be prestored, but the real power from this
feature comes in doing a series of repetitive functions with prestored com-
mands.
Prestored commands may contain more than one Editor command. Each
legal Editor command is separated by what is called a command delimiter. This
is usually the escape4 character (although it looks like a “left bracket”), which
is generated by pressing the Esc or Escape key on your keyboard.
The command delimiter tells the Editor where the end of an Editor
command occurs, and functions as a <cr> between the Editor commands being
activated. Here’s an example of a more complex prestored command sequence:
-P1 B[U22[L22<cr>
Recursive Prestored In the previous examples of prestored commands, each command is “self-
Commands contained,” meaning that after it does its function or series of functions, control
returns to the Editor Command mode.
As you might have guessed, it can get much more complicated and
correspondingly powerful.
Suppose, for instance, that there is a file called ORDERS, which
contains details on orders placed by your customers. In this hypothetical
example, let’s assume that the ORDERS file has the following logical layout:
4
Note for Ultimate users: Ultimate uses a sub-value mark as the command
delimiter. This is usually generated from the keyboard with a < ctl-\ > or <
ctl-Shift- \>, depending upon which keyboard you are using.
9
5
Chapter
1
Item-id: Order Number
Attr 001: Customer Name
Attr 002: Order Date
Attr 003: Salesperson’s Initials
Naturally, a “real” data file would contain more information, but this is
enough to allow an illustration of a recursive prestored command. Let’s now
assume that there are five items in the ORDERS file, and here is how they
appear:
Item-id : 10000
001 LOW-TECH INDUSTRIES 002 6789
003 BR
Item-id : 10001
001 SLATE ENTERPRISES 002 6880
003 FF
Item-id : 10002
001 DINOSAUR DELIGHT
002 6901
003 BR
Item-id : 10003
001 BEDROCK BAR & GRILL
002 6902
003 FF
Item-id : 10004
001 BEDROCK GENERAL HOSPITAL
002 6925
003 BR
Now that the data is in place, the hypothetical problem arises: The two
main salespeople, FF (Fred Flintstone) and BR (Barney Rubble) resign from
the company and you want to replace their initials in the appropriate attributes
of the order items with the initials of their replacements. Let’s say that Wilma
Flintstone should be assigned all of Fred’s orders, and Betty Jean Rubble (just
to make things interesting) will get all of Barney’s orders. Using prestored
commands, this is a snap. Here’s the sequence of events that would make it
happen. First, activate the Editor:
-P1 3[R/FF/WF[R2<cr>
-P1 <cr>
Final Warnings Be careful! There is no provision for logical testing of data values prior to issuing
about Prestored Editor commands within prestored commands. Be especially careful when
Commands defining complex prestored commands which perform “loops.” Always make
sure that your “loop” has some method of leaving the item
9
7
Chapter
5
(usually accomplished with the File command). Finally, review the prestored
command sequence with the PD command prior to starting it!.
Summary
You have just completed a crash course on the PICK Editor. It is vital that you
understand how to use the Editor, as it is the tool used to modify dictionaries,
PROCs, PICK/BASIC programs, and, occasionally, even data items.
98
ACCESS: The Data Retrieval
Process
ACCESS is a data retrieval language that allows the generation of reports using free-
form, English-like sentences. ACCESS provides a full complement of relational and
logical operators for data selection in its sentence structure. In addition:
■ ACCESS provides many inherent functions for adding special features to
reports, including page headings and footings, output breaks, and subtotals.
■ Output from ACCESS sentences may be routed to CRTs, printers, or magnetic
media.
■ All of the commands and words used with ACCESS may be easily tailored to
the specific vocabulary of the data to which it is being applied.
■ ACCESS can be activated from TCL or stored procedures known as PROCs, or
from PICK/BASIC programs.
ACCESS Verbs
The most powerful verbs, by far, are not (strictly speaking) TCL commands at all.
They are ACCESS verbs, designed to SELECT, SORT, and/ or LIST data from data or
dictionary files with nearly unlimited flexibility. Used in conjunction with attribute-
defining items, the ACCESS verbs are the basic relational tool in the PICK relational
database. We’ll begin by describing the ACCESS verbs and showing the general
9
9
Chapter
5
format of some of these powerful commands.
ACCESS Verb ACCESS verbs can be divided into several distinct categories:
Categories tt J u
® Output-producing verbs
LIST
LIST-ITEM SORT SORT-ITEM
List-processing verbs SELECT SSELECT
Statistical verbs
CHECK-SUM COUNT SUM STAT
Label-producing verbs
LIST-LABEL SORT-LABEL
Tape-handling verbs
S-DUMP T-DUMP T-LOAD
File-analysis verbs HASH-TEST ISTAT
Special verbs
:SWD :SWE :SWX :SWZ REFORMAT SREFORMAT
Good News About With the exception of the “special” verbs listed in the previous section, ACCESS
ACCESS verbs do not update the database. This comforting thought tends to put most new students/users at
ease. It means that when you attempt an ACCESS sentence and it fails, nothing in the system is hurt and
nobody but you knows about it. You simply pick yourself up, dust yourself off, and get back up on that horse
and try again. If it’s any consolation, even PICK masters have to tinker around with ACCESS sentences and
dictionaries to get ACCESS to do exactly what they want it to do.
The examples in the following section illustrate how ACCESS sentences are
constructed. They are intended to provide a general overview of how ACCESS
processes the sentences it receives. Later, in the tutorial, you will get a chance to
construct and execute ACCESS sentences using the STAFF file created in chapters 3
and 4.
If you want to execute these sentences now, you will first have to build the
attribute-defining items in the dictionary of the STAFF file. The instructions for
adding them are described later in this chapter, under Attribute-Defining Items.
ACCESS Sentences
ACCESS sentences require at minimum a verb and a filename. Optionally these may
be followed by any ACCESS operative, including sequencing criteria, selection
criteria, output modifiers, a list of attributes to display, and special “options,” to alter
10
0
the normal behavior of an ACCESS sentence. A sample minimum ACCESS sentence
is shown below.
>SORT STAFF<cr>
where:
SORT is the verb.
STAFF is the filename.
A few seconds later, the following report appears on the screen:
STAFF.....
100
101
102
103
1
0
1
Chapter
5
104
105
106
7 ITEMS LISTED.
Adding an Output
The format of an ACCESS sentence is relatively free-form. ACCESS insists on having
Field
the verb as the first word in the sentence, but after that, almost anything goes. One of
the features that may be added is a list of attributes to output on the report. This is
illustrated in the following example:
where:
SORT is the verb.
STAFF is the filename.
NAME is the output field.
This sentence produces the following report:
STAFF..... NAME............
7 ITEMS LISTED.
Adding Sequencing The PICK System stores data in a random sequence, based on its unique hashing
Criteria algorithm. This means that special modifiers must be added to the sentence when a
report is to be prepared in a collated sequence. The key word here is the BY modifier. It
indicates the field on which the sort is to be performed. Multiple BY modifiers are
permitted, and they are processed
from left to right in the sentence. The next example illustrates the use of the BY modifier.
10
2
ACCESS
where:
SORT is the verb.
STAFF is the filename.
BY NAME is the sequence criterion.
NAME is the output field.
The output from this statement is as follows:
STAFF...... NAME............
7 ITEMS LISTED.
Adding Selection Unless ACCESS is told to exclude certain data, it automatically reports on Criteria the entire
contents of a file. Selection criteria may be added to an ACCESS sentence to have it work with data that meets a
certain criterion or set of criteria. The key word here is the WITH modifier. It allows ACCESS to compare the
value of an attribute with a user-specified string of characters, to see if each record is eligible for processing. The
following ACCESS sentence contains a single selection criterion.
where:
SORT is the verb.
STAFF is the filename.
BY NAME is the sequence criterion.
WITH STATE = "CA" is the selection criterion. NAME STATE are output
fields.
10
3
Chapter
5
PAGE 1 12:30:30 26 JUN 1992
3 ITEMS LISTED.
Attribute-Defining Items
The ACCESS language relies on the two bottom levels of the PICK System file
hierarchy: the dictionary and the data levels.
The data level is the point at which the data actually resides. The dictionary
level is reserved for the attribute- defining items (the words) used in ACCESS
sentences to retrieve and display data items.
Attribute-defining items are used to:
■ Define data attributes (fields), and indicate to the PICK System exactly where
these fields are located in the file.
■ Define mathematical functions and formatting operations that will be applied to
the data prior to display—for example, algebraic equations or the concatenation
of several attributes and/or literals.
■ Define the width of the output column on the report, the justification of the
data, and the optional column headings.
■ Define output masks, or conversions, the functions that assist in converting data
from internal to external format.
10
4
ACCESS
Format of Attribute- As discussed in chapter 2, each attribute-defining item has a specific function and
Defining Items format.
001 Attribute pointer type (A, S, or X). The majority of attribute-defining
items contain an A pointer here. S is called a “Synonym” definition item,
and is almost exactly identical to an A. X is called a “protected” attribute;
it is discussed later in this chapter in the section on Implicit Attribute-De-
fining Items.
002 Attribute Mark Count (AMC); the position of the data attribute within the
data item. In most cases, this is the field number to extract. A few special
values are accepted here. When there is a 0 (zero) here, it refers to the
item-id field. When there is a 9999 here, it displays the size, in bytes, of the
item being processed.
003 Optional column heading to display at the top of the column for the
data value.
004 Optional “association specification” (used on multivalues only).
005 Not used; should be null.
006 Not used; should be null.
007 Optional output conversion. Make a mental note of this: The conversion line
is called the postprocessing phase. This means that any conversion (or
correlative) code(s) listed here are applied to the data just before print time.
008 Optional output correlative. This is called the preprocessing phase. This
means that any correlative (or conversion) code(s) listed here are applied to
the data before it is sorted or selected.
009 Justification. At present four possible values may go here: Left, used for any
data that contains alphabetic characters; Right, for purely numeric data
(including dates, money amounts, and time); Text, used on alphabetic data
that may contain spaces, so that detail lines will break between words
rather than at the width of the column; and Unconditional Left, which
prevents the line from wrapping around, no matter how long it is.
010 Width of output column.
Sample Data Items For an example of how one or more attribute-defining items would be applied, examine the
sample data items from the STAFF file, in example 5-1.
10
5
Chapter
5
Example 5-1 Data
100 NAIL, RUSTY 101 PIERCE, CARLA
items used in 001 001
examples in this book 002 20 LONE PINE TRAIL 002 1565 ORANGE AVE
003 RICHMOND 003 COSTA MESA
004 VA 004 CA
005 23230 005 92667
006 8046678888 006 7145563691
007 4444 007 8777
008 -4444 008 -7000
009 157500 009 177000
102 103
001 POLITAN, COSMO 001 MORGAN, JULIE
002 100 MADISON AVE 002 BOX 1, ROUTE 7
003 NEU YORK 003 NAGS HEAD
004 NY 004 NC
005 10012 005 27930
006 2124468877 006 9199987755
007 8000 007 8111
008 2000 008 -1000
009 180000 009 155000
104 105
001 PORTER, MIKE 001 DOWNEY, KELLY
002 4435 LAKE BLVD. 002 2231 MISSION WAY
003 LAKE ELSINOR 003 ST. LOUIS
004 CA 004 MO
005 98764 005 88876
006 7146436543 006 3147436543
007 7777 007 4525
008 -2000 008 -1500
009 150000 009 160000
106
001 HARRIS, FOREST
002 2345 CLOUD NINE DR
003 HOLLYWOOD
004 CA
005 92777
006 2138765432
007 5678
008 -9000
009 999999
These are the items used throughout all of the examples in this book.
Naturally, since you built your own data in the STAFF file according to the
instructions in chapter 4, your data items will differ from these.
10
6
ACCESS
Sample Dictionary Table 5-1 shows sample attribute-defining items that you might find in the Items dictionary
of a file. These items from the STAFF file represent five distinct items.
001 A A A A A
002 1 2 3 4 5
003 NAME ADDRESS CITY STATE ZIP
7 ITEMS LISTED.
ACCESS reports automatically include the filename from which the report was
generated and the item-id of each item presented (the left-most column). At the end of a
report, the number of items presented is also displayed. Reports generated by ACCESS
also provide a default heading if one is not requested. The default heading includes the
10
7
Chapter
5
current time, date, and page number.
Adding the In chapter 4 you constructed the actual data in the STAFF file. Now it’s Dictionary
Items time to build the attribute-defining items for retrieving the data with ACCESS. Attribute-defining
items are typically built through the Editor. To add the five sample items listed in the previous table to the
DICT (dictionary) of the STAFF file, follow these steps:
This instructs the Editor to edit these five items into the DICT of the STAFF
file.
NAME
NEW ITEM TOP - I<cr>
001 +A<cr>
002+1 <cr>
This informs ACCESS that the data for NAME will be located in the first
attribute of the data item. Once NAME has been filed and you are building the other
items in the STAFF dictionary, be sure to use the appropriate number (AMC) for the
attribute-defining item being built.
003+NAME<cr>
This indicates that the word NAME should appear at the top of the column
when the NAME is being printed or displayed.
004+X<cr>
The X in this and the next four attributes will eventually be changed to nulls. It
is placed here so that you can continue to add new attributes in the Editor Insert mode
until you reach attributes 9 and 10, where the justification and column width will be
placed. This procedure has nothing to do with attribute-defining items; it just makes
building them easier.
As an aside, you could use a character other than X. The reason that X was chosen is
that it is visible and does not appear in any of the attributes. Some people are inclined to use
a space instead of an X, since it keeps the Editor in the Insert mode and does not appear on
the screen; therefore, there must be nothing there. Wrong. This shortcut is quickly discovered
when the next ACCESS sentence is executed using the attribute-defining item containing the
10
8
ACCESS
spaces. The sentence croaks with a message to the effect: ILLEGAL CONVERSION CODE
' '. (The space between the quotes is intended). This means that ACCESS tried unsuccessfully
to apply the space as a conversion and failed, because it’s not a valid conversion. Fortu -
nately, nothing is hurt. Just use the Editor to replace the spaces with nulls and then file the
item and issue the sentence again.
005+X<cr>
006+X<cr>
007+X<cr>
008+X<cr>
009+L<cr>
This tells ACCESS that the data in this attribute is to be displayed left-justified on
output.
010+15<cr>
This specification provides for 15 columnar positions in the NAME column when
NAME is output. If the actual data in the NAME attribute is wider than 15 column positions,
it will wrap around to the next line. Now the structure of the attribute-defining item is
complete, but we have to remove all of the position holding X characters.
011+<cr>
Pressing <cr > at the + prompt character causes the Editor to leave the Insert mode and
return to the Command mode.
TOP
-F<cr>
This instructs the Editor to flip the buffers so that the current item may be
examined.
TOP
-R10/X//<cr>
This instructs the Editor to replace, in the next ten attributes, the first occurrence of the
letter X with a null. The effect is that all of the positions containing an X are converted to
null. The result on the CRT screen looks like this:
004
005
006
007
008
EOI 010
10
9
Chapter
5
The attribute-defining item is now ready to file. The FI command instructs the
Editor to write the current item into the dictionary of the STAFF file.
-FI<cr>
•NAME* FILED.
ADDRESS
NEW ITEM
TOP
Because you initially requested five items for editing, the next item in the
itemlist automatically appears. Return to the top of the procedure used for the NAME
attribute-defining item to construct the ADDRESS attribute-defining item, then repeat
the procedure for the CITY, STATE, and ZIP. After the five attribute-defining items
are constructed, the ACCESS report may be created with the following sentence:
where:
PAGE 1 12:34:32
26 JUN 1992 STAFF........... NAME.................. ADDRESS........ CITY
...........
HOLLYWOOD
CA 92777
100 NAIL, RUSTY 20 LONE PINE TRAIL RICHMOND
VA 23230
11
0
ACCESS
101 PIERCE, CARLA 1565 ORANGE AVE COSTA MESA
CA 92667
102 POLITAN, COSMO 100 MADISON AVE NEW YORK
NY 10012
103 MORGAN, JULIE BOX 1, ROUTE 7 NAGS HEAD
NC 27930
104 PORTER, MIKE 4435 LAKE BLVD. LAKE ELSINOR
CA 98764
105 DOWNEY, KELLY 2231 MISSION WAY ST. LOUIS
MO 88876
7 ITEMS LISTED.
The ACCESS sentence in the previous example displays the items in the
STAFF file, and each item’s item-id, name, address, city, state, and ZIP. The
items do not appear on the report in the same order in which they were entered.
They appear in an apparently random sequence. This is due to the hashing
method that the PICK System uses to place items into, and retrieve items from,
files. To sequence data by the item-id, or the NAME, or any other attribute, the
SORT verb is used in place of the LIST verb with a BY modifier in the
sentence. When no sort key is specified, ACCESS automatically sorts by the
item-id.
All of the ACCESS reports up to this point, and throughout the rest of the
Implicit Attribute
tutorials, fall into a class called explicit reports. This means that if you want a
Defining Items
particular attribute defining item to appear on a report, it must be “explicitly”
requested. For instance, to see the name on the report, you could issue the
following sentence:
>SORT STAFF<cr>
11
1
Chapter
5
STAFF 100
101
102
103
104
105
106 7 ITEMS LISTED.
Notice that on the report, all you see besides the standard page heading is the
filename and item-id for each item in the STAFF file. Now, you can add the implicit
attribute-defining items to the dictionary of the STAFF file. The ACCESS statement
below is one method by which the implicit attribute-defining items can be added.
>COPY DICT STAFF NAME ADDRESS CITY STATE ZIP<cr> TO:1 2 3 4 5<cr>
1 NAME TO 1
2 ADDRESS TO 2
3 CITY TO 3
4 STATE TO 4
5 ZIP TO 5
6 ITEMS COPIED.
Now, try the same ACCESS command again, as shown in the next example:
>SORT STAFF<cr>
PAGE 1 12:34:32
26 JUN 1992 STAFF........... NAME.................. ADDRESS......... CITY
...........
RICHMOND
VA 23230
101 PIERCE, CARLA 1565 ORANGE AVE COSTA MESA
CA 92667
11
2
ACCESS
7 ITEMS LISTED.
STAFF.............
100
101
102
103
104
105
106
7 ITEMS LISTED.
The next time the file is LISTed or SORTed, the CITY will not display.
The only way that the CITY would display is by explicitly requesting it, which
would then require explicit requests to display the other attribute-defining
items.
7 ITEMS LISTED.
>SOR STAFF<cr
T >
Before moving on to the next topic, change the X back to an A in the
attribute-defining item called 3.
Throwaway Connectives
Up until now, we have seen ACCESS commands where each unique word in
the command had a special purpose. ACCESS provides extra words in your
account MD, called throwaway connectives, to assist in making ACCESS
sentences more readable and grammatically correct. The word “throwaway”
should be self-explanatory. ACCESS “parses” these words out of the sentence
before the actual execution of the command, in effect ignoring them. The
throwaway connectives provided with PICK-on-the- PC are as follows:
A IN
AN ITEMS
ANY OF
11 ARE OR
4
ACCESS
DATA THE
With these items in the MD of the current account, the following sentence is
valid:
where:
SORT is the verb.
THE is a throwaway connective.
STAFF is the filename.
ITEMS is a throwaway connective.
Here’s a little trick that lets you supplement the existing set of throw-
away connectives in your MD by copying one of them over and over to new
item-ids:
1 A TO SHOW
2 A TO SHOWING
3 A TO FIELD
4 A TO ATTRIBUTE
5 A TO DISPLAY
6 A TO DISPLAYING
7 A TO TO
8 A TO TUBE
9 A TO FILE
10 A TO PLEASE
10 ITEMS COPIED
Once the new items have been successfully added to your MD, the
ACCESS sentence in the next example is possible. You can use this same
technique to add local slang words and colloquialisms to your vocabulary (like
“PARDNER” for Texans, “YO” for New Yorkers, and “FER- SURE” for
Southern Californians).
STAFF............... NAME............................
7 ITEMS LISTED.
Of course, this report could have also been produced with the sentence:
Selection Criteria
We discussed selection criteria briefly earlier in this chapter. Selection of
specific items from a data file requires the WITH or IF modifier in an AC-
CESS sentence. The WITH modifier causes ACCESS to retrieve only the
items that meet the criteria following the WITH. The WITH modifier has the
general form:
WITH attribute-name logical-operator "value string"
The attribute-name may be any attribute-defining item in the dictionary
level of the file (for example, NAME, ADDRESS, CITY, STATE, or ZIP).
The logical-operator can be any of the symbolic or mnemonic forms listed in
table 5-2.
= EQ Equal to
> GT or AFTER Greater than
< LT or BEFORE Less than
>= GE Greater than or equal to
<= LE Less than or equal to
# NE or NO or NOT Not equal to
The value string may be any series of letters and/or numbers; it should be
entered between double quotation marks ("). In order for an item to be eligible for
ACCESS processing, it must contain exactly the same characters that appear
between the quotes in the value string specification. The following examples show
how selection criteria can be applied.
3 ITEMS LISTED.
4 ITEMS LISTED.
1 ITEMS LISTED.
where:
PAGE 1 13:06:00 26
JUN 1992
END OF LIST
In the previous example, only data items with the city of HOLLYWOOD
and the state of CA will be displayed. This means that all other items with CA in
the STATE attribute will be ignored, as will HOLLYWOOD Florida.
In the preceding example, data items that meet either selection criterion will
be displayed.
Shortcuts in The selection criterion assumes a few “default” settings when certain Selection
Criteria things are omitted. For instance, when the logical operator is omitted, it automatically means
equal to, as shown in the following example. In each of the next three examples, the first and second
sentence do exactly the same thing.
STAFF......NAME.............
END OF LIST
11
9
Chapter
5
Note that the value in quotes is now preceded by a [ (left bracket)
character. This instructs ACCESS that the value in the name field may be
preceded by any characters, as long as it ends with the characters CARLA. In
this case, item 101 is selected for display. Using the [ instructs ACCESS to
ignore everything to the left of the specified value string.
The ] (right bracket) character instructs ACCESS to ignore all characters
to the right of the value string. This is illustrated in the following example:
STAFF......NAME............
3 ITEMS LISTED.
This example instructs ACCESS to select only those items whose NAME
field begins with the letter P.
The string searching function can also be used in both directions si-
multaneously, as in the following ACCESS sentence:
STAFF...... NAME...........
2 ITEMS LISTED.
Rules on the Use of ACCESS recognizes a functional difference between single quotes and Quotes
double quotes in a sentence.
STAFF......NAME............ ADDRESS...............
END OF LIST
STAFF......NAME............
3 ITEMS LISTED.
String Searching In the previous example, individual item-ids were requested in an AC- and Item-
Ids CESS sentence. The earlier topic of string searching is often combined with single quotes to
perform a special form of string searching on item- ids. Both of the following examples appear to do
the same thing, but they are, in fact, quite different.
In both of the previous sentences, only the item-id 101 appears on the
report. The primary difference in the two sentences is that the first instructs
12
1
Chapter
5
ACCESS to locate the item-id 101, which it accomplishes by “hashing” it to its
logical address. The second sentence effectively instructs ACCESS to retrieve
all item-ids called 101 in the STAFF file, meaning that it starts at the “top” of
the file and looks at every item before, including and after the item-id 101.
Since there can only be one occurrence of any item-id in a file, this second
sentence is kind of pointless. More importantly, because your STAFF file is
still relatively small, it is difficult to discern any noticeable difference in
processing time between the two sentences. Processing time on the second
form of this sentence increases proportionately with the amount of data that
ACCESS must wade through, while the first sentence’s processing time is
completely independent of the amount of data in a file.
The second form of the sentence is more often used in conjunction with the
[ and ] characters introduced earlier. The following example illustrates string-
searching of an item-id.
MD.......
LIST
LIST-ITEM
LIST-LABEL
LIST-LOCKS
LISTABS
LISTACC
LISTCONN
LISTDICT
LISTFILES
LISTPEQS
LISTPROCS
LISTPTR
LISTU
LISTUSERS LISTVERBS
15 ITEMS LISTED.
12
2
ACCESS
In the previous sentence, ACCESS is instructed to display all item- ids
in the MD that start with the characters LIST. The same sentence without the =
will not work unless there is an item in the MD called "LIST]", which is
unlikely.
The COUNT Verb The COUNT verb simply returns the number of items in a file, or the number
of items that meet a certain selection criteria.
>COUNT STAFF<cr>
7 ITEMS COUNTED
In the example above, the COUNT verb instructs ACCESS to count all
the items in the STAFF file.
3 ITEMS COUNTED
The LIST verb displays items in their “hash order” sequence within the file; no
The LIST Verb sorting takes place. The output from the following ACCESS sentence includes
the item-id, the NAME, and the ADDRESS attributes from each item in the
STAFF data file.
STAFF.....NAME............. ADDRESS...............
12
3
Chapter
5
103 MORGAN, JULIE BOX 1, ROUTE 7
104 PORTER, MIKE 4435 LAKE BLVD.
105 DOWNEY, KELLY 2231 MISSION WAY
7 ITEMS LISTED.
LIST-ITEM and The LIST-ITEM and SORT-ITEM verbs display the entire item, without
SORT-ITEM applying any attribute-defining items to the data. This is effectively like using
the COPY command with the T (for Terminal output) option, but ACCESS has
the ability to sort data, while the COPY command does not. The LIST-ITEM
verb is illustrated in the following example:
100 001 NAIL, RUSTY 002 20 LONE PINE TRAIL 003 RICHMOND 004 VA 005
23230 006 8046678888 007 4444 008 -4444 009 157500
103 001 MORGAN, JULIE 002 BOX 1, ROUTE 7 003 NAGS HEAD 004 NC 005
27930 006 9199987755 007 8111 008 -1000 009 155000
LIST-LABEL and The LIST-LABEL and SORT-LABEL verbs are used to produce formatSORT-
LABEL ted labels on the CRT or printer. After the command has been entered, ACCESS prompts for the
label parameters with a question mark. Each label parameter must be separated by a comma. An example
of LISTLABEL follows:
The previous sentence indicates that the labels are to be produced from
the STAFF file and that the NAME, ADDRESS, CITY, STATE, and ZIP
fields are to be displayed on five separate lines. (In Appendix E, Dictionary
Listings from Tutorials, an item called CSZ is provided to have ACCESS put
the CITY, STATE, and ZIP all on the same line. Try this one later when you
get a chance.)
The C option activates the COL-HDR-SUPP (column header suppress)
function, and the I option activates the ID-SUPP (suppress display of item-id)
function. Both are discussed again later in this chapter.
After pressing the <cr>, the ? prompt character appears on the screen.
This is the point at which the label parameters are provided to ACCESS. The
label parameters include:
1. The number of labels across the page
2. The number of lines being printed on each label
3. The number of positions between labels (horizontal)
4. The number of positions to indent
12
4
ACCESS
5. The number of print positions on each label
6. The number of lines between labels (vertical)
7. The letter C to “compress” blank lines
Each of the label parameters is separated by a comma, as shown in the
following example:
?2,5,1,0,30,2,C<cr>
These are the label parameters. They have the following meanings:
2 The number of labels across the page. This is a function of the labels
themselves.
5 The number of rows per label. This is a function of the number of
fields to be printed (NAME, ADDRESS, CITY, STATE, and ZIP).
1 The number of blank lines (vertically) between labels on output.
0 The number of spaces to indent from the left margin. It is
recommended that the labels be physically aligned at the proper
indentation on the printer itself and that this parameter always be 0
(zero).
30 The number of print positions per label. If the data being printed
exceeds this number, it will be truncated (chopped off) to prevent
accidental overprinting on the next label.
2 The number of spaces (horizontally) between labels.
C Instructs ACCESS to compress null values. For example, if one of the
records has no address field, this prevents a blank line from
occurring where the address would normally print. The city prints
where the address normally would, and the rest of the label data
moves up one line.
NC CA 12
5
Chapter
5
27930 98764
List-Processing Commands
The ACCESS list-processing commands provided with PICK are used to
create lists of item-ids that are in a particular sequence and/or selection
criterion. Once they are created, these lists of item-ids may be immediately
used by another process, like a TCL or ACCESS command, or saved as an
item for use later. Before we investigate this PICK System feature, we need to
locate a certain special file used in list processing.
The POINTER- All ACCESS list-processing commands use the file called POINTER FILE FILE
to store and retrieve saved lists.1 Let’s check now to make sure that you have this file, or that you
have a Q-pointer in your MD to this file, by using ACCESS to list the contents of the POINTER-
FILE.
>LIST POINTER-FILE<cr>
A message will indicate that the file has been created. The steps in the
following section must be performed on the pointer to the POINTERFILE in
your MD.2
>ED MD POINTER-FILE<cr>
TOP
-R/D/DC<cr>
001 DC
. FI<cr>
•POINTER FILE* FILED.
12
6
ACCESS
SELECT and The SELECT command is used to build a temporary list of item-ids that
SSELECT meet a specific selection criterion. SSELECT is functionally identical, but allows the
item-ids to be sequenced by one or more sort criteria.
The SELECT verb is illustrated in the following example:
’Note for Open Architecture users: Any file may contain lists in addition to the
POINTER-FILE. As a result, all list-processing commands (like SAVE-LIST and GET-
LIST) allow a filename specification in the form :verb filename listname.
2
Note for Ultimate, McDonnell Douglas, and Open Architecture users: Don’t do this!
This not only is not required on your system, it could cause other problems. ate a list of
item-ids using the selection criterion that the data items to be selected must
have the characters CA in the attribute defined by the STATE attribute-
defining item.
The 3 ITEMS SELECTED message indicates that the SELECT process is
complete and that the list is now ready for use. It is extremely important to
understand that the list of item-ids must be used immediately; otherwise, it will
disappear. The very next command issued from TCL either uses or eliminates this
list of item-ids, as shown in the following example:
3 ITEMS LISTED.
Note that only the items containing the state abbreviation, CA, are displayed.
ACCESS applied the list of item-ids just generated by SELECT, and now the list
has gone away. This illustrates the immediate use of the SELECT command—
where the list is generated, used, then released—as opposed to saving the list for
later use.
The SSELECT verb is illustrated in the following example:
7 ITEMS SELECTED.
>LIST STAFF NAME<cr>
12
7
Chapter
5
STAFF......NAME.............
7 ITEMS LISTED.
12
8
ACCESS
The SSELECT verb in the previous example constructs a list of item-
ids, this time in the ascending name sequence. Using the list created with
SSELECT, the LIST verb is issued. The items on the report are displayed in
ascending sequence by NAME. Once again, the list is used, then it goes away.
The SAVE-LIST The SAVE-LIST command is used after a SELECT or SSELECT to save, or
Command write, the list to the POINTER-FILE for later use. An ACCESS command can
utilize this saved list again and again simply by referring to the name of the
list, which can be any combination of characters (as discussed earlier under the
topic of item-ids).
Choosing descriptive names for saved lists can be very helpful when
later reviewing the POINTER-FILE. There is no connection between the saved
list and the file from which the list of item-ids was generated; hence, it may be
useful to indicate the name of the file in the name of the saved list, as
illustrated in the following example:
7 ITEMS SELECTED.
>SAVE-LIST STAFF.LIST<cr>
Once a list has been saved, it may be retrieved for use with any file-handling
The GET-LIST command. The GET-LIST command is used for this purpose. It retrieves and
Command reactivates a specific saved list, just as it was immediately following the
SELECT or SSELECT that generated the list.
>GET-LIST STAFF.LIST<cr>
7 ITEMS SELECTED.
>LIST STAFF NAME CITY ZIP<cr>
12
9
Chapter
5
102 POLITAN, COSMO NEW YORK 10012
104 PORTER, MIKE LAKE ELSINOR 98764
7 ITEMS LISTED.
This instructs ACCESS to retrieve and reactivate the list called
STAFELIST. The 7 ITEMS SELECTED message indicates that the list is now
ready to be used.
Note that the data items are displayed in ascending NAME sequence, as
requested in the SSELECT command that generated the list.
The EDIT-LIST
Command
Saved lists may be edited with the EDIT-LIST verb. EDIT-LIST allows every
command discussed in chapter 4 to be used, and automatically retrieves the lists
from the file called POINTER FILE. Consequently, the general form of the
EDIT-LIST command does not require a filename. This is shown in the
following example:
>EDIT-LIST STAFF.LIST<cr> TOP .P<cr> 001 105 002 106 003 103 004 100 005 101 006 102
007 104 EOI 007 - EX<cr> •STAFF.LIST* EXITED.
The previous example shows the steps needed to edit the list called
STAFELIST. This simply illustrates that all commands in the Editor command
sei are available to EDIT-LIST. (The P command defaults to Li st 22 lines.) To
leave the list unchanged, the EX (Exit Item) command is issued.
The COPY-LIST command is used to copy saved lists to new names or to the
The COPY-LIST CRT or printer.
Command
>COPY-LIST STAFF.LIST<cr>
TO:TEMP.LIST<cr>
1 STAFF.LIST TO TEMP.LIST
This example instructs the system to copy the list called STAFELIST to
a new item-id called TEMP.LIST, resulting in identical lists with different
names.
The DELETE-LIST The DELETE-LIST command is used to clean up the POINTER-FILE. Command
In systems where storage space is limited, removing obsolete lists helps to return extra storage space to
the virtual memory overflow table. This makes more virtual workspace available for processing and data
storage.
13
0
ACCESS
>DELETE-LIST TEMP.LIST<cr>
This instructs the system to remove the saved list called TEMP.LIST. Note
that the DELETE-LIST verb is a modified TCL-II type command. Even
though it does not require a filename, it still accepts the * to affect all items.
This means that you could, although you probably wouldn’t want to, issue the
command: >DELETE-LIST *. This has the annoying side effect of leaving
your system quite “listless.”
13
1
Chapter
5
Generating a T- The following commands illustrate how to archive data to magnetic media for
DUMP Tape or Disk later retrieval by ACCESS.
>T-ATT<cr>
TAPE ATTACHED. BLOCK SIZE: 500.
>T-REW<cr>
BLOCK SIZE: 500
>SSELECT STAFF<cr>
7 ITEMS SELECTED >T-DUMP STAFF<cr> 1 100 2 101 3 102 4 103 5 104 6 105 7 106
7 ITEMS DUMPED.
Producing Reports Position the media back to the beginning with the T-REW command as shown
from Media: The in the following example:
TAPE Modifier
>T-REW<cr> BLOCK SIZE: 500
13
2
ACCESS
100 NAIL, RUSTY 20 LONE PINE TRAIL
101 PIERCE, CARLA 1565 ORANGE AVE
102 POLITAN, COSMO 100 MADISON AVE
103 MORGAN, JULIE BOX 1, ROUTE 7
104 PORTER, MIKE 4435 LAKE BLVD.
105 DOWNEY, KELLY 2231 MISSION WAY
106 HARRIS, FOREST 2345 CLOUD NINE DR
7 ITEMS LISTED.
This produces a report showing the item-id, name, and address of every
item on the media, indicated by the TAPE modifier. The data items are in
ascending sequence, as they were SSELECTed before the T-DUMP.
An important note: The TAPE modifier may only be used with AC-
CESS commands that do not sort data. This includes LIST, COUNT, SUM,
STAT, SELECT, LIST-ITEM, T-LOAD, and REFORMAT. The LIST-LABEL
was deliberately left out of this list because it does not work consistently with
the TAPE modifier.
Loading Data from T- It may be necessary on occasion to reload data from a T-DUMP tape or disk.
DUMP Media The T-LOAD command is used for this purpose. In the first example, using the
media you just created with the T-DUMP verb, the protective nature of the T-
LOAD process is revealed. T-LOAD never unconditionally writes over
existing data items unless it is specifically directed to do so.
>T-REW<cr>
BLOCK SIZE: 500
>T-LOAD STAFF<cr>
• lOO* EXISTS ON FILE
• 101 EXISTS ON FILE
1
0 ITEMS LOADED.
If you want to unconditionally write these items to the STAFF file, the
O (as in Overwrite) option is used to overwrite duplicate item-ids, as illustrated
in the following example:
>T-REW<cr>
1 100
2 101
3 102 13
3
Chapter
5
4 103
5 104
6 105
7 106
7 ITEMS LOADED.
Each item-id displayed during the process indicates that the item has
been successfully written to the STAFF file.
One final note on T-LOAD: It, too, can be combined with selection
criteria, just like T-DUMP.
where:
NAME ADDRESS are the output fields.
COL-HDR-SUPP ID-SUPP-LPTR are the modifiers.
13
4
ACCESS
MORGAN, JULIE BOX 1, ROUTE 7
PORTER, MIKE 4435 LAKE BLVD.
DOWNEY, KELLY 2231 MISSION WAY
This ACCESS sentence could also be written using the option form
shown in the following example:
where:
(CIP) are the options.
Note: Not all modifiers have one-character option equivalents.
The BREAK-ON The BREAK-ON modifier is used to generate a visual and logical control break
Modifier when a change occurs in an attribute used for sorting the items. The visual
portion of the break is displayed as the string *** between two blank lines on
the report. If the TOTAL modifier is also in effect during a control break, then
the subtotal for each attribute specified with the TOTAL modifier is displayed.
★ ★★
***
***
***
13
5
Chapter
5 it it it
***
7 ITEMS LISTED.
The BY Modifier The BY modifier specifies the sort sequence of a report. The default sequence is
ascending. Each BY modifier must be followed by a valid attribute-defining
item defined in the dictionary of the file being used for the report. There is no
limit to the number of BY modifiers; when more than one is present, they are
processed left to right.
7 ITEMS LISTED.
The BY-DSND The BY-DSND modifier reverses the ascending sequence normally specified by
Modifier the BY modifier and causes the data to be sequenced in descending order. Just
like the BY modifier, each BY-DSND modifier must be followed by a valid
attribute-defining item. There is no limit to the number of BY-DSND modifiers,
and they are also processed from left to right.
13
6
ACCESS
7 ITEMS LISTED.
This instructs ACCESS to sort the data in the STAFF file by descending
ZIP code.
The COL-HDR- The COL-HDR-SUPP modifier suppresses both the default page heading—
SUPP Modifier or which normally includes the time, date, and page number—and the attribute
(C) Option column headings. Its equivalent is the (C) option. This modifier is typically
used during processes such as the LIST-LABEL command, to prevent the
headings from appearing on the labels.
13
7
Chapter
5
The DET-SUPP The DET-SUPP modifier is used in an ACCESS sentence in which a sort
Modifier or (D) sequence is combined with a BREAK-ON modifier. The function of this
Option modifier is to suppress the display of all detail lines contributing to a con trol
break, and instead to display the data value that caused the control break to
occur.
CA $13,269.99
MO $1,600.00
NC $1,550.00
NY $1,800.00
VA $1,575.00
★★★ $19,794.99
7 ITEMS LISTED.
The previous sentence instructs ACCESS to sort the data items by the
contents of the STATE attribute. During output, each time the data item in the
STATE field changes, only the STATE attribute is displayed, rather than all of
the data items or detail lines that comprised the control break. Because the
TOTAL modifier is also in effect, each control break shows a subtotal and the
columnar total for the SALARY attribute.
If this example had failed with the message THE WORD ’SALARY ’
CAN NOT BE I DENT IFI ED, it might suggest that you didn’t see the note
earlier in this chapter called Read Me Before Continuing! You need to add
the dictionary items from appendix E.
FOOTING and The HEADING and FOOTING modifiers are identical in their syntax and
HEADING options. The HEADING modifier defines text to be displayed at the top of
Modifiers each report page, while the FOOTING defines the text at the bottom of each
page. The general form of HEADING and FOOTING is as follows:
13
8
ACCESS
Option Function
C Centers output
D Outputs (external) system date
F Outputs filename
L Performs linefeed/carriage return
P Outputs page number, right-justified in a field of four blanks
PN Outputs page number, left-justified
T Outputs (external) system time and date
ii Outputs one single quote
>SORT STAFF BY STATE BY ZIP HEADING "'LC'STAFF FILE REPORT 'L'" FOOTING
’’'LC'PAGE 'PN'
PRINTED AT ,TL,,, NAME ADDRESS CITY STATE ZIP<cr>
STAFF FILE REPORT
13
9
Chapter
5
103 MORGAN, JULIE BOX 1, ROUTE 7 NAGS HEAD
NC 27930
102 POLITAN, COSMO 100 MADISON AVE NEW YORK
NY 10012
100 NAIL, RUSTY 20 LONE PINE TRAIL RICHMOND
VA 23230
PAGE 1 PRINTED AT 13:39:17 26 JUN 1992
The HDR-SUPP The HDR-SUPP modifier suppresses the default page heading that contains the time,
Modifier or (H) date, and page number. Its equivalent is the (H) option.
Option
>SORT STAFF BY HIRE.DATE NAME HIRE.DATE HDR-SUPP<cr>
14
0
ACCESS
The ID-SUPP Modifier The ID-SUPP modifier suppresses the automatic display of each data item’s
or (I) Option item-id. Its equivalent is the (I) option.
NAME............. PHONE.........
7 ITEMS LISTED.
The WITH and IF The WITH and IF modifiers are identical in function, and form the basis of the
Modifiers selection criteria of an ACCESS sentence. IF can be substituted for WITH to
make the ACCESS sentence more readable. This topic is discussed in detail in
Selection Criteria, earlier in this chapter.
The LPTR Modifier or The LPTR modifier directs the output of the report to a printer instead of the
CRT. Its equivalent is the (P) option.
(P) Option
>SORT STAFF BY NAME LPTR<cr>
The NOPAGE Modifier The NOPAGE modifier displays the report on the CRT without pausing for the
or (N) Option user to press a key between each page of output. Its equivalent is the (N)
option. This modifier is typically used when the report is being printed on a
slave printer attached to the CRT.
>LIST MD NOPAGE<cr>
14
1
Chapter
5
PAGE 1 13:49:41 26 JUN 1992
STAFF... .. SALARY....
106 $1,400.00
100 $1,575.00
101 $1,770.00
102 $1,800.00
103 $1,550.00
104 $1,500.00
105 $1,600.00
★★★ $11,195.00
7 ITEMS LISTED.
STATISTICS OF SALARY :
TOTAL = $11,195.00 AVERAGE = $1,599.2857 COUNT = 7
The SUM Verb The SUM verb provides a total for a numeric field.
These two verbs are used to provide a “histogram” representing the distribution
ISTAT and HASH-
of items in a file. The output is useful for determining information pertinent to
TEST
sizing and resizing files.
REFORMAT and These two verbs are the only ACCESS verbs that can actually update a file.
SREFORMAT They are typically used to take selected attributes from a file and put them into
another file, reorganizing them along the way. If you should happen
14
2
ACCESS
to use this verb, be aware that if you are not careful you can destroy your files
very quickly.
The LISTDICT You have just completed a crash course in ACCESS. A verb that is related to
Command this topic is LISTDICT. It prepares a formatted report on the contents of a
specified dictionary and is illustrated in the following example. The output
looks better on wide (132-column) paper.
PAGE 1 13:52:34 26
JUN 1992
. S/AMC CONVERSIONS..
NAME A 1 NAME
L 15 ADDRESS A 2 ADDRESS
T 20 CITY A 3 CITY
L 15 STATE A 4 STATE
L 5 ZIP A 5 ZIP
R 5
PHONE A 6 PHONE ML((#W ###-
L 14
####)
HIRE.DATE A 7 HIRE.DATE D2Z
R 8
BIRTHDAY A 8 BIRTHDAY D2- R
8
SALARY A 9 SALARY MR2,$
R 10
9 ITEMS LISTED.
14
3
Chapter
5
The PROC language provides a means of storing TCL and ACCESS com-
mands for automatic execution. It also provides a vehicle for controlling the
flow of data processing, because it interfaces all of the essential processors,
specifically PICK/BASIC, ACCESS, and TCL.
PROC is a powerful and useful tool. Loosely described as a “language,”
it has a unique set of instructions. This chapter deals with the instructions most
often used.
PROC Features
PROCs are essentially stored procedures. A PROC is simply a chronological
list of instructions that are interpreted to perform one or more tasks. These
tasks usually include activating ACCESS sentences and TCL commands, and
running PICK/BASIC programs. For that matter, any command that can be
entered at TCL may be activated from a PROC. They are loosely similar to, if a
little more primitive than, the “batch” files found in MS-DOS. Some people
even liken them to JCL (Job Control Language) on mainframe-class systems.
Since PROCs are “interpreted” each time they are activated, no
compilation is needed. One may write a PROC, file it, and then immediately
activate it.
14
4
PROC
Identifying a PROC To indicate to the system that an item is a PROC, the system requires that each
PROC must have PQ on the first line (attribute) of the item.
Statement Labels Statement labels are optional. A statement label is a number at the beginning of a
PROC line that can later be used as a destination for a GO command. As we’ll
discover in our menu example, these usually occur at the beginning of a series
of commands that will be repeated some number of times. The following
example shows a PROC that uses a statement label and a GO statement:
001 PQ
002 10 T "HELLO THERE"
003 GO 10
14
5
Chapter
5
Command Line PROCs may have a maximum of one PROC command per line, with the exception
Limitation of the IF command, which allows a maximum of two commands on one line.
The PROC Primary Input Buffer is the point through which almost all input passes
on its way to TCL, which also happens to have its own Primary Input Buffer.
Remember how you constructed ACCESS sentences and TCL commands, then
pressed <cr> to submit them for processing? Well, each word you entered was
stored in the TCL Primary Input Buffer. When you pressed <cr>, the word or
sentence was “passed” to TCL where it either worked or croaked. You may also
remember that each word in the sentence or command was separated by a space.
This is extremely important in learning how to deal with the input buffer.
The PROC Primary Input Buffer is the repository for the answers to
questions asked in the PROC. A “pointer” of sorts is maintained in the input buffer.
Its purpose is to “point” to one of the words in the buffer. Examine the TCL
command in the following example:
Each word in the sentence is delimited by a space. We can take for granted
by now that when this, or any other, command or sentence is entered, something is
going to happen. In this case, we issue an ACCESS sentence that produces a report
if the file is there. Underneath the hood, so to speak, something takes place each
time a command is entered, and prior to anything being submitted to TCL for its
scrutiny. This process is called parsing the sentence. The Primary Input Buffer is
analyzed to determine how many things are in it. Since each word is expected to be
separated by a space, the “parser” starts at the beginning of the command and
begins to search for the first space. When it encounters this space, it effectively
says to itself, “Okay. This is the first thing in the input buffer.” In this example, it
determines that the word SORT is the first thing in the input buffer. It then
14
6
PROC
continues to scan for the next space, which it discovers after the word STAFF, so it
tags STAFF as the second thing in the input buffer. This process continues until it
runs out of things in the input buffer.
After parsing, the sentence is passed to TCL for processing. TCL always
expects the first thing in the input buffer to be a valid command (verb), so it
takes the first thing from the input buffer (without actually removing it or
physically changing the buffer) and hashes what it finds in the current MD. If
it finds what it is looking for (in this case, the SORT verb), it loads the
appropriate code from the operating system and begins to execute it. Since this
command issues an ACCESS sentence, ACCESS sends back the message that
it needs a filename in addition to a verb. The system then goes to look for the
second “thing” in the input buffer, to determine if it is a valid file pointer.
Each subsequent thing is removed from the input buffer and handled according
to the rules of the process being invoked.
The important object lesson to this story is that since you are now
writing PROCs, you must learn how to construct and navigate your way
through the input buffer. This is the place where the answers to questions that
PROCs ask are placed. Remember that each thing in the input buffer is
separated by a space, and that there is a “pointer” to “point” to one of the
things in the input buffer. This pointer has two modes of operation: it may be
manually controlled with certain commands, and it sometimes controls and
moves itself automatically.
Good news! You won’t need it. It is generally used to store the error message
numbers that are created by a process. None of the examples in this text rely
upon it.
This is perhaps the strangest of all buffers. Many attempts to explain the
abstract principle associated with it have been undertaken before this one. One
day in class I figured out an excellent analogy for the Secondary Output
Buffer. It comes from the popular “Tonight Show, Starring Johnny Carson.”
Carson occasionally does a character called “Carnac the Magnificent,” who
has the gift of clairvoyance. It seems that the “Mighty Carnac” can determine
14
7
Chapter
5
A little while later the system prompts with a ? character, asking you to
enter the label parameters. In PROCs, the user normally doesn’t want to be
bothered with such trivia, preferring that it automatically be provided. So when
we, as PROC programmers (Proctologists?), send a command such as the
SORT LABEL command to TCL through the Primary Output Buffer, we
anticipate that TCL will get around eventually to asking for more stuff, like the
label parameters. We use the secondary output buffer to “stack” the answers to
questions that TCL hasn’t even gotten around to asking yet. That’s why the
instruction that awakens the SOB is called STON (or ST ON). It is pronounced
“STack ON.” Don’t worry. This chapter includes a few excellent illustrations
of the SOB.
>ED MD CLS<cr>
N EW IT EM (Important! See note below about this message.) TOP
- Kcr>
001+PQ<cr>
002+T C<cr>
003+<cr>
- FI<cr>
•CLS* FILED.
NOTE: If, upon typing this ED command, it does NOT indicate that this is a
NEW ITEM, then DO NOT PROCEED with the example! Rather, exit the
Editor with the EX command and use another item-id as your PROC name—
for example, CS. You see, if CLS already exists in your MD it might be a file
pointer, or a PROC, or a cataloged PICK/BASIC program. Editing it could
corrupt and/or destroy what is already there!
Now that the PROC is safely stored in your MD, it is ready for action.
This is accomplished by typing in the PROC’s name at the TCL prompt
14
8
PROC
>CLS<cr>
Wasn’t that easy? If this worked correctly, your terminal screen is now
clear. This very simple little PROC just made use of the T (for Terminal)
command and one of its options: the Clear screen. If it did not work correctly,
either your term-type parameter set by the TERM command does not
correspond to the actual type of terminal you are using, or there could be
something wrong with the PROC itself. Just edit it again and make sure it
looks like the example provided above.
PROC Linkages
You could put all of your PROCs into your MD, but that is not usually
considered the most efficient technique. The more items there are in an MD,
the longer it generally takes to find them. While access time is measured in
milliseconds, it can add up. But even this is not the main reason. The MD is a
repository for many things: file pointers, verbs, connectives and modifiers, and
yes, even PROCs. The PICK System itself comes with a number of PROCs
that you will find by looking through your MD.
It is considered a better technique to keep all of your PROCs gathered
together in a file other than your MD. That’s why you created the PROCS file
earlier in this tutorial. By keeping your PROCs together, you can find them
more easily. You don’t have to weed through tons of items in the MD to
determine which belong to you and which already are part of the system.
Since PROCs are treated as verbs, in that they must be initially activated
from the TCL prompt character, at least one PROC must be put into the MD.
We generally refer to this particular PROC as the trigger PROC. Its sole
purpose is to reside in the MD until it is requested, and then to start
14
9
Chapter
5
up a PROC that resides somewhere else. In your case, this is a PROC in the
PROCS file called MENU. From that point on, all subsequent PROCs and other
TCL processes are controlled by the MENU PROC in the PROCS file. When
this PROC is told to stop, it does, and the user is returned to the TCL prompt
character for the next operation.
In their most common form, PROCs are connected to form a method of
controlling many functions. For this reason, the PROC language provides an
inherent means of linking, or connecting, PROCs. This linkage occurs in two
forms: one-way transfer of control and two-way transfer of control.
One-Way Transfer of Whenever a line in a PROC begins with the (character, control is about to pass
Control to another PROC. As is usual in the PICK System, it needs to know the name
of the file and also the name of the PROC to activate. The characteristic of this
type of transfer is that it is considered oneway. This means that when the PROC
being transferred to completes, control does NOT return to the original PROC.
The following example illustrates this feature.
001 PQ
002 (PROCS MENU)
Line 1 indicates that this is a PROC. The second line transfers control to
a PROC called MENU in the PROCS file. Again, using the parentheses around
the filename and item-id of the PROC being called indicates that when it
finishes, control does not return to the original PROC.
Two-Way Transfer of It is often necessary to have control return to a PROC automatically after
Control another PROC completes. The menu is a classic example of this. After each
menu-activated PROC completes, you want the menu to reappear. This is
accomplished by using square brackets ([ and ]), rather than the parentheses
used in the one-way transfer.
When a PROC line begins with the [ character, the PROC interprets this
as a transfer to another PROC. Just like the other form of transfer, this form
usually (but not always) requires the filename and item-id of the PROC to be
activated. The big difference is that when the PROC being activated finishes,
control automatically returns to the PROC that activated it. This relationship is
often referred to as the mainline and subroutines. Suppose, for example, that
there are two PROCs in the PROCS file: one called STAFF-REPORT and the
other called CUSTOMERREPORT. The following examples illustrate these
PROCs.
STAFF-REPORT
001 PQ
002 HSORT STAFF BY HIRE.DATE
003 H NAME ADDRESS HIRE.DATE
15
0
PROC
004 P 005 X
CUSTOMER-REPORT
001 PQ
002 HSORT CUSTOMER-FILE BY NAME
003 H NAME ADDRESS CITY STATE ZIP CONTACT PHONE
004 P 005 X
Now, if you want to produce both of these reports with one command,
another PROC can be added to the PROCS file. Let’s say you call this PROC
BOTH-REPORTS. The following example shows how this PROC might
appear.
BOTH-REPORTS
001 PQ
002 [PROCS STAFF-REPORT]
003 [PROCS CUSTOMER-REPORT] 004 X
The MENU PROC The PROC language is often used to construct menus from which other
procedures are activated according to a menu option selected by an operator.
The menu subsequently activates each of the procedures. Initially, there must
be one trigger PROC in the MD. As noted earlier, it is here that the system
initiates all PROC processing. From this point, each subsequent PROC is
activated from the PROC called MENU, which we will store, appropriately
enough, in a file called PROCS. Enter the following PROC:
15
1
Chapter
5
>ED MD MENU<cr>
NEW ITEM
TOP
-Kcr>
001+PQ<cr>
O02+(PROCS MENUXcr)
003+<cr>
. FI<cr>
•MENU1 FILED.
Comment Lines
>ED PROCS MENU<cr>
NEW ITEM
TOP
- I<cr>
001+PQ<cr>
002+C CLASS PROC MENU<cr>
Any line in a PROC that begins with the C (Comment) command is ig nored by
the PROC language. A comment line allows the person writing the PROC to
include remarks that may be used as references later. Each PROC in this section
has a comment line that describes the function of the procedure.
15
2
PROC
15
3
Chapter
5
012+IP:<cr>
15
4
PROC
014+IF # A1 GO 10<cr>
At this point in the PROC, we have tested to see if the user bailed out, or
forgot to answer the question. Now it’s time to check for the possible menu
choices. This line reads: “If input buffer 1 contains the number 1, then transfer
control to the PROC called EXAMPLE 1 in the file called PROCS.” Note that
this is one of the special two-way linkages that automatically return control to
the MENU PROC when the other PROC completes.
Line 16 reads: “If input buffer 1 contains the number 2, control transfers
to the PROC called EXAMPLE2 in the file called PROCS,” and returns to the
next line of this PROC when EXAMPLE2 completes.
Line 17 reads: “If input buffer 1 contains the number 3, control transfers
to the PROC called EXAMPLE3 in the file called PROCS,” and returns to the
next line of this PROC (MENU) when EXAMPLE3 completes.
Line 18 reads: “If input buffer 1 contains the number 4, control transfers
to the PROC called EXAMPLE4 in the file called PROCS,” and returns to the
next line of this PROC (MENU) when EXAMPLE4 completes.
Line 19 reads: “If input buffer 1 contains the number 5, control transfers
to the PROC called EXAMPLES in the file called PROCS,” and returns to the
next line of this PROC (MENU) when EXAMPLES completes.
15
5
Chapter
5
021+S1<cr>
The command on line 21 sets the input pointer to the first location of the
input buffer, in the process making the first location the “active” location. The
next IP instruction that is executed will place the input in storage area 1 of the
Primary Input Buffer.
022+IP: <cr>
023+IF A1 = Q X<cr>
15
6
PROC
025+<cr>
. FI<cr>
’MENU* FILED.
The PROC is now filed and ready to use. This menu may be activated by
entering the word MENU at the TCL prompt character (>).
>MENU<cr>
Upon activation, the screen clears, and the menu appears, offering five
options and one bailout mechanism (the letter Q). Enter a Q to return to TCL.
You need to add a few more PROCs to the file before you can use your menu
options. These are given in the examples that follow.
Placing Text into the Earlier, we discussed the various buffers associated with the PROC language.
Primary Output In the MENU PROC, all you need is the input buffer. Now, it’s time to use the
Buffer output buffers. First, we make use of the Primary Output Buffer. Remember
that the output buffer is simply a “construction area” where strings of
characters that will eventually represent a TCL command are placed. The H
command is used by PROC to move a literal string of text to the currently
active output buffer. Since this is the first time anything has been sent to the
output buffer, the result of the command is that it will contain the string,
SORT STAFF BY NAME.
15
7
Chapter
5
is processed by TCL and ACCESS. It is at this point that the output appears on
the CRT screen.
Terminating the
PROC (the X 005+X<cr>
Command)
In the MENU PROC, the X command is used to stop the PROC and return
control to TCL. In a PROC that is called via a two-way linkage (remember that
this example is called by MENU), the X command functions as a completion or
a RETURN command. Once it is executed, control returns to the PROC that
called the current PROC—in this case, the MENU PROC.
006+<cr>
. FI<cr>
'EXAMPLEr FILED.
>MENU<cr>
A report appears on the CRT, showing the contents of the STAFF file
built earlier in the Editor tutorial. At the end of the report, a prompt appears on
the CRT to remind you that the end of the report has been reached. To resume
the tutorial, enter Q to quit.
The Secondary Certain processes are divided into multiple stages. For instance, in the AC-
Output Buffer and CESS tutorial we saw the SORT-LABEL command, which is a two-part
the Mighty Carnac command.
The first part is the actual ACCESS sentence,
which is sent to ACCESS with a <cr>. ACCESS then requests more
information, specifically, the label parameters.
15
8
PROC
004+H BY ZIP<cr>
Line 4 moves the text, BY ZIP, to the end of the output buffer. The
Primary Output Buffer now contains the text, SORT-LABEL STAFF BY ZIP.
The space in front of the word BY is to make sure that the space is embedded
between STAFF and BY, as required by ACCESS.
Line 5 moves the string, NAME ADDRESS CSZ, to the end of the
Primary Output Buffer. (See appendix E for more information on the attribute-
defining item called CSZ. It must be added to the STAFF file dictionary for
this example.) The Primary Output Buffer now contains the string: SORT-
LABEL STAFF BY ZIP NAME ADDRESS CSZ.
15
9
Chapter
5
008+H2,3,1,0,30,2,C<<cr>
Because the previous STON instruction activated the SOB, this string of
text (line 8) is stored in the SOB until required by ACCESS. Note the <
character at the end of the line, before the carriage return. When moving data to
the SOB, this forces the data on the stack, effectively storing a <cr> after the
label parameters. This is particularly important when multiple strings are to be
placed on the stack.
009+P<cr>
Line 9 submits both the Primary and Secondary Output Buffers to TCL.
After processing the command, both buffers are cleared and the Primary Output
Buffer is “tagged” as the active output buffer, meaning that the next string of text
moved to an output buffer automatically goes to the Primary Output Buffer.
There is a command called RO, which is used to “Reset Output” buffer. This
command is not needed, as reset happens automatically after processing with a
P, PP, PW, PH, or PX command.
010+X<cr>
011+<cr>
-FI<cr>
•EXAMPLEZ1 FILED.
Activate the MENU PROC and watch the output from this example by
selecting menu option 2.
The STON command activates the stack. The name “stack” derives from
the fact that many things can be stacked here, as long as each is terminated by
the pseudo-<cr> character < at the end of each string. The < “pushes” the next
response on the stack. Each stack entry satisfies subsequent input requests to the
process, initiated from the POB.
Here’s the conclusion to the SOB phenomenon: The instructions listed
below, when used from the Primary Output Buffer, usually require some
response to be provided from the Secondary Output Buffer.
16
0
PROC
004+RI <cr>
16
1
Chapter
5
PROC asks if you want a report printed. You have the option of answering the
question with either a Y or N. Usually, the PROC also allows a default condition
if <cr > is pressed without answering the question. This is because PROC has the
ability not only to test for specific strings in the PIB, but also to test for the
absence of data in a particular location. If the PIB isn’t cleared ahead of time,
there may be something already in the PIB from the last time it was used.
The T command accepts what are often called UX,Y” coordinates as one of
its arguments. This allows you to position the cursor at a specific “X” (column)
and “Y” (row) position on the screen. Since PROC only allows one legal
statement per line, the T command is usually found before a command to input or
display text. The + character at the end of the line forces PROC to suppress an
automatic linefeed after outputting the text on the screen. Line 5 displays
ENTER YOUR FIRST NAME at position (column) 3 of line (row) 3 and leaves
the cursor positioned next to the prompt.
006+S1 <cr>
The S instruction is used to set the absolute location of the input pointer, to
direct input into a specific location within the PIB. It is almost always followed
by a number that indicates the desired location for the next input received. Line 6
sets the input pointer to the first location in the PIB. When anticipating input in a
PROC, the storage locations are most reliable when used in chronological order.
For the record, this wasn’t actually necessary since the input pointer has already
been “set” to the first location, by the RI instruction on line 4. The reason that it
is there is to clarify exactly where the input should be placed.
008+IF # A1 X<cr>
16
2
PROC
would indicate that <cr> was pressed without a response, then perform the X
command.” The X command terminates the PROC and returns to the MENU
PROC. The IF statement in PROC is similar to the IF . . . THEN construct in
most BASIC languages, including PICK/BASIC. When the conditional
expression evaluates to “true,” then the statement following the expression is
executed; otherwise the PROC continues execution at the next line.
010+S2<cr>
Because the first location of the Primary Input Buffer is already being
used, the S command on line 10 causes subsequent input to be stored in the
second location in the Primary Input Buffer. PROC automatically places the
appropriate character between the strings in the input buffer.1
An alternate to the S (Set) instruction is the F (Forward) instruction. It
moves the input pointer forward to the next location in the PIB. If the F
instruction were used instead of S2, the effect would be the same; the next
input would go into the second location of the PIB.
011 + IP:<cr>
012+IF # A2 X<cr>
Un the case of “generic” PICK Systems, the character used to separate PIB storage
locations is a space. At the time of this writing, Ultimate and McDonnell Douglas
systems use the “attribute mark” ( A) as the delimiter. This has the advantage of allowing
spaces to be embedded within arguments in PIB locations.
16
3
. PROC
Line 12 reads: “If the second location in the PIB contains a null (or <cr>),
then perform the X command,” which terminates the PROC and returns to the
MENU PROC.
This displays the text, LAST NAME, at position 3 on line 9, then moves the
cursor to position 35 on line 9.
016+D2 <cr>
Line 16 displays the contents of the second location in the PIB at the current
cursor position (35,9). This displays the string you entered when the PROC
requested your last name.
Line 17 displays the text, FIRST AND LAST NAME, at position 3 on line
11, then moves the cursor to position 35 on line 11.
018+D0<cr>
The DO command displays the entire contents of the PIB. This displays both
your first and last names.
019+X<cr>
16
4
Chapter
6
After filing EXAMPLES, activate the MENU PROC and choose option
3. Follow the instructions to enter your first name and your last name
About Branching Example 4 also shows the use of branching. In all of the previous PROCs, each
PROC instruction was executed in the order in which it appeared. This is not
always the case. Sometimes a PROC may be required to skip over a section of
statements or even forced to execute a section of instructions more than once.
This is accomplished with the PROC statement GO statement label, which
transfers control to a numeric “statement label” elsewhere in the PROC. The
GO statement in PROC is analogous to the GOTO statement in BASIC.
Line 7 reads: “If the first location of the PIB is null (meaning that the
operator pressed <cr> at the prompt for entry of a Social Security number),
then transfer control to statement label 10, which occurs on line 3 of
EXAMPLE4.” In other words, “Answer the question, Senator.” This is how
PROC forces input fields to be input-required.
An important note: The statement label has NOTHING to do with the
physical line (attribute) number of the PROC. The only time a statement label
is needed is when it is used as the destination of a GO state
16
5
Chapter
5
008+IF A1 = Q X<cr>
Line 8 reads: “If the first location of the PIB contains the letter Q, then
perform the X command,” and return control to the MENU PROC. Otherwise,
the PROC continues at the next line (9).
N for numbers
A for alphabetic characters A through Z (upper- and lowercase)
X for “wildcards,” which may be any character
010+GO 10<cr>
16
6
PROC
012+D1 <cr>
Line 12 displays the contents of the first location of the PIB, which
contains the Social Security number in a validated format.
013+X<cr>
014+<cr>
-FI<cr>
•EXAMPLES FILED.
Line 7 reads: “If input buffer 1 contains a null (or <cr>), then go to
statement label 10,” which occurs on line 3.
Line 8 reads: “If the data in input buffer 1 does not match the pattern of
ON (any length of numbers), followed by IX (any character), followed by ON
(any length of numbers), followed by IX (any character), followed by ON (any
length of numbers), then go to statement label 10,” which occurs on line 3.
16
7
Chapter
5
Line 9 moves the text, SORT STAFF WITH DOB > = , to the Primary
Output Buffer.
010+A"1<cr>
Earlier, we used one form of the A command to look into a location in the
Primary Input Buffer with the IF statement. The A command actually has two
different purposes. When the A command is the first command on a PROC line, it
has a different function. On line 10 the A command moves the contents of the
specified input buffer (1 in this case) to the current position of the currently active
output buffer (normally the end of the output buffer). The double quote (")
character causes the PROC to surround the data with double quote marks. For
example, if you had entered the date 5/26/51, it would have been placed into the
Primary Input Buffer as ”5/26/51". Any single character maybe used as the
“surround” character. If one is not specified, a space is used.
After moving the argument from the Primary Input Buffer to the Primary
Output Buffer, the POB now contains the string: SORT STAFF WITH DOB > =
"5/26/51". And now the PROC continues with:
Line 11 moves the text, BY DOB NAME DOB AGE, to end of the Primary
Output Buffer.
013+P<cr>
Line 13 causes the PROC to process the contents of the output buffer by
passing it to ACCESS.
014+X<cr>
015+<cr>
. FI<cr>
'EXAMPLES' FILED.
Activate the MENU PROC and choose selection 5. At the prompt for the
beginning date, enter a date somewhere around the year 1950, in the form
MM/DD/YY. For example, May 26, 1951 would be entered as
05/26/51. Leading zeros are normally optional. This can also be entered as
5/26/51.
16
8
PROC
Logon PROCs
A logon PROC is a PROC that starts automatically when you log on or to
an account, sort of like an “AUTOEXEC” file in MS DOS. It is relatively
simple to add to your account, and requires placing an item in your ac-
count MD with the same item-id as the account. For instance, say your
account is called ACCOUNTING. The following example shows how you
can check to see if there already is a logon PROC in your account MD.
Note that you should find out the name of the account, using the WHO
command, and substitute that account name for ACCOUNTING in the
example.
001 Q
with at least one attribute containing the letter Q. The item may have
more than one attribute.
If the latter case is true, you can replace the Q-pointer with a logon
PROC. This Q-pointer is a semi-redundant reference to your MD, and is not
usually needed. The Q-pointer can be replaced using the steps listed in the
following example:
>ED MD ACCOUNTINGS)
TOP
. DE99<cr>
EOI nnn
• I<cr>
000+PQ
000+(PROCS MENU)
000+<cr>
. FI<cr>
•ACCOUNTING* FILED.
16
9
Chapter
5
Local PROC At the beginning of this chapter, the concept of PROC linkages was dis-
Subroutines cussed. We examined two ways that linkages are accomplished, the first being
through the use of parentheses, in the form:
(filename PROCname)
In this form, control is passed one-way to another PROC. The second
form involves the use of square brackets, and takes the general form:
[filename PROCname]
The difference with the second form is that when the external PROC
completes, control automatically returns to the “calling” PROC at the next line.
This is what we used in the MENU PROC; it is known as an external PROC
subroutine. Through an extension to this latter form, an internal PROC
subroutine may be executed with the square brackets. This has the general
form:
[ ] statementlabel
Note that nothing appears between the brackets; this causes the PROC to
transfer to itself and to begin executing the PROC instructions beginning at the
occurrence of the specified statement label. This is analogous to a GOSUB
statement in PICK/BASIC. The next time an X instruction is encountered, the
PROC automatically returns to the next executable line after the line that
contained the [ ], which transferred control. The following short example
shows how this might be used:
001 PQ
002 [] 10
003 Xhere is where the PROC stops_________________
004 10 T "Now in Subroutine 10..."
005 X
17
0
PROC
PROC subroutine is a different item, perhaps even in a different file. All of the
EXAMPLE PROCs are considered external PROC subroutines.
Testing for Error A special operand exists for use in the IF statement. It is the letter E, which
Message Numbers allows an error message buffer to be interrogated after performing a TCL
command. This operand usually has one of the following forms:
IF E = errmsgH statement
IF E # errmsg# statement
The following short example shows how this might be used:
001 PQ
002 HSSELECT STAFF WITH STATE = "XX"
003 STON
004 HSAVE-LIST TEST<
005 P
006 IF E = 401 XNo Items Were Selected!
007 ____ PROC continues
001 PQ
002 S1
003 IHN
004 T "Do you want the report printed ? (Y/N) ",+ 005 IP:
On line 2, the input pointer is set to the first location of the PIB. Line 3
moves the letter N into the current location (1). Line 4 prompts for input, and
line 5 stops the PROC to await input. If the operator presses <cr>, then the
letter N is still present in the first location of the PIB. If a non-null response is
provided, it overwrites the first location of the PIB.
17
1
Chapter
5
Alternate Method of In each tutorial PROC that performed output to the terminal, the T instruction
Terminal Output was used. This is because the T instruction is more versatile than its
predecessor, the O command. The O command is used to Output to the terminal
screen, at the next available line; thus none of the special features for clearing
the screen or positioning the cursor at a specific location are available. This is
illustrated in the following example:
001 PQ
002 ODo you want the report printed ? (Y/N) +
Note that the text string following the O command does not have to be
enclosed in quotes, and that the + character is still available, just as it was with
the T command.
Extensions to the P Each time we have illustrated the use of the Primary Output Buffer, the P
Command command has been used to Pass or Process the command. Several alternative forms of the P
command are available to perform slightly different functions.
The PH command is used to Process and Hush output. Any terminal
output that would normally appear as a result of the command being executed
is not displayed. This is often used when performing a SELECT or SSELECT,
followed by a SAVE-LIST, as illustrated in the following example:
001 PQ
002 HSSELECT STAFF BY NAME
003 STON
004 HSAVE-LIST TEST<
005 PH
006 ______ PROC Continues __________
17
2
PROC
4On McDonnell Douglas systems, the PP instruction behaves like the PW instruction in
generic PICK systems.
17
3
Chapter
5
Trade-Offs for There is no such thing as a free lunch; all things come at a price. In the case
PROC-Iess Systems of using PICK/BASIC for everything, that trade-off is two-fold. First, it’s likely that
a mature application may have hundreds of PROCs that would have to be converted to PICK/BASIC,
introducing the possibility of new problems into an otherwise stable package. Second, due to the nature of
the EXECUTE statement, there is some overhead for using it. Translation: it tends to be a little slower
than PROC.
Each terminal attached to the PICK System looks like its own logical
computer to the operating system, with sixteen address registers and its own
private “process workspace” for storing data and programs. The EXECUTE
statement attaches an extra process workspace when it is executed. Depending
on the implementation you are using, this means that hundreds of frames must
be gathered together for use by the process being executed. Naturally, heavy
disk use slows down any process. Several versions of PICK keep the extra
workspace attached after it is used, which prevents the extra workspace from
having to be attached for the next EXECUTE statement. Still other versions
allow the workspace to be “preattached” through various TCL commands. It is
likely that the PICK licensees will adopt the technology to reduce the overhead
associated with the EXECUTE statement, thus making its use even more
appealing in the future.
A pragmatic approach to reducing, and eventually replacing, PROCs in
your system is to learn the PROC language, so that you will be able to
understand what each PROC is doing. Then in time, you should learn
PICK/BASIC. As new procedures are required, write them in PICK/BASIC
instead of PROC. As existing procedures need modifications, rewrite them in
PICK/BASIC and archive the original PROC in a separate file.
17
4
7 PICK/BASIC: The
Programming Language
The only full-featured programming language provided with the PICK System
is called PICK/BASIC. A popular, easy-to-use programming language,
PICK/BASIC offers features of many of the most popular languages currently
available, including:
■ Full integration with the database file-handling processes
■ Special data-handling instructions to aid application development
■ Security controls to protect the integrity of the database
■ Many powerful string manipulation capabilities for values and
subvalues within attributes
■ The ability to execute any TCL command, thereby eliminating the need
for the PROC language
■ Support for interactive and batch programming
■ Support for multiple output devices
■ Internal and external subroutine calls
■ Many built-in intrinsic functions, including data conversion, string and
protocol conversion, and trigonometric functions
1
7
7
Chapter
5
About PICK/BASIC1
The PICK System comes equipped with a very powerful
programming language: PICK/BASIC. PICK/BASIC is remotely
similar to standard Dartmouth BASIC (Beginners All-purpose
Symbolic Instruction Code), but far exceeds it in features and
benefits.
The similarities of PICK/BASIC to the “standard”
Dartmouth BASIC end at the READ, WRITE, and PRINT
statements. Outside of a few intrinsic functions, PICK/BASIC is
significantly enhanced and different in syntax.
For example, in PICK/BASIC, statement labels are
optional. When they are used, most versions of PICK still
require numeric statement labels, while some now allow
alphanumeric statement labels.
The language is very well suited to dealing with strings of
characters. This is particularly convenient in a system where
everything is stored as a string. A special set of intrinsic functions
—such as INSERT, REPLACE, and DELETE—are provided to
deal with the PICK “three-dimensional” data (item) structure.
This means that items (records) are composed of attributes
(fields), which in turn are optionally composed of “multi-values”
(sub-fields), and finally, “sub-values” (sub-sub-fields???).
Through PICK/BASIC, you tell the computer what you want to
do to an item, not how to do it. This is why it is beneficial to
have a general understanding about the PICK file and item
structure before jumping into updating files.
PICK/BASIC programs are primarily used to capture and
validate data before storing it on disk. They can also be used to
format reports and
17
8
PICK/BASIC
17
9
Chapter
5
and appreciate the PICK file and item structure, soon realize that
this environment provides the ability to write PICK/BASIC
programs that can write other PICK/BASIC programs. There are
several excellent “code generators” commercially available to
the PICK System.
By now, you are realizing that the PICK Operating System
provides many powerful features that address many problems
plaguing other computer environments with fixed-length record
structures. The PICK Operating System provides a very
powerful language called PICK/BASIC. It is almost unfortunate
that it is called “BASIC,” because of the association with earlier
and simpler BASIC languages. PICK has more high-level loop
control constructs available than the ever-present COBOL
language, and an exceptional environment for tracing and
analyzing program “bugs.”
Also, because PICK provides this unique file structure,
with variable-length items, many additional functions are
provided to manipulate these character string structures. The
concept that PICK retrieves a field without knowing what the
data represents (no “data typing”) means that the PICK System
provides an ideal environment for creating parameter- driven
application systems. This provides the ability to write programs
that read data files that contain the parameters and instructions
that instruct the programs how to function. Parameter-driven
systems avoid the necessity to “hard code” the functions of a
program into its source code, which requires recompiling if
changes are needed. Such systems are typically more flexible
and generic in application. This is a great aid for software
developers.
Another distinction of the PICK System is the way in
which it stores time and date values. In instances where you need
to store a date, you may store it as a string—such as 07/04/1997
—or, you may use a function that converts the date to an integer
representing the number of days that have elapsed since the
reference date of 12/31/1967. This process is known as internal
conversion. Dates before 12/31/1967 have a minus sign
preceding the integer number of days. For example, if you
convert the date 12/31/ 1967 with the date conversion function,
the result is 0 (zero). The string 1/ 3/1968 converted with the
same function, yields the result 3, and 12/29/ 1967 yields -2.
The advantages of this internal conversion process are
many. First, it makes calculations on dates extremely easy to
perform, because they are stored internally as integer numbers.
Second, it optimizes disk storage, given that dates in “internal
format” require less room than their “external format”
equivalents. Third and finally, it assists in sorting dates, as it is
easy to compare two integer numbers to determine which is
greater. Many “external” date conversion codes are provided to
retrieve virtually every possible aspect of a date, such as the day
18
0
PICK/BASIC
18
1
Chapter
5
Terminology of the
PICK/BASIC Language
Statements A statement is a list of words that comprise the detailed instructions from
which the computer makes its decisions and performs its duties. It normally
consists of constants, variables, expressions, and/or the special “commands”
of the PICK/BASIC language. The PICK/BASIC language allows multiple
statements to be put on one physical line (attribute), provided that each
statement is separated by a semi-colon (;). The following example illustrates
what happens when this feature is abused:
PRINT "ENTER NAME " ; INPUT NAME ; IF NAME = "" THEN STOP
where:
PRINT "ENTER NAME " is the first statement.
INPUT NAME is the second statement.
IF NAME = " " THEN STOP is the third statement.
where:
COUNTER = 0 is the first statement.
SET NUMBER OF ITEMS COUNTER TO ZERO is the second statement.
Constants and A constant is a value that remains unchanged. Numeric constants do not have
Literals to be enclosed in quotes. For example:
18
2
PICK/BASIC
18
3
Chapter
5
where "PHYSICAL INVENTORY REPORT" is the literal constant.
where ’ NAME ’, , and ’ PAY RATE1 are the literal constants. Other ac
ceptable literal constants include:
PROMPT ""
where the two double quotes represent the "null” string, meaning "no value.”
AGE = "0"
AGE = 0
Since no data typing occurs in PICK, these two statements produce the same
effect.
Variables A variable is a symbol that represents and contains a data value. As its name
implies, the value or contents of a variable may change during program
execution. Some other systems call these data names.
In many versions of BASIC—as well as in languages such as Pascal,
Ada, and PL/I—the "type” of a variable must be declared prior to storing data
in it. This means that the computer is told what type of data to expect in a
particular variable—whether it will be a number or a combination of both
letters and numbers. In other versions of BASIC, variable names are typically
single alphabetic characters for numeric variables, which are used in arithmetic
operations. String variables are usually single alphabetic characters followed by
a $ character. String variables contain alphabetic and/or punctuation characters
and, on occasion, numbers.
In PICK/BASIC, the concept of data type does not apply. Variable
names may be any length and therefore may be descriptively named. Variable
names may include alphabetic characters, periods, and dollar signs, but must
begin with an alphabetic character. The following are samples of variables
names that are all valid in PICK/BASIC:
Self-Explanatory Form The "Guess What" Form
AGING.TOTAL = 0 AT = 0
IF EXIT.FLAG THEN STOP
IF X THEN STOP
MATREAD CUSTOMER.ARRAY...
MATREAD CA...
18
4
PICK/BASIC
ITEM.COUNTER = 0
Functions Functions are operations on one or more variables, constants, or expressions (see
Nuclear Tokens and Functions, this chapter), which generate a value. They are
one of the kinds of elements that may be used in a PICK/BASIC expression.
(The other two are variables and constants.)
Functions perform relatively complicated operations, like removing all ex-
traneous blanks from a string or converting dates to alternate formats.
18
5
Chapter
5
Functions ordinarily do not stand alone in a statement. They are typically
assigned to a variable or output with a PRINT statement. Following are a few
of the various functions available in PICK/BASIC.
PRINT STR("!”r25)
CUSTOMER. ITEM(1) = TRIM(">RESPONSE)
CURRENT.TIME = TIME»
There are some rare occasions, however, where functions may effec-
tively “stand alone.” One such case is when a function is passed to an external
subroutine as an argument. Essentially, the rule is that functions may be used
anywhere an expression may be used.
Functions that are native to a language are called intrinsic functions. The
intrinsic functions within PICK/BASIC have one common syntactical
denominator. They are always immediately followed by a set of parentheses.
Sometimes, depending on the type of function, there are one or more
arguments or expressions within these parentheses. In a few exceptional cases,
there are no expressions within the parentheses. Following is a partial listing
of functions showing the required number of expressions within the
parentheses.
COL1()
COL2()
TIME()
DATE() TIMEDATE( )2
According to one leading PICK expert, the TIME( ), DATE( ), and TIME-
DATE( ) functions would be more accurately called “global system variables.”
They just happen to have a syntax that makes them appear confusingly similar to
functions.
Functions that require three expressions:
FIELD(s^rZng. expression, string, expression, numeric, expression)
INDEX(5Zr/ng. expression,string, expression, numeric, expression)
18
6
PICK/BASIC
Operators Operators are characters and sometimes words that perform logical, arithmetic,
relational, or string-modifying operations. Operators include: + — / * < > <= >=
# : and a few others.
The operators can be classified into three distinct categories:
1. Arithmetic operators. These include + (addition), — (subtraction), / (division),
* (multiplication), and A (exponentiation).
2. Logical operators. These are used in comparison operations, and include >
(greater than), < (less than), >= (greater than or equal to), <= (less than or
equal to), and # (not equal to, which may also be represented by < > or > <).
3. String operators. These include: (concatenation, or “linking” strings together)
and the MATCHES relational operator, which detects “patterns” of characters.
Here are some samples of how the operators are used in PICK/BASIC:
The > symbol is a logical operator that means “greater than,” and + is an arithmetic
operator for addition.
Expressions and An expression is a valid series of constants, variables, and functions, con-
Arguments nected by operators. These are also frequently referred to as arguments. The simplest
expression is a single constant, variable, or intrinsic function. For example:
18
7
Chapter
5
Expressions produce a result, such as a string of characters or a number.
The result produced determines the type of expression. It is important to
distinguish types of expressions in attempting to explain the capabilities of
PICK/BASIC.
Some functions, for example, test for a true or false condition; these
could be classified as “conditional” expressions. As you proceed through the
tutorials, you will see a variety of expressions, such as “string” expressions
and “numeric” expressions. Each new type of expression is explained as it is
encountered. For example:
18
8
PICK/BASIC
END
IF ELIGIBLE.FOR.RETIREMENT AND (YEARS.WORKED > 10) THEN RETIREMENT.GIFT =
“ROLEX WATCH”
END
In the initial definition of functions it was mentioned that functions are always
immediately followed by a set of parentheses, often containing one or more
Nuclear Tokens and
expressions. This is where the concept of nuclear or atomic tokens needs to be
Functions
discussed. Effectively, a nuclear token is the smallest part of an expression.
Functions may also contain other expressions, which in turn may contain
other functions. This is known as an infix notational language. An example of this
is the statement:
Once you know how to program in one language, you discover that most of the
same principles apply in all languages: programs are used to capture, manipulate,
store and retrieve data on the computer. In current technology, data is stored on
hard disks. In a few years, hard disks may be obsolete, but the principles of
Standards and dealing with the new media will remain the same. There will still be a need to
Conventions have programs to organize and administer data management.
In any programming language as flexible as PICK/BASIC, it is important to
consider adopting standards. These are “standard” methods of doing things. Often,
in programming textbooks and training classes, standards are left until the end for
discussion, after habits are already started. Introducing some of the concepts early
on allows you to take advantage of them from the start.
Many programming shops have lists of programming standards. These are
the guidelines which programmers follow in order to produce programs that
everyone can understand and maintain. This text suggests many standards. You
may choose to implement some and/or use some of your own.
Most versions of PICK are implemented using the ASCII coding scheme. 5 Any
5Some newer versions of PICK, notably the IBM 4300 and 9370 implementations, use
the EBCDIC coding scheme. EBCDIC is an acronym for Expanded Binary Coded
Decimal Interchange Code. This is an 8-bit coding scheme, similar to ASCII but using
the eighth bit, which extends the range of characters to 256.
18
9
Chapter
5
variable may contain a number or a character string. Since there are no “typed”
variables in the PICK System, it is suggested that you use some variable
naming conventions.
For example, all variables that act as accumulators could have the
suffix .TOTAL. Following are some of the conventions that are used
throughout this text.
INPUT CUSTOMER.ID
Note: You may use any conventions that you like to name your variables. It
is recommended that you use some naming conventions, because many
programmers have found that naming conventions make programs less
difficult to create and/or modify.
Summary You have just completed the “crash course” on programming concepts. In it, you
learned important principles and terms such as variable, expres
19
0
PICK/BASIC
sion, and operator. These principles, with few exceptions, are generalized and apply to
virtually every programming language. From now on, the topics become much
more specialized.
Creating Your Prior to getting into the PICK/BASIC tutorial, a program file must be created.
Work Files If you do not have one, use the following steps to create it; otherwise these
steps can be skipped.
Preparing the The file in which PICK/BASIC programs reside needs a minor modifica- Source
File tion prior to compiling programs.
This is accomplished by using the Editor to change the D pointer (the
file definition item) in the MD. Note: Readers with Ultimate or McDonnell
Douglas computer systems do not need to do this!
>ED MD BP<cr>
TOP
-1 <cr>
001 D
.R/D/DC<cr>
001 DC
.FI
’BP' FILED.
The reason that this has to be done is that PICK/BASIC object code has
to be handled differently than “normal” data items. Source code refers to the
human-readable list of instructions to be performed as a program. In the PICK
System, source code resides in the DATA section of files. Object code is
produced by compiling source code into executable, machine-readable code.
When a program is compiled, a pointer item is placed in the dictionary of the
source file.6 This pointer item tells the system where the object code will be
found for execution. The name of the pointer item is the same as the source
program item. Incidentally, this is exactly the same way in which “lists” are
handled with the SAVE-LIST command.
6This scheme does not currently apply to computers from McDonnell Douglas
(Microdata). Rather, the executable object code is created as an item in the same file as
the source code. The object code item-id is the program name preceded by a $.
19
1
Chapter
5
Note for Ultimate users: Ultimate Corporation added a verb called
UPDATE-FILE in Release 122, when “security” was implemented. This
was ostensibly to prevent users from damaging file definition items (D-
pointers). This change does not have to be done to source files on Ultimate
systems, as any file may contain source and/or object code. However, if you
do feel like doing this to a file, you must use the UPDATE-FILE verb;
otherwise, you may damage or even destroy the file!
The ED Command and PICK/BASIC programs are typically entered through the standard PICK
HELLO Program Editor, although any Editor will do. The PICK Editor is activated with the ED
or EDIT command. Enter the following program using the Editor:
>ED BP HELLO<cr>
NEW ITEM
TOP
- Kcr>
001+IF TIMEO < 43200 THEN PRINT "GOOD MORNING"<cr> 002+IF
TIMEO > 43200 THEN PRINT "GOOD AFTERNOON"<cr> 003+END<cr>
004+<cr>
TOP
. FI<cr>
•HELLO’ FILED.
>ED BP BP
5
Older versions of the PICK System limited the length of the item-id to 50
bytes.
19
2
PICK/BASIC
or
Actually, the PICK System will let you get away with this . . . for the
moment. It catches up with you later when it destroys your file. The next
section discusses the BASIC command, which is used to compile source code
into (executable) object code. Normally, when a compile takes place, a pointer
to the object code of the program is placed in the dictionary level of the source
file, using the same item-id as the source item. If there is a program with the
same name as the file, there is a danger of the object pointer writing over the
file pointer (the pointer to the DATA section of the file). If this happens, all
your program source items will be lost! Some versions of PICK have built in
protective mechanisms to prevent this problem.
Compiling The BASIC command activates the PICK/BASIC compiler, to translate the
Programs: The BASIC source code into object code. The following examples illustrate the BASIC
Command command and some of its available options.
>BASIC BP HELLO<cr>
★★★
Program ’HELLO* Compiled. 1 Frame/s Used.
Each * represents one source line successfully compiled into executable object
code.
A listing of the program may be produced with the L option:
Activating the There are two ways to load and execute a compiled program. The first is by
Program: RUN and using the RUN verb.
CATALOG
(If the time is after 12:00 PM, the program displays: GOOD AFTERNOON.)
The second way is to CATALOG the program. This effectively makes a "verb"
out of the program.
>CATALOG BP HELLO<cr>
19
3
Chapter
5
[244J ’HELLO1 CATALOGED.
>HELLO<cr>
GOOD MORNING
(or GOOD AFTERNOON)
The rule with regard to cataloging programs is that the only programs
which must be cataloged are those that are considered “external” subroutines.
While all of your programs do not have to be cataloged, it’s still a good idea.
Note that external subroutines do not have to be cataloged on Ultimate
systems, unless the subroutine resides in a different file from the program that
“calls” it.
From now on in the tutorials, compile all of your programs with the
BASIC command, and then CATALOG each program.
If It Didn’t Work If you had any problem with the previous example called HELLO, check the code
using the Editor. It must be entered exactly as it appears in the text.
There are many possible reasons why programs don’t compile. Here is a
partial list of the most common compile failures:
1. Functions or instructions are misspelled. For example:
This has the unpleasant side effect of using the next END directive that
the compiler encounters as the terminator for the THEN initiator. Don’t
worry about this for now.
5. Having a blank or “null” line in the source program. At the time of this
writing, only Ultimate and a few other licensees allow null source lines.
For example:
19
4
PICK/BASIC
001
002 * This program is used to enter General Ledger accounts
Again, the programs in this book were tested and they worked on our
test machines. The most important thing to do is to compare your program
listing line by line with the program listings from the book. You may find that
you left out a character or two here and there. Don’t feel bad if your programs
don’t always compile the first time; it happens to everybody.
Example 7-3
PICK/BASIC
program example
>ED BP EX.001<cr>
TOP
. Kcr>
001+* EX.001<cr>
002+* BASIC TERMINAL I/O AND CONDITIONAL EXPRESSIONS<cr>
003+* mm/dd/yy : date last modified<cr) Put today’s date here.
004+* JES : author's initials<cr) <- Put your initials here.
005+*<cr> 006+ PROMPT ":"<«> 007+ PRINT<cr> 008+*<cr>
009+* GET NAME<cr>
010+*<cr>
011+ PRINT "PLEASE ENTER YOUR NAME " : <cr>
012+ INPUT NAME<cr)
013+ PRINT<cr>
014+*<cr> cont.
015+* CHECK TO SEE IF THEY WANT TO STOP<cr> 016+*<cr> 017+ IF NAME = "" OR
NAME = "QUIT" THEN STOP<cr>
018+ PRINT "HELLO THERE " : NAME<cr>
019+ PRINT<cr> 020+*<cr> 021+* NOW GET STRING OR NUMBER<cr> 022+*<cr> 023+
PRINT "PLEASE ENTER A NUMBER OR A STRING OF LETTERS " :<cr> 024+ INPUT
RESPONSE<cr> 025+ IF RESPONSE = "" OR RESPONSE = "QUIT" THEN STOP<cr>
Q26+ PRINT<cr> 027+*<cr> 028+* CHECK TO SEE IF STRING IS NUMERIC<cr> 029+*<cr>
030+ IF NUM (RESPONSE) THEN<cr> 031+ PRINT "ABS VALUE OF " : RESPONSE : " IS "
19
5
Chapter
5
: ABS(RESPONSE) <cr> 032+PRINT "THE SQUARE IS " : RESPONSE * RESPONSE<cr>
033+ PRINT "THE SQUARE ROOT IS " : SQRT(RESPONSE)<cr>
034+ STOP<cr> 035+ END<cr> 036+*<cr> 037+* CHECK TO SEE IF STRING IS LETTERS
ONLY<cr> 038+*<cr> 039+ IF ALPHA(RESPONSE) THEN<cr> 040+ PRINT "THE LENGTH
OF " : RESPONSE : " IS " : LEN (RESPONSE) <cr> 041+ STOP<cr> 042+ END<cr>
043+*<cr> 044+* STRING MUST CONTAIN NON-ALPHA AND NON-NUMERIC
CHARACTERS <cr) 045+*<cr> 046+ PRINT "YOUR RESPONSE WAS NOT CONSIDERED
NUMERIC OR ALPHABETIC"<cr) 047+ END<cr> 048+<cr) .FI
The program is now ready to compile and run. Remember that from now
on, after entering each program example, compile it with the BASIC verb,
catalog it with the CATALOG verb, then type the program name at the TCL
prompt. Once again, here’s an example:
>BASIC BP EX.001(cr>
***********************************************
Program ’EX.001’ Compiled. 2 Frame/s Used.
19
6
PICK/BASIC
>CATALOG BP EX.001<cr>
[244] ’EX-OOr CATALOGED.
>EX.OO1<cr>
Once the program loads and begins execution, the following prompt appears
on the screen:
Program Names 001+* EX.001 and Comment 002+* BASIC TERMINAL I/O AND CONDITIONAL EXPRESSIONS
Sections 003+* mm/dd/yy : date Last modified 004+* JES : author’s initials 005+*
The PICK System is very flexible regarding the manner in which files and items
are named. This usually results in some rather diverse item-ids, particularly when
naming programs. (A program is stored as an item in the PICK System, so a
program name is an item-id.) For instance, a programmer may decide to call a
program AP101, which may mean that this program is used to enter and update the
accounts payable vendor file. Others go to the extreme of identifying the nature of
the program in its item-id. For instance, another programmer may call this same
program ENTER.ACCOUNTS.PAYABLE.VENDOR.
Rather than trying to explain the entire program in the program
19
7
Chapter
5
name, it may be more useful to decide on a simple item-id and explain the
purpose of the program through remarks in the program.
A comment section is simply a standard set of remark statements that
appears at the beginning of each program. Remark statements have little effect
on the execution of the program. This technique makes it easier to work with
program files.
Line 2: The Description 002+* BASIC TERMINAL I/O AND CONDITIONAL EXPRESSIONS
Line 2 contains a single line description of the program. For example: UP-
DATE THE ACCOUNTS PAYABLE VENDOR MASTER FILE.
19
8
PICK/BASIC
single character may be used as the argument. When this statement is left out of
the program, the default prompt character is a ? (question mark).
Annotating 008+*
Programs 009+* GET NAME
010+*
Comments, also called remarks, have already been discussed at various points
in this book. This block of comments serves two purposes. First, it provides
visual spacing to make the source code more readable to those who must
maintain it; second, the comment on line 9 reminds the programmer of the task
at hand.
The Principle of The important principle of program design in pseudo-code is discussed here.
Pseudo-Code Pseudo-code is the process of writing a program in plain English. Since a
program is simply a set of instructions to perform a task, it is often necessary to
plan out the logic of the problem before starting to write the code that will
accomplish it. This may be done by organizing the logic in plain English
statements, in the form of remarks. This way, the logic may be debugged before
the first line of executable source code is ever written.
For example, if you want to teach a robot how to “make toast,” you have
to tell it the steps to perform. The robot must go to the kitchen, find the bread,
remove a slice, find the toaster, put the bread in the toaster, push the button,
wait for it to cook, remove the bread, then find a plate to place it on. Once this
sequence of events has been “programmed,” all you need to tell the robot the
next time you want toast is simply “make toast.” The same principle applies to
telling the robot how to make coffee, eggs, juice, etc. After the robot has been
taught all of the individual routines, you may then put them all together by
telling the robot to “make breakfast.” This means, to the robot, make toast,
make coffee, make eggs, etc. Although this may seem like an elementary
example, it introduces the principle of modularity. Programs typically are
comprised of a series of individual, self-standing modules, each of which
performs a specific task.
As this relates to the subject at hand, the entire logic of any program
problem may first be written in comments, as in this example. Once the logic is
in place, the source instructions of the appropriate language may be inserted
after the comments.
19
9
Chapter
5
and positions the cursor two spaces to the right of the word NAME. Note that
the space between the word NAME and the double quote (”) character is to
force the space between the literal and the cursor.
Throughout PICK/BASIC: A Programmers Guide, many other forms of
the PRINT statement are explained, including its ability to print at specific
coordinates on the screen or to do special functions such as erase the screen.
Additionally, the PRINTER ON and PRINTER OFF statements are discussed,
along with their effects on the output of PRINT statements.
The INPUT statement causes the program to wait for the user to enter
something on the keyboard. When input is received, it is placed into the
variable following the INPUT statement, which in this case is the variable
NAME. Generally, what the user enters on the keyboard must be followed by a
<cr>, although PICK provides the ability to automatically issue the <cr> when
a certain number of characters have been received.
20
0
PICK/BASIC
numeric data), then these fields are treated as though they contain the value 0
(zero).
A good way to check how your system handles nulls is to try the fol-
lowing statements in a test program:
Boolean Operators Two or more conditional expressions may be connected by a Boolean operator.
Boolean operators are the words OR and AND. Normally, when only one
conditional expression follows an IF instruction, then the statement (or
statements) following the THEN is (are) executed if the expression evaluates to
true. Otherwise, unless an ELSE is present, control “falls through” to the next
physical line of the program. The ELSE initiator is optional in the IF construct,
and is explained in chapter 4 of PICK/BASIC: A Programmer's Guide.
When two conditional expressions are connected with an OR, then either
of them evaluating to true causes the statement(s) following the THEN initiator
to be executed. Having an AND connect the conditional expressions means that
both expressions must evaluate to true in order for the statement(s) following the
THEN initiator to be executed.
This line has two possible choices for executing the STOP statement that
follows the THEN initiator. Either a null (carriage return or linefeed) or the
word QUIT would cause the STOP statement to be executed.
Here are sample conditional expressions using boolean operators:
This statement indicates that both of the conditional expressions must evaluate to
true in order to execute the statement (or statements) following the THEN
initiator.
Bailout Eventually (if this hasn’t happened to you already) you will run a program that
Mechanisms: prompts you to enter something and you will not know exactly what it wants.
Escape Pods” Maybe it needs something in a particular format, like a date or money amount,
but you have no way of knowing. So, you try the <cr>, and it displays
something to the effect, “INPUT REQUIRED!” and prompts you again. You try END or QUIT or ? or
HELP, then you try your favorite obscenity, again to no avail. In frustration, you try the data entry
operator’s last resort—the Break key—and find that it is disabled. At times like this you reconsider your
future in data processing vs. a less frustrating career, such as religious cult management or air traffic
20
1
Chapter
5
control.
To make a long story short, it is a very thoughtful touch to allow
operators an “escape,” or “bailout” mechanism. This means that in your
programs, any time an operator is prompted to input data, one consistent
response is always available. This word (or character) is the panic button. In
all of the tutorial examples, QUIT is used as the magic word. You may choose
anything you want, but whatever you choose should be the first thing you
teach your data entry operators. Tell them that when they enter this word, it
means “get me out of here!!!”
Implementing the escape pod principle has some remarkable side effects.
First, it greatly reduces the fears of your users, assuring them that they may
always escape in an orderly fashion from any program, without hurting
anything. Second, it allows you, the programmer, the benefit of cleaning up
any unfinished program business before returning the user to the process or
menu that sent him there.
The most important aspect of implementing your escape pod scheme is
that you remain consistent in what you check or test for, to allow them to bail
out. Don’t make it X in one place, QUIT in another, and END in yet another.
Line 17 is waiting for either a null or QUIT to allow the operator to get
out. If that’s what the operator inputs, then the program stops.
20
2
PICK/BASIC
Avoiding Redundancy Many of the instructions that have been covered up until now, such as PRINT,
INPUT, IF . . . THEN, PROMPT, and comments are used extensively
throughout the rest of the tutorials. Rather than re-explaining the same things
over and over, they will NOT be documented from this point on, unless some
new twist or nuance is being introduced.
The ABS function produces the ABSolute (positive) value of a numeric string.
Suppose you had entered —123.45 as your response. Line 31 then displays:
The ABS function comes in handy when printing the bottom line totals
of profit and loss reports for unstable companies.
Note that no range checking took place on the numbers you entered.
This program may produce unusual results if the number is too large.
20
3
Chapter
5
Producing Squares 032+ PRINT "THE SQUARE IS " : RESPONSE * RESPONSE
This statement prints the message, THE SQUARE IS, followed by an expres-
sion that takes the value of RESPONSE and multiplies it by itself. This is here
simply to demonstrate the fact that formulas may be 1) performed in the same
line as a PRINT statement, or 2) “assigned” to a variable on a separate source
line and have the value displayed here. Both ways are discussed throughout this
text.
There is also the intrinsic function EXP, which may be used to raise a
number to other exponential powers, and the A (caret) operator, which also
indicates exponentiation.
The SQRT function produces the square root of a numeric expression. This
displays the message shown, followed by the square root of RESPONSE.
Terminating an IF
035+ END
Statement
When an IF . . . THEN statement or IF . . . THEN . . . ELSE statement spans
more than one physical line of a program, it must be “terminated” with an END
statement. This principle is referred to as the initiator/terminator relationship,
and is discussed at the end of this chapter. This particular END statement
terminated the THEN initiator, which started at line 30.
The ALPHA function, like the NUM function discussed earlier, is also
considered a conditional expression. Again, these are expressions which
evaluate to a true (numeric non-zero) or false (zero or null) condition.
They are most often used in IF . . . THEN, IF . . . THEN . . . ELSE, and in
CASE constructs.
This statement tests the variable RESPONSE to determine if it con-
tains only alphabetic characters. This means no characters other than the
letters A through Z (upper- or lowercase). If this evaluates to true, then
the statements up to the next END statement are executed. Otherwise,
execution of the program continues after the next END statement, which
happens to occur on line 42.
20
4
PICK/BASIC
The PRINT Statement 046+ PRINT ’’YOUR RESPONSE WAS NOT CONSIDERED NUMERIC
on OR ALPHABETIC”
Line 46
If this message appears, then it means that the response provided to the variable
RESPONSE is not considered either entirely numeric or alphabetic.
Consequently, this line displays the message shown and program execution
stops at the next line.
047+ END
The END Statement:
Terminating the The END statement (more accurately called a compiler directive) occurs in two
Program places in PICK/BASIC. The first occurrence is when it is used as a terminator
for a multi-line IF . . . THEN or IF . . . THEN . . . ELSE statement. The second
and final form is when it serves as a program terminator, meaning that this is
the logical end of the program. On most PICK Systems, if the final END
statement is left out, one is automatically assumed at the end of an item
(remember, even programs are considered “items”). It is recommended that you
include the final END statement, just for consistency. This END statement on
line 47 terminates the program.
More on the IF . . . The IF statement has perhaps the greatest number of possible syntactical forms
THEN Statement of any instruction in the language. Because it is one of the most frequently used
statements, it is important to understand the mechanics of how and when it is
used. The examples and discussions will first focus on the simplest forms. As
you progress through the examples, more sophisticated cases and uses are
uncovered. Example 7-3 illustrates the following forms:
The single-line form means that the entire logic test, and the instructions that
are to be executed when it evaluates to true, are contained in one physical
source line. The syntactical form appears as:
20
5
Chapter
5
IF conditional.expression THEN statement
END
The multi-line form introduces the concept of the initiator/termina- tor
relationship. When the THEN instruction appears as the last word in an IF . . .
THEN statement, it is considered an initiator. This means that it must be
terminated later with an END statement. When the conditional expression
evaluates to false, program execution continues with the first executable
statement after the END statement.
There are cases where “nested” IF statements are needed. Remember to
terminate every THEN or ELSE with an END later, when they are the
last words on a source line.
IF conditional.expression THEN<cr> (starts level 1)
statement(s) . . .
20
6
PICK/BASIC
statement(s) . . .
END (ends level 3)
statement(s) . . . END (ends level 2)
statement(s) . . . END (ends level 1)
Avoid having too many levels of nested IF statements. It makes pro-
grams more difficult to figure out and increases the probability of logic and
syntax errors (The use of the CASE construct is discussed in chapter 9 of
PICK/BASIC: A Programmer^ Guide.) Also, to assist in making the program
more readable, try to align the END statement underneath the IF statement that
initiated it.
Note that many instructions in the PICK/BASIC language allow (or
require) the THEN and/or ELSE construct. Anywhere they are allowed/
required, the single or multiple line forms may be used.
Note also that on all versions of PICK, the first END compiler directive
encountered that is not part of a THEN/ELSE construct above causes the
program to stop compiling.
20
7
Controlling Peripherals
where:
X No terminal addressing
20
8
Controlling
Peripherals
Unlike the other parameters in the terminal characteristics, the termtype
parameter is alphabetic rather than numeric; consequently, it may appear anywhere
in the parameter list after the TERM or SET-TERM command. However, SET-
TERM does not affect the terminal or printer characteristics for those users already
logged on.
Cursor control from PROC and PICK/BASIC is heavily dependent on the
setting of the terminal type parameter. If it is not set correctly, problems may result
with specific address coordinates on the screen. This sometimes manifests itself by
printing an entire menu on one line of the screen. Often, it can be remedied by
changing the termtype parameter and restarting the process.
Examining The current settings may be displayed by entering the TERM command without
Terminal parameters, as in the following example:
Characteristics
TERMINAL
PAGEWIDTH: 79 23 1 2
PAGEDEPTH: 28
LINESKIP: LF V
DELAY: FF
DELAY:
BACKSPACE:
TERMTYPE:
>TERM<cr>
The printer width setting is the seventh argument in the list. You don’t count
the termtype argument, because it’s always a letter. To leave the existing
settings as they are, while changing the printer width and/or depth, you simply
put a series of commas with nothing between them, as illustrated in the
following examples:
20
9
Chapter
5
TERMINAL PRINTER
PAGEWIDTH: 79 23 1 2 80 60
PAGEDEPTH: 28
LINESKIP: LF V
DELAY: FF
DELAY:
BACKSPACE:
TERMTYPE:
21
0
Controlling
Peripherals
This establishes for the current process that the printer output char-
acteristics are 80 columns by 60 rows. All other current settings remain the
same.
Changing Terminal
Type Since the terminal type code is the only alphabetic character in the terminal
characteristics, it may appear anywhere in the list of arguments, as long as it
precedes a number or comma. This is illustrated in the following example:
TERMINAL PRINTER
PAGEWIDTH: 79 132
PAGEDEPTH: 22 60
LINESKIP: 1
LF DELAY: 2
FF DELAY: 2
BACKSPACE: 8
TERMTYPE: R
This establishes, for the port from which the command was issued, the
terminal type as an (ADDS) Regent and sets the terminal characteristics at 79
columns by 22 rows. The R option displays the resulting changes.
The termtype parameter may even be changed without providing any
other arguments. This is shown in the following example:
>TERM W<cr>
This establishes a Wyse terminal type for the current process. Check the
setting with the TERM command to verify that it worked.
21
1
Chapter
5
Attaching Media to Before anything can be done with the media, it must first be attached, or a Process
(T-ATT) assigned, to you. This is called “attaching” a device to your terminal session or process, and is
accomplished via the T-ATT (Tape Attach) command, as shown in the following example:
>T-ATT<cr>
BLOCK SIZE = 500
Only one process may have the media device attached at any given time.
The BLOCKSIZEis the number of bytes written in a single transfer of
data to the media. The PICK System automatically fills the “tape” buffer to
this length prior to writing it to the media. The default block size varies
somewhat between implementations, typically between 500 and 8,192 bytes.
Some versions of PICK now offer block sizes up to 27,456 bytes or
higher. Some types of media, such as floppy disks and most streamingcartridge
tapes, may use only one block size. Other types, such as halfinch (round)
tapes, can use whatever block sizes are allowed by the particular system being
used. The block size may be specified after the T-ATT command as shown in
the following example:
>T-ATT 8000<cr>
TAPE ATTACHED. BLOCK SIZE: 8000
21
2
Controlling
Peripherals
The linenumber is the port number of the process having the media
attached.
Detaching Media Whenever you are finished with the media, it is advisable to detach it from your
from a Process (T- process. This is accomplished with the T-DET command, as shown in the
DET) following example:
>T-DET<cr>
Since you probably just detached the media from your process, this
message may appear if you attempt any of the commands in the next several
sections. Re-attach the media with the T-ATT command before continuing.
The Logical Structure The PICK System constructs magnetic media in two ways. The first of these is
of Media referred to as a SAVE format, meaning that it was generated with the SAVE
command. This type is typically created with the FILE-SAVE or ACCOUNT-
SAVE procedures located in the SYSPROG account.
The second type of media is called a T-DUMP. A T-DUMP type may
contain the contents of one or more files, with each file being separated by
• an end-of-file mark that PICK automatically writes at the end of each file.
Since SAVE media are designed for use by PICK System “restore” processes,
the T-DUMP format is more commonly used for data. We will examine this
format in this tutorial.
The Label Each file on the media is preceded by a label. This 80-byte block contains the
following information. A sample label is shown in the following example:
21
3
Chapter
5
where:
It is suggested that, when creating magnetic media, you rewind the media to its
Rewinding the
Media (T-REW) logical beginning position (sometimes called the load point) prior to any read or
write operation. This is accomplished with the T-REW command, as shown in
the following example:
>T-REW<cr>
Preparing Media In chapter 5, (ACCESS), we covered the T-DUMP command. Use the
for the Tutorial commands in the following example to create several files on your media.
>T-DUMP STAFF<cr>
7 ITEMS DUMPED.
The T-DUMP process writes the entire contents of the STAFF file to the
media, in the storage (“hash” ) order within the file. The media is now positioned
at the end of the file just written. Use the S-DUMP command, shown in the
following example, to sort the items by their item-ids prior to dumping them to
tape.
21
4
Controlling
Peripherals
>S-DUMP STAFF<cr>
7 ITEMS DUMPED.
Now that the media has a few files on it, the following commands may
be tested.
Moving Backward on The T-BCK command backs up just past the previous mark on the media, as
the Media (T-BCK) shown in the following example:
>T-BCK<cr>
[94J END OF FILE.
The message ENDOF FILE refers to the last piece of data read on the
media before it stopped (the end-of-file mark on the previous file).
Continue to issue T-BCK commands until the message output changes
to [96] BOT, which indicates that the Beginning Of Tape has been reached.
(This is the slow way of doing a T-REW).
Moving Forward on the The T-FWD command moves the media forward to the next End Of File mark.
Media (T-FWD)
>T-FWD<cr>
[94] END OF FILE.
The message ENDOF RECORDED DATA 2 FILE(S) means that the sys-
tem has detected the logical end of the written area of the media and that “2”
files were found.
Reading the Media The T-READ command provides a means of visually checking the media (T-READ)
to verify that the data in a particular file is the data desired. The steps in example 8-1 illustrate the process
of reading the media.
RECORD = 1
RECORD = 2
101 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
151 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
201 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
251 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
301 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
351 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
401 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
451 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
501 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
RECORD = 3
cont.
1 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
51 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
101 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
21 151 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
6
Controlling
Peripherals
201 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
251 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
301 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
351 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
401 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
451 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
501 :[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[:
The first line of output is the label for this file, indicating the block size
as 500 (hexadecimal 01E4), the time and date when the file was created, the
filename from which it was generated, and the reel number (at the right end of
the label).
The record number is the consecutive number of the block. The data
from the STAFF file is displayed here. (See chapter 9 for a discussion of how
to read the physical data items in this block.)
The character along the right side of the display indicates each 50- byte
segment of data. Note that the block was padded to a length of 500(the block
size) with the [ bracket characters. Although all of the data is written in the
first two blocks, the PICK System automatically writes an empty block at the
end of this process.
Reading the Media The T-RDLBL (Tape Read Label) command reads and displays the 80- Label (T-
RDLBL) byte tape label. This may be accomplished as shown in the following example:
>T-REW<cr>
>T-RDLBL<cr>
BLOCK SIZE: 500
L 01E4 12:00:00 26 JUN 1992 STAFF 01
Completing the The commands shown in the previous section permit you to control me- Session
dia. Again, once you are done, remove the magnetic media and detach the device from your
process.
>T-DET<cr>
The PICK Spooler
The spooler is a process that runs constantly as a “phantom” process, not
associated with any terminal. Its primary function is to control the output of
data to printers, although it can be used to output to tape. Some other features
are listed below.
■ It increases printer productivity in multi-user and/or multiprinter
environments.
■ It allows unrestricted generation of reports regardless of whether or not a
printer is available.
21
7
Chapter
5
■ It allows jobs requiring special forms to be automatically routed to the
printer in which the forms are mounted.
■ It allows the simultaneous management of up to 125 different forms.
■ It allows print files to be sent to printers or magnetic media.
■ It allows the use of up to four parallel and sixteen serial printers.
Types of Spooler Every report that is directed to a printer passes through the spooler. The Entries
spooler records the report on disk until it can be “de-spooled” to the appropriate device. While the
report is in this temporary disk storage, it is referred to as a spooler entry. There are two types of
spooler entries:
Normal Entries
The normal entry is one in which the report is held by the spooler until it has
completely de-spooled to the proper device, at which time the space that it
occupied is returned to the overflow table.
Hold Entries
A hold entry (or hold file) is an entry in the spooler that requires manual
processing for de-spooling and deletion. Hold entries occur as a result of the
spooler assignment options, discussed later in this section under the SP-
ASSIGN command.
The advantage to hold entries is the ability to restart a print operation in
the event that it becomes necessary, such as running out of paper on the
printer.
21
8
Controlling
Peripherals
Spooler Control Some of the most dangerous spooler control commands are limited to the
Commands SYSPROG account only, due to their rather destructive side-effects. Of course,
if you know how to copy verbs from SYSPROGs MD and it is unprotected,
then any verb may be copied to any account.
> :STARTSPOOLER<cr>
SPOOLER STARTED.
Starting Printers The PICK System handles two types of printers: serial and parallel. All systems
(STARTPTR1) can support serial printers through the RS-232C interfaces provided for the
CRTs. Special hardware can be installed on some PICK Systems to support
parallel printers.
Regardless of the type of printer being used, the command is the same
to get them started. Starting a printer requires five parameters, as illustrated in
the following format for the STARTPTR command:
> ST ARTPT Sprinter#, formqueue#, # eject pages, type address
These terms have the following meanings:
printer# This is the logical address of the printer that is
used later in other spooler commands. The first printer
on the system is always 0 (zero). Printers are typically
assigned the next available number.
21
9
Controlling
Peripherals
formqueue# The form queue number is a means of organizing types of
entries in the spooler. Normally, but not always, a
formqueue is associated with a printer, but spooler entries
may be routed to a formqueue that has no printer attached.
For example, you could route a special type of form—such
as paychecks—to formqueue 17, where there is no printer
attached. When you are ready to print, you could delete the
printer, start it up again on formqueue 17, then reverse the
process when it completes. This prevents people from
getting their program listings on your paychecks. Where
possible, we suggest that the formqueue number be the
same as the printer number to avoid confusion.
#eject pages This parameter tells the spooler how many blank pages to
eject on the device prior to printing. Note: ACCESS
automatically issues a formfeed (blank page) prior to
beginning a print job. This parameter most often is 0
(zero).
type address The last two parameters in the string specify the type of
printer (P for parallel or S for serial), immediately
followed by the address or the port number. The address
depends on the type of printer. If parallel, it is likely to be
the first (or perhaps only) parallel printer, and as such
would have a physical address of 0 (zero). Serial printers,
on the other hand, are attached to RS-232 ports, just like
terminals. In the case of serial printers, the address is the
actual port number.
The following examples illustrate the STARTPTR command. Don’t Do
This! Just read and observe.
>STARTPTR 0,0,0,P0<cr>
>STARTPTR 0,0,0,S2<cr>
Displaying Spooler The LISTPEQS (List Printer Element Queues) command provides a display of
Entries (LISTPEQS2) all spooler controlled entries. Most likely there are no entries currently in the
spooler, so we will place one there for use by this command.
First, adjust your spooler assignment to hold file output as shown in the
following example. (This is discussed later in more detail under the SP-
ASSIGN command.)
>SP-ASSIGN HS<cr>
2
This is called SP-LISTQ on Ultimate systems.
22
0
Chapter
5
Now, send an entry to the spooler using the BLOCK-PRINT command,
as shown in the following example:
HOLD ENTRY # 1
The number assigned to the entry was chosen by the spooler, and this
number may later be used to access the entry. Next, reset your spooler as-
signment using the SP-ASSIGN command as shown in the following ex-
ample:
>SP-ASSIGN<cr>
>LISTPEQS<cr>
PRINTER LIST ELEMENTS 26 JUN 1992 09:30:34
# STAT LK LN STATUSES CP FO FRMS DATE TIME ACCT
22
1
Chapter
5
deleted.
I Immediate; means that the entry was assigned immediate
priority. This is discussed later under the SP-ASSIGN
command.
L Locked; while an entry is waiting to be output, it is
locked by the spooler so that it becomes inaccessible.
N No close; a result of the SP-OPEN command, meaning
that multiple print reports are to share the same entry
number.
0 Currently being output; indicates the report that is
currently being printed.
P Printer; assigned for printer output.
R Requested; means that the entry has previously been
accessed.
S Spooled; waiting to output.
T Tape; indicates that the entry is destined for the
magnetic media as its output device.
X Aborted; indicates that the entry has been aborted via
the SP-KILL command.
The last line indicates two things: the total number of entries in the
spooler, and the total number of frames used by all of the spooler entries.
Displaying Printers The LISTPTR command displays the current data relating to printers on
(LISTPTR3) the system, as shown in the following example:
22
2
Controlling
Peripherals
>LISTPTR<cr
>
SERIAL INACTIVE
Displaying Current Every report directed to the spooler relies on the spooler assignment specified
Assignments during the SP-ASSIGN command. The LISTABS command is useful for
(LISTABS4) determining the current output routing specification for every port on the
system and is shown in the following example. The status codes are just like
those explained under the LISTPEQS command.
>LISTABS<cr
>
22
3
Chapter
5
Displaying Spooler The SP-STATUS command displays the current condition of the spooler and all
Status (SP-STATUS) spooler-controlled devices. It is shown in the following example:
>SP-STATUS<cr>
Many forms of output from this command are possible. For the most part,
the other messages are generally self-explanatory. Our personal favorite is a
message that indicates that the spooler is in an “unambiguous state.” We assume
that this means it is O.K.
Changing Spooler The SP-ASSIGN command is probably the single most important command
Assignment (SP- related to the spooler. It indicates how output is to be handled for your process.
ASSIGN) Many options are provided, and combinations of options are permitted.
These output routing specifications may be changed by following the SP-
ASSIGN command with the options discussed in the next few sections.
When you first log onto the system, your options are typically set to default. That
is, output is directed to printer 0, formqueue 0, 1 copy, and 0 blank pages between
output.
The SP-ASSIGN command, when issued by itself, resets the output routing
specifications back to this default state, which is required prior to using the SP-
EDIT command to spool reports in the spooler.
>SP-ASSIGN<cr>
Any integer number in the range 0 to 125 may be supplied with the SP- ASSIGN
command to indicate the number of copies to be produced. The default number of
copies is always 1. When presented to the system, this must be the first option in
the string, unless each option is separated by a space.
>SP-ASSIGN 2<cr>
22
4
Controlling
Peripherals
This indicates that 2 copies of every report are to be produced when
output is routed to the spooler from your process.
The ? option, by itself, displays the current spooler assignment options without
changing them. When the ? option is used in conjunction with other options,
the resulting setting is displayed.
>SP-ASSIGN ?<cr>
LINE STATUS COP FORM
# IES #
OP 2 0
The C activates the choke function. This means that the spooler entry will not
require more than about twenty frames of overflow for storage, and is only
used when virtually no overflow space is available. The C option must be used
with the I option and may not be used with the H option.
>SP-ASSIGN CI?<cr>
LINE STATUS COP FORM
# IES #
0 CI 2 0
The I option indicates immediate (or instant) print output. This greedy option
tells the spooler to attach the printer and begin output as soon as the first frame
of output is ready. This frequently is counterproductive, since the spooling
process ties up the device both while the report is being generated and while it
is printing, rather than just while it is printing.
22
5
Chapter
5
>SP-ASSIGN F1?<cr>
LINE STATUS COP FORM
# IES #
OP 1 1
Notice that when you changed the formqueue, it automatically reset all other
assignment options to default settings (1 copy, normal “P”-type entries). Multiple
options may be combined in the command.
The H option directs output to hold files, meaning that a semipermanent entry is
placed into the spooler to be held until it is manually spooled and/ or printed. The
H option by itself creates hold entries and prints one copy of each report. For this
reason, the H option is often combined with the S option to suppress the first copy
of the report. This is shown in the following example:
>SP-ASSIGN HS?<cr>
LINE STATUS COP FORM
# IES #
# HS 1 0
The S option suppresses printing a copy on the system printer. Its purpose is
to prevent printing a report that is simultaneously directed to a hold file or to
magnetic media.
Note: Even though (sometimes) the S option is stripped from the STATUS
display in the resulting setting, fear not; it took hold.
The T option attaches the magnetic media unit as the output device. It is
frequently accompanied by the S option.
>SP-ASSIGN TS?<cr>
TAPE ATTACHED BLOCK SIZE: 500
0 TS 1 0
The following examples offer ways in which more than one option may be
22
6
Controlling
Peripherals
used simultaneously.
>SP-ASSIGN 2F1?<cr>
OP 2 1
>SP-ASSIGN 3F1HS?<cr>
0 HS 3 1
Accessing Spooler Once hold entries have been placed in the spooler queue, they may be procEntries
(SP-EDIT) essed with the SP-EDIT command. In its simplest form, the SP-EDIT command produces a
series of prompts for processing each spooler entry generated from the current account. Issue the SP
EDIT command and follow along with the text and test each of the options.
>SP-EDIT<cr>
The SP-EDIT command accesses the first available hold file and prompts with
the message:
DISPLAY (Y/N/S/D/X/(CR))?-
(CR) Transfers control to the next spooler entry or to TCL if no more entries
are present.
22
7
Chapter
5
After dealing with the display options, the STRING prompt appears as follows:
STRING:-
This prompt is used to restart a job that has been killed. After entering a string
of characters, the spooler searches for the first occurrence of the string, positions
itself at the location where it was found, and transfers control to the SPOOL prompt.
If a Y response is then provided at the SPOOL prompt, printing begins from the
point where the string was found.
After the STRING prompt, the next prompt deals with spooling the output to a
device.
SPOOL (Y/N=CR/T/TN/F)?~
The last prompt is for deleting the spooler entry. The options are self-explanatory.
DELETE? (Y/N=CR)?~
Stopping Spooler The SP-KILL command is used to stop a report currently being output to Output
(SP-KILL) a device. With the D option, it is used to remove printers from the system.
When these printers are serial, it returns the port to which they were attached
back to a normal state, where they may be used again by a terminal. Some
examples follow:
22
8
Controlling
Peripherals
>SP-KILL Stops output of specified spooler entries, or
currently active job.
>SP-KILL DI Removes printer 1 and returns the port to an
available status.
>SP-KILL 1 Stops output on printer 1.
>SP-KILL 0F2 Stops output of entry 2 and returns entry to
available hold file status.
22
9
The Logical Computer
After the tour of TCL, ACCESS, PROC, and BASIC, it’s time to get down to
the core of things. In the core of the PICK world, some pretty powerful things
are happening. For example:
■ Simultaneous multi-user and multitask processing in single-user
computers
■ Dynamically allocated files, up to the size of the disk
■ A “three-dimensional” data item supporting multiple values in delimited
fields
These unique features are representative of the approach to data that
we’ve called “PICK-like” processing. The reason is that certain fundamental
processes make such advanced features possible, and without them other
systems have considerable difficulty in performing the same tasks. These
processes are fundamental only in concept; their implementation in the early
seventies was radical. Consequently, few other systems today enjoy the
inherent features of the PICK approach.
2
3
0
The Logical Computer
The user at a terminal sees the system as the layered environment that
we saw in chapter 2. From the surface the user is presented with a well-
ordered set of data files, each with its own dictionary in the database level.
The user also sees a set of processes (PROC, ACCESS, TCL, PICK/BA- SIC,
and the Editor) that are activated from the surface. These are used for moving
the data from within the database up to the surface, where it is viewed through
the window of the CRT screen or sent off to paper or perhaps to magnetic
tape.
These tools are all oriented toward the user’s view of the files and dic-
tionaries. This is the view that we provide to a user when we create an appli-
cation database that users can then manipulate for their own purposes.
23
1
Chapter
5
world, these complex processes are continuously running. Their function is to
maintain the PICK world so that the user processes are continually available,
and yet the user and programmer are freed from most of the concerns
associated with the hardware and the management of multiple users. The
PICK System manages files and disk space automatically through its unique
virtual memory management software.
Expressed in the simplest terms, virtual memory management means that there
is more room on the inside of the computer than there appears to be from the
outside. It is a technique for expanding real or main computer memory through the
use of disk space. The PICK System has taken this technique to its limit. Every
user and every program, and even the PICK System itself, operates virtually
unrestricted in what seems to be a giant working memory (as shown in figure 9-2).
VIRTUAL
WORKSPACE
Virtual workspace functions as if the entire computer is composed of RAM, with all the programs and data files in main memory at
the same time.
Under this approach, the user is less limited by the hardware, and can work
unaffected by other users. There are no apparent limitations in programs for disk
space or for dealing with the printers or tape drives; there is no contention for the
CPU or the data files. Each user and each process is allowed to perform work
independently, on a kind of “personal computer” within the real system. Yet the
system easily supports its multiple users in relatively small amounts of RAM. The
operating system is performing all the real work, handling the demands for the
CPU, the memory, and the disk. It does the work “in pieces,” by establishing a
workspace within the computer composed of small pieces of the disk area called
frames.
As shown in figure 9-3, disk space on all computers is divided into sectors
within concentric tracks on the disk surfaces. In the physical view of the PICK
System, a frame is a continuous string of characters usually contained within a disk
sector.
Each frame has a specific frame-id or FID by which the frame can be
referenced. The virtual memory software at the core of the PICK world provides
the connection between the physical computer and the logical workspace. That
small program, called the Monitor, “maps” or converts frame-ids into the
appropriate physical disk addresses. Mapping involves calculating a disk drive,
track, and sector so the disk hardware can accurately position the disk heads to
access the frame.
23
2
The Logical Computer
FRAME
‘FLUSHED’ OUT
Figure 9-4 Frame paging
If all the main memory buffers are filled, the system frees up frame
buffers by searching for write-required buffers (those that have been changed)
and the oldest unchanged buffers, and flushes them back out to disk. Then the
buffer is available for use.
This “least-recently-used” approach is applied continuously to the frame
buffers to ensure an adequate supply of main memory for all users. On
computers equipped with disk drive activity lights, this process is actually
visible; it is not unusual to notice the Monitor merrily performing such
housekeeping even though the users are all logged off.
23
3
Chapter
5
FILES
VIRTUAL WORKSPACE
Figure 9-5 The logical view of the PICK environment
If the user’s view is the view of what the user is doing with the data,
then the logical view is the view of what the system is doing with the data.
23
4
The Logical Computer
The Logical View of The logical view of the computer provided by this virtual memory tech-
Data Files: Groups nique greatly simplifies the task of understanding what the computer is
of Frames doing. But the benefits of such an approach are not limited to the user’s
understanding. Virtual memory management provides a logical view of
the disk storage to programs and processes as well. In this way, the pro-
grams work only with formatted frames of data. Here is how frame man-
agement is performed by the PICK System.
Disk space on the PICK-based computer is permanently maintained
in frame format. When a file is created, a block of frames is set aside. No
physical movement of data occurs; the frame-ids are simply removed
from a table of available frame-ids known as the overflow table.
The frames can be considered contiguous, or adjacent to each other
in the workspace, as shown on the left in figure 9-6 as the NEW OR CON-
TIGUOUS FILE. This is the departure from the physical view. Even
though the frames may be logically adjacent, and the frame-ids may be a
sequential series of numbers, the frames may not be physically adjacent.
That is, the second group of the file may be in a different sector, or track,
or even another disk surface, from the first. (In actual fact, multiple-drive
disk controllers will often put successive frames on widely separated loca-
tions on the disk, in a process known as interleaving of disk storage, to
reduce the amount of disk head movement needed to write and retrieve
“contiguous” frames.)
The idea that the frames are contiguous means that the system
knows where the first frame of the file resides, along with the number of
frames that the file contains beyond that point, with each frame having
the next higher frame-id. This contiguous set of frames is sometimes
referred to as the primary space of a file (see figure 9-6).
23
5
Chapter
5
NEW OR
CONTIGUOUS EXPANDED
FILE FILE
23
6
The Logical Computer
the virtual memory software adds the data at the appropriate group until
the frame is full. Then the system acquires an additional frame from the
table of available frame-ids, the overflow table. The system writes the re-
maining data on the new frame and sets the original frame to point to the
frame-id of the new frame, and likewise adjusts the new frame to point
backward to the previous frame in the file.
The whole process is even more effective in reverse. If data is later
deleted, most systems would simply flag the deleted record and leave the
silly thing in the middle of good data. The PICK System rewrites the
group, freeing up any extra frames and listing their frame-ids as available
in the overflow table.
Every user, and every user program, benefits from this approach.
The PICK System automatically maintains logically correct files, adjust-
ing file size no matter how much the file grows or shrinks. Programs and
users work in the logical workspace and are freed from administration of
file sizes, at least until restore time. This is also why frames are referred to
as groups after they are designated as belonging to a file. The number of
groups (modulo) remains fixed, whereas the number of file frames (and
consequently data) that can be attached is virtually unlimited.
BYTE 1 2345 67 8 9 10 11 12
U N FORWARD LINKBACKWARD LINK N U
n N FRAME-ID FRAME-ID P n u C C u
s F F s
e e
d d
23
7
Chapter
5
The first and last byte of the Linkage Fields are not used at this time. Byte 2 is
the NNCF, which stands for Number-of-Next Contiguous- Frames. This is always 0
unless the separation parameter, or size of the groups in the file, is greater than 1.
(See the preceding section for a discussion of file modulo and separation
parameters.)
The FORWARD LINK in bytes 3-6 is the frame-id of the next logically
attached frame. It is always 0 except when the last frame in the group has
overflowed, and extra frames have been attached. Otherwise, the next frame-id is
the next logically numbered frame. Likewise, the FORWARD LINK from the last
frame in the group is always 0; no entry is necessary, because the virtual memory
software knows that if the FORWARD LINK from the last frame of a group is 0,
then the next file frame is the frame-id of the first frame in the current group plus
the separation parameter for the file. An example of such “logically” linked frames
is shown in figure 9-8A.
The BACKWARD LINK (bytes 7-10) is the frame-id of the previous
logically attached frame. The first frame in a group always has a BACKWARD
LINK of 0, for exactly the same reasons as in the Forward Link.
NPCF in byte 11 stands for the Number-of-Previous-Contiguous Frames.
Like the NNCF, this is used only with a separation parameter greater than 1, as
illustrated in the second group in figure 9-8B.
Prepare for a But the best way to describe a PICK virtual frame itself is to examine one.
DUMP Job Fortunately, the PICK System itself contains tools for accessing and displaying
frames in an easy-to-read format. When executed from TCL, the DUMP command
will retrieve any frame in the system and display its contents.
Example 9-1 shows a DUMP of a typical PICK frame. The frame is from a
file with one group, containing one item. We are using a 512-byte frame for this
example.
23
8
The Logical Computer
Closeup of a The DUMP command accesses frames by their frame-ids and displays Virtual
Frame them ás shown in example 9-1. The first line is the decoded linkage information. It contains
the FID of the frame and the four Linkage Fields, in decimal format. The same information is also
displayed within the parentheses in hexadecimal format. This information indicates that the frame-
id is 23025 (or hex 59F1), and that the frame is part of a contiguous set of frames; the zeros in
Forward Link and Backward Link are used by the virtual memory software to indicate that this
frame is currently not connected to any other frames. Since the number of next and previous
contiguous frames are both 0, it can be assumed that the separation parameter for this file is 1.
The frame itself is displayed in ASCII format, 50 bytes at a time,
between the colons (which are not part of the data). To the left of each line is a
line number. This number is sometimes called the displacement of the line into
the frame, but the technician would be wise to remember to add 12 bytes to this
number to calculate the correct displacement. Although the first 12 bytes of our
example frame appear to contain data, the DUMP command is actually
displaying the 13th through 512th bytes, while the first 12 bytes of the frame
holding the Linkage Fields have been unpacked and displayed on the first line
of the display. The same display appears on systems with larger frames,
although the lines of data go on for several more screens.
Our example frame has one item in it. Items within frames look pretty
much alike, except for some minor variations in the end-of-item and end-of-
group marks on some PICK implementations. In the generic PICK System, our
item looks like this:
Here is what each of these characters means to the virtual memory software:
003 B Hexadecimal byte count field (decimal 59)
23
9
Chapter
5
The item contains a lot more information than the user ever sees. For
example, every item is stored with a byte count in hexadecimal format. It is
003B in our example item, representing 59 bytes from the beginning of the
byte count to the item terminator character. The byte count is used by the
PICK System virtual memory software as a double check on the format of the
data and its delimiters.
Immediately following the byte count is attribute 0 or, in our example,
the item-id 312. It is delimited by an attribute mark, which is an ASCII 254 or
hexadecimal FE. The PICK System displays attribute marks with the A symbol
or caret.
After the item-id, each attribute in the item is delimited by an attribute
mark. If any attribute contained multiple values, they would be separated by an
ASCII 253, depicted by ] (right bracket). Any sub values would be separated
by an ASCII 252, depicted by \ (backslash).
At the end of the item is an item terminator, which is an attribute mark
followed by an ASCII 255, A (caret) followed by an underscore. The end of the
group is indicated by this underscore character as well; it is recognized by the
virtual memory software by the combination of item terminator and group
terminator, or A___________________, a caret with two underscores. These
delimiters were selected because of their uniqueness. Other systems often use
commas or other common characters as delimiters, which prevents their use in
the data.
When there is more than one item in the group, the items are separated
by an item terminator. Example 9-2 shows the same frame with two items, 312
and 714, recorded in the group, with an item terminator at the end of the first
item and a group terminator at the end of the group.
1 :0038312ASteveVanArsdaLeAPO Box1105AMt.ProspectAI:
51 :LA60056A_003F714AJES &Associates, Inc.AP.O. Box 1:
101 :9274AIrvineACAA92714A__..................................:
151 :......................................................:
201 :......................................................:
251 :......................................................:
301 :......................................................:
351 :......................................................:
401 :......................................................:
451 :......................................................:
24
0
The Logical Computer
Note in example 9-2 that the byte count of the new item for JES &
Associates, Inc. is a hexadecimal 3F, or 63 bytes from the beginning of the
four-digit byte count to the end of its item terminator.
VIRTUAL
WORKSPACE
The ABS Area Frames 0 through 399, or 400 frames in the generic PICK System, are reserved
for the PICK System itself. These frames are usually 2000 bytes each. All
programs in the PICK System reside in this 800K of virtual workspace. This is
known as the ABS, or ABSolute area, and is reserved for the PICK System
object code and tables, which are paged in from the disk as they are needed.
Frames between 400 and somewhere between 512 and 1023 are reserved for
The User ABS Area the user. This area varies according to how the PICK System is implemented.
This is the area in which the programmer who chooses to use PICK assembly
language stores the assembled object code.
The PCB Area The next area in the virtual workspace is the PCB, or Process Control Block
workspace. Here 32 frames are reserved for each process on the system. Each
24
1
Chapter
5
32-frame section is called a PCB, and is used to store all status and control
flags used by the PICK System to manage the activity of the process. A
process can be a physical CRT connection or “port,” a printer, or even a
nonphysical port that can be logged on, perform batch tasks, and be logged off.
(So-called “phantom ports” are used for background tasks on a PICK
computer, and can be used for multitasking by a knowledgeable user.)
The Process
Workspace Area
The next area is called the Process Workspace. Once again, a specific set of
frames is allocated to each port in the computer configuration. There are
several storage areas within a port’s Process Workspace. The size of these
areas is set by the computer manufacturer. The largest areas are called the Input
Storage (IS), Output Storage (OS) and History Storage (HS). Historically
speaking, the size of Process Workspace has always been somewhere between
100 and 127 frames per area, depending on the specific computer.
Note: If you should hear someone refer to lo^ disk on a PICK System,
that’s the Process Workspace, near the bottom of our diagram of virtual
workspace.
The User Data Area Following the Process Workspace begins the data file frames, which extend all the
way to the end of the disk area, or MAX-FID (Maximum Addressable Frame-
id). The location of the end of the User Data Area varies according to the exact
capacity of the disk drive. The last frame-id in the system is known as the
MAX-FID and is displayed after the user enters the command WHAT at TCL;
it is approximately the disk capacity of the computer divided by the system’s
frame size.
The first file in the User Data Area is always the SYSTEM file. It is the
file that is used by the PICK System’s LOGON program to determine where
all user Master Dictionaries reside. The SYSTEM file contains the initial links
in the pointer item chains that stretch out through the array of user data frames
occupying the vast remainder of the virtual workspace.
You can calculate the beginning frame-id of the SYSTEM file, as in this
example of a twelve-port system with 1024 ABS frames and 127-frame
working storage areas (assuming that the spooler is operating on the last port):
400 PICK ABS frames
624 User ABS frames
384 User PCB frames (32 frames times 12 ports)
4572 Process Workspace frames (127 times 3 times 12 ports)
5980 Base FID of the SYSTEM file
This can be a handy number if you are poking around trying to locate
your logon item or other bits of “good stuff” stored in the SYSTEM file.
Now we have toured the major PICK levels, examined one of the virtual
workspace data frames, and even learned the unlisted number of the SYSTEM
file. However, the real mystery component of the virtual workspace is the
24
2
The Logical Computer
silent and powerful program that keeps it all running. The next stop on our tour
is the core itself, the location of the ABSolute Code.
Functions of the The Monitor program makes the PICK System functional by providing Monitor
the services that a multi-user, multitasking environment requires. It also runs the virtual memory
management software, which supports the relational database structure, and the unique PICK
accessing methods. Some of the main functions of the Monitor include:
■ Maintaining control of the computer’s main memory, including all of the
memory-resident tables used by the virtual memory software, such as the
overflow table.
■ Maintaining and controlling the virtual memory workspaces.
■ Providing central control of multiple-user accesses.
■ Maintaining the status of each user/port/process in the reserved areas
known as the Process Control Blocks.
■ Scheduling, activating, and suspending user and system processes.
■ Controlling all input and output to the computer peripherals.
■ Maintaining and controlling the system software clock.
24
3
Chapter
5
for the user processes. In other words, one of the processes that the Monitor
pages into real memory as required is the PICK System itself! That makes it
possible for the Monitor to support enormous amounts of processing in
relatively small computers. It is true that eight interactive users can work
productively on a PICK computer with only 64K of real memory. The Monitor
makes it possible.
The Monitor program also provides the PICK System with its ability to
run on many different types of computers. The PICK System ABSolute Code
is written in PICK assembly language, while the Monitor itself is coded in the
native assembly or machine code of the host computer processor chip. Because
the Monitor is the only PICK component that is native to the host computer, it
is the only component that must be rewritten when the PICK System is moved
to a new computer. This is known as a “pseudo-system” or “p-system”
architecture, with the logical or pseudocomputer wrapped around the true
computer hardware. It is this architecture that has given the PICK System its
portability and ensured compatibility from the 8-bit micro to the 64-bit
mainframe, and every machine in the future.
How the Monitor The Monitor maintains the control tables for the virtual workspace. These Works
tables contain the FIDs and a status byte for each frame that is currently located in main memory. The
Monitor controls the update and access of those frames and provides much of the internal efficiency of
the PICK System.
The Monitor maintains the status of each frame as one of the following:
Available: Ready for use
Corelocked: Permanently locked in main memory
I/O Busy: In process of transferring data from disk to
main memory
Write Required: Scheduled to be written to disk
The tables allow the Monitor to locate frames already in main memory
and thus dramatically reduce the number of redundant disk accesses required
on the system. Studies have shown that 80 to 95 percent of all frame requests
on a properly tuned PICK System are satisfied from frames already in main
memory. This is one of the techniques that allow the PICK System to service
several terminal users in relatively small amounts of main memory or “RAM.”
The Monitor continuously balances the user processes and the hardware
resources to maintain throughput on the PICK System. It uses a “process
scheduling and time-slice allocation” scheme. This means that each port or process
that is active on a port is allocated a time slice of 5 to 50 milliseconds of the CPU’s
attention. The process is allowed to execute uninterrupted for the duration of this
time slice and then is suspended by the Monitor. All registers needed to reactivate
the process are stored, and the process is scheduled for reactivation after other
processes have been serviced. The Monitor then cycles through each of the
processes that are active on the system, activating and suspending the processes as
appropriate. The polling is extremely fast in human terms; every port on the
system is usually serviced in the time it takes an operator to lift a finger off the
keyboard.
24
4
The Logical Computer
24
5
Putting the Parts
10 Together: Applications
As you tour the PICK world, you’ll notice the inhabitants busily going about
their business. Let’s look at how they work.
At this writing, over two thousand “application packages” for the PICK
System are being sold commercially. A great many more are simply the work
of the users themselves. These are the self-contained, custom-written PICK
applications created for a specific business use; they “apply” the PICK System
processes to the user’s particular business objectives.
2
4
6
Chapter
10
Furthermore, the resulting system is likely to be perfectly suited to the
user’s requirements, level of knowledge, and skills. After all, it was created by
the user. Finally, such a system is likely to be well suited to the user’s future
needs; the user knows where and how to modify it.
Rolling Your Own A native database application on the PICK System begins with a good file design.
Experienced PICK users design segregated data files, with a file for
unchanging data such as names and addresses, and separate files for frequently
updated data and transaction items. This approach makes both files simple
enough to maintain with the Editor.
As described in figure 10-1, the user creates a data file, loading the
dictionary with simple attribute-defining items. For the purposes of this
illustration, we’ll assume the sales are of yachts, usually only one per cus-
tomer, and the customers like to maintain their privacy. So the names are kept
separate from the addresses.
The yacht dealer loads the data file, again using the Editor, or perhaps a
simple PROC that stores one item at a time by prompting for the data and then
activating the Editor. Then the user enhances the attributedefining items,
perhaps adding translations through a second file of common codes. The two
files and their dictionaries can be used to produce reports on the CRT or on the
printer, manipulating the data in any way the user sees fit. Skillful use of the
dictionaries can accomplish an astounding amount of data processing for any
user familiar with the ACCESS op
24
5
Applications
ACCESS STATEMENT:
LIST THE CUSTOMERS LAST NAME AMOUNT ADDRESS STATE.NAME
24
9
Chapter
5
“PHYSICAL” FILES
CUSTOMER #
“LOGICAL” FILE
NAME -
ACCOUNT LAST NAME
AMOUNT
CUSTOMER #
STATE.NAME
DATE
AMOUNT
CUSTOMER #
ADDRESS
CITY
L ZIP CODE
ZIP CODE
"[STATE.CODE
STATE.CODE 4
"[sTATE.NAME
Obtaining the customer’s last name is easy. An attribute defining item in the
dictionary of the CUSTOMERS file will define LASTNAME as follows:
LASTNAME
A
001 1 LAST NAME
002
003
007
004
008 GOJ
005
009 L
006
010 25
AMOUNT
25
0
Applications
001 A
002 0
003
004
005
006
007
008 TSALES;C;2;2
009 L
010 15
ADDRESS
001 A
002 0
003
004
005
006
007
008 TADDRESSES;C;1;1
009 L
010 20
STATE.NAME
001 A
002 0
003 004 005 006 007 MCT 008 TADDRESSES;C;3;3 ] TCODES;C;1;1 008
009 L
010 15
25
1
Chapter
5
when using the Editor. It causes the system to perform the first correlative and then
the second. (It is shown here with blanks on each side for illustrative purposes
only; blanks are not acceptable in front of the MCT or “Masked Character—Text”
specification.)
In most database systems, this process requires additional index files, utility
programs, and even temporary files to merge the data before output. In PICK-type
processing, the logical view of the data is the whole purpose of the system.
Retrieving a particular view of the data requires only a few dictionary items and a
simple ACCESS command from TCL, like that in figure 10-2.
In many respects the correlatives and conversions represent the strongest
features of the PICK relational database. All these additional attributes were
instantly added to the user’s view of the CUSTOMERS file, with no editing or
redundancy of data, and consequently, no misspellings or mistakes.
Even more powerful data processing is possible when the Functional (F) and
Algebraic (A) specifications are used in attribute-defining items.
They provide nearly unlimited computational power. These specifications in a
dictionary item can perform complex mathematics, conversions, even table
look-ups and output formatting. When combined with the ACCESS BREAK-
ON and TOTAL options, the A and the F specifications can even perform
mathematical operations on summation data that only exists when the output is
created, such as an average of the lines that appear on the page. Furthermore,
when applied to multivalued attributes, these functions are applied to each
value individually, and the results can be used separately or summed.
Please see appendix D, Conversion/Correlative Reference, for a
complete discussion of the A and F conversion/correlative functions.
As if that isn’t enough, there are features in the next release of the PICK
System (called Open Architecture Version 2), as well as the emulations
Revelation under MS-DOS and Uni-verse under UNIX, which allow the user
to put BASIC programs in correlatives. Anything that can be done in a
program can then be done in a simple ACCESS report.
Keeping It Simple With these relational database capabilities, an application system using only the
Editor and ACCESS is not difficult. We teach PICK users to utilize the native
PICK processors just for the sheer simplicity and time saved. Native PICK
processes can provide unlimited use of the data, with very little initial
development effort. As you travel in the PICK world, you may meet users
whom we’ve trained, who rarely need to leave the TCL.
On the other hand, there are many who take the Editor window down to
the PROC and PICK/BASIC programming level. These users combine the
magic of the TCL level with the power and the flexibility available in the
lower levels. We’ll examine program-based applications next.
25
2
Applications
25
3
Chapter
5
The Basic Mistake The predominant programming language in the PICK world is clearly
People Make About PICK/BASIC. It was developed in the early seventies by Ken Simms, a
BASIC programming wizard working for Pick in southern California. At about the same
time, just down the street, the Microdata Corporation reported simultaneous
development of the DATA/BASIC language by another brilliant programmer named Tom Ells, creating a
schism that produces incompatible code even today. In any case, Simms reportedly regrets naming the
language BASIC. The name has created the impression that PICK/ BASIC is similar to the rudimentary
“Gee-Whiz BASIC” used on personal computers. Nothing could be further from the actual fact.
PICK/BASIC is clearly a top-of-the-art application language (clearly at
least to any professional who uses it before expressing an opinion). The
PICK/BASIC language is a significant extension of the “Beginners All-Purpose
Symbolic Instruction Code” created at Dartmouth College. The extensions draw
upon the PICK data model and the tools available in the PICK world.
For example, there are special features such as dynamic arrays, untyped
variables, and fully recursive and reentrant subroutines, as shown in figure 10-3.
There are features outside of BASIC as well—for example, a feature in TCL
designed for facilitating BASIC application systems. It is called the Logon
PROC.
25
4
Applications
The Alternative Here is an interesting piece of PICK folklore: While other languages can
Language: RPL be run successfully on the PICK System (such as the Report Generator Language
RPG and even a version of COBOL), there has only been one programming language to rival
PICK/BASIC. The Real-Time Programming Language, or RPL, resides between the PROC and
BASIC levels when it is installed in the PICK world. The language is similar to PROC, but has most
of the programming capabilities of BASIC. Yet the RPL program language is not part of the
standard PICK System as it is sold by PICK Systems, Inc.
RPL was developed in the mid-seventies in Chicago by Systems
Management, Inc. under the direction of George Ridgway, working with an
enlightened guru by the name of Chandru Murthi and a technical genius named
Tim Holland. The company has licensed the language for use on dozens of
different computers, and today markets some exceptional accounting and
manufacturing software written in RPL.
The RPL language enjoys some advantages over PICK/BASIC. First, the
language is reportedly 20 to 50 percent faster in some operations. Second, the
language is supplied with a library of useful utilities, including a fully
25
5
Chapter
5
interactive debugger. Third, the RPL language is based upon PROC, and uses
the TCL and ACCESS processes, as well as the file dictionaries. It is said that
RPL looks down at the database from above, utilizing the dictionary structure,
while PICK/BASIC processes work from below, where all the dictionaries
appear simply as data files.
While RPL is said to be more difficult to read than PICK/BASIC, the
major disadvantage to RPL is its file handling. A limited number of data files
can be opened for input and output at one time; file handling has therefore
been called “cumbersome.”
25
6
Applications
Types of The first type is the code generator, designed to create PICK/BASIC program
Application code that can be handled by the standard PICK processes. This type of
Generators application generator creates systems that are easily transported from one
PICK System to another, and that can easily be modified by the user. Some of
the more well known PICK code-type application generators are WIZARD from Wizard Software, Inc. of
Irvine, California, and SYSTEM BUILDER from System Builder Technologies of Irvine, California.
The second type of application generator software is the run-time system.
This type produces tables or lists of parameters instead of program code. To
use the application generator, the user must have the “runtime” software
installed on the computer. This program reads the parameter tables and
performs all the work specified. The run-time system produces more secure
code, because any potential user must have the run-time software, and
modifications of the generated applications are usually not possible without
the original application generator software. The runtime system application
generators are typically more expensive than code generators but usually offer
features that significantly enhance the final application. One of the more
notorious run-time application generators at this writing is ALL from the
McDonnell Douglas Corporation.
There is a third type of application generator software that is only now
making its debut in advanced computer systems such as PICK. More than a
language or application generator, it is called a fourth^ generation environment.
This type of generator is actually a general-purpose application system in its
own right. It draws upon the PICK world’s intrinsic processes to provide a
wide range of services to the user. These services take place 1) during
generation of application systems, 2) during the operation of those systems,
and 3) even while using PICK outside the generated application.
In a fourth-generation environment, in addition to a code type or run-
time application generator, there are usually facilities for:
■ creating files and dictionaries
■ establishing cross-indexed databases
■ generating output reports
■ setting up and monitoring batch processes
■ establishing and monitoring system security
■ automating the office, including phone messaging, word processing,
electronic mail, personnel scheduling, and diaries.
25
7
Chapter
5
All three types of application generators typically work the same way. The
program-creation method uses a set of menus, sometimes written in the application
Similarities among
generator software itself. These tools are designed to assist the software developer
Application
or dealer in defining applications. One menu process usually creates screens that
Generators
display data, prompt the operator for input, and create or update data items in files.
Often this process is referred to as “painting” a screen. After entering all the
specifications for a particular screen, the painter program typically creates a
PICK/BASIC program, or creates a table that can be executed by a run-time
program.
A second menu process is used to create output reports. On the PICK
system, this tool usually creates ACCESS reports according to the user’s
specifications, although some application generators produce PICK/BASIC
reports. Once again, after the user enters all the specifications for a particular
report, the report generator creates files or a table of parameters for a run-time
program.
In the more comprehensive application generators, a third tool is also
available. This third tool creates programs that combine, compare, or update the
user’s data files in a batch process.
25
8
Applications
special needs. The net result is a less costly application system for the buyer,
and an application package that is easier to maintain for the dealer.
Application In the private use of the PICK System, application generator systems have a
Generators and the very important role in the “make-or-buy” decisions. They are utilized during
End User the design process, to create prototypes of the desired application system for
testing the user’s requirements. Furthermore, during development of an
application system, there are excellent economic and technical reasons to avoid writing code when good
code can be generated.
Here are some important considerations regarding purchasing an
application package versus in-house programming on a PICK System.
First, the user must define the specific functions to be performed and
detail the procedures surrounding those functions as much as possible. In other
words, it is necessary to determine what the application is and how it fits the
operation, in the most intimate detail that time will allow. A structured analysis
and design technique, with its emphasis on the data and its flows, is especially
well suited for a PICK-based operation.
Second, the developer must determine the best way for the system to
perform the user’s work. There is no substitute here for a prototype. Needless to
say, if there is no substitute for a prototype, then there is no substitute for an
application generator to build it, rather than coding from scratch.
Third, any developer worth paying will make a thorough search for
application software that does the job or can be modified to do the job. Inhouse
coding is very expensive. An often-cited production estimate is twenty
debugged lines of program code per day. That’s $50 or $60 PER PROGRAM
LINE, considering technical labor, programming tools, and program
maintenance costs . . . and it is not unusual for a simple ac counting package to
have several thousand lines of application code. A particular application
software package may not be exactly what a particular user might require, but
modifying a package can offer a significant cost saving over programming from
scratch.
Even with purchased software, application generators are of great value. If
an application package is based upon an application generator, it can usually be
modified at a relatively low cost. Moreover, it can usually be maintained over
the years at the same low cost, provided the application generator is included in
the purchase. And even if no application software package is available, purchase
of an application generator will reduce the cost of additional programming.
In any case, the user should consider some expert advice. Thorough
training in the facilities and features of the PICK System being used is a real
bargain, considering the cost of ignorance. Beyond extensive training, there are
many PICK dealers and distributors who offer a wealth of information on what
is available, and the experience to recommend a good fit. For example, a
software company with long experience in Chicago now offers consulting
services that measure the effectiveness of a user’s PICK System and application
software, and analyze which of the competitive PICK hardware alternatives will
run the user’s software most
25
9
Chapter
5
The Difference in
PICK Assembly
While PICK assembly language looks much like other assembly language
Language programming code, it is significantly different from the basic assembler
language (BAL) used on most other computers. BAL source code is assembled
or translated into machine language instructions for execution. In this form, the
resulting program executes extremely fast and has access to very powerful
hardware control registers. PICK assembly language source code, on the other
hand, is handled by the PICK Monitor before execution.
The result is an object code program that is not quite as fast as BAL, but
somewhat more powerful. Since PICK assembly language programs are
interpreted, the language has many commands that can take advantage of the
Monitor’s virtual memory services and database functions. However, all of the
PICK Operating System itself (with the exception of the Monitor) is written in
the PICK assembly language. So, user programs
written in PICK assembler are executed right along with the operating system.
26
0
Applications
Not To Worry There are excellent application software packages that use assembler routines to
improve screen handling and performance. Because they are integrated
directly into the PICK environment, these routines are quick and powerful.
One application generator, TPL from LAZAROV Software of Colorado,
created assembly language applications that were many times faster than
comparable BASIC routines.
Furthermore, assembly language routines can add new features to the
PICK System, such as graphics and communications. PICK assembly language
can be used to create the powerful peripheral control routines for new video
displays to be attached to PICK-based computers. Assembly language can
weld PICK to UNIX, opening vast new processing capabilities to both
environments. The latest version of the PICK System, Open Architecture, has
features to simplify the development of assembly language routines and make
them safer to use.
In summary, some of the best software in the PICK world is written in
PICK assembly language, but it requires special support. If the software is
good enough, has been around for a while, and the developer and vendor are
reliable, the software is likely to be worth the effort. We trust these factors. For
26
1
Chapter
5
General Accounting 75
Accounts Payable 31
Accounts Receivable 25
Communications 16
Distribution 54
Expert Systems 2
Fixed Assets 18
General Ledger 44
Graphics 3
Application Generators 32
Inventory Control 30
Job Costing 8
Mailing List Management 18
'Source: The GUIDE to Products, Services, and Software for Pick-based Computer
Systems, U.S. and Canada edition, 1987. Published by TMS, Inc. at 22951
LaCadena, Laguna Hills, California, 92653, 714-855-4442.
26
2
Applications
Manufacturing 48
Office Automation 5
Order Entry 16
Payroll 20
Personnel 5
Point-of-Sale 12
Sales Management 25
Spreadsheets 4
Telemarketing 4
Word Processing 5
Accounting Broadcasting
Advertising Agency Cable Television
Agriculture/Agribusiness Cemetery Management
Airline/Aircraft Chemicals Management
Alumni/Fund Raising Church Membership
Animal Registration Collection Agency
Apparel/Garment Trade College Administration
Architecture Management Construction/Contracting
Association Management Conference Administration
Attorney/Time Reporting Country Club Management
Automotive Credit Union
Banking/Finance Dairy Route Management
Bookkeeping Dentist Office Management
Bookstore Diamonds/Precious Stones
Bridal Registration Inventory
26
3
Chapter
5
Dispatching/Field Service Psychiatric Practice Publishing Real
Administration Estate/Sales Real Estate/Taxes and
Education/School Administration Assessment Recipe Processing
Engineering Management Referee Assignment Religious Text
Entertainment Industry Accounting
Management Restaurant
Equal Employment Reporting
Management Rodeo Management
Equipment/Fleet Maintenance
Security Services Sports
Fabrics Distribution
Management Stock Brokerage
Fire Department/Public Safety Flat
Surveyors Tax Collection
Glass Cutting Food Services
Telephone Interconnect Services
Food/Allergist
Television and Appliance Stores
Freight Company Fund Raising
Time/Services Reporting Traffic
Furniture Dealership Gas and Oil
Management Government Control Transportation/Freight
Administration Group Life and Travel Agency Truck Dealership
Health Hazardous Materials Trust Administration
Handling Health Club/Physical
Fitness Hospital/Health Management
Hotel/Motel Housing Authority
Importing/Exporting Insurance
Agency/Brokerage Investment
Management Labor Union Law
Enforcement Lease/Rental
Legislative/Legal Reporting
Library/Cataloging Loan/Premium
Handling Lumber Wholesale/Retail
Mail Order/Direct Sale Mailing
House Marine/Maritime
Medical/Clinic Medical/Dental
Medical/Hospital
Membership/Subscription
Metals/Precious Jewelry Mortgage
Management Municipal
Management Museum Management
Non-Profit Organizations Nuclear
Plant Management Office Products
Partnership Management Pawn Shop
Management Personnel Agency
Pharmacy Printing Shop Property
Appraisal Property Management
26
4
Applications
1
One of the purposes of this book is to print some things that need to be said
about the PICK System. One of these things is that the PICK is differ ent from
most other systems available for use in business today. Part of that difference
is that the system can be used by anybody, but to be used well it should be
used with some thought. Sometimes it is not used well. And that is why we
have included this side trip through the “how to use” aspect of the PICK
System.
2
6
6
Chapter
11
always take out the old system and put in a new one at half the cost of any
other computer system.
Such professional programmers typically create systems in one of ‘
two ways. They use design methods suitable for batch-oriented computer
environments, such as flow-of-control flowcharting and large redundant
programs, which are not appropriate for a relational database, virtual machine
like PICK. Worse yet, programmers experienced in PICK sometimes rely on
their knowledge of its tools and simply crash along without designing at all.
In the latter case, the PICK System’s ease of use actually
encourages such poor application system design. Each of us (ugh) has
known programmers who simply create a file to hold the data, then lash
together some application code to replace manual procedures. The
lifetime of the resulting patchwork application is a distasteful process of
stitching together little files and programs, and tying off bits of the
application until they rot and fall off the backup tape. This situation
continues until the organization is sick of the patchwork computer
system, and it is mercifully put to death.
Unfortunately the cure is occasionally worse. The next system is of-
ten designed by a committee, or even worse, a “data processing profes-
sional” who brings the baggage of preconceived notions about data files
and indexed record processing. At least the old system was built entirely
on the user’s view; the new system may well be constructed entirely for
the computer’s needs under the excuse of efficiency. It is even possible
that the PICK System itself is tossed out with the old bathwater; because
it didn’t work all that well before and the design committee doesn’t know
very much about it, PICK is sometimes simply considered “not powerful
enough to do the job.”
In this case, the new system will cost in both usefulness and hard
dollars. The user pays for brand-spanking-new computer gear with an
old- styled, hardware-oriented operating system that will cost many times
the purchase price in inflexibility and the resources to keep it running.
Or, the user might be saddled with a “simulated computer.” This is the
famed local area network, which can be defined as “a multi-user
computer spread out around the room, with at least two operating
systems struggling for control.”
No matter what the scenario, the final result is the same: everyone
grumbles and works around the computer instead of through it. And the
people who are responsible for the computer system get neither recogni-
tion for their efforts nor satisfaction from their jobs. It is therefore more
cost effective, more professional, and just more fun to design a system
well in the first place.
■ f course, there is a price. Good design work adds as much as 20
percent to the cost of a new system. But studies by companies such as
IBM indicate that good design saves TEN TIMES the additional cost, just
in maintenance and replacement.
■ A well designed system is likely to be more flexible and oriented
toward the user’s needs rather than the computer’s limitations.
267 ‘
Chapter
5
■ A well designed system is certain to be better understood and easily
modified, instead of just being replaced.
■ A well designed system is likely to bring more self-esteem to the
developers and more gratification to the users, thereby enhancing its
life expectancy and improving the care that it receives.
That is why design is not a luxury, but a necessity, like planning for
a soft landing on the PICK world rather than heading off in the general
direction and crash landing at the theoretical destination.
A Little Structure At about the time that Dick Pick and Don Nelson were developing the first
PICK database environment, thoughtful studies were being published re-
garding the nature of data. As some of those studies presumably influ-
enced Pick and Nelson, they also had a profound effect on the people who
were designing computer systems elsewhere. Two of those people were
Larry Constantine and Ed Yourdon.
Without a major side expedition, our tour cannot include the ex-
traordinary techniques of Structured Design that were developed by these
two. While these techniques are highly recommended, we must leave the
details of these approaches to other books, which we have listed at the end
of this chapter. But we can discuss the underlying concepts of good appli-
cation design, and why it is particularly appropriate for use with PICK-
based systems . . . even if the final system is NOT implemented in PICK.
That’s right. A PICK-based computer can be very helpful during
design, even if the final decision is to implement the system on something
else.
26
8
Analysis and Design
Overview of the Here is our itinerary for this little design side trip. First, we briefly discuss
Design Process the fundamental steps in analyzing and designing a database application
system. The good designer analyzes the data and how it “flows” through the existing system.
The observations are recorded in a graphic form because it clarifies the data flow and because
it is easy to revise. The resulting paper “model” is painstakingly revised until it is reliably
accurate and until all considerations of the current system and the computer, or the “physical”
aspects, are removed. What remains is the logical flow of the data and the processes that must
be applied. Then the designer modifies the paper model into the best solution for the problem:
the most “logical” way to hold the data and process it for the people and the objectives of the
final system. Finally, the designer adds back the physical considerations for the intended
system, and tests those considerations with a prototype. The results are the specific recipe for
the final system, in a form that everyone agrees with and all can understand.
That is where development and structured programming begin, and
our side trip ends. Structured programming is another consideration,
while analysis and design are thoughtful applications of what works well
in PICK. So let’s get to work.
Analysis
The first step a designer must undertake with a new or existing system is
to learn the data flow, in “as intimate a level of detail” as time will permit.
Hours spent here save weeks at the other end of the project.
The technique with the greatest benefit downstream in the design
process is to build a “logical model” of the system on paper, clearly identi-
fying the data that enters each process (input) and the data that leaves
(output). This may not seem unusual for any analysis, but a surprisingly
large number of systems professionals start with an analysis of what is
DONE to the data, thereby ensuring that any problems with the current
processing will be carried forward into the final system.
The analysis tools called data flow diagrams and data dictionary seem
almost to have been created for PICK-based designs. The method
involves finding the physical pieces of data (forms, transactions, reports)
and defining them in detail, while identifying “processes” in which the
data is transformed in some way—i.e., combined, updated, modified,
calculated, stored. The data flow diagram, as shown in figure 11-1, is a
graphic representation of what goes in, the name of the transformation
process that is applied, and what data flows out. Storage locations for
data are referred to as data stores-, in PICK-based data flow diagrams,
they are shown with a dictionary portion on the left and a data portion on
26
9
Chapter
5
the right.
The data flow diagram is drawn, revised, and redrawn over and over as
the processes are partitioned in simpler modules and more facts are discovered
about the flow of the data. While these DFDs are being casually created and
revised, details about the processes are postponed. They will be determined
later, after the designer is absolutely certain that all data flows have been
identified and accounted for in the environment.
Details about the data flows, on the other hand, are being lovingly
recorded in a data dictionary, which is usually a collection of three-by- five
cards, similar to that shown in figure 11-2. On these cards are the data flow
name and the specific elements of the data within the flow, along with details
about whether the data is optional, or appears more
-------------------------------------
-----------------I
-----------------------------
------------------ ----
MM
27
0
Analysis and Design
than once (“iterations”). There are usually comments on data dictionary cards,
in the invaluable margins.
Recently, automated systems have sprung up to maintain the data
dictionary during the design effort. These systems can be helpful, if they do
not become so complex that they hinder the effort. In practice, a native PICK
System can be a good tool for automating the data dictionary during the design
effort.
A PICK Data It is a simple matter for a designer to create a PICK file with items in the
Dictionary following format:
Filename: DATA-DICTIONARY
Item-Id: DATA-FLOW-NAME
The designer records each data flow in this file, storing each data element
as a multiple value in the first attribute. The second attribute contains an
“Iteration,” in the following form:
minimum number — maximum number
where 0 in the first location means optional, and in the second position means
no limit. For example, a data element that must appear at least once and may
appear four times has an Iteration of 1-4. If the data element is optional and
may appear up to four times, the Iteration is 0-4; if it is optional and may
appear without limit, the Iteration is 0-0. The item contains one Iteration
specification for each data-element.
The third and fourth attributes of the data item contain the name of the
process in which the data flow is used, perhaps preceded with an “I-” if the
data flow goes into the process, or an “O-” if the data flow comes out of the
process. (Good data flow diagrams don’t usually have data flows that go into a
process and come out without modification, but if necessary, a “B-” prefix
would indicate both.)
There can be multiple values in the PROCESS attribute if a data flow
appears in several processes, but these are independent of association with any
data element.
The Comments attribute can replace the beloved margin. On those items
that describe only one data element (called “primitives”) the Comments
attribute often contains the anticipated format of the data element.
Dictionary for the Finally, the designer creates attribute-defining items in the dictionary of the
Data Dictionary file. The attribute-defining item for the DATA ELEMENT has the following
correlative:
TDATA-DICTIONARY;C;1;1 J TDATA-DICTIONARY;C;1; 1
27
1
Chapter
5
A data flow item that contains other data flows as elements is then
automatically expanded by the PICK System on output, as follows: When DATA-
ELEMENT is included in any output, the PICK System automatically looks up
each data element in the multivalued list; if the value appearing in the multivalued
attribute is itself a data flow, the system retrieves all its component parts. A
multiple-valued translation specification such as the one above even translates them
into “primitives,” or data elements consisting of one datum. (Remember to set the
justification in the DATA-ELEMENT attribute-defining item to “Text” by placing
a T in attribute 9.)
The PROCESS attribute-defining item can be written with the correlative
T3,99. This retrieves only the process name from the item, even if there are several.
An attribute-defining item named TYPE with a correlative of Tl,l returns I, O, or B
for the data flow that is input, output, or both. Finally an “exploded sort” such as
this:
produces a printed report for each process, including all data elements that go in,
and all data elements that go out. This can be invaluable when a designer wants to
know all of the places that a particular data element is used. While the PICK data
dictionary has some limitations compared to the margin, its use is a reliable
alternative to cards, and one that can be shared by all designers working on the new
system.
The Second The second general step in the analysis is to identify and specify exactly General Step
what goes on in each process of the application. For this purpose, the designer “interviews the
existing system.” That usually means talking to a person, but it can mean examining a computer
program that performs each process. The designer’s responsibility then is to document the pro cess, in
a clear, concise, and simple step-by-step description of what goes on.
One of the more common practices is to use something called structured
English. A structured English description for writing a check for a purchase might
look like this:
PROCESS: Produce-Check
Write CREDITOR on CHECK
If DUE-DATE is less than current date minus 10
Get DISCOUNT
Else DISCOUNT equals zero
For each ITEM-COST Get QUANTITY-BILLED
Get UNIT-PRICE
Calculate ITEM-SUBTOTAL
UNIT-PRICE times QUANTITY-BILLED less DISCOUNT
Get next ITEM-COST and repeat
27
2
Analysis and Design
Calculate INVOICE-TOTAL
Sum ITEM-SUBTOTALs
Get AMOUNT-PAID
Calculate AMOUNT-DUE
INVOICE-TOTAL less AMOUNT-PAID
Put AMOUNT-DUE on CHECK
Stop
Structured English looks a little like program code. That’s because of its
rules:
■ Imperative verbs only, no adverbs or adjectives
■ Only nouns from the data dictionary, including processes
■ A special set of reserved words for “policy,” such as “next,” “repeat,”
“on,” etc.
One good way to control the writing of structured English is to write it
with a word processor within the same system as the data dictionary. The
PICK “REFORMAT” command at TCL can easily create a file of acceptable
words from the item-ids, the data elements, and the process names. With the
addition of a few dozen verbs and policy words, the file becomes an excellent
spelling checker that will warn of the use of any words that are not part of the
designer’s established “structured English vocabulary.”
It would be an oversimplification to say that the analysis process is
finished here. In practice, the analysis is painstakingly iterative, ferreting out
every tiny inconsistency between what goes in and what goes out, and
between what was said then and what is known now. At the end, however, the
designer has a clear picture of what is (or should be) happening, free from
considerations of what computer processes the data, who does what, or how
the system has always worked in the past. While there are many other ways
that the PICK System can be helpful in the analysis, it’s time to move on to
design.
Design
Design is the process of creatively selecting, testing, and replacing ideas to
accomplish small components of the overall solution. A good systems de-
signer needs neither a bagful of books nor advanced degrees, nor even ar-
27
3
Chapter
5
tistic tools. After a thoughtful and disciplined analysis, most designers have all
that they need to create a workable database processing system.
Among the first components to be designed in a data-driven system is
the database itself. There are nearly as many methods for creating a database as
there are designers. They range from:
■ Beginning with one file for each data access and gradually combining
them to improve system efficiency, to
■ Starting out with one giant file containing every type of data, and
gradually splitting the “superfile” up to improve system efficiency.
Step 1—Analyze 1. Create a list of all data stores shown on the DFD.
the Data Stores 2. Define the data flow for each access of each data store; label them as
Input Access or Output Access.
3. Replace any procedural flows (such as forms) with actual data elements
or primitives from the data dictionary.
4. Eliminate any unused data in each data flow, and eliminate any
historical data elements that are not being used, as well as any elements
used solely as accessing methods or for political reasons, but which are
not actually “transformed” in the process(es) in question.
What is left are the required “user’s views” of the data at each process
throughout the system. Each is labelled as an Input Access or Output Access
associated with a process. Now the task is to mold the requirements of the
system into a clean, nonredundant set of logical data stores. This is the part that
is fun to do while sitting on the beach.
1. Identify the “object” of each data store, or the unique central subject
of each user’s view. If there are two, create two separate data stores.
Step 2—Analyze Identify for each object the attributes that are specifically related to it and
the User’s Views the key attribute that uniquely defines that object.
2. Identify any “repeating groups” of data elements within a user’s view
(such as the item/description/quantity/unit price that appears on a
customer’s invoice), and ensure that no user’s view has more than one of
them. If necessary, isolate each repeating group as a separate data store,
with a unique key attribute.
3. “Sanitize” the attributes that are associated with each object and data
store; eliminate those that can be “derived” by calculating or summing of
other attributes, or looked up in other data stores.
27
4
Analysis and Design
Step 3—Reassemble 1. Assume that each data item is the layout for a file. Assume that
each correlation is an index. On a PICK-based system you can eliminate
the correlations by placing the appropriate keys in the list of attributes
associated with an object.
2. If possible, eliminate data stores consisting of only repeating groups by
reinserting them into their appropriate object data stores; remember,
however, that no data store should have more than one repeating group.
3. Create a diagram of the various data stores, showing how they are
accessed and how they are related.
4. Apply the new data stores to the logical model by redrawing the DFD,
using the new data stores. Check to make sure that each process gets the
data it requires, and has a location for the data it produces.
At the end of this process, you have completed the task of determining
the best fit for the needs of the system. But the job is not quite over. What you
have created is not necessarily the most effective layout of the data. Now you
apply the ingredient that separates a good design from trash: common sense.
Commmon sense is all that is needed to add the physical characteristics
that make an “effective” database. These include file considerations, ACCESS
methods, design of individual modules within the processes, and adjustment of
data stores to meet the needs of the modules with a minimum of data accesses.
For this step, there is no substitute for experience. For most designers, use of
PICK for the data dictionary during the analysis pays off here. A good way to
determine how the data is to be stored is to try building a few files like the
ones you have in mind, and test them.
Process Design
The designer now looks at the collected total of data flow diagrams, and
draws a boundary around those processes that will be automated. The
processes inside the boundary are to be handled by the new computer system,
while those outside are to remain as they are, at least for the time being.
Transaction Now the design of the processes begins. This includes analysis of each proAnalysis
cess specification for the most efficient and effective way to accomplish each specified task. This
27
5
Chapter
5
design step is often called “transaction analysis” and it involves:
1. Separating each process into “modules” that can be automated.
2. Assembling the appropriate sequence of steps in each module.
3. Analyzing the type and degree of “coupling” (or communication) and
“cohesion” (or dependence) between modules to maximize efficiency and
reduce redundancy.
There are many more steps in process design, far too many to cover here.
But here are a few considerations from among the many that appear to be
particularly important to PICK-based computer systems.
■ Processes should be broken down or “partitioned” to a level at which
everything happening inside can be expressed as one of three constructions:
1. A sequence of simple steps, such as GET, SUM, or CALCULATE
2. A repetition, such as FOR EACH . . . DO the following
3. A choice, such as IF . . . THEN . . . ELSE
Prototyping— One of the final steps, then, is to put in some of the physical considerations
Designing in Clay of people/computer interfaces (screens), storage mechanisms (database files and
indexes), and procedures (operations). It is here that the PICK System makes its greatest contribution
to the design process. It is here that I the designer utilizes a prototype, or a physical model of how the
intended system works, to determine if what the designer has heard agrees with what the user lias been
saying.
27
6
Analysis and Design
27
7
1 The Future of the PICK
-L System
The PICK System was called “the best-kept secret in the industry” by Business
Week magazine ten years ago. More recently the magazine praised Dick Pick
for his “take-it-to the-people” campaign to make the PICK System known in
the popular computer marketplace. That’s because of this simple statistic: in a
market of millions of computers and tens of millions of users, PICK only
accounts for about 1 percent of the total systems in use in the United States. In
their 1987 Annual Report, Pick Systems, Inc. observed, “business data
processing specialists of the 1970s are still mentally and financially locked into
batch processing.”
But elsewhere “the spread of the PICK system has reached global
proportions.” In newer markets such as Europe, where system selection is
based more upon performance than on marketing, Pick’s share is closer to 10
percent. In Australia, it is reportedly approaching 15 percent. It would not be
the first time that a good idea, like William Deming’s production methods and
the Beatles’ rock-and-roll, had to reenter America from overseas.
2
7
9
Chapter
5
microcomputers to mainframes, but due to the nature of PICK they all now use
the same data structures, programs, software, and virtual memory management
architecture. This means that a user has many different machines to choose
from when application software is programmed to run in a PICK environment.
With the advent of PICK running under UNIX, the number has been
multiplied.
Each year the PICK world continues to attract new licensees. The major
PICK System licensees are listed in appendix A.
PICK Emulations
Cosmos Revelation on Cosmos announced the Revelation Operating System in 1983, was sued in
the PC 1984, and became a licensee in 1985. While not a “true” PICK System, it is
certainly a true emulation. For example, virtually all PICK/BASIC programs
can be downloaded to the IBM PC running “REV” and compiled into
R/BASIC. The Revelation product has been heavily advertised in the personal
computer marketplace, and has established a significant user base. Its future is
tied to the use of personal computers in local area networks, while true PICK
provides a multi-user environment for the 80286/ 80386 microcomputers.
Prime Information The Information System (1979) is a PICK-like environment that was devel-
under Primos oped by a company named Devcom and later sold to Prime. It is reported that
the Information product represents a substantial portion of Prime’s total
revenues. In early 1987, Prime quietly settled a long-standing dispute as to the
miraculous similarity between Information and PICK by becoming a PICK
licensee. More recently, Prime has taken steps to offer UNIX, MS-DOS, and
PICK in the form of Uni-verse on the new EXL series of computers.
V-Mark Uni-verse
28
0
Future of the PICK System
Extensions to the The PICK System for the Intel chips contains several enhancements, to PICK
System take advantage of the special capabilities of this popular hardware. Special extensions have
been made to the PICK/BASIC compiler and to the Terminal Control Language, to take advantage of
the memory-mapped screen display. These extensions allow the user to control color and reverse
video, and display half-intensity protected fields on the screen.
28
1
Chapter
5
In addition, the PICK implementation takes advantage of the disk
partitioning capabilities, to allow the disk space to be shared with as many as
two other operating systems—e.g., PC-DOS and UNIX. Meanwhile the PICK
partition brings its multi-user capabilities to any MS-DOS compatible
computer, even the portables. At a recent national PICK-based computer show,
a portable computer the size of a lunch box had no difficulty supporting
seventeen simultaneous users, prompting one technical stick to remark,
“someday the PICK computer may just be a fat spot in the user’s CRT power
cord.”
The day of the “fat spot in the cord” is coming closer. At a time when
microcomputer users are scratching their heads about what to do while waiting
for a true multi-user, multitasking operating system, a new PICK System
prepares the way to the next generation.
Features and Open Architecture is designed as “the operating system’s operating sys-
Capabilities tern,” according to Pick Systems, Inc. The new version will provide features and
capabilities to extend the surface of PICK beyond what is available at TCL today. For example,
OAv2 offers:
■ A full screen Editor with “on-the-fly” searching capabilities that use
dictionary definitions
■ The capability of using BASIC programs in dictionary attributedefining
correlatives and conversions
■ Automatic menus, stored as items in the Master Dictionary and activated
by simply typing the menu item-id
■ The ability to suspend a process currently active at TCL and start up a
new process, providing up to sixteen TCL “levels” to the PICK
environment
■ Explicit indexing of data files in both BASIC and ACCESS, with B-Tree
and cross-reference indexes that are automatically maintained. BASIC under
OAv2 also supports Soundex indexes.
■ A permanent “memory” for TCL, recalling and executing any TCL
statement entered since logon
■ A new TCL command that causes the system to execute a TCL command on
another terminal elsewhere in the system
■ Facilities for running background “phantom” tasks from TCL, and
monitoring the progress of such tasks
28
2
Future of the PICK System
Potential According to Pick Systems, Inc., Open Architecture was designed as the
Developments developer’s platform. It provides the opportunity for system developers to create ABS
extensions. Easier to modify and to enhance, OAv2 can provide virtual memory management and
relational database services not only to application packages, but also to alternate operating systems.
Here is how it works:
The new PICK OAv2 System is capable of interacting with more than one
operating system in two ways. The first is through a greatly simplified internal
organization that enhances the interface between the ABS, the Monitor, and the
external environment. The second way is by allowing more than one ABS area in
the PICK virtual workspace. Each port or process can specify that it will operate
out of its own ABS area. This suggests that several different versions of ABSolute
Code can run simultaneously, including ABS that has been modified by user-
written assembly language routines. This could include routines that communicate
with, or even run, UNIX and MS-DOS software.
At this writing, more than a dozen companies have chosen to offer Open
Architecture, including COST/Sequoia, Rexon, Seattle Operating Systems,
Pick Systems, Inc., and developers who are working to combine the UNIX
system with the PICK System, such as Icon, Edge, Scan-Optics, and Sequoia.
Much of the interest in PICK Open Architecture, however, is based upon
speculation about what is to come. The system’s advanced approach may be
the path to the integrated environment of the future.
28
3
Chapter
5
28
4
Future of the PICK System
memory and device controllers. The advent of solid logic has been called
the turning point from third generation computers to today’s fourth generation
computing systems.
Now a fifth generation can be seen in the not-too-distant future. Unlike the
previous generations, it is not expected to be based upon any revolutionary
technology. Instead, the fifth generation is being called the birthplace of artificial
intelligence. Like our memory or speech, fundamental data handling processes
will be inherent in the computer instead of the software. Data structures, storage
techniques, device control, and many other aspects of operation will be relegated
to the hardware and operating system, while the application software will be
elevated to a higher perception of the data and the associated devices. The
application software, then, will become a kind of intelligence that uses the
system’s data and devices in ways never before possible.
There are several milestones along the road to that not-too-distant future. First,
there is the database structure for the information or “knowledge” that a fifth
Components of the generation computer will need. This collection of data must be dynamic and
Next Generation flexible to be useful in an environment that continuously alters the relationships
between data elements. The current candidate for such a database is the
relational database model. In this approach, the relationship between any two
physical data attributes is created as required, and data items consist of logical
collections of data elements, as opposed to physical records within the computer.
The second major milestone to be developed for artificial intelligence is
sometimes called the “inferential algorithm,” or the set of logical rules by which
the software will relate the available data. At this writing, little progress has been
made on the general set of rules, although encouraging results have been
demonstrated in specialized applications, such as medical diagnosis and
geological studies. The breakthrough here is expected in the systems that learn
and store relationships in dictionaries of experience.
A third step to the next generation computer is a humanistic interface.
Artificial intelligence systems require that human users interact easily with
complex processes that are interacting with more complex processes deep within
the computer. To be manageable, each interface must take the form of normal
human interaction, with a personalized, conversational input and “politely
precise” output.
Every computing system that has ever existed has made its contribution to the
evolution of fifth generation computing machinery. Just how does the PICK
System contribute?
■ The PICK System has pioneered a virtual machine architecture designed to
PICK’S elevate the operating system and applications away from hardware
Contributions constraints.
■ The data structure is exclusively database, with a physical and logical
relational structure, which is made available for use at any time, by any
process.
■ The user interface is an exclusively interactive user environment, with a
natural data retrieval language and graduated programming languages
28
5
Chapter
5
patterned after spoken English and fundamental Beginner’s All-Purpose
Symbolic Instruction Code.
In a word, the PICK System might be considered the “predecessor” of
the fifth generation; it is an environment in which many of the AI features are
present, and in which the user provides the logical relationships or inferential
algorithm between the data elements by creating and altering the dictionary
attribute-defining items.
The Transition to No one can specifically predict the transition to the next era in computers, the Next
Era This gives us a perfectly good opportunity to speculate.
We can expect technological advances to perpetuate the present turmoil,
without any real advances in the computer architecture itself. Briefcase
computers already have the capabilities of full-scale systems, and desktop
computers act more like multi-user minicomputers every day. More power
does not seem to get any more work done, yet manufacturers will continue to
exhort users to upgrade until they have many times the processing power that
they need.
Multi-user systems will become the standard; the people who have to
pay for them will soon realize that local area networks are simply multiuser
systems spread out all over the room. Terminals will become smarter and take
over more data manipulation and presentation tasks, while personal computers
will become multi-user systems (as soon as the pc suppliers realize that they
have gotten all they can out of artificially constraining users in the single-user
mode).
So, in the best blue tradition, hardware has and will continue to
overpower most applications, and can be expected to provide all the pro-
cessing cycles necessary for at least the next few years. How that power is
used will be the important issue. The focus will be on software, driven by the
user and the investor in tomorrow’s computing market.
User management will soon become the driving force in the computer
market, as it doggedly searches for the most useful and functional computer
systems. Buyers will focus on systems that they can understand, and that do
the job easily and efficiently. Their employees, the actual users, will tell them
with their successes (and failures) which approaches are the most functional in
their businesses.
Close behind them will be the investors, looking for the product that
delivers that functionality. This time, standardization will be a major in-
vestment consideration, as the investors get smarter about what will work and
what will sell. This will limit the garage workshops and the distracting start-up
companies that created so much rich diversity, and diluting confusion, in the
computer industry. As the shake-out reduces the distractions, the investment
capital will, in turn, stabilize the direction of development.
There will be more emphasis on innovation along industry compatible
lines of development, in application software, operating systems, and user
environments. We should soon see the software engineering house as the
darling of the investment market again. But this generation of software
developers will be motivated to sacrifice uniqueness and focus on productivity,
both their own and that of their end users. That means a renewed interest in
28
6
Future of the PICK System
putting all those billions of unused processing cycles to work, making the
computers work harder and allowing the users to concentrate more on the
problem and less on the computer.
This focus on the central issues of the computer’s logical architecture
will bring about sweeping changes in the way computers work. We should see
advances in efficiency, more standardization in interface technology, better
database management techniques, improved user interfaces, new approaches in
system implementation, and layering of system processes on true multitasking
hardware. Before long, we should see the emergence of a host-type operating
system, acting as a silent general manager of the devices and as a servant for
application software and even alternate operating environments.
28
7
Chapter
5
allows for powerful programming languages and device drivers. These would
be welcome additions to the PICK environment. Like two skilled negotiators,
each could bring features that the other lacks.
It is for these reasons that it is spurious to compare the features of the
PICK System to those of UNIX or any other operating system. The differences
are more important. Tomorrow, as the diagram in figure 12-1 illustrates, both
are likely to reside in our computers, with each doing what it does best:
perhaps UNIX handling the devices, while PICK relates to the data and talks
to the users.
In any case, one thing is clear: there is more to come than has occurred since
the beginning. Computers and computer software will change dramatically in the
near future, that much is known for certain. Perhaps one of the best places to stand
during the shock wave is out on the periphery, in one of the places that is already
much like the next era: the PICK world.
28
8
Lists
2
9
1
Appendix A
User Groups
Nearly every major city in the United States and many in other countries (most
notably Australia and England) have local user groups for those with PICK
Systems. These groups often provide an excellent source of information and an
opportunity to locate others in your area with a common interest. The list of
user groups grows each month; hence, it is pointless for us to publish it in this
book. Each issue of Pickworld has an updated list, or you can call Pick Systems
directly for more information.
PICK Licensees
The following section lists Pick licensees and authorized emulations at the
time of this writing. The phone numbers are provided where known, so that
you may call and request information about their product offerings.
29
2
List
s
Profile: ADDS is a wholly owned subsidiary of NCR (National
Cash Register) and was incorporated in 1969. It is one of the
largest suppliers of OEM CRTs. The implementation of PICK
on the ADDS Mentor and a continuous program of innovative
improvements has resulted in what has been considered one of
the better versions. In 1987 ADDS reportedly implemented the
PICK System on the NCR Tower 2000.
29
3
Appendix A
29
4
List
s
Completed: 1983
Processor: MC68020
Profile:
Climax became a PICK licensee soon after its formation in
1983. The Climax company is now partly owned by the Ford
Modeling Agency, where appearances are everything. The
Climax computer is offered with built in routines for
supporting optical disk storage devices.
Licensee:
Datamedia Corporation Pennsauken, New Jersey (609) 665-
5400
System: 932 Series
Completed: 1982
Processor: MC68000 Series
Profile:
Datamedia has become one of the largest distributors of VT
compatible CRTs during its operation over the last decade. It
was the first licensee to offer an MC68000- based PICK
System.
Licensee:
Electronique Serge Dassault
Cedex, France
(1) 46 02 50 00
System: Unknown
Completed: Unknown
Processor: Unknown
Profile:
Obviously, this French company has made little mark in the
U.S. market. Despite being overshadowed by the In-
tertechnique company, Electronique Serge Dassault is
predicted to be a major player in the European market.
Licensee:
Fujitsu of Australia
North Sydney, NSW, Australia (61) (7) 844-3444
System: Formerly WICAT MC68000
Completed: 1983
Processor: Motorola MC68000
Profile:
WICAT was formed in 1983 by Lionel Singer, who had
formerly established the Australian division of Prime
Computer. WICAT was acquired in 1988 by Fujitsu of
Australia.
29
5
Appendix A
29
6
List
s
System: Talisman, Predator
Completed: 1987
Processor: MC68020
Profile:
IBC supplied thousands of its computers to customers before
noticing that its computer hardware was ideal for PICK. The
system was ported to the Talisman in order to differentiate the
company’s products and to take advantage of what is seen as an
emerging industry standard.
Licensee:
Intertechnique (IN2)
Paris, France
(1) 30 55 81 81
System: Multi-6 Series
Completed: 1978
Processor: Discrete 8-bit
Profile:
Intertechnique is a French-based manufacturer of computing
systems. It has been a licensee since 1978 when it entered into
a deal with Pick Systems and a start-up company named
Evolution. Intertechnique markets primarily in France, and has
extended the communication capabilities of its PICK
implementation with extensions to the BASIC programming
language. It has also extended the reach of the PICK System,
with reportedly over 5000 systems sold in Europe, Russia, and
even Tahiti.
29
7
Appendix A
29
8
List
s
Licensee: Scan-Optics, Inc. (formerly Pertec Computer Systems)
Irvine, California (714) 660-0488
System: Pertec 4200 Sabre Series
Completed: 1983
Processor: MC68000 Series
Profile: Pertec was a subsidiary of Triumph Adler AG, which in
turn is a subsidiary of Volkswagen AG. In 1987, Pertec was
acquired by Scan-Optics, a robotics manufacturer. The Pertec
implementation includes a “shell” or fourthgeneration
environment, which includes an application generator. Early in
1988, it announced plans to be the first licensee to implement
and offer Pick’s new Open Architecture Version 2.
Licensee: Sequoia
System: Fault-tolerent multicomputers
Completed: 1986
Processor: MC68020
Profile: This tightly coupled, fault-tolerant computer architecture
forms a platform for a PICK environment running as a guest
on Sequoia’s proprietary version of UNIX. Sequoia has the
distinction of the largest PICK systems in use, including one
that serves nearly 800 users with 10 gigabytes of on-line
relational database.
Licensee: Systems Management, Inc. (SMI)
System: PICK/370 for IBM VM
Completed: 1983
Processor: IBM 4300, 4331, 4361, 3O3x, 9370
Profile: SMI is a Chicago-based company that has the distinction
of being one of the first software houses in the PICK community.
Its application software library is built around its proprietary RPL
29
9
Appendix A
30
0
List
s
revenue per employee in 1986.
30
1
ASCII Codes
The following table lists the ASCII codes and conversions, as used and
interpreted in the PICK System. The first 27 codes are commonly used to
control peripheral devices and special terminal functions. They are shown with
the keyboard entries required to generate the codes on most ASCII terminals.
3
0
3
Appendix B
29 ID 035 00011101 ID GS
30 IE 036 00011110 IE RS
31 IF 037 00011111 IF US
32 20 040 00100000 40 SPACE
33 21 041 00100001 5A I
34 22 042 00100010 7F ii
35 23 043 00100011 7B #
36 24 044 00100100 5B $
37 25 045 00100101 6C <7o
38 26 046 00100110 50 &
39 27 047 00100111 7D
40 28 050 00101000 4D (
41 29 051 00101001 5D )
42 2A 052 00101010 5C *
43 2B 053 00101011 4E +
44 2C 054 00101100 6B I
45 2D 055 00101101 60 —
46 2E 056 00101110 4B .
47 2F 057 00101111 61 /
30
4
ASCII Codes
Decimal Hex Octal Binary EBCDIC ASCII Keyboard
48 30 060 00110000 F0 0
49 31 061 00110001 Fl 1
50 32 062 00110010 F2 2
51 33 063 00110011 F3 3
52 34 064 00110100 F4 4
53 35 065 00110101 F5 5
54 36 066 00110110 F6 6
55 37 067 00110111 F7 7
56 38 070 00111000 F8 8
57 39 071 00111001 F9 9
58 3A 072 00111010 7A
59 3B 073 00111011 5E >
60 3C 074 00111100 4C <
61 3D 075 00111101 7E =
62 3E 076 00111110 6E >
63 3F 077 00111111 6F ?
64 40 100 01000000 7C @
65 41 101 01000001 Cl A
66 42 102 01000010 C2 B
67 43 103 01000011 C3 C
68 44 104 01000100 C4 D
69 45 105 01000101 C5 E
70 46 106 01000110 C6 F
71 47 107 01000111 C7 G
72 48 110 01001000 C8 H
73 49 111 01001001 C9 I
74 4A 112 01001010 DI J
75 4B 113 01001011 D2 K
76 4C 114 01001100 D3 L
77 4D 115 01001101 D4 M
78 4E 116 01001110 D5 N
79 4F 117 01001111 D6 O
80 50 120 01010000 D7 P
81 51 121 01010001 D8 Q
82 52 122 01010010 D9 R
83 53 123 01010011 E2 S
84 54 124 01010100 E3 T
85 55 125 01010101 E4 U
30
5
Appendix B
86 56 126 01010110 E5 V
87 57 127 01010111 E6 W
88 58 130 01011000 E7 X
89 59 131 01011001 E8 Y
90 5A 132 01011010 E9 Z
91 5B 133 01011011 80 [
92 5C 134 01011100 E0 \
93 5D 135 01011101 90 ]
94 5E 136 01011110 5F A
95 5F 137 01011111 6D —
96 60 140 01100000 79 1
97 61 141 01100001 81 a
98 62 142 01100010 82 b
99 63 143 01100011 83 c
100 64 144 01100100 84 d
30
6
ASCII Codes
Decimal Hex Octal Binary EBCDIC ASCII Keyboard
30
7
Appendix B
30
8
ASCII Codes
309
Appendix B
Decimal Hex Octal Binary EBCDIC ASCII Keyboard
31
0
Verb Formats
The Terminal Control Language processor (TCL) looks to the Master Dic-
tionary (MD) for the definitions of the commands entered by the user. These
verb-defining items cause TCL to perform system functions, activate
peripheral devices, or call other PICK processes.
Verbs can be classified into three distinct groups: TCL-I, TCL-II, and
ACCESS verbs.
TCL-I Verbs
All TCL-I (pronounced TCL-one or “tickle-one”) verbs have a common
denominator: they do not affect files. Generally, the syntax for this type of verb
requires only a verb, followed by a <cr>. Some of these verbs, however, do
allow or even require other non-file-related parameters, and nearly all verbs
allow for options enclosed in parentheses at the end of the command line.
One of the TCL-I commands is WHO; it causes TCL to display the port
and the user’s logon ID. There is an item in the user’s MD with the following
format:
WHO
001 P
002 10BB
3
1
1
Appendix C
Note: When you examine a verb that does not have 4 characters in its entry
point, it branches directly to entry point zero of the frame. Another very
important note: Never, ever, create your own verbs without being
absolutely sure that you are instructing the system to branch to a valid ABS
address! Guessing at entry points and ABS frames will inevitably cause
your system to croak.
TCL-II Verbs
TCL-II verbs are a class of commands that require a verb, a filename, and an
item-id or an asterisk (*), which signifies all items in a file. Here are some
examples of TCL-II commands:
31
2
Verb
Formats
data section to access.
>ED STAFF,EXECUTIVES 108<cr>
TCL-II verbs all have a similar format, in that they all have exactly five
attributes, and attribute 2 always contains the number 2. Here is the format of a
TCL-II verb:
EDIT
001 PE
002 2
003 D
004
005 CUPN
001 PE Indicates that this item is a verb. The character that follows the P
is referred to as the SCP; it defines special functions that
the system software will perform during the operation. SCP
characters and their functions are: Q PROC, Z all-purpose,
A output list, C change, D delete, E add, L list processing,
O ignore options (as in CREATE-FILE), G retain quotes on
items with embedded quotes.
002 2 The mode-id (ABS address); frame 2 = TCL2.
003 D Referred to as the mode-id 2, the ABS frame address to which
control will pass for processing.
004 Typically null, this attribute is referred to as the mode-id 3. It is used
only in verbs such as LISTLABEL and REFORMAT.
005 CUPN Alphabetic characters that act as codes to indicate special
functions of the verb. Each character is an operative to the
system, indicating which functions to perform upon
execution: C copy item to process workspace, U update
permitted, P print item-id, N new items allowed.
ACCESS Verbs
A third class of TCL commands are the ACCESS commands. They re-
quire at minimum a verb and a filename, but optionally may be followed
by any ACCESS operative—for example, LIST, SORT, COUNT. This is
the verb structure:
LIST
001 PA 002 35 003 4D
31
3
Appendix C
001 PA Indicates that this item is a verb. The character that follows the
P is referred to as the SCP and defines special functions that
the system software will perform during the operation. SCP
characters and their functions are: Q PROC, Z all-purpose, A
output list, C change, D delete, E add, L list processing, O
ignore options (as in CREATE-FILE), G retain quotes on
items with embedded quotes.
002 35 The mode-id (ABS address). All ACCESS verbs use this mode.
003 4D Referred to as the mode-id 2, the ABS frame address to which
control will pass for processing.
Chapter 5 covers the syntax of ACCESS verbs and provides many examples of
ACCESS sentences.
31
4
Conversion/Correlative
Reference
Although they are one of the most powerful features of the PICK world, the
conversions and correlatives found in attribute-defining items are also one of the
most complex aspects. Briefly, they are specifications concerning what to do with a
data attribute before displaying it to the user.
As specifications, the conversions and correlatives are codes that are stored
in the attribute-defining items and interpreted by the ACCESS process. The
difference between a conversion and a correlative specification is in its location in
the attribute-defining item, which controls when the ACCESS process will apply
the specification to the data items. Conversion codes normally reside in the seventh
attribute of an attribute-defining item and are applied after ACCESS applies the
user’s selection criteria and sort criteria—in other words, immediately before the
data is printed or displayed. This is called the “post-processing phase.”
Correlatives normally reside in the eighth attribute and are applied before
ACCESS performs selection and sorting, which is often dubbed “pre-processing.”
The exception to this rule is the “associative” codes, which are used to align
multivalued attributes properly on ACCESS reports; they reside in the fourth
attribute and are referred to as correlative specifications because they are applied
before selection and sorting.
Format of Attribute-Defining Items
Following is a general format of an attribute-defining item, along with a
description of how each attribute in the item is used:
001 This indicates the type of attribute being defined:
A Attribute-defining item
3
1
5
Appendix D
S Synonym-defining item
X “Protected” attribute used only in implicit reports (see the
chapter on ACCESS for details of “implicit” reports).
002 Called the AMC, or Attribute Mark Count, it defines the attribute of
the item to access. In other words, this tells ACCESS the position
of the data within the attribute.
003 Called the S/NAME, this defines the optional column heading.
004 Called the S/AMC, this defines an association between multiple
parallel values spread over multiple attributes.
005 Not used by ACCESS. Usually left null.
006 Not used by ACCESS. Usually left null.
007 Called the V/CONV or CONVERSION, it is used to define special
conversions that are applied to the data right before the data is
printed or displayed. Multiple conversion codes may be put here
as long as each is separated by a value mark «ctl-J».
008 Called the V/CORR or CORRELATIVE, it is used to define special
correlatives that are applied to the data before it is sorted and/or
selected. Multiple correlative codes may be put here as long as
each is separated by a value mark «ctl-]».
009 Called the V/TYP or TP, it defines the output column justification:
L Left-justify. If data being displayed is wider than the width
specified in attribute 10 of the attribute-defining item, left-
justify causes the data to “break” at the right edge of the
output column, and displays the remaining characters on the
next line of output. Left- justify is used on attributes that
contain any alphabetic characters.
R Right-justify. This is used on all numeric data to assure proper
sorting sequence. If data being displayed is wider than the
width specified in attribute 10 of the attribute defining item,
right-justify causes the data to extend beyond the left edge
of the output column and possibly print or display on top of
data in the column to the left.
T Text-justify. This is like left-justify, but it prevents ACCESS
from breaking a line in the middle of a word; rather, if a
word won’t fit entirely on the current output line, it is moved
to the next line of output. When a word is wider than the
suggested width of the column, it reverts to behaving exactly
as left-justify.
U Unconditional left-justify. The exact opposite of right- justify,
except that data will extend into the column to the right if
too wide.
010 Called the V/MAX, it defines the width of the output column on
ACCESS reports.
31
6
Con version
/Correlative
Conversion and Correlative Codes
Table D-l contains a summary of the different conversion and correlative
specification codes, and where they can or must be used in an attributedefining
item.
A Algebraic expressions X X
C Concatenation X X
C Controlling multivalue X
D Dependent multivalue X
D Date conversion X X
F Function X X
G Group extract X X
L Length X X
MC Mask character X X
MD Mask decimal (same as MR) X X
ML Mask decimal, left-justified X X
MR Mask decimal, right-justified X X
MT Mask time X X
MX Mask hexadecimal X X
T Text extraction (sub-string) X X
T File translation X X
The A Correlative The A specification is used to define algebraic functions for performing arithmetic
and relational operations. A relatively recent enhancement to the conversion
and correlative specification codes, the algebraic specification is by far the
most powerful, capable of combining nearly all other conversion and
correlative codes into a kind of program.
The general form is:
A {decimal positions} {;} expression
The A specifications always begin with an uppercase A followed by a semi-
colon (;). The decimal-positions parameter is optionally used to indicate the
number of decimal digits (in the range 0 to 4) to retain during calculations
involving a mixture of whole numbers and numbers with implied decimals,
along with MR conversions in the body of the function. The A specifications
31
7
Appendix D
Available Operands
008 A1*2
008 AN(QOH)*N(UNIT.PRICE)
This causes ACCESS to locate the two attribute-defining items called QOH
and UNIT.PRICE. Then it uses attribute 2 of each of these items to determine
where the data is located. After retrieving the data, it then multiplies and displays
the result.
AN(DOB)(DWA):N(DOB)(DMA)::N(DOB)(DD):, ”:N(DOB)(DY)
31
8
Con version
/Correlative
TUESDAY, JUNE 26, 1992
Note: This secondary conversion form may also be used with a “direct”
reference to an attribute. For example, the following A specification would
produce the same output as the previous example:
D This specification retrieves the system date in its internal storage format
(the number of days since December 31, 1967). For example:
008 A;(D-8)/”365”
ND This operand provides the number of detail lines that have occurred
since the last control break. It is useful in instances such as calculating an
average. A processing restriction is imposed, however, in that this only works in
the conversion line, attribute 7 of an attributedefining item.
T Like the D (system date) operand, the T operand retrieves the current
system time, in internal storage format. In its internal form, time is stored as
the number of seconds past midnight.
A(9*"15")/"IO"
008 A6["1"r"3"J
32
0
Con version
/Correlative
The C Correlative The C specification is the Concatenate specification; it concatenates, or joins
together, any combination of elements.
The general form is:
Celement{;element . . . }
Allowable elements include:
■ Numeric constants, enclosed in quotes
■ An attribute number referenced by its numeric attribute mark count
■ Alphanumeric character strings. When delimited by semicolons, strings
must be enclosed in quotes. Otherwise, alphanumeric strings are not
separated from the other entries by semicolons.
The following example illustrates this:
32
1
Appendix D
Sample Data:
001 Irvine
002 CA 003 92714
Sample C Correlative:
Sample Output:
Irvine. CA 92714
The C Associative Controlling associative correlatives identify the controlling value of multi-
valued attribute sets. Each attribute-defining item identified in the “attr- num”
parameter(s) must contain the dependent (D) code and attribute number of the
controlling attribute. The general form is:
C;attrnum{;attrnum . . . }
The D Associative Dependent associative correlatives define the dependent portions of multi-
valued attribute sets. The attribute number specified in the “attrnum” parameter
must contain the controlling (C) code and attribute number of the controlling
attribute. The general form is:
D;attrnum
The D Conversion Date conversion specification converts value from internal to a wide range of
external date formats. The internal storage form is the number of days past
12/31/67, which is considered day zero (0) in the PICK world. The general
form is:
D{year digits} {skipdelimiter #skips} {separation character}
The “year digits” parameter specifies the length of the year display. It
must be a whole number between 0 and 4. The default length is the 4digit year
format.
The parameters specified in “skipdelimiter” and “#skips” are func-
tionally equivalent to the G (group extract) specification. They define the
position of the date value in a multivalued attribute.
If included, the “separation character” parameter specifies the character
that delimits the month, day, and year values. The output order is 2digit month,
2-digit day, and the year. The number of year digits depends on the “year
digits” parameter.
If the “separation character” parameter is omitted, the format is 2digit
day, 3-digit month abbreviation, and year. Again, the number of year
digits depends on the “year digits” parameter. Examples of date conversions are
32
2
Con version
/Correlative
shown in table D-2.
The F Correlative The F correlative is the Function specification for performing arithmetic and
relational operations on data. It is a stack-oriented function, requiring the
statement syntax to adhere to a Postfix Polish Notation format.
The general form is:
F{n};element{;element . . . }
Here is an example of Postfix Polish Notation, where values are pushed
down onto a stack of values. The values are “popped” off the stack and used every
time that an operand is encountered.
F;3;4;*
This example instructs ACCESS to put the value of attribute 3 onto the
stack, then push the value of attribute 4 onto the stack. STACK1 is said to contain
the value of attribute 4, while STACK2 contains the value of attribute 3. A
multiplication operand causes the STACK 1 value and the STACK2 value to be
“popped” off the stack and multiplied together; the resulting value is stored in
STACK 1 and will be displayed by ACCESS as the value of the attribute being
defined.
The F specification push-down stack has seven possible entries. All
operands push a specific value on the top of the stack (STACK1). A push
repositions all stack entries one position down. The entry in STACK? is lost when
an eighth operand is pushed onto the stack.
Note: For the most part, the F specification has been made obsolete by the
more flexible A Algebraic specification.
The G Correlative The Group extract correlative extracts data values from a string containing user-
specified (nonreserved) delimiters. The general form is:
G{skipsegments} delimiter getsegments
“Skipsegments” is the number of group segments to skip over. It must
be numeric and if it is omitted, zero is used. The “delimiter” is any
nonreserved character that separates part of the stored data. Reserved
characters are attribute, value, subvalue, and segment marks. “Getsegments” is
the number of groups to retrieve. It must be numeric, for example:
CA*92714*1000
Using the above sample data, examine the effects of the following
Group extract correlatives:
Correlative Result
G*1 CA
G0*l CA
Gl*l 92714
G2*l 1000
Gl*2 92714*1000
The L Conversion The Length specification specifies output length restrictions on data val ues. The
general form is:
Lminlength, maxlength
or
Lmaxlength
or
LO
The “maxlength” parameter indicates that the value will be output only if
the length of the string is less than the “maxlength” parameter; otherwise a null
is returned.
The L code, followed by a 0 (zero), displays the length of the data value
32
4
Con version
/Correlative
instead of the data itself. For example:
The M Conversion This specification is sometimes referred to as the Mask Decimal function. It is
designed to format numeric data for display or printing. Its purpose is to perform
output conversions, literal insertions, and currency formatting. The general form
is:
where:
32
6
Con version
/Correlative
MCU Converts all lowercase characters to uppercase and leaves
uppercase characters intact.
MCXD Converts hexadecimal data value to decimal equivalent.
The MT Conversion The MT specification is for “Masking Time.” It converts time data values from
their internal format to any of several formats of external output. The internal
storage format of time is the number of seconds past midnight. The general
form is:
MT or MTH or MTS or MTHS
where:
MT 46800 13:00
MTH 46800 01:00PM
MTS 46800 13:00:00
MTHS 46800 01:00:00PM
32
7
Appendix D
The MX Conversion The MX specification stands for the Mask Hexadecimal function. It converts
any decimal or ASCII character string to its hexadecimal equivalent. For
example:
MX 12345 1232333435
MX CHIP 43484950
The T Conversion This is the Text extraction, or substring, conversion. It retrieves any number of
characters from an attribute, starting at the position specified in “startcolumn,”
for the number of characters specified in “length ” Both parameters must be
numeric.
The general form is:
T{startcolumn,}length or Tstartcolumn
If the “length” parameter is not specified, the extraction begins from the
same end of the string as the justification attribute (9): either L (left) or R
(right). For example:
The T Correlative
This is the Translation specification. It allows an attribute value to be translated
through another file. The attribute referenced in line 2 of the attribute-defining
item will be used as an item-id in the specified filename, and one of the
attributes from the new item will replace the value in the original item.
The general form is: *
T{DICT }filename;code{vmc};inamc;outamc{;breakamc}
To retrieve a specific value within the attribute, the optional value mark
count may be specified in the “vmc” parameter.
The translate “code” determines the action to take with translate values,
when the data being translated does not exist on the translate file.
C Displays the original value if the value being translated does not exist
in the translate file.
32
8
Con version
/Correlative
V Displays an error message at the end of the report for each item
unsuccessfully translated.
X Displays a null if the value being translated does not exist on the
translate file.
The “inamc” parameter specifies the attribute mark count to use for
conversions on input. ACCESS does not use this operand.
The “outamc” parameter specifies the attribute mark count of the
attribute in the translate file that contains the value for output.
The attribute mark count referenced in the “breakamc” specifies a
different attribute to be used on the BREAK-ON and TOTAL lines, rather than
the outamc. Some examples are:
TSTATES;C;;1 CA California
TSTATES;X;;1 CX (no output)
This has been a brief excursion into the unique properties of the PICK
conversion and correlative specifications. PICK users learn more ways to use
these powerful features every day. The longer one stays, the more one learns
here.
32
9
Dictionary Listings from
Tutorials
001: A A A A
002: 1 2 3 4
009: L T L L
010: 15 20 15 5
3
3
1
Appendix D
33
2
Dictionary Listings
009: R R R
010: 8 11 8
33
3
Glossary
<cr> The standard abbreviation for “carriage re- Also, in the account’s MD are verbs, miscella-
turn.” On some keyboards, this key is called neous connectives and modifiers, and PROCs.
Enter or Newline or Linefeed. This is the key that Attribute An attribute is usually an object or a col-
you typically press to let the system know that lection of logically related objects within an item,
your command or input is to be considered fin- such as an address or list of addresses.
ished and ready for processing. Attribute mark The reserved character from the
ABS frames A frame that contains the executable ASCII character set used to indicate the end of
object code of the PICK Operating System. The one attribute and the beginning of another. Nor-
name is derived from “ ABSolute location,” since mally, these characters are “transparent,” mean-
everything within the frame is addressable by an ing that, for the most part, you will never see
absolute location, derived by taking the frame them. If, however, you go looking for them,
number (fid) and displacement (offset) into the here’s what you will find:
frame.
In conventional display form, it looks like an
ACCESS (RECALL, ENGLISH,
“up-arrow” (A).
INFO/ACCESS, etc.) The data retrieval
language used to produce reports with English- In hexadecimal, its representation is FE, but it is
like sentences. output as 5E.
In decimal, its representation is 254.
Accounts Accounts are collections of logically re-
lated files, much like departments within a com- To produce an attribute mark from the keyboard
pany. Each department has its own set of file requires a <ctl-A>. This reads: “control up-
cabinets. The name of the account is also the arrow.” Sometimes the up arrow key is located as
“logon,” that is, it is entered at the LOGON an uppercase character (usually when the A
PLEASE: message to gain access to the system. symbol appears above the 6 key on the numeric
keys above the alphabetic keys). In this case, it
3
3
5
Exploring the PICK
in one file cabinet, you may find file folders cally” reside elsewhere (for example, in another
containing information about your customers, account), but may also be used to refer to files
while in another cabinet may be the folders for within any account.
your suppliers. In the PICK System, the number Segment mark The reserved character from the
of items that can be put into a file is limited to ASCII character set used to indicate the end of an
the capacity of the disk. item or group. Normally, these characters are
Frame The basic division of the hard disk. The en- “transparent,” meaning that, for the most part,
tire disk is divided into individual “pages” or you will never see them. If, however, you go
“frames” of a predetermined length. In the classic looking for them, here’s what you will find:
PICK System, frames were 512 bytes, with the
first 12 bytes of each frame being “reserved” for In conventional display format, it looks like an
the “linkage” fields. Frame size now varies on “underline” (_).
PICK implementations. In hexadecimal, its representation is FE
Frame-id See Fid. In decimal, its representation is 255.
GFE Abbreviation for Group Format Error. The
To produce a segment mark from the keyboard
absolute nemesis of all PICK machines. The
requires a <ctl-_ >. This reads “control under-
presence of one or more GFE’s indicates that the
line.” Sometimes the “underline” key is located
data structure has become corrupted for one of
as an uppercase character (for example, when the
about twenty possible reasons, and that data loss
_ symbol appears above the — key on the
may be imminent.
numeric keys above the alphabetic keys). In this
Hashing The method by which items are placed into case, it takes a <ctl-shift-_ > to produce the
and retrieved from a file. Each item-id is put segment mark.
through a “hashing algorithm” that mathemati-
cally determines in which file group an item will Separation The number that goes hand in hand with
be looked for, or placed. An alternate to the in- modulo to indicate the number of frames in each
dustry-standard ISAM (Incredibly Slow Access group. By default on all PICK Systems, this is 1.
Method). Some schools of thought contend that it should
Item A collection of logically related attributes. be greater than 1 in some circumstances, but this
again is like discussing religion or politics. Pick
Item-id The unique item identifier or “key” of an
Systems, the company, has been trying to remove
item in a file.
separation altogether for quite a while. On many
Modulo The number of groups in a file. implementations, if you change the separation to
PROC The procedural language. something other than 1 with the intent of resizing
Q-pointer A “fake” file pointer, placed in the the file, the system thinks you were just kidding
Master Dictionary (MD), typically with the Edi- and changes it back to 1 for you.
tor. Q-pointers allow access to files that “physi- Sub-value An individual element of a value. Most
33
7
Exploring the PICK
schools of thought prefer to pretend that these Indicated with the > prompt character.
don’t even exist, since that’s how the ACCESS Value An individual element of an attribute. An
retrieval language reacts to them. attribute that contains more than one value is
Sub-value mark The reserved character from the typically referred to as a “multi-valued” attribute.
ASCII character set used to indicate the end of Value mark The reserved character from the ASCII
one sub-value and the beginning of another. Nor- character set used to indicate the end of one
mally, these characters are “transparent,” mean- attribute and the beginning of another. Normally,
ing that, for the most part, you will never see these characters are “transparent,” meaning that,
them. If, however, you go looking for them, for the most part, you will never see them. If,
here’s what you will find: however, you go looking for them, here’s what
you will find:
In its ASCII appearance, it looks like a “back-
slash” (\). In its ASCII appearance, it looks like a right
bracket (]).
In hexadecimal, its representation is FC.
In hexadecimal, its representation is FD.
In decimal, its representation is 252.
To produce one from the keyboard requires a In decimal, its representation is 253.
<ctl-\>. This reads “control backslash.” Some- To produce one from the keyboard requires a <ctl-]
times the “backslash” key is located as an up- >. This reads “control right bracket.” Sometimes the
percase character. In this case, it takes a <ctl- “right bracket” key is located as an uppercase
shift-\> to produce the sub-value mark. character. In this case, it takes a <ctl-shift-] > to
produce the value mark.
SYSPROG By far, the most powerful and danger-
ous account on any PICK System. This is the ac-
count from which most maintenance takes place,
such as the creation and deletion of accounts,
backups and occasionally restores, and dealing
with the spooler. The SYSPROG account is the
only account that contains the full complement of
verbs; thus it should be restricted to use by only
those with a full appreciation of the unlimited
damage it can wreak upon the rest of the system.
SYSTEM The “top” level of the PICK file hierar-
chy. This file contains “pointers” to all accounts
and system level files.
TCL Abbreviation for Terminal Control Language.
The point from which all operations begin.
33
8
Index
3
3
9
Exploring the PICK Operating System
J
Justification, 19, 22
3
4
1
K
Exploring the PICK Operating SystemMonitor, 13, 243 data dictionary, 5, 270
MSG Command, 47 design considerations, 267
KEYBOARDS file, 40
MT conversion, 327 emulations, 280
MULD command, 38 environment, 233
L Multi-6 series, 296 evolution, 6
Multitasking, 4, 5 file categories, 18
L conversion, 324 MX conversion, 328 file resizing, 23
Left-justify, 22, 316 internal architecture 5, 17
unconditional, 23 integrated processes, 12
N
LEN function, 203 “item,” 14
Licensees, 292-301 Natural languages, 5 licensees, 292
Line (attribute numbers), 66 NB operand, 319 -like processing, 5
Line positioning commands, 83 N command, 85 “Marks Brothers,” 25
Linkage fields, 236, 238 ND operand, 319 natural languages, 5
Linked frames/overflow, 235 NEWAC file, 55 nucleus (ABS), 11
LIST, 12, 39, 45, 72 Newspaper list, 291 operating environment, 10
List-class file, 20 Next PICK world, 288 “roadmap,” 17
LISTCONN, 45 932 series, 294 /SAVE source code, 20
LISTFILES, 39, 42 NI operand, 320 special characters table, 26
LIST-ITEM, 125 Nixdorf VM, 297 spooler, 217
LIST-LABEL, 125 Nopage (N), 42 system, 3, 5, 21, 261
List-processing commands, 127 (N) option, 142 370 for IBM VM, 299
LISTU command example, 44 “No trespassing” signs, 21 virtual memory, 5
LISTVERBS, 43 NS operand, 320 “world,” 11
Literal constant, 181 Nuclear functions, 187 PICK/BASIC, 177-205, 252
Local files, 39 Numeric constants, 181, 320 example, 193
Local PROC subroutines, 171 Numeric item-ids, 111 source code, 65
Lock-retrieval code, 21 NV operand, 320 terminology, 81
Lock update code, 21 tutorial, 189
Logging off, 36, 46 O POINTER-FILE, 128
Logical, Pointer items, 19
attributes, 30 Object code, 189
O command, 173 Pointer system, 17
computer, 229 (P) option, 142
operators, 321 OFF command, 37
One-way transfer of control, 151 Port (channel) number, 45, 47
view, 233 POVF, 48
Logon, 18, 45 On-the-fly indexing, 3-4
Open architecture, 32, 282 Prestored editor commands, 93
Logon PROC 32, 170 Primary,
LOGTO, 59, 170 Operands, 318
Operating environment, 10 control block, 45
LPTR, 43 input buffer, 147
Operators, 185
Optional column heads, 28 output buffer, 147, 158
M OR connectives, 118 “Primitives,” 271
Output column justification, 29 Printer width and depth, 209
Magazines list, 291 Printing expressions, 200
Output masks, 104
Magnetic media commands, 211 PRINT statement, 197
Overflow table, 48, 234
Map of virtual workspace, 241 Privilege level, 21, 56
Overwrite option, 53
Mask decimal function, 325 PROC, 12, 145-175, 252
Master dictionary (MD), 13, 18, 19, 21, BOTH-REPORTS, 152
23, 55 P
buffers, 147
Mathematical operators, 321 Parallel processor boards, 296 commands, 170, 171
MC conversion, 326 Password, 21,32, 33,57, 58 linkages, 150, 151
M conversion, 325 Patchwork application, 266 rules and conventions, 46
ME (merge) command, 90 Pattern matching, 167
Memory mapping techniques, 27 PCB area, 242
MENU PROC, 152, 156 Peripherals, 207
MESSAGE command, 46 Index
Microdata, REALITY, SEQUEL,
Series 18, Spirit, 297
Permanent symbol table, 41
Mighty Carnac, 159
Per tec 4200 Sabre series, 298
Mnemonic commands, 66
PICK,
Mnemonic forms of logical operator,
and UNIX, 287
117
assembly language code, 13
Modifiers, 45, 55
chronological history, 6-10
Modulo, 19, 21, 27, 59
database, 27
and separation, 56, 234
34
2
PROC—cont SORT-ITEM, 125 control level (TCL), 11, 12
tutorial, 153 SORT-LABEL, 125 type, 210
X command, 155 SP-ASSIGN, 223 Terminating a process, 36
PROCLIB file, 42 Special characters table, 26 Text justify, 22
Producing squares, 202 SP-EDIT, 226 Throwaway connectives, 114
Process design, 274 SPOOLER, 12 TIME command, 38
Prompt characters, 33, 34 control commands, 218 TOP (T) command, 84
Prototyping, 276 entries, 217 T operand, 320
Pseudo code, 197 status (SP-STATUS), 223 TOTAL modifier, 142
PSYM file, 41 SQRT function, 202 Transaction analysis, 275
STAFF file items, 70 T-READ, 215
Q STAFF-REPORT, 151 T-REW command, 133
Standardization, 5 Trigger PROC, 150
Q pointer(s), 23-24, 42, 170 Standard PICK files, 40 Tutorial files, 60
Q-SELECT, 52 Standards and conventions, 181 Two-way transfer of control, 151
Quotes, 25, 121 STARTPTR, 218 Type-ahead buffers, 35
START-SPOOLER, 218
R Statement labels, 146 U
RAM, 3, 19 Statements, 181
Ultimate, 300
REALITY series, 297 STAT-FILE, 41
Unconditional left justify, 23
Reallocation parameters, 20, 23 STAT verb, 143
UNIX, 287
Reassemble, 274 STON (secondary output buffer), 161
Update code, 19, 56
RECALL, 29 STOP statement, 200
User groups, 291
RECOVER-FD, 81 Storing a keystroke, 12
User processes (TCL), 31
REFORMAT command, 272 Storing TCL and ACCESS, 145
User’s view analysis, 273
Relational databases, 3 String, operators, 185 prompt, 227
Release R83, 40 searching and item ids, 120, 122
V
Remote file pointers, 39 variables, 182
Removing existing password, 58 SUED command, 38 Values, 13
Replace (R) command, 71, 85 Substring function, 320 Value string, 117
Replacement, 183 Subvalues, 13 Variables, 182, 188
Resizing file, 23 Summit, 297 VERIFY SYSTEM, 37
Restore processes, 23 SUM verb, 143 Virtual frame, 239
Resuming a process, 36 Suspending online program Virtual memory, 5, 230
Retrieval, 12, 13, 19, 29, 56 execution, 35 Virtual workspace, 233
Rewinding media, 213 Symbolic forms of logical operator, V-Mark Uni-verse, 280
Right justify, 22, 316 117
RPL, 252 SYSPROG, 32, 41, 58 W
RUN, 191 SYSTEM file, 13, 18, 21, 23, 42
System privilege, 1, 2, 21, 22 WHO command, 38, 48, 59
Running batch tasks, 6 WICAT MC6800, 294
System 2000, 295
WITH and IF modifiers, 142
S
T X
SALARY attribute, 139
SAVE-LIST, 20, 130 Talisman, Predator, 296 X command, 88, 164
Saving items, 76 Tandem, 300 X-type attribute-defining item, 113
Scattered frames, 23 TAU M-6800, 299
Secondary input buffer, 147, 148 TCL, 31-64 commands, 37 control Z
Secondary output buffer, 147, 149, 159 characters, 34
Secret routes, 23-24 TCL-I, commands tutorial, 38-50 Zebra, 295
SELECT, 52, 128 verbs, 37
Selection criteria, 103, 116 TCL-II, and files, 38
Separation, 19, 21, 59, 235 TCL-II—cont
SEQUEL series, 297 verbs, 312
SET-TERM, 207 tutorial, 50-64
Shared file pointer, 55 T-DUMP, 132
Simple serial interfaces, 5 TEMP-FILE, 61, 62
Single quotes, 122 TERM, 207
S (input buffer) command, 155 Terminal,
SNAKE, 64 control commands, 207
SORT, 12 control language (TCL), 31
3
4
3
ww111
HAYDEN BOOKS
Exploring the
PICK
Operating System
Second Edition
For years, the PICK Operating System was ahead of its time. A relational database
system that allowed multiusers in as little as 64K, it turned users into disciples. Now, as
more and more businesses need multiuser systems, the PICK System has come into its
own. For the many new PICK users and for "old friends" as well, this classic PICK title has
been revised and updated to include the latest PICK implementations. This illustrated,
easy-to-read yet technically detailed tour of the PICK Operating System offers:
• A complete introduction to PICK, its history, terminology, and integrated relational
database system.
• An expanded tutorial that demonstrates in clear examples the various system features,
including TCL, the Editor, ACCESS, PROC, and PICK/BASIC.
• A detailed examination of the newest PICK implementations including Open
Architecture and the use of PICK with UNIX®.
• State-of-the-art analysis and design techniques for programming with PICK.
• An extensive reference section that provides ASCII codes, verb formats,
conversion/correlative codes, and more.
For novice users or experienced programmers, this book is the definitive guide to the next
generation of relational database systems based on the PICK model.
Steve VanArsdale is a currently engaged in research
Chicago-based consultant who on the synergies of PICK with
brings a distinctive business- UNIX.
oriented perspective Jonathan E. Sisk is president of
. ‘ , to the PICK community. He JES & Associates, Inc., the
¡'y»—*, has written, lectured, largest independent PICK
and training company. Head-
consulted on computer- related quartered in California, his firm
subjects for 15 years, specializing in has trained over 10,000 people
the PICK worldwide on the PICK System. He has authored
System since its introduction in 1974. He is a PICK/BASIC programming guide and pocket
guides to PICK, REALITY, and ULTIMATE. '
$24.95 US/48412
ISBN