Nothing Special   »   [go: up one dir, main page]

Exploring The PICK Operating Sys

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 356

HAYDEN BOOKS 48412

Exploring the
PICK
Operating System
Jonathan E. Sisk
Steve VanArsdale
Exploring the PICK
Operating System
HOWARD W SAMS ^COMPANY
HAYDEN BOOKS

Related Titles

Advanced MS-DOS®: Expert WordPerfect Version 5.0: Expert


Techniques for Power Users Techniques for Power Users
and Programmers Kate Barnes
(forthcoming)
Carl Townsend Best Book of: WordStar (Release
5)
The Waite Group’s MS-DOS® Vincent Alfieri
Bible, Second Edition
Steven Simrin
Best Book of: OS/2 Database
Manager (forthcoming)
Best Book of: Lotus® 1-2-3®, Howard Fosdick
Second Edition
Alan Simpson Topics in C Programming
Stephen G. Kochan and Patrick H. Wood
Lotus® 1-2-3® Financial
Models UNIX® Shell Programming
Etna Tymes and Tony Dowden with Charles Stephen G. Kochan and Patrick H. Wood
E. Proel
UNIX® System Security
Best Book of: dBASE IV Patrick H. Wood and Stephen G. Kochan
(forthcoming)
Joseph-David Carrabis UNIX® Text Processing
Dale Dougherty and Tim O’Reilly
Best Book of: Microsoft®
Works for the PC Exploring the UNIX® System,
Ruth Witkin Second Edition
Stephen G. Kochan and Patrick H. Wood
Best Book of: Quattro™
Joseph-David Carrabis UNIX® System Administration
David Fiedler and Bruce H. Hunter
Best Book of: WordPerfect®,
Version 5.0
Vincent Alfieri

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

Jonathan E. Sisk and Steve VanArsdale

HAYDEN BOOKS
A Division of Howard W. Sams & Company 4300 West 62nd Street
Indianapolis, Indiana 46268 USA

©1989 by Jonathan E. Sisk and Steve VanArsdale


SECOND EDITION
FIRST PRINTING—1988

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.

International Standard Book Number: 0-672-48412-9


Library of Congress Catalog Card Number: 88-63208

Acquisitions Editor: James S. Hill


Development Editor: Jennifer L. Ackley
Manuscript Editor: Marie Butler-Knight
Illustrator: T.R. Emrick
Indexer: Tony Melendez
Compositor: Shepard Poorman Communications, Inc.

Printed in the United States of America

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

1 An Introduction to the PICK System 1


2 Getting Around in the PICK World 17
3 The User Processes: TCL 31
4 The Editor: The Window into the Processes 65
5 ACCESS: The Data Retrieval Process 99
6 PROC: The Stored Procedure Language 145
7 PICK/BASIC: The Programming Language 177
8 Controlling Peripherals 207
9 The Logical Computer 229
10 Putting the Parts Together: Applications 247
11 Analysis and Design for PICK-Based Systems 265
12 The Future of the PICK System 279
A Lists 291
B ASCII Codes 303
C Verb Formats 311
D Conversion/Correlative Reference 315
E Dictionary Listings from Tutorials 331
Contents

Preface xix

1 An Introduction to the PICK System 1


The PICK Milestone 2
The PICK Legacy 2
PICK and the Users 3
The PICK Data Structure 3
Don’t Bother to Stand Back 4
The Evolving Standards 5
The Evolution of the PICK System 9
The PICK Operating Environment 10
Processes within Processes 11
The View from the Surface 13

2 Getting Around in the PICK World 17


The PICK Files 17
The Pointer System: The PICK Roadmap 17

vii
Exploring the PICK Operating System

Things That Go Bump in the MD 19


The Secret Routes: Q-Pointers 23
Item-Ids and Accessing 24
Item Storage: “Look Ma, No Keys” 26
Item Accessing: “Just the Id, Ma’am” 27
Attributes and Attribute-Defining Items 27
What They Are 27
Dynamic Indexing 29

3 The User Processes: TCL 31


How to Enter and Exit the System 32
Account Names 32
Prompt Characters 33
Correcting Entry Errors 33
Special Control Characters 34
Cursor Control (“Arrow” Keys) 35
Type-Ahead Buffers 35
Suspending Online Program Execution 35
Terminating a Process 36
Logging Off Through the Debugger 36
Resuming a Process 36
The OFF Command 37
TCL Commands 37
TCL-I Verbs 37
TCL-II Verbs and Files 38
TCL-I Commands Tutorial 38
The Calculator Function Commands 38
The LIST Commands 39
The LOGON Command 45
The LOGOFF Command 46
The MESSAGE Command 46
The POVF (Display Available Overflow) Command 48
The WHO Command 48
The BLOCK-PRINT Command 49
TCL-II Verbs Tutorial 50
The Verb 50
The Filename 50
The Itemlist 51

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

4 The Editor: The Window


into the Processes 65
Theory of Operation 65 Mnemonic Commands 66 The Editor Line Pointer
Concept 66 Line (Attribute) Numbers 66
Editor Command Glossary 66
Activating the Editor: The ED and EDIT Commands 67
Editing Multiple Items 68
Editing All the Items in a File 68
The Editor File Buffers 68
Entering the Staff File Items 70
Creating Your First Data Item 70
The I (Insert) Command 71
The L (List) Command 72
Creating the Other Staff File Items 73
Saving Items and Related Commands 76
The FI (File Item) Command 76
The FIO (File Item and Overwrite) Command 77
Filing an Item into a Different Filename 77
The FIK (File Item and Kill) Command 78
The FS (File “Save” Item) Command 78
The EX (Exit Item) Command 79
The EXK (Exit and Kill) Command 79
The FD (Delete Item) Command 80

ix
Exploring the PICK Operating System

Recovering a Deleted Item 81


Miscellaneous Editor Commands 82
The ? (Display Info) Command 82
The S? (Display Size) Command 82
The S (Suppress) Command 82
Line Positioning Commands 83
The G (Go To) Command 83
The T (Top) Command 84
The B (Bottom) Command 84
The <cr> (Display Next Line) Command 84
The U (Up) Command 85
The N (Next) Command 85
Editor Commands Used to Alter Items 85
The R (Replace) Command 85
The X (Cancel Last Change) Command 88
The DE (Delete Line) Command 89
The ME (Merge) Command 90
The Prestored Editor Commands 93
The PD (Prestored Display) Command 94
Defining Prestored Commands 94
Activating Prestored Commands 95
Complex Prestored Commands 95
Recursive Prestored Commands 95
Final Warnings About Prestored Commands 97
Summary 98

5 ACCESS: The Data Retrieval Process 99


Access Verbs 99
ACCESS Verb Categories 100
Good News About ACCESS 101
ACCESS Sentences 101
Adding an Output Field 102
Adding Sequencing Criteria 102
Adding Selection Criteria 103
Attribute-Defining Items 104
Format of Attribute-Defining Items 105
Sample Data Items 105
Sample Dictionary Items 107 x
Content
s
Adding the Dictionary Items 108
Implicit Attribute-Defining Items 111
Throwaway Connectives 114
Selection Criteria 116
Shortcuts in Selection Criteria 119
String Searching 120
Rules on the Use of Quotes 121
String Searching and Item-ids 122
ACCESS Verbs and Examples 124
The COUNT Verb 124
The LIST Verb 124
LIST-ITEM and SORT-ITEM 125
LIST-LABEL and SORT-LABEL 125
List-Processing Commands 127
The POINTER-FILE 128
SELECT and SSELECT 128
The SAVE-LIST Command 130
The GET-LIST Command 130
The EDIT-LIST Command 131
The COPY-LIST Command 131
The DELETE-LIST Command 132
ACCESS Tape Handling Commands 132
Generating a T-DUMP Tape or Disk 133
Producing Reports from Media: The TAPE Modifier 133
Loading Data from T-DUMP Media 134
ACCESS Modifiers and Options 135
The BREAK-ON Modifier 136
The BY Modifier 137
The BY-DSND Modifier 137
The COL-HDR-SUPP Modifier or (C) Option 138
The DET-SUPP Modifier or (D) Option 139
FOOTING and HEADING Modifiers 139
The HDR-SUPP Modifier or (H) Option 141
The ID-SUPP Modifier or (I) Option 142
The WITH and IF Modifiers 142
The LPTR Modifier or (P) Option 142
The NOPAGE Modifier or (N) Option 142
The TOTAL Modifier 142
Miscellaneous ACCESS Verbs 143

xi
Exploring the PICK Operating System

The STAT Verb 143


The SUM Verb 143 ISTAT and HASH-TEST 143 REFORMAT and
SREFORMAT 143 :SWD, :SWE, :SWX, and :SWZ 144 The
LISTDICT Command 144

6 PROC: The Stored


Procedure Language 145
PROC Features 145 PROC Rules and Conventions 146 Identifying a PROC
146 Statement Labels 146 Command Line Limitation 147 The PROC Buffers
147
Writing Your First PROC 149
PROC Linkages 150
One-Way Transfer of Control 757
Two-Way Transfer of Control 757
The MENU PROC 752
The Tutorial—First Steps 153
Comment Lines 153
Clearing the Input Buffer (the RI Command) 153
Formatting the CRT (the T Command) 154
Positioning the Input Buffer Pointer (the S Command) 755
Testing the Response With IF 755
Branching with the GO Command 757
Example 1: Using the Primary Output Buffer 158
Placing Text Into the Primary Output Buffer 158
Processing the Output Buffer (the P Command) 158
Terminating the PROC (the X Command) 159
Example 2: Using the Secondary Output Buffer 159
The Secondary Output Buffer and the Mighty Carnac 159
Activating the Secondary Output Buffer (STON) 161
Example 3: Inputting and Displaying Data 162
Alternate Arguments (the T Command) 762 More on the IP (Input)
Command 163
Displaying PIB Locations (the D Command) 765 xii
Content
s
Example 4: The “IF” Statement and Branching 166
About Branching 166
Pattern Matching in the IF Statement 167
Example 5: Interactive Mode 168
Logon PROCs 170
Other PROC Commands 171
Local PROC Subroutines 171
Testing for Error Message Numbers 172
Moving Literal Text into the Input Buffer 172
Alternate Method of Terminal Output 173
Extensions to the P Command 173
Summary and Controversy 174
Trade-Offs for PROC-less Systems 175

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

PICK/BASIC Program Example 193


Explanation of Instructions 195
Program Names and Comment Sections 195
Line 1: The Program Name 196
Line 2: The Description 196
Line 3: The Date Last Modified 196
Line 4: The Authors Initials 196
Line 5: A “Spacer Remark Line” 196
The PROMPT Statement 196
The PRINT Statement and Blank Lines 197
Annotating Programs 197
The Principal of Pseudo-Code 197
More on the PRINT Statement 197
The INPUT Statement 198
The IF Statement and Null Strings 198
Boolean Operators 199
Bailout Mechanisms: “Escape Pods” 199
The STOP Statement 200
Printing Expressions 200
Avoiding Redundancy 201
The NUM Function 201
The ABS Function 201
Producing Squares 202
The SQRT Function 202
Terminating an IF Statement 202
The ALPHA Function 202
The LEN Function 203
The PRINT Statement on Line 46 203
Terminating the Program 203
More on the IF . . . THEN Statement 203
Concluding the PICK/BASIC Chapter 205

8 Controlling Peripherals 207


The Terminal Control Commands: TERM and SET-TERM 207
Examining Terminal Characteristics 209
Changing Printer Width and Depth 209
Changing Terminal Type 210
Magnetic Media Commands 211

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

9 The Logical Computer 229


The User’s View 229
The Physical View 230
Virtual Memory: More Room on the Inside Than on the Outside 230
The Logical View: Inside the Looking Glass 233
The Logical View of Data Files (Groups of Frames) 234
File “Shape”: Modulo and Separation 234
The Fundamental Building Blocks: Frame and Item Structure 236
Prepare for a DUMP Job 237
Closeup of a Virtual Frame 239

’SP-STARTLPTR on Ultimate Systems


2
LISTQ on Ultimate Systems
3
SP-LISTLPTR on Ultimate Systems
4
SP-LISTASSIGN on Ultimate Systems

xv
Exploring the PICK Operating System

The Map of the Virtual Workspace 241


The ABS Area 241
The User ABS Area 241
The PCB Area 242
The Process Workspace Area 242
The User Data Area 242
ABS and the Monitor 243
Functions of the Monitor 243
How the Monitor Works 244

10 Putting the Parts Together:


Applications 247
Native Applications Using the PICK System 247
Rolling Your Own 248
Keeping It Simple 252
The Languages of the PICK World: PROC, PICK/BASIC, and RPL 252
The Basic Mistake People Make About BASIC 253
The Alternative Language: RPL 254
The Next Generation of Programming Languages: Application Generators 255
Types of Application Generators 256
Similarities among Application Generators 257
Professional Use of Application Generators 257
Application Generators and the End User 258
The Reserved Programming Language: Assembly 259
The Difference in PICK Assembly Language 259
Not To Worry 260
Major Application Systems for PICK 261

11 Analysis and Design for PICK-Based Systems


265
Soft Landing on the PICK World 265
Design Considerations within PICK 267
A Little Structure 267
Overview of the Design Process 267
Analysis 268 A PICK Data Dictionary 270 Dictionary for the Data Dictionary 270
The Second General Step 271
Design 272
Step 1—Analyze the Data Stores 273

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

12 The Future of the PICK System 279


Players Who Have Seen the Light 279
PICK Emulations 280
Cosmos Revelation on the PC 280
Prime Information under Primos 280
PICK Personal Computing on the IBM XT and AT 281
Extensions to the PICK System 282
Open Architecture: The Universal Host 282
Features and Capabilities 282
Potential Developments 283
The Orbit of the PICK World 284
Components of the Next Generation 285
PICK’S Contributions 285
The Transition to the Next Era 286
PICK and UNIX in the Fifth Generation Computer 287

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

The G Correlative 324


The L Conversion 324
The M Conversion 325
The MC Conversion 326
The MT Conversion 327
The MX Conversion 328
The T Conversion 328
The T Correlative 328

E Dictionary Listings from Tutorials 331

Glossary 335

Index 339

xvii
i
Preface

Why We Are Here


It was late in the seventies when Jon and I discovered that there was very little
being written about this remarkable computer system. Five years of clippings
barely filled Jon’s one-inch binder. It was nearly impossible to refer to any
kind of manual or book, or even a comprehensive article about the PICK
System.
That suggested something ominous. Several times in the past few de-
cades great ideas have gone by the wayside. Through ignorance or short-
sightedness, or sometimes even greed, some truly spectacular developments
have died of lack of interest.
One was the Avanti motor car. Twenty-five years ahead of its time, the
Avanti was the most advanced automobile of its day. It was so good, in fact,
that it outlived its manufacturer, Studebaker.
Another was the Xerox STAR computer system, with its graphics, icons,
and electronic mouse. Ten years later it was re-invented by another company,
and while Xerox looked on in dismay, Apple made history with the Macintosh.
Likewise, the system that Dick Pick and Don Nelson created had never
even made it to the dusty pages of Auerbachs or Datapro, as either an
operating system OR database management. It looked as though PICK was
also headed for obscurity.
Yet the PICK System persisted despite a stubborn lack even of curiosity
from the mainstream computer industry. We believe that the approach was

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.

What You Will Learn Here


When Exploring the PICK first appeared in November of 1985, it was thought
that the book would start a wave of information about the PICK System and its
unique capabilities. Unfortunately, it didn’t turn out quite that way. The
articles and books written since then have offered pretty much the same thing:
namely, a re-hashing of the operator’s manual.
■ How the PICK System creates files
■ How to EDIT those files
■ How to generate ACCESS or ENGLISH reports
■ How to program in PICK/BASIC
To their credit, some of these books and articles do an outstanding job of
telling “how.” Some even do it better than Pick Systems, Inc.
Exploring the PICK Operating System is intended to provide a different
look at the PICK System. It is the intention of this book to also tell you “why.”
■ Why you’ve never heard of the PICK System before
■ Why the PICK System works the way that it does
■ Why one should use PICK to create files and generate reports
■ Why anyone would prefer programming in PICK
■ Why the PICK System is capable of designing its own applications
■ Why the PICK System is likely to be around for a long time
This book offers a new way to look at data and the computer. It explains
how to process data more effectively, more professionally, and just plain
better. It also explains how you can get more out of the computer, and the
people who use it.

How You Will Learn


The book begins by explaining where the system has been for the past fifteen
years, and why that is important to any real understanding of the PICK
System’s strengths and weaknesses. Chapter 2 discusses the terminology of the
system, because the language demonstrates how the system

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.

Steve VanArsdale Jonathan E. Sisk

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 Milestone


The PICK System was ahead of its time when it was created in the sixties, and
yet today it is still considered one of the most advanced database environments
of the eighties. This unusual longevity is due to a unique data structure, which
makes it simultaneously efficient and flexible, yet easy for nontechnicians to
learn.
Why does the PICK System represent a milestone? Because tomorrow’s
users will insist upon an easy-to-learn, easy-to-use environment on micro and
mainframe computers alike. And millions of users with billions of dollars and
demands for a PICK-like working environment are likely to shape the
computer industry. The PICK approach delivers that environment, whether it
is running “native” by itself, on small computers with MS-DOS and OS/2, on
minicomputers running UNIX, or even giant computers with VM or MVS.

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.

The Evolution of the PICK System


The PICK System is still relatively little known, despite its features and the
cult-like enthusiasm of its users for nearly twenty years. All of the system’s
unique features evolved from the turmoil of data structure and virtual memory
approaches in the late sixties and early seventies. Yet the system’s cloudy
reputation is a product of the turmoil as well; with all the clamor and
competing claims, many of the system’s features have been ignored or
discounted. Computer professionals are occasionally heard advising users that
the features of PICK are not even possible, let alone available.
It has been said that the PICK System is a product of its history and its
domination by one source. We’ve already discussed the PICK System as an
example of operating environments to come; now let’s look at how it came to
be here.
1965: The development of a database management package was started
at TRW by Don Nelson and Dick Pick. Originally called GIRLS (Generalized
Information Retrieval Language System), it was developed on an IBM 360
mainframe computer for controlling parts inventory on the Cheyenne
Helicopter Project. The system was designed for the specific purpose of ad
hoc reporting by nontechnical personnel. The approach of the design was
unique: the data structure and the report generator were designed before the
hardware, the processing mechanism, or even the user’s requirements were
determined.
1969: The database management system was delivered to the United
States Army. It was renamed GIM, for General Information Management.
When the project was halted, all the programs developed under the
government contract became public domain.
1970: Dick Pick left TRW and took a copy of the GIM software to work
on the Sigma 7 computer at the University of California at Irvine. There it was
determined that the underlying operating system adversely affected the
performance of the database management system. The software was rewritten
in a proprietary assembler code, and a small microcode program was written
to run the computer AND the database management system. The PICK System
was born. Since the original package was based solely upon end user data
utilization and hardware independence, it is understandable that the resulting
generic PICK System of today is so fundamentally different from any other
multiuser system.
Introduction to PICK

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:

WICAT, Australia—MC68000 implementation. This was promoted by


a now-famous PICK promoter named Lionel Singer, who left his mark
on nearly every PICK implementation sold “down under.”
TAU Engineering, Japan—MC68000. As the first PICK implementation
to use the katakana character set, the Tau was primarily reserved for the
use of one company in Japan.
CIE Systems, Japan—MC68000. Started by the trading giant C.
Introduction to PICK

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.

The PICK Operating Environment


Since the PICK System is so closely integrated, it is wise to consider the
system as a unique “environment,” or place in which to work. In this re-
gard PICK might be described as a small world in the computer market.
It spins out on the periphery of the cluster of computer systems, bright for
its space but relatively undiscovered.
The PICK world, as shown in figure 1-1, has a unique and hospitable

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.

Figure 1-1 The PICK “world’

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.

Each folder/item can be thought of as containing facts, on separate


sheets of paper. Each sheet is an attribute. Most of the time, each attribute
contains only one piece of data, or value. However, there can be more than
one value in an attribute—for example, a series of dates. Furthermore, each
value can have one or more sub values, such as a series of times for each
date.

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 PICK Files


The PICK file system is based on file pointers. A file pointer is a data item
that tells the operating system where to locate a particular file. Pointers
are automatically created by the system and stored along with the
dictionary items. They act as signposts in the PICK world.

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.

Figure 2-1 The PICK file categories

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.

The Various Components of the File Signposts

The first attribute, the D/CODE, identifies this item as a file-defining


item. It is automatically created with a D in attribute 1 by the CREATE-
FILE command (see chapter 3). On most PICK computers this code can
be changed to any of the following forms:
D For normal (data and dictionary) file pointers. This constitutes
the majority of files on the PICK System, and is read, backed
up to tape, and restored as a normal file.
DX This code affects the process that saves files to magnetic media.
A DX pointer instructs the save process not to save this
particular file. The file will continue to exist only until a re-
store is performed, when the file will not reappear. This
might be useful for unchanging files, like tables or program
software, which can be loaded from another tape and need
not be backed up each day.
DY This code instructs the save process to save the space reserved
for the file, but not its contents. After a restore, the file will
reappear empty. This is the same as clearing a file of its
contents while keeping the file’s primary space for the
storage of data. DY pointers are often used for temporary
transaction files that do not need to be saved on magnetic
backup media.
DC This defines the file as a list-class file and is reserved for files
that will contain PICK/BASIC source code items or saved-
lists created with the SAVE-LIST command. On most PICK
computers this type of file is reserved for those items that are
likely to exceed the maximum item length, which is usually
32,767 bytes. Newer versions of the PICK System have
greatly expanded or even unlimited item sizes, effectively
making all files into list-class files.
The second attribute, the base FID, is a number placed into the file
pointer during the CREATE-FILE process. It is the frame-id of the first
frame of the block of frames reserved for the file. A frame is a logical seg-
ment of file data, and a frame-id is a number used to reference the particu-
lar segment. (Later on our tour, in chapter 9, we will examine one of
several frames using this number, and the DUMP command.)
The third attribute is called the modulo (MOD-you-low). It and the
fourth attribute, the separation, indicate the number and size of the groups of
data items in the PICK file. Items are stored in groups to simplify the task of
finding them later. In chapter 9 we’ll take a brief side trip to learn how the

2
0
Getting Around

modulo and separation determine the “shape” of a PICK file.

An Important Note: The PICK System relies on attributes 2, 3, and 4 of the


file pointer to determine where data should be placed or where it can be
found. It is extremely important that none of these attributes be changed
by the user, as this can have a disastrous effect on the contents of the file,
and the other files in the system.

PICK’S “No Trespassing” Signs

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.

Special Attributes 7 and 8

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

of the other SYS1 features of the next privilege level, such as


CREATE-FILE. This level is used for data-entry-only and
inquiry-only users.
SYS1 System Privilege 1. Users with this privilege level have limited
access to most PICK commands. However, these users are
restricted from use of the system backup or restore
commands, the DUMP frame-display command, or the all-
powerful Assembly Language System Debugger activated
by the Break key. These users are effectively barred from
access to SYSTEM level files and the main SYSPROG
account. This privilege level is for users who maintain their
own files and generate their own output reports, and will
not need to affect the processing of other users.
SYS2 System Privilege 2. This is the highest level of PICK System
privileges, usually reserved for system administrators.
These individuals have access to all files and processes,
because they usually have to fix them if anything goes
wrong. In the PICK world, however, privacy is always re-
spected; even the user with a SYS2 privilege level can be
denied access to secured data with an application software
encryption scheme.

Note: A SYS3 privilege level has appeared on a few PICK imple-


mentations, notably those of Applied Digital Data Systems and General
Automation. This privilege level, however, is simply an extension of the
privileges normally inherent in the SYSPROG account on standard
PICK Systems.

File-Defining Items: Attributes 9 through 12

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

U Unconditional left-justify, overwriting columns to the right if


necessary for an item-id wider than the column width stored in
attribute 10. When this code is used in the SYSTEM filedefining
item, it has a special function.
In the SYSTEM file, where file-defining items point to account MDs,
there is an additional security function provided by the ninth attribute.
This is an automatic update of the accounting history file, or ACC, which is
accomplished when the letter U appears in the ninth attribute of the logon
pointer item in the SYSTEM file. In this case, the ACC file is updated each
time a user logs on or off. The system automatically stores a data item in
the ACC file that records the account name and port number used, the time
and date logged on and off, the number of CPU cycles used during the
session, and the number of pages sent to the system printer.
Attributes 11 and 12 of a file-defining item are reserved for future
use, and generally have nothing in them. As mentioned above, there are
occasionally a pair of numbers, called the reallocation parameters, in at-
tribute 13, which can be used to resize a PICK file to make it more efficent.

PICK File Resizing

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-Ids and Accessing


Files are interesting in the PICK world, but not as interesting as what
goes in them.
PICK files contain items that are similar to records; these items are
made up of attributes that can be thought of as fields. Attributes can be a
single string of characters or they can be composed of separate but equal
values; these values can contain subvalues. Within the PICK System,
items are strings of characters, as shown in figure 2-2. In the logical view
that we see on the screen, an item appears as a list of fields or attributes
with one or
Getting Around

many values. But in the diagram of an Item Physical Structure, we see


that attributes and their values are separated or “delimited” by special
characters.

ITEM-ID ATTRIBUTE 0

ATTRIBUTE 1

ATTRIBUTE 2; TWO VALUES

3; VALUES WITH SUBVALUES

a. Item Logical Structure

ATTRIBUTE 2 ATTRIBUTE 3

COUNT ITEM-|DAATTRIBUTE LVALUE] VALUE A VALUE] SUBVALUE\SUBVALUE A4 A AA_

(HEX) (ASCII 254) (ASCII 253) (ASCII 252) (ASCII 255)

b. Item Physical Structure

Figure 2-2 The item has a logical view (ours) and a physical view seen
only by the system itself.

Certain characters, namely A ] \ and _ are meaningful to the PICK


System. They appear as marks between the fields of the item, and are
sometimes referred to as PICK’S “Marks Brothers.” Their use is described in
table 2-1.
The PICK System itself recognizes these special characters and auto-
matically uses them while performing data storage and retrieval tasks. There
are some special benefits to this approach. One is that attributes within items,
and items within a file, can vary widely in size. Since values and attributes are
delimited by recognizeable characters, the system handles them appropriately
and can be relied upon to recognize where one field ends and another begins.
Consequently, all PICK items and files are completely variable in size.
One item may be twice the size of the next, while one attribute of an item may
be ten times the size of the same attribute in the next item. In the QUOTES
item in figure 2-3, we can see an example. Marie Antoinette was terse and to
the point, while Abe Lincoln told it like it was. A QUOTES file will be able to
handle them both as PICK items, as well as every notable quotable in the
future, no matter how concise or long-winded the speaker.

Table 2-1 PICK special characters and their use

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.

QUOTES FILE ITEMS

ITEM-ID: ANTOINETTE LINCOLN

NAME: MARIE ABRAHAM

QUOTE: “Let them eat cake.” "Fourscore and seven


years ago, our fore-
fathers brought. . .

Figure 2-3 Note that attribute 0 (ITEM-ID) and attribute 1 (NAME)


are similar in size, but the QUOTE attribute can be considerably
different in length.

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

number is divided by the modulo of the file, obtained from attribute


3 of the file-defining item. The remainder after the division is known as
the modulo, and it represents the group within the file in which the item
will reside.
The group number, times the separation stored in attribute 4 of the file-
defining item, is added to the base FID stored in attribute 2. The resulting
frame-id is the first frame of the group. The system then brings the first
frame of the group into virtual memory and begins searching through all the
items in the group. When the end of the group is encountered, the item is
added. If an item with the same item-id is encountered first, then the new
item replaces the old item. In some PICK implementations, the new item is
placed in the same location if the size has not changed, while other versions
always place the item at the end of the group. In any case, this is why users
will notice that the unsorted sequence of items in a PICK file might change
from time to time. Someone may have visited the file, edited an item, and
returned it, but the system did a little housekeeping of its own on the group.

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.”

Attributes and Attribute-Defining Items

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

008 Correlative; a reformatting or calculation to be performed before


the selection and/or sort.
009 Output column justification for this attribute on reports:
L—Left-justify
R—Right-justify
T—Left-justify with wraparound on blank
U—Unconditional left-justify
010 Width of the column for this attribute on reports.
011 Unused; once held the minimum width of the column on reports.

Attribute-defining items are used by the data retrieval process,


sometimes called ACCESS, ENGLISH, RECALL, or perhaps INFORM. In
all cases, it is the natural-language report generator inherent in all PICK-
based computers. The attribute-defining items contain the instructions for
■ the location of fields within the data item,
■ how the fields or attributes are to be handled, and
■ the format in which to display the attribute.

In positions 7 and 8, attribute-defining items can contain conversion


and/or correlative specifications. These codes instruct the retrieval process
to perform relational database tasks during retrieval. These tasks are
among the most powerful aspects of PICK’S relational database and its
ability to produce a user’s view of the data, regardless of the way in which
the data is actually stored. (For a detailed list of the conversion/correlative
specifications, see appendix E.)

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

An operating system is usually categorized by the way it appears on the


computer terminal or screen, its “surface” as seen by the people who work
on computer terminals. As you saw in chapter 2, the surface of the PICK
Operating System is known as TCL, short for Terminal Control Language,
the principal language spoken there. TCL is the interactive command
processor. It is known to residents and frequent visitors as “tickle,” and is
the first PICK process a user or technician encounters after logging on to a
PICK Operating System computer.
In addition to being the first process encountered, TCL is also the only
way into the PICK world. Every logon is handled in the same way.
Application systems often take a user to TCL and directly into an applica-
tion program, but every logon arrives in TCL for at least a moment. (It’s a
little like Customs; even the VIPs get stamped.)
It is from this surface that all navigating through the system begins, for
the novice and the master alike. TCL is also the only legal way to leave the
system, and it is for that reason that all PICK processes and user appli-
cations return the user to TCL when finished. All roads lead from TCL, and
all processes terminate there. It is fitting, then, that we begin our ex-
plorations at TCL, since our tour will eventually end here.
You arrive at TCL by entering a valid user ID at the “Logon Please”
screen. This screen differs from manufacturer to manufacturer, with each
computer displaying its own logo from an item entitled LOGON in the
SYSTEM file. But almost all logon screens have prompts to the effect of:
“Please Enter Your User ID.” A user ID is the item-id of a valid item also
3
1
Chapter
1
stored in the SYSTEM file (see Account Names, later in this chapter). One
user ID that should work is SYSPROG; it is the first and most powerful
account on any PICK System. Fortunately, PICK provides for a password in
the LOGON item in the SYSTEM file, and the SYSPROG logon is usually
protected with a complex password. So, you must have a valid user ID and
the password associated with it, to log onto the PICK System. See your
“travel agent,” the system administrator.
Once you have entered your user ID and the password, the PICK
System activates your process and points TCL to the appropriate MD
(Master Dictionary) file for the user ID. Like a faithful gatekeeper, the
TCL process always looks for an item in the user’s MD with the same
name as the user ID. (This is known as the Logon PROC\ it is discussed in
chapter 6.) If one is located, TCL immediately executes the command(s)
stored there. That’s how some user IDs get whisked off directly into an
application system without so much as a glimpse of TCL.
If no Logon PROC is located in your MD, then the TCL process
prompts you with a > character. The prompt character varies among
manufacturers, but it is usually a distinctive single character, such as >.
On some versions of PICK, such as Open Architecture and the McDonnell
Douglas version, the colon character (:) is used as the TCL prompt
character. Whatever character is used, this prompt means that the TCL
process is ready for you to enter a verb, which is a command from the
Terminal Control Language.
TCL is a powerful combination of system commands, user functions,
file commands, and commands to control peripheral devices. Several
special verbs open doors into other levels of PICK. Other TCL commands
can alter the entire system. A skilled user can even create verbs,
combining the best of TCL into a kind of personal language.

How to Enter and Exit the System


To enter the PICK System you must provide an account name.
Optionally, a password may also be requested, but more about that later.

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.

LOGON PLEASE: SYSPROG<cr>

Notes on the Local Customs

In a PICK System, almost every keyboard entry must be followed by a


carriage return. This may be called “Return” or “Enter” or “New Line”
on your terminal; they all mean the same thing. If your terminal does
not have a Return key, you may use Linefeed. The convention of
3
2
The User Processes:
TCL
abbreviating “carriage return” to <cr> is used throughout the tutorial in
chapters 3-8. The Control key is abbreviated as < ctl>, with Control
character combination keystrokes abbreviated as < ctl- x>. Boldface text
in examples indicates characters that you should enter or highlights
items being discussed.

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:

LOGON PLEASE: SYSPROG<cr>


PASSWORD: password<cr>

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

> TCL (Terminal Control Language)

Open Architecture/McDonnell Douglas TCL

• Editor Command Mode

+ Editor Insert Mode

★ 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.

Table 3-2 TCL control characters

Control Character Function

<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.

<ctl-I> Tabs to next tab stop.


<ctl-S>
On most PICK implementations, this produces an X-OFF signal,
which stops transmission of data to the terminal (or printer) until an
X-ON (<ctl-Q>) is generated.
<ctl-Q> This produces an X-ON, which restarts transmission of data to a
terminal or printer after an X-OFF (<ctl-S>). This often “unlocks”
frozen terminals.

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>
>

Control returns to TCL, as the prompt indicates.

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.

TCL-I Commands Tutorial


Here are some of the TCL-I verbs you will encounter in a PICK System.
Each manufacturer adds a couple of dozen, then the system administrator
usually adds a few, and of course each system technician has a few favor-
ites as well. But to avoid embarrassment when touring around on the sur-
face of the PICK Operating System, you should be able to recognize and
use the following TCL-I verbs.

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

In this example, 9 is the result with a remainder of 3.


The MULD command multiplies two integer numbers.

>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.

Displaying Files: The LISTFILES Command

The LISTFILES command displays all of the file pointers from the current
account.

>LISTFILES<cr>

The LISTFILES command displays all of the file-defining items (also


called file pointers) in the current account MD. File-defining items are divided
into two categories: local files, which normally have a D, DC, DX, or DY in
attribute 1 of their respective items in the MD, and remote file pointers, which
have a Q in attribute 1. The basic difference is that local file pointers are
created only with the CREATE-FILE command and remote (Q-pointer) items
are created through the Editor.
Usually on LISTFILES output, the file pointers are sorted by pointer
type, that is, the contents of attribute 1. This means that all of the standard D
pointers will sort together, then the DC pointers, and so on. Next to any D (or
derivative of D) pointer is generally displayed the base, modulo, and
separation. These are the disk addresses where the dictionary levels of the files
are located. Within each category of file pointer, the files are sorted by item-id.
Example 3-1 shows a sample listing from the LISTFILES command.

Example 3-1 PAGE 1 ★** MD FILE DEFINING ITEMS 26 JUN 1992


Sample output
from the MD CODE F/BASE.... F/MOD.... F/SEP...
LISTFILES CURSOR D 5360 1 1
command DOC D 5406 1 1

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

★ ★★

ACC BLOCK- Q ACC


CONVERT M/DICT Q BLOCK-CONVERT
MD QQ
PROCLIB SYS-ERRS Q PROCLIB
SYSPROG-BP Q SYSTEM-ERRORS
SYSTEM SYSTEM- Q SYSPROG BP
ERRORS Q SYSTEM
Q SYSTEM-ERRORS

★★★

'k'k'k

The Standard PICK Files

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 FUNCKEYS File Unique to PICK-on-the-PC, this file is used to


hold definitions for the function keys on the PC keyboard. It is used by
the command SET-FUNC on the SYSPROG account, and may be used
only from port 0.

The KEYBOARDS File Unique to PICK-on-the-PC, this file is used to


hold definitions for alternate keyboard character sets, such as British,
German, Dvorak, and a few others. Used by the command SET- KBRD
on the SYSPROG account, it may be used only from port 0.
The User Processes:
TCL
The NEWAC File This file contains all of the items that will be placed into
NEW ACcounts created with the CREATE-ACCOUNT command. Items may
be added, changed, or deleted to suit your own requirements.

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 POINTER-FILE This file is used to store “lists” of item-ids generated


with the SAVE-LIST command; it is discussed in chapter 5. Don’t panic if no
POINTER-FILE is in SYSPROG. Later, in the section on SELECT and SAVE
LIST, the steps to create it are discussed. It’s important to note that each
account may have its own POINTER-FILE. On the standard PICK-on-the-PC
version, a Q-pointer to this file is provided. This gets in the way later, when
you try to create this file in a new account. As a suggestion, we advise users to
remove this from the NEWAC file, but we’ll provide the steps later to deal
with this problem.

The SYSPROG-PL File This file contains PICK/BASIC programs and


some PROCs that are reserved for use by the SYSPROG account, because of
potentially dangerous side-effects. Some of these PROCs and programs are
CREATE-ACCOUNT, DELETE-ACCOUNT, FILE-SAVE, and ACCOUNT-
SAVE.

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

produces is based upon the information in this file. An additional feature is


provided with the ACC file. When attribute 9 of the account-definition item
(user ID) in the SYSTEM file contains the letter U (or RU or LU), the ACC
file records “permanent” statistics of the use of each account. These permanent
4
1
Chapter
1
statistics include:
■ the account name and port number from which it was accessed,
■ the time and date on which the account was logged,
■ the number of pages directed to a printer,
■ the “connect time” in minutes and seconds, and
■ the number of CPU charge units.
This information can be displayed with the LISTACC command on the
SYSPROG account. An important note: If permanent statistics are gathered,
then the ACC file should periodically be cleared using the CLEAR-FILE
command, but MAKE SURE THAT NO ONE IS LOGGED ON WHEN YOU
DO THIS!

The BLOCK-CONVERT File This file contains the definitions of the


characters used in the BLOCK-PRINT command for printing enlarged
characters on the terminal or printer.

M/DICT This Q-pointer is provided as an alternate reference to the


current account MD. Each account is provided with one of these, which tends
to be used by some of the older PROCs in the system.

MD This Q-pointer is provided to each account for access to the MD of


the current account.

The PROCLIB File This file contains a collection of common PROCs


(stored procedures), such as the LISTFILES procedure you just used. The
PROCs in this file are generally available to every account in the system.

SYSTEM This is a pointer to the SYSTEM file, which is used to store


the pointers to all other accounts and system-level files.

About TCL Options

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.

Displaying Commands: The LISTVERBS Command

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.

Example 3-2 PAGE 1 09:49:33 26 JUN 1992


Sample (partial)
output from the M/DICT... *A1.... ... _____ *A4...... ★A5.....
LISTVERBS *A3..
command
:ABSLOAD p D?
: STARTSPOOLER p 500A 60B6 10AF
:SWD PA 35 1090 44
:SWE PA 35 1090 45
:SWX PA 35 1090 58
:SWZ PA 35 1090 5A
:TASKINIT P 140
ACCOUNT-REPTORE 80D7
cont.
ADDD PA 40A0
ADDX PA AO
B/ADD PZ 2 53 57 CS
B/DEL PD 2 53 57 CS

A detailed explanation of the mechanics of verb-defining items is


provided in appendix D, Verb Formats. But for now, memorize these principles
and rules:
1. Any item in the MD with a (P) (optionally followed by one or more
alphabetic characters) in attribute 1 is considered a verb. The other
attributes are direct addresses to locations within the PICK ABS frames,
where the operating system code physically resides.
4
3
Chapter
1
2. NEVER CHANGE ANY OF THESE ATTRIBUTES! Changing even one
character in a verb can cause your system to crash, by sending it off to a
potentially invalid location!
3. BE CAREFUL WHEN EXPERIMENTING WITH VERBS! The
SYSPROG account is provided with more verbs than any other account.
All of the system maintenance verbs reside here, and it is expected that
users know how to use the verbs. If you’re not absolutely sure what a
particular verb may do, it’s safer not to try it.
Again, the output may be routed to the printer, via the spooler, through

>LISTVERBS (P) <cr>

or

>LISTVERBS LPTR<cr>

Displaying Current Users: The LISTU Command

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>

Example 3-3 shows an abbreviated form of output from this command.

Example 3-3 CH# PCBF NAME....... . .. DATE....... LOCATION.........


Sample output from 00 02C0 SYSPROG TIME..
14:44 26 JUN 1992 Computer Room
the LISTU command *03 0320 JES 06:15 26 JUN 1992 Jon’s Office
04 0340 JUDY 08:05 26 JUN 1992 Reception
05 0360 TRACY 07:30 26 JUN 1992 Tracy’s Office
06 0380 MICHELLE 07:45 26 JUN 1992 Shipping
07 03A0 HER 12:22 26 JUN 1992 Dial-up Line 1

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.

Displaying Connectives and Modifiers

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>

LISTCONN is the last of the LIST commands. Other fundamental TCL-I


commands are explained in the following sections.

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.

> LOGOFF <cr>


CHANNEL: 1 <cr>
[534] LOGOFF SUCCESSFUL.

The LOGOFF command breaks whatever process is in progress on the


port and supplies an OFF to the debugger prompt. This is not a good way to
win friends and influence people. It brutally terminates whatever they are
doing.
The LOGOFF command sometimes doesn’t work. There is a U option
to “Unconditionally” log off another line. This is accomplished as follows:

>LOGOFF (U) <cr>


CHANNEL: 1 <cr>
[534] LOGOFF SUCCESSFUL.

In this form, LOGOFF hardly ever fails. Of course, it is considered


dangerous due to unpleasant little side-effects such as leaving spooler entries
“open.” Caveat Emptor.

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.

>MSG SYSPROG WHAT KIND OF PAPER IS IN THE PRINTER?<cr>

where:
MSG is the command.
SYSPROG gives the destination of the message.
WHAT KIND_____PRINTER is the text of the message.

Sending a Message to All Users Currently Logged On

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:

>MESSAGE * THE SYSTEM WILL BE SHUT DOWN IN TEN


MINUTES! <cr>

Sending a Message to a Specific Line or Port Number

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.

>MESSAGE 13 DO YOU STILL HAVE MY PICK POCKET


GUIDE?<cr>

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.

Sending a Message to All Devices Attached to the Machine

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:

>MESSAGE !* PLEASE DO NOT LOG ON UNTIL AFTER 10:00 <cr>

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>

80759- 80760 : 2 80763-109366 : 28604

TOTAL NUMBER OF CONTIGUOUS FRAMES : 28606

The WHO Command

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.

>WHO 5<cr> 5 TRACY

Finally, the WHO command also allows an asterisk * to be entered in


place of a port number. This provides a list of the port numbers and account
names for all users currently logged on. Ports not being used are

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.

Example 3-4 The


BLOCK-PRINT
>BLOCK-PRINT HI THERE<cr>
command and sample
screen output

HH HH IIII
HH HH II
HH HH II
HHHHHHH II
HH HH II
HH HH II
HH HH IIII

TTTTTTTT HH HH EEEEEE RRRRRR EEEEEE


TT HH HH EE RR RR EE
TT HH HH EE RR RR EE
TT HHHHHHH EEEEE RRRRRR EEEEE
TT HH HH EE RR RR EE
TT HH HH EE RR RR EE
TT HH HH EEEEEE RR RR EEEEEE

There is no practical limit to the number of characters that may appear in


the output, but TCL restricts the input line to about 140 characters. Each word
space in the output forces the following word to appear below the previous
word. To force two words to appear on the same line of the screen or printer,
the words may be enclosed in quotes as shown in the following example:
>BLOCK-PRINT "JOE'S BAR" "& GRILL"<cr>

(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.

>BLOCK-PRINT HI THERE (P)<cr>

ENTRY n

When this option is used, the system printer will suddenly print a full-page
greeting.

TCL-II Verbs Tutorial


TCL-II verbs require a verb, filename, and itemlist specification. Most verbs
also allow a list of options, enclosed in parentheses, at the end of the command
line.
The general form of TCL-II commands is as follows:
> verb filename itemlist options{cx}

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:

Normal Form Alternate Form


>LIST STAFF >LIST DATA STAFF

>COPY BP ★ >COPY DATA BP ★


> ED STAFF ★ > ED DATA STAFF *

The second form of filename reference is considered the exception. It’s


used when you want to affect the dictionary level of a file. The general form in
this case requires the word DICT prior to the filename. The following examples
illustrate this form of filename specification:

>LIST DICT STAFF


>COPY DICT BP *
>ED DICT STAFF *

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:

>ED STAFF 100


>COPY DICT STAFF NAME

In these two examples, 100 and NAME are the item-ids.


Multiple item-ids may be specified, by separating each one with a space.
Multiple item-id specifications are illustrated in the following example:

5
1
Chapter
1
>ED STAFF 100 101 102 103 104 105 106

> ED DICT STAFF NAME ADDRESS CITY STATE ZIP

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:

>SSELECT STAFF BY NAME

> Items Selected


>ED STAFF<cr>

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}

Copying Items to the Terminal

The COPY command provides a (T) option to route output to the terminal
screen. This is illustrated in the following example:

>COPY MD LISTU (T) <cr>

Copying Items to the Printer

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:

>COPY MD LISTU (P)<cr>


The User Processes:
TCL
Copying an Item to a New Item-Id

The COPY command allows items to be copied to new item-ids. This is illustrated
in the following example:

>COPY MD *A1 <cr>


TO:TESTITEM<cr>

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:

>COPY MD *A1 <cr>


TO:TESTITEM<cr>

'TESTITEM' EXISTS ON FILE

0 ITEMS COPIED

The “Overwrite” Option in the COPY Command

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:

>COPY MD *A1 (0)<cr>


TO:TESTITEM<cr>

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:

>COPY MD TESTITEM (OD)<cr>


TO: ITEMTEST<cr>

1 TESTITEM TO ITEMTEST

1 ITEM COPIED

This time, after the copy, the original item—TESTITEM—has been


removed from the file.

Copying Items to a Different Filename

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 critical thing to remember in copying between files is that the


filename must be preceded by a left parenthesis character; otherwise the
system will treat the filename as an item-id, which can lead to further frus-
tration.
In the preceding example, the original item-id was retained during the
copy. Once again, we end up with duplicate items, this time with the same
item-id, yet in different files. All of the previous options—including renaming,
deleting, and overwriting—may be combined with the file copy form of the
COPY command.

The DELETE The DELETE command is used to remove an item from a file. It is illus-
Command trated in the following example:

>DELETE ERRMSG ITEMTEST<cr>

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>

Again, a brief disclaimer is important here. The CREATE ACCOUNT


process varies among different versions of the PICK System. If it appears differently
on your screen, that’s O.K. Some versions put all the questions on one “menu”
screen or ask the questions in a different order. Use the following sections to
determine how to answer the questions if they are not in the order described in this
book. This version, incidentally, is considered the “generic” version of CREATE-
ACCOUNT, from the PICK-on-the-IBM-AT Release R83.

Choosing the Account Name

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

Enter the account name CLASS, followed by a <cr>.

ACCOUNT NAME? CLASS<cr>

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>:

L/RET-CODE (S) ?<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>

Modulo and Separation

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:

FILE 'CLASS’ CREATED; BASE 7288, MODULO 29, SEPAR 1.

After a few seconds, other messages appear on the screen:

245 ITEMS COPIED ’account’ ADDED, ’account’ UPDATED.

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:

ENTER NEW PASSWORD?<cr>


5
7
Chapter
1
CONFIRM YOU WISH TO REMOVE THE ACCOUNT PASSWORD (Y/N)? Y <cr>

The PASSWORD process returns to the account name prompt, allowing


you to change another account name if you wish. If you do not want to change
any more account passwords, then enter a <cr>, at which point control
transfers to TCL. If you want to change another password, repeat the process.
Note: Don’t change other account passwords without approval, unless you are
fully vested in your company’s retirement plan.

Changing or Adding a Password

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>

Passwords may be any combination of alphabetic, punctuation, and/or


numeric characters. Each password is passed through an encryption algorithm
that converts it to an 8-byte string of hexadecimal characters before being
stored in the SYSTEM file.

Removing an Existing Password

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.

modulo}, sep} is the data level.


For example:

>CREATE-FILE CUSTOMERS 3 7<cr>

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.

>CREATE-FILE CUSTOMERS 3,1 7,1<cr>

5
9
Chapter
1
Creating Dictionary-Only Files

In the previous examples of CREATE-FILE, both dictionary and data levels


were created. A single-level (dictionary-only) file may be created using the
general form:
> CREATE-FILE DICT filename modulo{, separation}
In this form, a dictionary level only is created. Note that most files have
both a dictionary and a data section.

Creating Multiple Data Sections from One File

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.

Creating the Tutorial


Files Create the files for this tutorial using the following commands:

>CREATE-FILE STAFF 7 11<cr>

[4171 FILE 'STAFF* CREATED; BASE 7317, MODULO 7, SEPAR 1.

[4171 FILE 'STAFF* CREATED; BASE 7324, MODULO 11, SEPAR 1.

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.

>CREATE-FILE PROCS 1 11<cr>


>CREATE-FILE STATES 1 11<cr>
>CREATE-FILE BP 11 11<cr>
>CREATE-FILE SPOOL-FILE 1 11<cr>
>CREATE-FILE TEMP-FILE 1 1<cr>

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:

>COPY MD WHO TIME POVF<cr> TO: (TEMP-FILE<cr>

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>

PAGE 1 12:00:00 26 JUN


1992

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:

>CLEAR-FILE DATA TEMP-FILE<cr>

No message is displayed. That’s normal. Now we should verify that the


file has, in fact, been emptied. Use the LIST command again, as shown in the
following example:

>LIST TEMP-FILE<cr>

[401] NO ITEMS PRESENT.

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>

Again, no message is displayed. If all went well, you should now be


back to the TCL prompt character. Verify that the file has been removed with
the LIST command, as shown in the next example:

>LIST TEMP-FILE<cr> [10] FILE NAME MISSING

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

The second mode is the Insert/Replace mode, normally indicated by the


plus sign (+) prompt character immediately to the right of the line number.
From this point, any characters may be entered and are treated as data rather
than as commands. Also from this point, control may be transferred back to the
Command mode by issuing a <cr>at the + prompt character.

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.

Editor Command Glossary


Below is a list of the Editor commands and their respective functions:
.<cr> Moves the Editor line pointer to the next line.
.A Toggles the “wildcard” function on or off.
.? Displays the current filename, item-id, and line number.
.A Again: repeats the last Locate command.
.AS Activates the assembly formatter.
.B Bottom: moves the line pointer to the bottom (end) of the item.
.C Column: displays the columnar coordinates.
.DE Deletes a line or range of lines.
.EX Exits the item without saving changes.
.F Flips the Editor temporary file buffers.
6
6
The
.FD File Delete: deletes the current item. Editor
.F Files (writes) item and exits the Editor.
.FS Files (writes) item and remains in the Editor.
.G Goes to a specific line number.
.1 Insert: activates the Insert/Replace mode.
.L Lists a range of lines.
.L Locates a string within the current item.
.M Macro: activates Assembler macro expansion function.
.ME Merge: merges text into the current item.
.N Next: increments the Editor line pointer relative to the current
position.
.Pn Defines or executes prestored Editor commands.
.PD Displays prestored Editor commands.
.R Replaces a string of characters within the current item.
.S Suppress: activates or disables the display of line numbers
and assembled object code.
.S? Displays the size of the current item in bytes.
.T Top: positions the line pointer to the top of the current item.
.TB Tabstop: sets or updates tab stop positions.
.X Cancel: negates effect of the last Replace command.
.XF Cancel to Last Flip: negates the effect of all changes since
the last Flip command.
.Z Zone: establishes column limits for editing.

Activating the Editor: The ED and EDIT Commands


The EDIT and ED commands are used to activate the Editor process. Both are
automatically included as commands in your MD. The EDIT command
requires three pieces of information, as do all other TCL II verbs. These three
elements include the verb (ED in this case), the filename

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:

>ED STAFF 100<cr>

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:

>ED STAFF 100 101 102<cr>

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 STAFF *<cr>

The Editor File Buffers


When the Editor process is invoked, the data being accessed is moved to a
special memory area associated with the port. This area is called the Editor file
buffers, because there are actually two portions. The item is moved to one of
these areas, which immediately becomes the current version of the item. After
making changes to an item, a Flip command must be issued. During a flip, the
current item gets copied into the other Editor file buffer. Even though it has
moved, it is still the current version. The other area is now considered the old,
or history, version of the item. As each flip occurs, this process is repeated.
This process accounts for certain messages that appear during use of the
Editor. Let’s examine the most common of these messages.
To begin with, there is a rule in regard to making changes to an item:
6
8
The
Changes are always made from the TOP down, as shown in the followingEditor
example.
(You needn’t try to enter this example; reading it is enough for now.)

>ED MD FLIP.TEST<cr>
NEW ITEM
TOP
- Kcr>

I means Insert; it is explained later in the chapter.

001+THIS IS A TEST OF<cr>


002+THE PICK Editor UTILITY AND<cr>
003+THE FLIP COMMAND.<cr>
004+<cr>
TOP
. F<cr>

This “flips” the item in preparation for our example.

TOP
-2<cr>
002 THE PICK Editor UTILITY AND
.R/UTILITY/FUNCTION<cr>
002 THE PICK Editor FUNCTION AND

R means Replace; it, too, is explained later.


Now, a change has been made to line 2 of the item. Changes may be made to
any line after line 2, but not before. The next example shows what happens if an
attempt is made to change above the line that has already been changed.

.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.

Entering the STAFF File Items


For this example, you will create items in the file called STAFF, which was
created in chapter 3, in the section on using file processors. The items to be
built will have the format shown in table 4-1.

Table 4-1 Format for items in the STAFF file


Attribute Access Attribute
Number Name
Description

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.

>ED STAFF 100<cr>


NEW ITEM
- Kcr>
001+MERTZ, FRED<cr>
002+128 W 12TH ST, APT 3B<cr>
003+NEW YORK<cr>
004+NY<cr>
005+10012 <cr>
006+2125556789<cr>
007+6777 <cr>
008+-8000 <cr>
7 009+155000 <cr>
0
The
010+<cr> Editor
TOP
. FI<cr>
MOO’ FILED.

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:

>ED STAFF 100<cr>


TOP
- Kcr>
OOO+SHOULD WE REALLY BE DOING THIS?<cr>
000+<cr>
-F<cr>
TOP
. L22<cr>
001 SHOULD WE REALLY BE DOING THIS?
002 MERTZ, FRED
003 128 W 12TH ST, APT 3B 004 NEW YORK 005 NY 006 10012 007 2125556789 008 6777
009 -8000 010 155000 EOI 010 . EX<cr) '100' EXITED.

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:

>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 . FI<cr> '100' FILED.

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:

>ED STAFF 101 102 103 104 105 106<cr>

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.)

101 NEW ITEM TOP

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>

The Insert mode is always indicated by the + prompt character im-


mediately to the right of a line (attribute) number reference. Before returning to
the Command mode, enter the data indicated in the following instructions:
1. On line 1, which is indicated by the prompt 001+, enter a person’s name in
the format: 001 +last name, first name followed by a <cr>. An example of
this is:

001+FLINTSTONE, FRED<cr>

2. On the next line, enter a street address. For example: 002+121


PLEISTOCENE PLACE<cr>

3. On attribute 3 (yes, line means the same thing as attribute) enter a city.
For example:
003+BEDROCK<cr>

4. Attribute 4 is a two-digit state abbreviation. For example: 004+CA<cr>


5. Attribute 5 is a ZIP or POSTAL code. For example: 005+92713 <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>

9. Attribute 9 contains the dollar amount of the person’s salary. Money


amounts in the PICK System are normally stored internally as the
number of pennies. Later, you will use various conversion codes to
display this amount with the decimal point and other features. Enter a
number between 100000 and 300000. For example:
009+175000<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

Press <cr> to leave the Insert mode:

010+<cr>

Depending on which version of PICK you are using, it may automatically


flip for you this one time, since the item is brand new. If this happens, you are
automatically positioned at the top of the item and the display shows:

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.

The latter is what should happen here. This should be displayed:

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.

Saving Items and Related Commands


After changes have been made to an item, it is necessary to write the item back
to the file from which it originated.

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.

>ED STAFF 100<cr>


TOP
. FI<cr>
•lOO* FILED.

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:

>ED STAFF 100<cr>


TOP
-FI 108<cr>
’IOS* FILED-

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:

>ED STAFF 100<cr>


TOP
■ FI 108<cr>
CMND?

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:

>ED STAFF 100<cr>


TOP
-FI (STATES) <cr>
’lOO’ FILED-

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:

>ED STAFF 100<cr>


TOP
.FI (STATES 108<cr>
•108’ FILED.

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:

>ED STAFF 100 101 102 103<cr>


100
TOP
.FIK<cr>
•100’ FILED.

> (now back at TCL)

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.

>ED STAFF 100<cr>


TOP
-FS<cr>
-EX<cr>
•lOO' EXITED.

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:

>ED STAFF 100<cr>


TOP
.R99/FRED/ETHEL<cr>
001 MERTZ, ETHEL
EOI 005
. EX<cr>
•lOO* EXITED.

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:

>ED STAFF 100<cr>


TOP
. L1<cr>
001 MERTZ, FRED
. EX<cr>
'100’ EXITED.

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.

>ED STAFF 100 101 102 103<cr>


100
TOP

7
9
Chapter
1
. EXK<cr>
'100' EXITED.

Notice that control returned directly to TCL, as evidenced by the >


prompt. When you previously requested multiple items with the ED command,
each one was accessed until all had been processed. The current item was
exited, and the Editor process was terminated.2

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

Special Note: The PICK-on-the-PC version does not provide the


RECOVER-FD command in the NEWAC file! This means that the next
exercise will not work unless you first perform the following TCL
commands:
>SET-FILE SYSPROG MD<cr>
'QFILE' ADDED.

>COPY QFILE RECOVER-FD<cr>


TO:(MD

1 ITEMS COPIED

The following steps illustrate the circumstances under which items may
be recovered after the FD command.

>ED STAFF 100<cr>


TOP
.FS 110<cr>

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>

ENTER ITEM-ID * 100<cr> MOO’ FILED.

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.

Attempting to recover item 110 is ineffective:

>RECOVER-FD<cr>

ENTER ITEM-ID *110<cr>

ENTER ITEM-ID *<cr> [4013 NO ITEMS PRESENT

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:

>ED STAFF 100<cr>


TOP
• ?<cr>
STAFF 100 L 000

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 ITEM LENGTH will most likely be different on your display,


since this a function of the number of characters that you enter. Remain in the
Editor on item 100 for the next example.

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

NY 10012 2125556789 6777 -8000 155000 EOI 009

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.

Line Positioning Commands


Now that you have learned how to get into and out of the Editor, it’s time to
learn how to move the line pointer while editing an item.

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 second example also instructs the Editor to go to a line number, in


this case, line 4, and display the line. The G is optional.

The T (Top) command is used to unconditionally position the line pointer at


the TOP of the current item, as shown in the following example:

The T (Top) -T<cr>


Command TOP

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.

The <cr> (Display


Next Line) Command The <cr> functions as a line advance. Each time it is used, the next attribute
of the item is displayed and the Editor line pointer is incremented by one:

• <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:

. N2<cr> 003 NEW YORK

The N2 command instructed the Editor to increment the current line


pointer by 2 and display the resulting line, which happened to be line 3. File
this item prior to entering the next example, using the FI command as follows:

. FI<cr>
’100' FILED.

Editor Commands Used to Alter Items


Up to this point, you have learned how to insert new attributes. This section
covers the instructions used to change and optionally delete existing attributes.

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.

Replacing a String of Text within a Line

When only a portion of a line needs replacement, there is no need to reenter


the entire line. Rather, a portion, or string, of characters within the line may be
replaced. The following general form applies:
.R/oldstring/ newstring/ < cr >
This reads: “Replace, on the current line, the first occurrence of old
string with new string.” It causes the Editor to scan the entire line for the first
occurrence of the old string and replace it with the new string. For instance:

> 1 <cr>
001 RUBBLE, BARNEY
-R/BARNEY/BETTY<cr>
001 RUBBLE, BETTY

Multiple Replace commands may be performed on the same attribute


without issuing the F(lip) command between each Replace command. Go
ahead and exit the item:
The
> EX<cr> •lOO’ EXITED. Editor

The Use of Delimiters in the Replace Command

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

and you tried to issue the Replace command as follows:

003 NEIMAN/MARCUS
.R/NEIMAN/MARCUS/NEIMAN-MARCUS<cr>

The Editor gets quite confused and displays the message:

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>

Replacing in More Than One Line

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:

>ED STAFF 100<cr>


TOP
-R99/T/X<cr>

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:

>ED STAFF 100<cr>


TOP
.RU99/T/X<cr>
001 MERXZ, FRED
002 128 U 12 XH SX, APX 3B
EOI 009
. EX<cr>
'100' EXITED.

The X (Cancel Last


Change) Command

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.

>ED STAFF 100<cr> TOP


. RU99/E/X<cr> 001 MXRTZ, FRXD 003 NXW YORK EOI 009 .X<cr> L 000 . F <cr>
TOP
. L3<cr>
001 MERTZ, FRED
002 128 W 12TH ST, APT 3B 003 NEW YORK . EX<cr> 'lOO' EXITED.

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:

Deleting One Line

All by itself, the DE command deletes the current line, as shown in the following
example:

>ED STAFF 100<cr>


TOP
- L3<cr>
001 MERTZ, FRED
002 128 W 12TH ST, APT 3B
003 NEW YORK
-DE<cr>
-F<cr>
TOP
. L4<cr>
001 MERTZ, FRED
002 128 W 12TH ST, APT 3B
003 NY
004 10012

The line is not actually deleted until after the Flip command is issued.
Remain in the Editor for the next example.

Deleting a Range of Lines

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>

Deleting a Line Containing a Specific String

The Delete command can be made conditional by specifying a string of


characters to search for in the general form of the command. This means that
only attributes containing the specified string of characters will be deleted. It
has the following general form:
.DE«/srh«g<cr)
The following example illustrates this form of the Delete command.

>ED STAFF 100<cr>


TOP
. DE99/Y<cr>
003 NEW YORK
004 NY
EOI 009
-F<cr>
TOP
. L3<cr>
001 MERTZ, FRED
002 128 W 12TH ST, APT 3B
003 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.

Merging Attributes from within the Current Item

For the first example, we’ll instruct the Editor to merge in 5 lines from the current
item:

>ED STAFF 100<cr>


TOP
. L5<cr>
001 MERTZ, FRED
002 128 W 12TH ST, APT 3B
003 NEW YORK
004 NY
005 10012
• ME5//<cr>
. F<cr>
TOP
. L10<cr>
001 MERTZ, FRED
002 128 W 12TH ST, APT 3B
003 NEW YORK
004 NY
005 10012
006 MERTZ, FRED
007 128 W 12TH ST, APT 3B
008 NEW YORK
009 NY
010 10012
. EX<cr>
'100' EXITED

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:

Item-id : 101 001 FLINTSTONE, FRED 002 121 BEDROCK WAY

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.

>ED STAFF 100<cr> TOP


.ME2/101 /1 <cr> -F<cr> TOP
. L5<cr> 001 FLINTSTONE, FRED 002 121 BEDROCK WAY 003 MERTZ, FRED 004 128
W 12TH ST, APT 3B 005 NEW YORK
. EX<cr> •100’ EXITED

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.

Merging from Another Item in a Different File

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:

>ED STAFF 100<cr> TOP


.ME99(ERRMSG B1OO<cr> EOI 004 . F<cr> TOP . L22<cr> 001 L 002 ELINE 003
A
004 H COMPILATION ABORTED; NO OBJECT CODE PRODUCED.
005 MERTZ, FRED
006 128 W 12TH ST, APT 3B 007 NEW YORK 008 NY 009 10012 010 2125556789 011 6777
012 -8000 013 155000 EOI 013

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 P command is the same as PO (P-zero) and is automatically defined


to issue an L22 command each time the Editor is activated.

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.

The only default prestored command is P0, or simply P, which defaults


to “List 22” lines. Remain here for the next example.

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}

In defining prestored commands, the P command is usually followed by


a number, which indicates the storage location to be defined. After the number
is a space, and this is followed by any legal Editor command. For example:

-PI RU999/FRED/BARNEY<cr>

Whenever you define prestored commands, it is always a good idea to


review them with the PD command prior to execution.

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>

This command has three parts:


1. It positions the line pointer to the Bottom (or end) of the item.
2. It moves the line pointer Up 22 lines.
3. It Lists 22 lines.
Effectively, Pl may now be used to display the last 22 lines of the item.
Again, note that the character between the legal Editor commands must
be an Escape, not a left bracket.

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:

>ED ORDERS *<cr>


10000
TOP
The
This activates the Editor and brings up the “first” item. Now thatEditor
the Editor
is invoked, the prestored commands may be defined:

-P1 3[R/FF/WF[R2<cr>

Let’s examine this much of it. In prestored command 1, three separate


things happen:
1. The line pointer is positioned to the appropriate line with the 3 command.
This legal Editor command is followed by an [ (Escape), to separate it from
the next part of the command.
2. A Replace command is issued, which replaces the first occurrence of FF
with WF. It, too, is followed by an Escape.
3. The third part of prestored command 1 is a reference to another prestored
command. That’s right, even though it hasn’t been defined yet, it’s about to
be.
Let’s move on into the next part:

-P2 R/BR/BJR[FI [P1 <cr>

Three things take place in prestored command 2. First, another Replace


command is issued, which replaces the first occurrence of BR with BJR.
Remember two important things here: the line pointer has been left
positioned at line 3 of the item in the previous prestored command. Multiple
Replace commands may be performed on an attribute without issuing a F(lip)
command in between. With these two replaces being issued against the data, at
least one of them should work.
The second step in prestored command 2 is to File the item. Here’s where
the tricky part comes into play. Remember that when the FI command is issued,
one of two things happens: either control returns to TCL if you have run out of
items, or control passes to the top of the next item in the file. If control “falls out”
to TCL, then the prestored commands evaporate. On the other hand, if control
passes to another item, we want the entire (prestored) process to repeat itself;
hence, the third step of prestored command 2: P1. This starts the process over in
each item that the Editor encounters. You have just constructed a miniature
“program” of sorts that will go through every item in the file and repeat this
process!
There is only one step remaining to perform, and that is to get it started:

-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:

PAGE 1 12:27:53 26 JUN 1992

STAFF.....

100
101
102
103

1
0
1
Chapter
5
104
105
106
7 ITEMS LISTED.

In its simplest form, an ACCESS sentence requires a verb (SORT) and a


filename (STAFF). Unless otherwise specified, all ACCESS reports are displayed on the
CRT screen.

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:

>SORT STAFF NAME<cr>

where:
SORT is the verb.
STAFF is the filename.
NAME is the output field.
This sentence produces the following report:

PAGE 1 12:28:34 26 JUN 1992

STAFF..... NAME............

100 NAIL, RUSTY


101 PIERCE, CARLA
102 POLITAN, COSMO
103 MORGAN, JULIE
104 PORTER, MIKE
105 DOWNEY, KELLY
106 HARRIS, FOREST

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

>SORT STAFF BY NAME NAME<cr>

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:

PAGE 1 12:29:15 26 JUN 1992

STAFF...... NAME............

105 DOWNEY, KELLY


106 HARRIS, FOREST
103 MORGAN, JULIE
100 NAIL, RUSTY
101 PIERCE, CARLA
102 POLITAN, COSMO
104 PORTER, MIKE

7 ITEMS LISTED.

In the preceding example, the data is sorted in alphabetic ascending sequence by


the data in the NAME field.

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.

>SORT STAFF BY NAME WITH STATE = "CA" NAME STATE<cr>

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.

This statement produces the following report:

10
3
Chapter
5
PAGE 1 12:30:30 26 JUN 1992

STAFF...... NAME............ STATE

106 HARRIS, FOREST CA


101 PIERCE, CARLA CA
104 PORTER, MIKE CA

3 ITEMS LISTED.

As before, we have a verb, a filename, and a sorting sequence. We also have a


selection criterion that limits the items to be accessed to those whose value in the
STATE attribute is equal to CA.
These examples merely skim the surface of ACCESS. In order to become truly
proficient in the use of ACCESS, it is important to learn about attribute-defining
items, since they comprise much of the ACCESS vocabulary.

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.

Table 5-1 Sample attribute-defining items


Attribute
Number
ACCESS Attribute-Defining Items
NAME ADDRESS CITY STATE ZIP

001 A A A A A
002 1 2 3 4 5
003 NAME ADDRESS CITY STATE ZIP

004 (null) (null) (null) (null) (null)


005 (null) (null) (null) (null) (null)
006 (null) (null) (null) (null) (null)
007 (null) (null) (null) (null) (null)
008 (null) (null) (null) (null) (null)
009 L T L L R
010 15 20 15 5 5

Here is an example of an ACCESS statement that accesses the STAFF file,


using the attribute-defining items in the STAFF dictionary file.

>SORT STAFF BY STATE BY NAME NAME STATE<cr>

PAGE 1 12:31:56 26 JUN 1992

STAFF. ... . NAME............ STATE

106 HARRIS, FOREST CA


101 PIERCE, CARLA CA
104 PORTER, MIKE CA
105 DOWNEY, KELLY M0
103 MORGAN, JULIE NC
102 POLITAN, COSMO NY
100 NAIL, RUSTY VA

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:

>ED DICT STAFF NAME ADDRESS CITY STATE ZIP<cr>

This instructs the Editor to edit these five items into the DICT of the STAFF
file.

NAME
NEW ITEM TOP - I<cr>

This places the Editor into Insert mode.

001 +A<cr>

This defines the current item as an attribute-defining item.

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:

>LIST STAFF NAME ADDRESS CITY STATE ZIP<cr>

where:

LIST is the verb.


STAFF is the filename.
NAME, ADDRESS, CITY, STATE, ZIP are the attributes to display.

The resulting report looks like this:

PAGE 1 12:34:32
26 JUN 1992 STAFF........... NAME.................. ADDRESS........ CITY

...........

STATE ZIP.. 106 HARRIS, FOREST 2345 CLOUD NINE DR

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:

>LIST STAFF NAME<cr>

There is a second class of ACCESS sentences called implicit reports.


Implicit reports are sometimes called “automatic” reports since the fields in the
report appear automatically, that is, without having to be requested.
Here’s the secret. When there are attribute-defining items in the dic-
tionary of a file using numeric item-ids starting with the number 1, and you do
not request any explicit items to display, ACCESS automatically prepares the
numbered items for output. To best illustrate this phenomenon, issue the
following sentence:

>SORT STAFF<cr>

This produces the output:

PAGE 1 12:27:53 26 JUN


1992

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>

The report now looks like:

PAGE 1 12:34:32
26 JUN 1992 STAFF........... NAME.................. ADDRESS......... CITY

...........

STATE ZIP.. 100 NAIL, RUSTY 20 LONE PINE TRAIL

RICHMOND

VA 23230
101 PIERCE, CARLA 1565 ORANGE AVE COSTA MESA
CA 92667

11
2
ACCESS

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
106 HARRIS, FOREST 2345 CLOUD NINE DR HOLLYWOOD
CA 92777

7 ITEMS LISTED.

Once the implicit attribute-defining items have been added to a dictionary,


they appear automatically whenever you LIST or SORT the file without requesting
any explicit attribute-defining items.

About the ONLY Modifier

To suppress the implicit attribute-defining items in an ACCESS report and thus


display only the item-ids, the ONLY modifier is used. This is one of the few
modifiers that ever precede the filename. It is illustrated in the next example:

>SORT ONLY STAFF<cr>

PAGE 1 12:27:53 26 JUN


1992

STAFF.............

100
101
102
103
104
105
106

7 ITEMS LISTED.

About X-Type Attribute-Defining Items

Earlier, in the discussion of the format of attribute-defining items, we mentioned


that three letters are valid for use in attribute 1 of an attributedefining item. These
three letters are A, X, and S. We have seen the use of A already. Now let’s look at
X. When attribute 1 of an implicit attributedefining item contains the letter X, the
11
3
Chapter
5
item will not display on the report. Suppose, for instance, that you do not want the
CITY item to display automatically each time the file is listed. This can easily be
accomplished by the following steps:

>ED DICT STAFF 3<cr>


TOP
.1<cr>
001 A
.R/A/X<cr>
001 X
-FI<cr>
•S’ FILED.

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.

PAGE 1 12:34:32 26 JUh 1 1992

STAFF... .. NAME............ ADDRESS.............. STATE ZIP..

100 NAIL, RUSTY 20 LONE PINE TRAIL VA 23230


101 PIERCE, CARLA 1565 ORANGE AVE CA 92667
102 POLITAN, COSMO 100 MADISON AVE NY 10012
103 MORGAN, JULIE BOX 1, ROUTE 7 NC 27930
104 PORTER, MIKE 4435 LAKE BLVD. CA 98764
105 DOWNEY, KELLY 2231 MISSION WAY MO 88876
106 HARRIS, FOREST 2345 CLOUD NINE DR CA 92777

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:

>SORT THE STAFF ITEMS<cr>

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:

>COPY MDAAAAAAAAA A<cr>


TO:SHOW SHOWING FIELD ATTRIBUTE DISPLAY DISPLAYING
TO TUBE FILE PLEASE<cr>

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).

>SORT THE STAFF FILE BY THE NAME ATTRIBUTE SHOWING THE


NAME TO THE TUBE PLEASE<cr>

PAGE 1 13:00:50 26 JUN 1992

STAFF............... NAME............................

105 DOWNEY, KELLY


106 HARRIS, FOREST
103 MORGAN, JULIE
100 NAIL, RUSTY
101 PIERCE, CARLA
11
5
Chapter
5
102 POLITAN, COSMO
104 PORTER, MIKE

7 ITEMS LISTED.

Of course, this report could have also been produced with the sentence:

>SORT STAFF BY NAME NAME<cr>

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.

Table 5-2 Symbolic and mnemonic forms of logical operator

Symbolic Form Mnemonic Form Description

= 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.

>SORT STAFF BY NAME WITH STATE = "CA" NAME STATE<cr>

PAGE 1 13:02:44 26 JUN 1992

STAFF...... NAME............ STATE


11
6
ACCESS
106 HARRIS, FOREST CA
101 PIERCE, CARLA CA
104 PORTER, MIKE CA

3 ITEMS LISTED.

>SORT STAFF BY ZIP WITH ZIP > "SOOOO" NAME ZIP<cr>

PAGE 1 13:03:41 26 JUN 1992

STAFF...... NAME............ ZIP..

105 DOWNEY, KELLY 88876


101 PIERCE, CARLA 92667
106 HARRIS, FOREST 92777
104 PORTER, MIKE 98764

4 ITEMS LISTED.

>LIST STAFF WITH ZIP BEFORE "20000" NAME ADDRESS ZIP<cr>

PAGE 1 13:04:51 26 JUN 1992

STAFF...... NAME............ ADDRESS................ ZIP..

102 POLITAN, COSMO 100 MADISON AVE 10012

1 ITEMS LISTED.

To enhance the selection power of ACCESS, more than one set of


selection criteria may be combined in an ACCESS sentence by separating each
individual selection criteria phase with either the AND or the OR logical
connective, also referred to as “Boolean” operators (after its inventor George
Boole).
When two selection criteria phases are connected with an AND con-
nective, both phases must be true in the data item in order for it to be selected
for ACCESS processing. By contrast, the OR connective permits either of the
selection criteria phases to be true for the data item to be selected for
processing. The following examples illustrate multiple selection criteria
phases.

>LIST STAFF WITH CITY = "HOLLYWOOD" AND WITH STATE =


"CA" NAME CITY STATE<cr>

where:

LIST is the verb.


STAFF is the filename. 11
7
Chapter
5
WITH CITY = "HOLLYWOOD" is the selection criterion.
AND is a logical connective.
WITH STATE = "CA" is the second selection criterion.
NAME CITY STATE tells what is to be displayed.

PAGE 1 13:06:00 26
JUN 1992

STAFF...... NAME............ CITY............. STATE

106 HARRIS, FOREST HOLLYWOOD CA

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.

>LIST STAFF WITH STATE "NY" OR WITH STATE


"CA" NAME STATE<cr>
PAGE 1 13:07:02 26 JUN 1992

STAFF. ... . NAME... ........ STATE

106 HARRIS, FOREST CA


101 PIERCE, CARLA CA
102 POLITAN , COSMO NY
104 PORTER, MIKE CA
4 ITEMS LISTED

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.

>LIST STAFFWITHSTATE = "CA"<cr>

>LIST STAFFWITHSTATE "CA"<cr>

Next, the default logical connective is an OR:

>LIST STAFFWITHSTATE = "CA" OR WITHSTATE ="NC"<cr>

>LIST STAFFWITHSTATE "CA" WITH STATE"NC"<cr>


11
8
ACCESS
Finally, when multiple OR selections are being made upon the same field, the
attribute-defining item does not have to be repeated.

>LIST STAFF WITH STATE = "CA" OR WITH STATE = "NC"<cr>

>LIST STAFF WITH STATE "CA" "NC"<cr>

A Note about Spaces in an ACCESS Sentence


Whenever you are unsure whether a space should or should not be in an
ACCESS sentence, it is important to remember that ACCESS never minds
when you have too many spaces, but sometimes chokes when you have too
few. The following examples illustrate both cases.
>LIST STAFF<cr> This works just fine.

>LISTSTAFF<cr> +-This doesn’t.

String Searching When an EQ or = is used in an ACCESS selection criterion, a character- for-


character match must occur between the attribute and the contents of the value
string. This sometimes poses a hindrance when only part of the field is being
searched, such as a last name in the NAME attribute. Hence, it’s time to
introduce ACCESS string searching. String searching is an extension of the
selection criteria and provides ACCESS with the ability to test part of an
attribute. For example, suppose the NAME attribute of a data item contains the
name “PIERCE, CARLA” and the following ACCESS sentence is issued:

>LIST STAFF WITH NAME = "CARLA" NAME<cr>

[401J NO ITEMS PRESENT.

The infamous NO ITEMS PRESENT message indicates that the string


being requested (CARLA) does not match exactly what was stored (PIERCE,
CARLA). With the use of the string searching characters [ and ] (brackets), the
comparison criterion is more flexible. Using the same data as before, examine
the next ACCESS sentence:

>LIST STAFF WITH NAME "[CARLA" NAME<cr>

This produces the following report:

PAGE 1 13:11:39 26 JUN 1992

STAFF......NAME.............

101 PIERCE, CARLA

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:

>LIST STAFF WITH NAME = "Pl" NAME<cr>

PAGE 1 13:13:14 26 JUN 1992

STAFF......NAME............

101 PIERCE, CARLA


102 POLITAN, COSMO
104 PORTER, MIKE

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:

>SORT STAFF BY NAME WITH NAME "[ER]" NAME<cr>

PAGE 1 13:15:37 26 JUN 1992

STAFF...... NAME...........

101 PIERCE, CARLA


104 PORTER, MIKE

2 ITEMS LISTED.

This example instructs ACCESS to accept any item as long as the


characters ER appear somewhere in the NAME attribute. Any number of
characters may precede or follow the string ER.

Rules on the Use of ACCESS recognizes a functional difference between single quotes and Quotes
double quotes in a sentence.

Double Quotes (” ”) Double quotes are typically used to surround value


strings in the selection criteria of an ACCESS sentence, as illustrated in the
following example:
12
0
ACCESS
>SORT STAFF BY NAME WITH NAME = "[PIERCE]"<cr>

Single Quotes (1 Single quotes are typically used to enclose item-


id strings, as in the following example, which instructs ACCESS to display a
specific item from the STAFF file.

>LIST STAFF '100' NAME ADDRESS<cr>

PAGE 1 13:16:21 26 JUN 1992

STAFF......NAME............ ADDRESS...............

100 NAIL, RUSTY 20 LONE PINE TRAIL

END OF LIST

Multiple item-ids may also be requested:

>LIST STAFF '100' '101' '105' NAME<cr>

PAGE 1 13:17:14 26 JUN 1992

STAFF......NAME............

100 NAIL, RUSTY


101 PIERCE, CARLA
105 DOWNEY, KELLY

3 ITEMS LISTED.

ACCESS will accept either double or single quotes interchangeably


around value strings or item-ids as long as they are the only type of quote
required by the sentence. ACCESS gets fussy, however, when both types of
quotes are required in a sentence; that’s when it starts enforcing the rules about
double quotes around value strings and single quotes around item-ids.

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.

>LIST ONLY STAFF ’lOl^cr)

>LIST ONLY STAFF = MOI^cr)

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.

>SORT ONLY MD = ’LISTl^cr)

PAGE 1 13:18:35 26 JUN 1992

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.

ACCESS Verbs and Examples


There is much more to ACCESS verbs than we have seen thus far. This section
provides a step-by-step introduction to the most commonly used ACCESS
Verbs.

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.

>COUNT STAFF WITH STATE = "CA"<cr>

3 ITEMS COUNTED

The COUNT verb in the previous example instructs ACCESS to dis-


play a count of all items in the STAFF file with the characters CA in the
STATE attribute.

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.

>LIST STAFF NAME ADDRESS<cr>

PAGE 1 13:19:29 26 JUN 1992

STAFF.....NAME............. ADDRESS...............

106 HARRIS, FOREST 2345 CLOUD NINE DR


100 NAIL, RUSTY 20 LONE PINE TRAIL
101 PIERCE, CARLA 1565 ORANGE AVE
102 POLITAN, COSMO 100 MADISON AVE

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:

>LIST-ITEM STAFF '101' '103'<cr>


PAGE 1 13:20:28 26 JUN 1992

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

SORT-ITEM functions like the LIST-ITEM command, but displays the


data sorted by the item-ids, although any attribute-defining item may be used for
sorting.

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:

>LIST-LABEL STAFF NAME ADDRESS CITY STATE ZIP (CI)<cr>

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.

The resulting list of labels looks like this:

HARRIS, FOREST 2345 CLOUD NINE NAIL, RUSTY 20 LONE


DR HOLLYWOOD CA 92777 PINE TRAIL RICHMOND
VA 23230

PIERCE, CARLA POLITAN, COSMO


1565 ORANGE AVE 100 MADISON AVE

COSTA MESA NEW YORK


CA NY
92667 10012

MORGAN, JULIE PORTER, MIKE


BOX 1, ROUTE 7 4435 LAKE BLVD.
NAGS HEAD LAKE ELSINOR

NC CA 12
5
Chapter
5
27930 98764

DOWNEY, KELLY 2231 MISSION WAY


ST. LOUIS MO 88876

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>

If the message [101 FI LE NAME MISSING appears on the screen, then


you do not have a pointer to this file and you will need to create it with the
CREATE-FILE command, as illustrated in the example below. If a message
indicates that the file is there, you can skip over the next two steps. In this
case, return to the TCL prompt character with a <ctl X>.

>CREATE-FILE DICT POINTER-FILE 11,1<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.

This is necessary to make your POINTER-FILE one of the special class


of files, known as pointer-class files (see chapter 2). This is the only time that
this EDIT operation will have to be performed on the POINTER-FILE file-
defining item, unless a new POINTER-FILE is created on another account
elsewhere in the system.

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:

>SELECT STAFF WITH STATE = "CA’^cr)

3 ITEMS SELECTED. >

The SELECT verb in the previous example instructs ACCESS to cre-

’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:

>LIST STAFF NAME STATE<cr>

PAGE 1 13:22:59 26 JUN 1992

STAFF...... NAME............ STATE

106 HARRIS, FOREST CA


101 PIERCE, CARLA CA
104 PORTER, MIKE CA

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:

>SSELECT STAFF BY NAME<cr>

7 ITEMS SELECTED.
>LIST STAFF NAME<cr>

PAGE 1 13:23:17 26 JUN 1992

12
7
Chapter
5
STAFF......NAME.............

105 DOWNEY, KELLY


106 HARRIS, FOREST
103 MORGAN, JULIE
100 NAIL, RUSTY
101 PIERCE, CARLA
102 POLITAN, COSMO
104 PORTER, MIKE

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:

>SSELECT STAFF BY NAME<cr>

7 ITEMS SELECTED.
>SAVE-LIST STAFF.LIST<cr>

List ’STAFF.LIST1 saved. 1 frame/s used.

In the previous example, SSELECT builds the list of item-ids again in


ascending NAME sequence. The SAVE-LIST verb saves the list in the
POINTER-FILE and, in this case, calls the list STAFELIST The message after
the command informs us that the list was saved and indicates the number of
frames used for its storage.

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>

PAGE 1 13:24:34 26 JUN 1992

STAFF..... NAME............ CITY............. ZIP..

105 DOWNEY, KELLY ST. LOUIS 88876


106 HARRIS, FOREST HOLLYWOOD 92777
103 MORGAN, JULIE NAGS HEAD 27930
100 NAIL, RUSTY RICHMOND 23230
101 PIERCE, CARLA COSTA MESA 92667

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>

[245J LIST ’TEMP.LIST* DELETED

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.”

ACCESS Tape Handling Commands


Data may be written to magnetic media with ACCESS, a feature useful for
incorporating selection criteria and sort sequences to data being copied to tape
for safekeeping.
This operation is called a T-DUMP. The types of tapes or disks that it
produces are also referred to as T-DUMPs, to distinguish this formatted media
from a PICK System SAVE format. (See chapter 8 for a description of tape
processes.)
Using T-DUMPs is an effective means of off-loading data to backup
media on a file-by-file basis. ACCESS provides the capability of retrieving the
data for generating reports, using the TAPE modifier in the ACCESS sentence.
This means that you can produce reports from this data without physically
reloading the data to the system.

Note: Many implementations of PICK now support multiple types of


magnetic media. For instance, the PICK-on-the-PC version supports floppy
disks and streaming-cartridge tapes. There are field-developed interfaces to
half-inch tapes for larger system backup requirements. This means that
before the next sequence of instructions may be used, you may have to find
a special verb on your system to direct the “tape” handling commands to
the correct device. The PC PICK version provides the SET-FLOPPY and
SET-SCT verbs for this purpose; the verbs for handling media tend to vary
from system to system. Remember the LISTVERBS command; it may help
you locate the appropriate verb for your system.

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.

This TCL command attaches the tape or disk to your process.

>T-REW<cr>
BLOCK SIZE: 500

The T-REW command rewinds the tape or disk to the beginning or


“load point.” This generally doesn’t take long with floppy disks.

>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.

The T-DUMP command simply instructs ACCESS to write all items in


the STAFF file to the media, in ascending order by item-id. The T- DUMP
command does not allow sorting. There is an S-DUMP command that does
allow sorting on any attribute-defining item.

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

Now use ACCESS to create a report from the media.

>LIST STAFF NAME ADDRESS TAPE<cr>

PAGE 1 13:29:15 26 JUN 1992

STAFF...... NAME............ ADDRESS...............

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

• lOZ* EXISTS ON FILE


^031 EXISTS ON FILE
^041 EXISTS ON FILE
• IOS* EXISTS ON FILE
• lOó* EXISTS ON FILE

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>

>T-LOAD STAFF (0) <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.

Read Me Before Continuing!


Go ahead and enter the rest of the attribute-defining items from Appendix E
to the dictionary of the STAFF file, BEFORE proceeding with the tutorials,
because some of them are used in the following examples.

ACCESS Modifiers and Options


Modifiers are used to add special output or reporting functions to an ACCESS
report. Most modifiers can appear anywhere in an ACCESS sentence, unless
otherwise indicated. Many modifiers have “option” equivalents, meaning that
a one-character option at the end of the sentence may be used in place of the
modifier. Options always appear in parentheses at the end of an ACCESS
sentence. An example of modifiers is shown below.

>LIST STAFF NAME ADDRESS COL-HDR-SUPP ID-SUPP LPTR<cr>

where:
NAME ADDRESS are the output fields.
COL-HDR-SUPP ID-SUPP-LPTR are the modifiers.

HARRIS, FOREST 2345 CLOUD NINE DR


NAIL, RUSTY 20 LONE PINE TRAIL
PIERCE, CARLA 1565 ORANGE AVE
POLITAN, COSMO 100 MADISON AVE

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:

>LIST STAFF NAME ADDRESS (CIP)<cr>

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.

>SORT STAFF BY STATE NAME BREAK-ON STATE<cr>

PAGE 1 13:31:22 26 JUN 1992

STAFF..... NAME............. STATE

101 PIERCE, CARLA CA


104 PORTER, MIKE CA
106 HARRIS, FOREST CA

★ ★★

105 DOWNEY, KELLY MO

***

103 MORGAN, JULIE NC

***

102 POLITAN, COSMO NY

***

100 NAIL, RUSTY VA

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.

>SORT STAFF BY STATE BY NAME STATE NAME<cr>

PAGE 1 13:32:19 26 JUN 1992

STAFF..... STATE NAME.............

106 CA HARRIS, FOREST


101 CA PIERCE, CARLA
104 CA PORTER, MIKE
105 MO DOWNEY, KELLY
103 NC MORGAN, JULIE
102 NY POLITAN, COSMO
100 VA NAIL, RUSTY

7 ITEMS LISTED.

This instructs ACCESS to sequence the data first by the ascending


STATE attribute, then within each STATE by the NAME attribute, and to
display the item-id, the STATE, and the NAME.

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.

>SORT STAFF BY-DSND ZIP NAME ZIP<cr>

PAGE 1 13:32:55 26 JUN 1992

STAFF...... NAME............ ZIP..

13
6
ACCESS

104 PORTER, MIKE 98764


106 HARRIS, FOREST 92777
101 PIERCE, CARLA 92667
105 DOWNEY, KELLY 88876
103 MORGAN, JULIE 27930
100 NAIL, RUSTY 23230
102 POLITAN, COSMO 10012

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.

>SOR STAFF NAME COL-HDR-SUPP<cr>


T

100 NAIL, RUSTY


101 PIERCE, CARLA
102 POLITAN, COSMO
103 MORGAN, JULIE
104 PORTER, MIKE
105 DOWNEY, KELLY
106 HARRIS, FOREST

Again, an option equivalent is provided:


>LIST STAFF NAME
106 (C)<cr> HARRIS, FOREST
100 NAIL, RUSTY
101 PIERCE, CARLA
102 POLITAN , COSMO
103 MORGAN, JULIE
104 PORTER, MIKE
105 DOWNEY, KELLY

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.

>SORT STAFF STATE BREAK-ON STATE TOTAL SALARY


BY (D)<cr>
PAGE 1 13:38:10 26 JUN 1992

STAFF..... STATE SALARY....

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:

HEADING ntext 'options"1


FOOTING "text 'options1"

13
8
ACCESS

The entire HEADING string is enclosed within double quotes, while


special options within the HEADING or FOOTING are enclosed within single
quotes. A list of some of the standard HEADING and FOOTING options is
provided in table 5-3. Once a HEADING or FOOTING is declared in an
ACCESS sentence, all normal or default page headings are turned off.

Table 5-3 Standard HEADING and FOOTING options

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

The following example illustrates an ACCESS sentence using both a


page heading and footing. This sentence may contain more characters than fit
on one line of your CRT. When you reach the right edge of the screen,
continue keying in the sentence as you normally would; the characters will
wrap around to the beginning of the next line. As long as the sentence is less
than 140 characters, you won’t run into any problems.

>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

STAFF. ..... NAME.... ADDRESS.............. CITY............


STATE ZIP.. ........

PIERCE, CARLA 1565 ORANGE AVE COSTA MESA


101 CA 92667
106 CA HARRIS, FOREST 2345 CLOUD NINE DR HOLLYWOOD
92777
104 CA PORTER, MIKE 4435 LAKE BLVD. LAKE ELSINOR
98764
DOWNEY, KELLY 2231 MISSION WAY ST. LOUIS
105 MO 88876

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

This is how the HEADING in this sentence works:



1
LC1 issues a linefeed (blank line) at the top of each page and causes the
following text string to be centered on the page. When more than one option is
needed, they may share the same set of single quotes.
■ STAFF FILE REPORT is the text to be centered.

1
L1 issues a blank line after the HEADING text.

This is how the FOOTING in this sentence works:


■ ’ LC ’ issues a blank line before the FOOTING text and causes the following
text and options string to be centered on the page.
■ PAGE 1PN1 prints the text PAGE, followed by the current page number of the
report, left-justified.
■ PRINTED AT ’TL* prints the text PRINTED AT, followed by the current system
time and date, followed by a blank line at the end of the page.

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>

STAFF... .. NAME................................ HIRE.DATE

100 NAIL, RUSTY 03/01/80


105 DOWNEY, KELLY 05/21/80
106 HARRIS, FOREST 07/18/83
104 PORTER, MIKE 04/16/89
102 POLITAN, COSMO 11/25/89
103 MORGAN, JULIE 03/16/90
101 PIERCE, CARLA 01/11/92

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.

>SORT STAFF BY NAME NAME PHONE ID-SUPP<cr>

PAGE 1 13:43:43 26 JUN 1992

NAME............. PHONE.........

DOWNEY, KELLY (314) 743-6543


HARRIS, FOREST (213) 876-5432
MORGAN, JULIE (919) 998-7755
NAIL, RUSTY (804) 667-8888
PIERCE, CARLA (714) 556-3691
POLITAN, COSMO (212) 446-8877
PORTER, MIKE (714) 643-6543

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>

>SORT STAFF (P)<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>

>LIST MD (N) <cr>

The TOTAL modifier produces a columnar total of a numeric field.


The TOTAL Modifier
>LIST STAFF TOTAL SALARY<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.

Miscellaneous ACCESS Verbs


This ACCESS tutorial has covered the primary ACCESS verbs. Several other
verbs are provided, but tend to be less frequently used. A brief explanation of
these verbs is provided in this section.

The STAT verb provides a total and an average of a numeric field.


The STAT Verb
>STAT STAFF SALARY<cr>

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.

>SUM STAFF SALARY<cr>

TOTAL OF SALARY = $11,195.00

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.

:SWD, :SWE, :SWX,


These verbs were put here to serve only one purpose: They change a file’s “D-
and :SWZ
pointer” to something other than a D. This is ostensibly so that the file pointer
can be copied or ignored on a backup. We strongly recommend that you leave
these verbs alone, since tinkering with file pointers can be dangerous.

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..

STAFF...... CODE A/AMC S/NAME......


CORRELATIVES TP MAX

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

PROC: The Stored


Procedure Language

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

One important and potentially controversial statement about the best


features of PROC is the fact that PROCs are no longer required in the PICK
system. They may be replaced with much more powerful PICK/BASIC
programs that execute TCL commands that were formerly only possible
through PROCs. PICK/BASIC offers many advantages over PROC, but that is
not the consideration here; rather, since most systems are still heavily infested
with PROCs, you need to know how to read and write them to get by in the
PICK world.

PROC Rules and Conventions


Creating a PROC is exactly like defining your own unique set of commands
that may be activated simply by entering the name of the PROC at the TCL
command prompt. For this reason, PROCs are usually activated by an item in
a user’s MD. A PROC can execute a series of TCL commands or can even
activate other PROCs. This is very often how menus are constructed; each
menu is a separate PROC in a file with the appropriate PROC instructions
necessary to “connect” them together according to the user’s request.
Just like PICK/BASIC programs, PROCs are usually constructed using
the standard PICK Editor.

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

If you were unfortunate enough to execute this PROC, you would


quickly discover a phenomenon known in programming as an infinite loop.
This PROC will continue until a) the Break key is pressed, b) the system is
powered down, or c) time as we know it ends.

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.

In most programming languages, user interaction is permitted. This is often called


The PROC Buffers terminal I/O, short for Input and Output. This means that the language must be able
to receive input from something—a keyboard, for example—and store the input so
that it may later be examined and acted upon. In a language like PICK/BASIC, when the user is prompted
to answer a question on the screen, the response entered is stored in a variable. The PICK/BASIC
program recognizes that input has been received and the input is stored in a location referred to by a
symbol or word, for later use in the program.
PROC was born without variables. Instead, it uses a series of buffers for
storing input and output. It’s important to know how and when these buffers are
used.
The four buffers used in PROC are
■ the Primary Input Buffer, sometimes called the PIB
■ the Secondary Input Buffer, which is hardly ever used
■ the Primary Output Buffer, usually called the Primary Output Buffer
■ the Secondary Output Buffer, most often called the SOB. This is also called
“the stack.”

The PROC Primary Input Buffer

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:

>SORT STAFF BY NAME

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.

The Secondary Input Buffer

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.

The Primary Output Buffer

It may be useful to think of the Primary Output Buffer as a construction area


for putting together commands that will subsequently be passed to TCL.
PROCs are used to issue any TCL command, rather than accepting the input
from the keyboard. Characters which will ultimately compose a command or
sentence are placed into the Primary Output Buffer. When construction of the
command or sentence is completed, it is then shipped off to TCL. Many
examples of the Primary Output Buffer are provided in this tutorial.

The Secondary Output Buffer (“the Stack”)

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

the answer to a question before it is asked. This is, metaphorically speaking,


exactly like the Secondary Output Buffer. It’s a place to hold the answers to
questions that have not yet been asked. Like the Primary Output Buffer, it’s a
place to put things that will eventually be passed to TCL. It’s just that the
things that are put here are sent to TCL before it asks for them.
This may sound kind of vague, but a good illustration is the SORT-
LABEL (ACCESS) command. Remember how you used this command? The
following example illustrates a TCL command that requires subsequent input.

>SORT-LABEL STAFF BY ZIP NAME ADDRESS CSZ (CI<cr>

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.

Writing Your First PROC!


PROCs may be very simple in nature. Basically, there is a finite set of PROC
instructions that are provided, but, depending on how they are put together,
they can become extremely complex. The following example contains a
sample PROC for you to construct.

>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

character. The following example shows the activation of the 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

When BOTH-REPORTS is activated, the first “executable” instruction


is found on line 2, where a transfer of control is indicated. This immediately
transfers control to the PROC called STAFF-REPORT in the PROCS file.
When STAFF-REPORT finishes, it automatically returns to the mainline
PROC and continues execution at the next line, where it finds yet another
transfer, this time to the PROC called CUSTOMER-REPORT in the PROCS
file. After completion of the CUSTOMER-REPORT, control again returns to
the mainline PROC and subsequently stops.
When a PROC runs out of executable instructions, or is instructed to
stop, control generally returns to TCL. But since you can activate any TCL
command, you can also force the process to “OFF” itself when a menu
completes. This is a technique frequently employed to keep users from leaving
menus and gaining access to TCL. Their only choice is to stay in the menu or
be logged off.

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.

This PROC simply provides a mechanism for the system to transfer to


the PROCS file and begin execution of the PROC called MENU that resides
there. This is the only entry that needs to be made into the MD. It is often
useful to keep all procedures gathered together in a file, such as our PROCS
file, to simplify maintenance.
The MENU PROC illustrates many of the PROC language features,
including the capability of performing terminal output, accepting input from a
keyboard, and performing conditional operations based on the keyboard input.

The Tutorial—First Steps


In the tutorial that makes up the rest of this chapter, the PROC instructions are
discussed as you enter them. Each subsequent PROC illustrates new
instructions and variations on instructions covered in earlier PROCs.
Enter each PROC as shown, paying special attention to entering it
exactly as it appears in the text.

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.

Clearing the Input 003+10 RI<cr>


Buffer (the RI
Command) In this example, the number 10 is a statement label, which is used later to cause
the PROC to “branch” to this line. The RI command causes the
PROC language to Reset the Input buffer, the area through which all input
passes into PROC. This ensures that nothing remains in the input buffer from

15
2
PROC

any previous use.

Formatting the 004+T (-1),(20,0),"CLASS PROC MENU"<cr>


CRT (the T
Command) The T (Terminal) command provides a means of formatting output to a CRT
screen. The T command has many functions. This example uses three of them:
1. (-1) causes the PROC to clear the CRT screen and position the cursor in
the upper left-hand corner of the screen (sometimes called the home
position).
2. (20,0) is called an “X, Y” coordinate. It causes the PROC to move the
cursor to (column) position 20 on line (row) 0, which is the top line of
the screen.
3. "CLASS PROC MENU" is a string of text to be displayed on the CRT
screen at the coordinates specified in the previous (20,0) function.

005+T (3,2),"1. THE H AND P COMMANDS"<cr>

In this example, the T command prints the text—1. THE H AND P


COMMANDS—at position 3 on line 2.

006+T (3,3),"2. THE STON (STACK ON) COMMAND"<cr>

This prints the text—2. THE STON (STACK ON) COMMAND—at


position 3 of line 3.

007+T (3,4),"3. THE D (DISPLAY INPUT) COMMAND"<cr>

This prints the text—3. THE D (DISPLAY INPUT) COMMAND— at


position 3 of line 4.

008+T (3,5),"4. THE IP COMMAND AND PATTERN MATCHING"<cr>

This prints the text—4. THE IP COMMAND AND PATTERN


MATCHING—at position 3 of line 5.

009+T (3,6),"5. AN INTERACTIVE PROC"<cr>

This prints the text—5. INTERACTIVE PROC—at position 3 of line 6.

010+T (3,20),"ENTER OPTION OR Q TO QUIT",+<cr>

This line prints the text—ENTER OPTION OR Q TO QUIT—at


position 3 of line 20. The plus sign (4-) causes the cursor to remain positioned
at the end of the current line on the CRT for the next IP (Input) command.

15
3
Chapter
5

Positioning the 011+S1 <cr>


Input Buffer
Pointer (the S The PROC S command Sets the input buffer pointer to a location in the Command)
PROC Primary Input Buffer. It establishes the storage location for the next input received from the
keyboard. The next IP (INPUT) command that is executed will place the keyboard input into the first
location of the Primary Input Buffer.

012+IP:<cr>

The IP (InPut) command suspends execution of the PROC until input is


received from the keyboard. The character following the IP command specifies
the character that will be printed on the screen as the prompt character for the
input. The input received from the keyboard is stored in the currently active
location in the active input buffer. Since the previous Set instruction positions the
pointer to the first location, that is presumably where the user’s response is to be
placed. Notice the use of the term “currently active” in reference to the current
location within the input buffer. Again, the “pointer” can be positioned manually,
and sometimes positions itself automatically.

Testing the 013+IF A1 = Q X<cr>


Response with IF
Once input has been received from the keyboard, the IF statement is used to
determine which action is to be taken, based upon the response provided. The IF
statement on line 13 literally reads: “If the first location (sometimes also called
argument) in the input buffer contains the letter Q, then perform the X command.”
The PROC X command is like a RETURN statement in PICK/BASIC. If
this PROC was not “called” with a “[filename procname]” linkage, then control
returns to TCL. If it was called by another PROC, then control returns to the next
line of that PROC. The purpose of this IF statement is to provide a means of
terminating (or quitting) the PROC. In the event that input buffer 1 does not
contain the letter Q, the PROC continues execution at the next line.
This structure is often referred to as an IF . . . THEN construct. You got
used to this principle early on in life. Remember being told, “IF you touch that
stove, THEN you will get burned” ? The same logic holds true here. The
statement is composed of three separate elements: first, the keyword IF, which
PROC interprets accordingly; second, the conditional expression, which is an
expression that evaluates to a true or false condition. The expression usually acts
on one of the input buffer locations. In this example, Al refers to the first location
of the input buffer. This is then compared to the letter Q, using the = symbol to
determine if the contents of the input buffer match this letter. When the
conditional expression evaluates to “true,” the third element of the statement is
performed. This may be any legal, single PROC command. In this case, we advise
the user that if he wants to quit the menu, then he should enter the letter Q. If
that’s what the user enters, then the X command is performed.
Notice that the IF statement in PROC has no provision for an ELSE
clause, unlike the PICK/BASIC IF statement. When the conditional expression
within the IF statement evaluates to false, the PROC “falls through” to the next
line and continues execution. This means that virtually every possible response
must be individually checked with an IF statement. Yet another terrific
argument for replacing PROCs with PICK/BASIC.

15
4
PROC

014+IF # A1 GO 10<cr>

The IF statement can be used to determine if the user has provided no


response, meaning that they have just pressed <cr >. This is called testing for a
null string.
The IF statement on line 14 literally reads: “If there is nothing in the first
location of the Primary Input Buffer, then go to the line that contains the
statement label 10 (which occurs on line 3 of the PROC).” The input buffer is
considered empty, or null, if a <cr> is entered without anything else. In the
event that input buffer 1 is not null, the next line of the PROC is executed.

015+IF A1 = 1 [PROCS EXAMPLE1J<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.

016+IF A1 = 2 [PROCS EXAMPLE2J<cr>

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.

017+IF A1 = 3 [PROCS EXAMPLES]<cr>

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.

018+IF A1 = 4 [PROCS EXAMPLE4]<cr>

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.

019+IF A1 = 5 [PROCS EXAMPLES]<cr>

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.

020+T "END OF REPORT. <cr> TO CONTINUE OR Q(UIT)",+<cr>

Line 20 is here to provide a pause at the end of each PROC being


executed by this MENU PROC. When each EXAMPLE PROC completes, it
returns control to the next line of the calling PROC. This means that this line,
and the following lines, will be executed at the end of each PROC.

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>

The IP command on line 22 suspends execution of the PROC until input


is received from the keyboard. The colon (:) character is used to indicate the
“prompt” character that appears next to the cursor on the screen. Any single
character may be used in place of the colon, which also happens to be the
default prompt character when it is not specified.

023+IF A1 = Q X<cr>

Again, a test is performed on line 23 to determine if the user wants to stop


the menu or have it restart. If the user enters a Q, then the MENU PROC stops;
otherwise, the statement on line 24 is executed.

Branching with the 024+G0 10<cr>


GO Command
The GO command on line 24 is used to transfer control to a numeric statement
label. This line reads: “Unconditionally transfer control to the line that contains
statement label 10,” which happens to occur at line 3.

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.

Example 1: Using the Primary Output Buffer


In its very simplest form, a PROC may be used to store a command such as an
ACCESS sentence, as in the following example:

>ED PROCS EXAMPLE1<cr> NEW ITEM TOP - Kcr> 001 +PQ<cr>


002+C EXAMPLE OF H AND P COMMANDS<cr> 003+HS0RT STAFF BY
NAME<cr>

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.

Processing the 004+P<cr>


Output Buffer (the P
Command)
Once the content of the output buffer is ready, it may be passed to TCL for
processing. The P (Process) command instructs PROC to do just that—it passes the string in the currently
active output buffer to TCL, where it is parsed and handled as though the command were typed in at the
TCL prompt. Since the output buffer now contains a legal ACCESS sentence, it

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.

To activate EXAMPLE 1, start the MENU.

>MENU<cr>

At the prompt ENTER OPTION OR Q TO QUIT, enter a 1 (one).

ENTER OPTION OR Q TO QUIT:1<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.

END OF REPORT. <cr> TO CONTINUE OR Q(UIT)Q<cr>

Example 2: Using the Secondary


Output Buffer
In Example 1, only the Primary Output Buffer was needed. Example 2 il-
lustrates the use of the Secondary Output Buffer, sometimes called the stack.
This involves the more obscure instructions and principles in the PROC
language.

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

Since the purpose of PROC is to prevent having to enter commands at


TCL, a means of providing answers to processes such as SORT-LABEL is
needed. That’s what the Secondary Output Buffer is used for. (Remember the
“Mighty Carnac.”)
In the EXAMPLE 1 PROC a string of characters that represents an
ACCESS sentence is placed into the Primary Output Buffer, which is sub-
sequently passed to TCL. This time, we are going to put into the Primary
Output Buffer a command (SORT- LABEL) that we know will ask subsequent
questions. Rather than having to enter the answers it wants from the keyboard,
we will place the answers in the SOB (Secondary Output Buffer). When
ACCESS needs the information, it will sense that the SOB is holding it, and go
talk to the SOB to see what it has to say.
This example illustrates some now-familiar commands, along with the
STON command used in multistage commands from a PROC.

>ED PROCS EXAMPLE2<cr>


NEW ITEM
TOP
- Kcr>
001+PQ<cr>
002+C EXAMPLE OF STON COMMAND<cr> 003+HS0RT-LABEL
STAFF<cr>

Line 3 moves the text, SORT-LABEL STAFF, to the Primary Output


Buffer.

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.

005+H NAME ADDRESS CSZ<cr>

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.

006+H COL-HDR-SUPP ID-SUPP<cr>

Just as when we execute this ACCESS command from TCL, ACCESS


still requires modifiers to suppress the automatic page heading and the display
of the item-ids on each label. This moves the text, COL-HDR- SUPP ID-
SUPP, to the end of the Primary Output Buffer. The Primary Output Buffer
now contains the text, SORT-LABEL STAFF BY ZIP NAME ADDRESS
CSZ COL-HDR-SUPP ID-SUPP.

15
9
Chapter
5

Activating the 007+STON<cr>


Secondary Output
Buffer (STON) The first half of this command is now ready for processing. We still need to
somehow store the label parameters so that they may be passed automatically to
ACCESS. We call this special storage area the Secondary Output Buffer, or SOB
for short. The STON (STack ON) command causes any subsequent H commands
to be routed to this area. When ACCESS (or any other process) requires
parameters, PROC tells ACCESS that the SOB is holding the information.
ACCESS then interrogates the SOB for the data.

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>

This terminates (returns) the EXAMPLE2 PROC and causes control to


return to the MENU PROC.

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

Instructions that require the STON command


SELECT, SSELECT, QSELECT
GET-LIST
SORT-LABEL, LIST-LABEL
COPY, COPY-LIST
ED, EDIT
FORMAT, REFORMAT
SAVE (used by the FILE-SAVE and ACCOUNT-SAVE PROCs)
Instructions that sometimes require the STON command
RUN (used to activate PICK/BASIC programs) programname (ditto, but
with a cataloged program name)

Example 3: Inputting and


Displaying Data
The PROC language provides a means for conditional execution of statements
via the IF statement. The EXAMPLES PROC illustrates how data is input into
the PIB (Primary Input Buffer) and later displayed. It also shows how a PROC
may be used to perform specific commands based on the input.

>ED PROCS EXAMPLES<cr> NEW ITEM


TOP
. Kcr> 001+PQ<cr> 002+C EXAMPLE OF D COMMAND<cr> 003+T
CrB<cr>

Alternate The T command is used to control terminal functions. Arguments used


Arguments (the T with the command are separated from it by a space, and the PROC lan-
Command) guage tends to be particular about requiring this space. The arguments themselves are
separated by a comma. The two arguments used here are C and B. The C clears the CRT screen. The B
causes the CRT’s audible alarm to sound. Some call this the bell. Later you will see many other
arguments that are available with the T command, including other ways of clearing the screen and the
ability to position the cursor at specific coordinates on the screen.

004+RI <cr>

The RI instruction is used to reset the Primary Input Buffer. It is not


uncommon to find this near the beginning of many PROCs. The reason is that
when the PROC is started at TCL, the entire TCL Primary Input Buffer is
passed to the PROC Primary Input Buffer. The word MENU is actually placed
into the first entry of the PROC PIB. By clearing the PIB, there is no chance of
unexpectedly finding something there, in the event that the PIB is interrogated
later for the absence or presence of something.
This might seem kind of odd, but PROCs often ask questions of the user
that require something like a Yes or No response. The classic example is when a

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.

005+T (3,3)/'ENTER YOUR FIRST NAME", + <cr>

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.

More on the IP 007+IP: <cr>


(Input) Command
The IP instruction suspends execution of the PROC until input is received from
the keyboard, followed by a <cr>. The response provided is placed into the first
location of the PIB, since the input pointer was last positioned there with the SI
command. The colon (:) character that follows the IP instruction designates the
prompt character that will appear on the screen to the immediate left of the
cursor at input time. This also happens to be the default character used when the
prompt character is not specified. Any single character may be substituted for the
prompt character, although using the ! character tends to make people nervous.

008+IF # A1 X<cr>

The IF statement performs a conditional expression. The conditional


expression is created by examining the contents of PIB storage locations and
determining if certain conditions exist. In the IF statement, the “A” expression
is used to look into a PIB location. It is often, but not always, followed by a
number indicating which location is to be interrogated. When the number is
left out, it looks at the currently active storage location in the PIB.
Line 8 reads: “If the first location (Al) of the PIB contains a null, which

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.

009+T (3,5) /’ENTER YOUR LAST NAME", + <cr>

Line 9 displays ENTER YOUR LAST NAME at position 3 of line 5 and


again leaves the cursor positioned at the end of the text.

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>

Line 11 issues another Input command. This statement again suspends


execution of the PROC until input is received from the keyboard. Input is
placed into the second location of the Primary Input Buffer.

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.

013+T (3,7),"FIRST NAME:",(35,7),+<cr>

Line 13 displays the text, FIRST NAME, at (column) position 3 of line


(row) 7, then moves the cursor to position 35 of line 7 and holds it there.

Displaying PIB 014+D1 <cr>


Locations (the D
Command) The D command Displays the contents of either a specific location in the PIB, or the
entire PIB. It is usually employed as a debugging tool, to examine the contents of
the PIB prior to execution of a TCL command constructed from the PROC. The D
command may be followed by a number that indicates the location to be displayed,
or by the number 0 (zero), which displays all locations in the PIB. Line 14 displays
the contents of the first location within the PIB at the current cursor position
(35,7). This displays the string of characters you entered when the PROC
requested your first name. Note that the + character may also be used with the D
command to hold the cursor position, as seen earlier with the T instruction.

015+T (3,9),"LAST NAME:",(35,9),+<cr>

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.

017+T (3,11),"FIRST AND LAST NAME:",(35,11),+<cr>

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>

Line 19 terminates EXAMPLE3 and returns to the MENU PROC.

020+<cr> . FI<cr> 'EXAMPLES' FILED.

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

Example 4: The “IF” Statement and


Branching
This example shows more functions of the IF statement, specifically the
function of pattern matching, that is, verifying that the keyboard input adheres
to a specific format. This is typically used to ensure that the operator provides
valid input to the PROC.

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.

>ED PROCS EXAMPLE4<cr> NEW ITEM


TOP
. Kcr>
001+PQ<cr>
002+C TEST OF PATTERN MATCHING AND THE IF STATEMENT<cr>
003+10 RI<cr>
004+T C,(3,3),"ENTER SOCIAL SECURITY # (nnn-nn-nnnn) "f+ <cr>
005+S1 <cr>
006+IP: <cr>
007+IF # A1 GO 10<cr>

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

ment, or an internal PROC subroutine reference (like a PICK/BASIC GOSUB


statement), which uses the form: [ ] statementlabel.

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).

Pattern Matching 009+IF A1 = (3N"-"2N"-"4N) GO 20<cr> in the IF Statement


Line 9 illustrates for the first time the principle of pattern matching. This is the
process of verifying that the input received adheres to a specific format. The
pattern match string is composed of special pattern match operators and/or
literal text strings. The available pattern match operators are

N for numbers
A for alphabetic characters A through Z (upper- and lowercase)
X for “wildcards,” which may be any character

Each of the pattern match operator characters are preceded by an integer


number, which indicates the exact number of the particular character that will
be accepted. For example, if the pattern match string is 4N, only four numbers,
no more or less, can be accepted. Pattern match strings may be combined
together and must be enclosed within parentheses.
Line 9 reads: “If the first location of the PIB contains a string that
consists of three numbers, a hyphen, two numbers, a hyphen, and four numbers,
then transfer control to statement label 20,” which happens to occur on line 11.
If the string does NOT match this pattern, then the next line of the PROC is
executed, which unconditionally transfers control back to statement label 10
(line 3).

010+GO 10<cr>

Line 10 is executed only if the pattern match fails on line 9. It causes an


unconditional transfer of control to statement label 10. The logic for lines 9 and
10 effectively states that there are only two ways around this prompt: by
“bailing out” by entering a Q to quit, or by providing a legitimate Social
Security number.
Pattern matching is useful in PROC to filter out unwanted input from
operators. Without validation of keyboard input, it might be possible to pass an
invalid response into a process, proving the old “GIGO” adage: “Garbage In,
Garbage Out.” Pattern matching is discussed again in Example 5.

011+20 T (3,5),"YOUR ENTRY WAS ",+<cr>

Line 11 displays the text, YOUR ENTRY WAS, at position 3 of line 5,


and leaves the cursor at the end of the text.

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>

This terminates the EXAMPLE4 PROC and returns to the MENU


PROC.

014+<cr>
-FI<cr>
•EXAMPLES FILED.

Example 5: Interactive Mode


This example illustrates how the PROC language may be used in an inter-
active mode. The ACCESS sentence contained in the next PROC lacks all of
the information required for successful execution. For this reason, the PROC
prompts the operator for the required (missing) information, and passes the
input into the ACCESS sentence prior to being processed. This is perhaps the
most common use of the PROC language.

>ED PROCS EXAMPLES<cr>


NEW ITEM
TOP
- Kcr>
001+PQ<cr>
002+C PATTERN MATCH AND PARAMETER MOVEMENT<cr>
003+10 RI<cr>
004+T (5,5)/’ENTER BEGINNING DATE (MM/DD/YY) ", + <cr>
005+S1 <cr>
006+IP:<cr>
007+IF # A1 GO 10<cr>

Line 7 reads: “If input buffer 1 contains a null (or <cr>), then go to
statement label 10,” which occurs on line 3.

008+IF A1 # (0N1X0N1X0N) GO 10<cr>

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.

009+HSORT STAFF WITH DOB >=<cr>

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:

011+H BY DOB NAME DOB AGE<cr>

Line 11 moves the text, BY DOB NAME DOB AGE, to end of the Primary
Output Buffer.

012+H HEADING "’LC’STAFF REPORT PAGE,PL,,,<cr>

Line 12 moves the text, HEADING "'LC’STAFF REPORT PAGE ’ PL ’", to


the end of the 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.

>COPY MD ACCOUNTING (T)<cr>

This command may output one of two things:


1. If there already is a logon PROC, you should be able to read it.
2. If the account contains a file pointer as a by-product of creating the
account, it will appear as:

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.

When you LOGTO an account, or log on to it from the Logon Please


screen, the PICK System automatically checks for that account name in the
SYSTEM file. When and if it finds it, that account MD is checked to see if
there is a PROC by the same name. If it is found, it is automatically executed;
otherwise control falls out to TCL on the new account. Naturally, any PROC
instruction may be included in the logon PROC, but this example simply
illustrates its use for starting up the MENU PROC.

16
9
Chapter
5

Other PROC Commands


The most frequently used PROC commands have been discussed in this
chapter tutorial, but several others are worth mentioning. Following is a short
synopsis on less frequently used commands.

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

This is called a local PROC subroutine because the PROC commands


are physically contained within the PROC itself. An external

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

If this PROC were executed, SSELECT would determine that no items


met the selection criteria. As a result, error message # 401 (NO ITEMS
PRESENT) would be present in the error message buffer. By immediately
testing for this condition prior to the execution of the rest of the PROC, a
logical test can determine whether or not the PROC should continue.

Moving Literal Text


into the Input Buffer
In nearly all of the examples in this tutorial, the IP (Input) statement is used to
get text from the operator. PROC has the ability to “force” text strings into the
PIB through the use of the IH instruction. This is useful for supplying default
answers to questions, as illustrated in the following example:

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 __________

When a SELECT or SSELECT is performed, it displays the message that


some number of items were selected. The SAVE-LIST command displays the
fact that the list was saved and the number of frames used to save the list. In
the previous example, both of those messages are not displayed.
The PP command is used to Print and Process the command in the
Primary Output Buffer. The net effect is that the command being executed
appears on the screen while it is being executed. This command is marginally
useful.
The PW command is preferred to the PP command. It means Print and
Wait, meaning that the command in the Primary Output Buffer is displayed on
the screen, then the PROC stops to await a response, prompting with a ?
character. Several responses are available:
■ An X causes the PROC to stop without performing the command, and
returns control to TCL.

17
2
PROC

■ A response of S causes the PROC to Skip this command and continue


with the next executable PROC statement.
■ Finally, a response of <cr> causes the PROC to go ahead and perform
the statement being displayed.
The PW command is extremely useful when writing and debugging
PROCs, and should be replaced with a P statement prior to placing the PROC
into production.4
Finally, the PX command is also a tool used during the debugging
phases of writing PROCs. Its purpose is to Process and then Stop, regardless
of whether or not the PROC has more executable instructions. This means that
after performing the TCL command, control returns to the TCL prompt
character.

Summary and Controversy


The PROC language has been part of the PICK System for years. The PROC
language was originally provided to automate TCL commands. Later, after
PICK/BASIC was added to the system, it became sort of a “bridge” between
ACCESS and PICK/BASIC. Its primary purpose was to execute a series of
TCL commands, and frequently was used to perform SELECTS and
SSELECTs on data files, passing the resulting “lists” of item-ids into
PICK/BASIC programs for processing. This was necessary, due to the fact that
BASIC couldn’t “talk” to ACCESS without stepping all over itself. As a
result, PROCs have proliferated like weeds throughout PICK systems.
In the several years since the original version of this book, PROC
became redundant. This was accomplished by the introduction of the EX-
ECUTE statement in PICK/BASIC. The EXECUTE statement provided
PICK/BASIC with the ability to perform any TCL command and pass its result
back into the program, all without losing its mind.
So, here you are. You’ve just learned the PROC language and now you
learn that it is not needed?! ? Well, the truth is that it will probably be part of
the PICK System for quite some time; however, we encourage people to learn
PICK/BASIC and to write procedures with that powerful language, for several
reasons:
1. PICK/BASIC is much more powerful and feature laden, with a rich
complement of statements and functions, not the least of which is the
ability to read and write to files. (O.K., we admit that some PROCs use
“user-exits” to do this, but support for these is almost nonexistent. User-
exits make PROCs even more difficult to interpret by the programmer.)
2. Writing in PICK/BASIC helps to standardize the system as all programs
and procedures are written in just one language. As a by-product of this,
users have one less programming language to learn.
3. PROC is limited in the scope of its statements and functions.

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

A Little To provide adequate coverage of the PICK/BASIC language, an entire book is


Commercial needed. This chapter was excerpted with permission from PICK/BASIC: A
Message Programmers Guide by Jonathan E. Sisk, published by TAB Books, Inc. of
Blue Ridge Summit, PA. It is intended to provide a general introduction to
some of the principles of programming in PICK/BASIC and to provide a sample of what’s
in store for you when you decide to further your exploration into this powerful language.
Both of the authors of this book conduct training seminars on all aspects
of the PICK System, including PICK/BASIC. The best way to learn PICK is
to attend a class. Information on classes and seminars in selected cities around
the world is available from:
Jonathan E. Sisk Steve VanArsdale The Consultant Co.
JES & Associates, Inc. 414 Can-Dota
PO Box 19274 Irvine, CA 92713 (714) Mt. Prospect, IL 60056 (312) 259-7224
548-2388

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

’The remainder of this chapter is excerpted from PICK/BASIC: A

17
8
PICK/BASIC

Programmers Guide by Jonathan E. Sisk, with permission of the


publishers, TAB Books, Inc. menus, but generally these functions
are done in ACCESS and PROC, respectively.
The many other features of this unique language are
covered throughout this text. The bottom line is, if you have used
a “standard” BASIC, you will find PICK/BASIC to be a much
more elegant alternative. If you have not used standard BASIC,
congratulations; here’s your chance to be exposed to a
sophisticated, flexible, and easy-to-learn programming language.
This book deals with “generic” PICK/BASIC code; that is,
the programs in the tutorials are designed to be used on any
implementation of the PICK System, unless otherwise
mentioned in the text.

If You Have Worked on Other Systems


Most systems that impose the fixed length field and record
structure require individual programs to be stored in separate
source code files with each 80-character record representing a
single line or statement of source code.
Since PICK does not impose this fixed-length mentality,
source programs in the PICK System are stored differently.
Typically, a single file is created to contain multiple programs of
a certain application, such as AR.BP to contain “Accounts
Receivable” programs. Each item in the file is a program. Each
attribute (or field) in the (program) item is a single PICK/BASIC
line of source code. Remember that PICK has only one file
structure, which accommodates variable-length items, attributes,
values, and sub-values. The only constraint is that the total
length of the program cannot exceed 32,257 characters, which is
too much to place in one program, anyway.
Because each attribute (field) is variable length, there is no
concept of a continuation character, used by other systems when
a given line of source code exceeds the space allocated within
the 80-character constraint. Also, there is no requirement in
PICK/BASIC source programs that statements start in the 7th or
8th column position of the line and end in the 72nd or 73rd
column. PICK/BASIC source statements may begin in any
column position.
The concept that multiple source programs (items) are
stored in the same source code file affects how you indicate to
the various utilities which program you want to edit, compile,
and run. Basically, you have to tell the various utilities that the
program is in a certain file and has a certain name (item-id). This
is no different than the way PICK manipulates items in other
files; there is only one file structure.
Experienced programmers, just beginning to understand

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

of the week, the Julian date, or the date of the quarter.


The storage of time has a similar “internal conversion”
scheme. Hours and minutes are internally converted to an integer
number that represents the number of seconds that have elapsed
since midnight.
In this unusual world of PICK, items (records)
automatically expand and contract and no attempt is made to
“type” the data stored in fields. This means that an attribute in an
item, which had previously been used to contain customer
address information, may be changed easily and without
breaking rules, to accommodate a numeric value, such as the
person’s age.

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.

As a rule of thumb, however, it’s recommended to put only one state-


ment per line. This makes programs more visually appealing and, conse-
quently, easier to maintain. The one exception to this rule is when a comment,
or remark, is included on a source line, as illustrated in the next example:

COUNTER = 0 ; ★ SET NUMBER OF ITEMS COUNTER TO ZERO

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:

SECONDS. PER. HOUR = 3600

This replaces the current value of the variable SECONDS.PER.HOUR with


the value 3600. 3600 is the constant.
Literal constants are strings enclosed in single or double quotes, or
between “backslashes” (\). Any number of characters, up to the maximum
item size of 32K, may occur between the quotes or backslashes. For example:

REPORT.TITLE = "PHYSICAL INVENTORY REPORT"

18
2
PICK/BASIC

18
3
Chapter
5
where "PHYSICAL INVENTORY REPORT" is the literal constant.

PRINT.LINE = ’NAME* : : ’PAY RATE*

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"

where "0" is the literal constant.


Purely numeric values do not have to be enclosed in quotes. The
equivalent statement is:

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

Assignment Variables may be assigned an initial value in a program. For example:

ITEM.COUNTER = 0

This assigns the value of 0 (zero) to the variable named


ITEM.COUNTER. This is also known as the process of replacement. When a
variable name appears on the left side of an equal sign, then the result of
whatever appears on the right side of the equal sign will be placed there.
Typically, what appears on the right side is a function that produces some result,
or a literal string enclosed in quotes, or even a number, as in the previous
example.
This phenomenon is extremely important. There are many instances of
using assignment throughout a program.
When the program assigns the value of 0 (zero) to the variable
ITEM.COUNTER, the variable is initialized. Initializing means that the program
is making the first reference to a variable. The result of not initializing a
variable before it is referenced is the error message C B10 J VARIABLE HAS
NOT BEEN ASSIGNED A VALUE; ZERO USED ! It’s a good idea to
systematically assign initial values to variables.
The most important aspect of variables with regard to initializing is that
they must be declared on the left side of an equal sign before referring to them on
the right side of an equal sign. Examples 7-1 and 7-2 illustrate the correct and
incorrect approaches to initializing variables.

Example 7-2 Failure


to initialize a variable
014 TOTAL.AMOUNT = TOTAL.AMOUNT + CHECK.AMOUNT

Example 7-1 003 TOTAL.AMOUNT = 0


Properly initializing a
variable •

007 PRINT "ENTER DOLLAR AMOUNT OF CHECK " :


008 INPUT CHECK.AMOUNT

014 TOTAL.AMOUNT = TOTAL.AMOUNT + CHECK.AMOUNT


TOTAL. AMOUNT appears at line 14 for the first time in example 7-2,
and therefore generates the runtime error message, CB10J VARIABLE HAS NOT
BEEN ASSIGNED A VALUE; ZERO USED !

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.

Functions that require no expressions:

COL1()
COL2()
TIME()
DATE() TIMEDATE( )2

Functions that require one expression:

RND(« umeric. expression)


INT (numeric, expression)
NUM(« w meric, expression)
ASC]I(string. expression)

Functions that require two expressions:

COUNT (string, expression, string, expression)


SlR(string. expression, numeric, expression)
ICONV (string, expression, conversion.expression)
OCONV(string, expression, conversion.expression)

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

Functions that require four expressions:


EXTRACT(arroy.varzaWe, numeric.expression, . . .
. . . numeric.expression, numeric.expression) DELETE(array.variable,
numeric.expression, . . .
. . . numeric.expression, numeric.expression)
Functions that require five expressions:
INSERT(arraj.varzaWe, numeric.expression, . . .
. . . numeric.expression, numeric.expression, . . .
. . . string.expression)
^EPLNCE^array.variable, numeric.expression, . . .
. . . numeric.expression, numeric.expression, . . .
. . . string.expressiori)

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:

IF CHECK.AMOUNT > 0 THEN CHECK.TOTAL = CHECK.TOTAL + CHECK.AMOUNT

The > symbol is a logical operator that means “greater than,” and + is an arithmetic
operator for addition.

IF PART.NUMBER MATCHES "1A4N" THEN TITLE = TITLE : " " : RESPONSE

MATCHES is a relational operator that checks patterns of characters, and the


colon (:) is a string-modifying operator that means concatenate. Concatenate is
another way of saying “link together.”

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:

TOTAL = TOTAL + NEXT.AMOUNT

This is an arithmetic expression, one that adds the two (presumably


assigned) variables together and stores the result in a variable called TOTAL.

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:

ELIGIBLE.FOR.RETIREMENT = (AGE >= 65)

This is a known as a relational, logical, or Boolean expression. Boolean


expressions use the operators >, <, > = , <=,=, < >, > <, and #. Any such
expression evaluates to a numeric non-zero (normally 1) if true and 0 (zero or
null) if false. This statement assigns the value 1 to the variable
ELIGIBLE.FOR.RETIREMENT if the variable AGE is greater than or equal
to 65; otherwise, it is assigned a 0 if not true.
The parentheses not only clarify, but also determine, the meaning of the
statement. By the way, if you don’t put the parentheses around the expression,
then it will not work on some versions of PICK.
Logical or Boolean expressions are used within conditional expressions
such as the IF . . . THEN and LOOP . . . UNTIL constructs. They also have the
property of being able to stand alone in an assignment statement.
This process of combining expressions continues in an ever expanding
combination of syntactical permutations when parentheses and the logical
operators OR and AND are included. The following illustrates the use of
parentheses and logical operators.

ELIGIBLE.FOR.RETIREMENT = (AGE >= 65)


IF ELIGIBLE.FOR.RETIREMENT AND (YEARS.WORKED > 1 AND YEARS.WORKED < 10)
THEN
RETIREMENT.GIFT = "TIMEX WATCH"

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:

PRINT ABS(INT(X * Y))

In evaluating expressions, the computer starts from the innermost set of


parentheses first and from there works outward. This example has (X * Y) at its
core. X and Y themselves are nuclear tokens, because they are variables that
already contain results by assignment or calculation. When X is multiplied by Y,
the result itself becomes the nuclear token for the INT function. The INT function
retrieves the INTeger portion (the numbers to the left of the decimal point) of the
number, which becomes the nuclear token for the ABS function, which retrieves
the ABSolute value on a numeric expression. The absolute value is always the
positive value of a numeric variable; hence the ABS function “strips” off the lead-
ing minus sign if the result is a negative number.

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.

Variable Naming Conventions

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.

File Variables: filename.FILE A file variable is used to refer to a DATA


or DICT file and is always declared in an OPEN statement. The suggested
convention is that the variable name of the file is always followed by the
suffix, .FILE

OPEN "CUSTOMER-FILE" TO CUSTOMER.FILE...

Item-Id Variables: variableJD An item-id variable is a variable used to


contain an item-id (what many people call a key). It’s a good idea to always
follow the name of the variable with the literal, .ID.

INPUT CUSTOMER.ID

Array Variables: arrayname.ITEM or ar rayname. ARRAY An array


variable is the resting place for an item read through a READ or MATREAD
statement. The suggested convention is that the name of the array is always
followed by the suffix, .ITEM.

MATREAD CUSTOMER. ITEM FROM


CUSTOMER.FILE,CUSTOMER.ID...

Flag Variables: variable.FLG A flag variable typically contains one of


two possible conditions: 0 (zero) or (numeric) non-zero (normally 1). These
end with the suffix, .FLG.

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.

The PICK/BASIC Tutorial

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.

>CREATE-FILE BP 11,1 11,1 <cr>

[417] FILE ’BP' CREATED. BASE = fid. MOD = 11. SEPAR = 1


[417] FILE 'BP' CREATED. BASE = fid. MOD = 29. SEPAR = 1

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.

This program is now ready to be compiled, which must be done before it


may be run.
Note: The instructions in this program test the current system time.
Earlier in this chapter, the internal representation of time was discussed. The
important point to remember is that time is stored internally as the integer
number of seconds past midnight. 43200 is 12:00 (noon), which is 12 (hours)
multiplied by 3600 (seconds per hour).
The command line, ED BP HELLO, entered at the TCL command
prompt (>), instructs the PICK System to activate the Editor. The program
goes into the file called BP, and its item-id is (or will be) HELLO.

Since PICK stores individual programs as items (records) in a single program


Notes on Program file and PICK does not limit the length of the item-id 5 (program name), you
Names (Item-Ids) may use descriptive item-ids. One warning, however. Never use a program
name that has the same name as the source file in which it will reside!
Following are some invalid program names:

>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

>ED AR.BP AR.BP

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:

>BASIC BP HELLO (L)<cr>

001 IF TIMEO < 43200 THEN PRINT "GOOD MORNING"


002 IF TIMEO > 43200 THEN PRINT "GOOD AFTERNOON"
003 END
Program ’HELLO’ Compiled. 1 Frame/s Used.

The listing may be routed to a printer by including the P option.

>BASIC BP HELLO (LP)<cr>

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

>RUN BP HELLO<cr> GOOD MORNING

(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:

PRONT "HELLO THERE"

2. Quotation marks, used in printing or assigning literals, are “unbalanced,”


meaning an odd number exists. For example:
PRINT "HELLO THERE

3. A GOTO or GOSUB statement instructs the program to transfer control


to a nonexistent statement label. For example:
001 10 PRINT "HELLO"
002 GOTO 99
003 END

4. An IF . . . THEN or IF . . . THEN . . . ELSE statement isn’t properly


terminated with an END directive, or worse, is terminated with too many
END directives. For example:
IF QTY.ON.HAND < REORDER.POINT THEN
PRINT "PRODUCT NEEDS TO BE REORDERED!"
(Here is where the END statement should have been.)

(and the code goes on . . . )

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.

PICK/BASIC Program Example


In the program that follows, many of the most fundamental principles of
programming in PICK/BASIC are discussed. Topics, statements, and functions
covered include: comments (remarks), PROMPT, PRINT, INPUT, ABS,
SQRT, ALPHA, NUM, END, IF . . . THEN, STOP, the null string, and LEN.
Enter the program in example 7-3. An explanation of each instruction
and technique follows. Most of the spaces in the tutorial programs are put there
for visual esthetics. The easier a program is to read, the easier it is to maintain.
Generally, they are optional. There are some cases, however, where they are
not. To be safe, enter the programs exactly as shown in the examples.

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:

PLEASE ENTER YOUR NAME:


Explanation of A feature of this textbook is the detailed explanation of each new topic or
Instructions derivative of former topics, following the tutorial programs. The instruction,
or group of statements and instructions, is repeated in the text prior to the
narrative that explains it. This technique minimizes the amount of
backtracking that you will have to do in order to examine the actual source
instructions.

Note for FORTRAN and COBOL programmers learning PICK


After a quick visual scan of the program EX.001, or any other
PICK/BASIC program, you will notice the total absence of data typing via
implicit assumptions by virtue of the first character in the data/field names.
Nor do you find the ever-present DATA DIVISION that all COBOL
programs must contain. Remember that no data typing exists in the PICK
system. A field is a field is a field.

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 1: The Program


Name 001+* EX.001
It’s a good idea to use line 1 of each program to repeat the program name. The
reason for this is that programs that are considered “external” subroutines
require a SUBROUTINE statement on this line, so you can’t always count on
this line being available. Note: Instead of placing a remark on line 1, you can
put the word PROGRAM, followed by the program name. This little-known
feature has been present for years in the PICK System.

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.

003+* mm/dd/yy: date last modified


Line 3: The Date Last
Modified
This is the last date the program was changed. Follow a consistent date format,
such as mm-dd-yy. For example:

003+* 12/15/97 : date last modified

Line 4: The Author’s 004+* JES : author’s initials


Initials
These are the initials of the last person who changed the program, which is
useful for finding and persecuting the guilty party.

Line 5: A “Spacer 005+*


Remark Line”
This provides a visual separation of the comment section from the actual
executable code of the program.

The PROMPT 006+ PROMPT


Statement
The PROMPT statement defines the character to display on the screen when an
INPUT statement is executed. Any expression that produces a

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).

The PRINT 007+ PRINT


Statement and
Blank Lines The PRINT statement is used to print data on the screen or printer. By itself on
a line, it simply skips a line on the output device.

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.

More on the PRINT 011+ PRINT ’’PLEASE ENTER YOUR NAME ” :


Statement
This PRINT statement displays PLEASE ENTER YOUR NAME on the screen

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 012+ INPUT NAME

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.

The IF Statement and 017+ IF NAME = ” ” OR NAME = “QUIT” THEN STOP


Null Strings
The IF statement is used to determine whether or not a certain condition
applies prior to continuing execution. IF statements are always followed by
conditional expressions. These are expressions that evaluate to either true or
false. In the PICK System, true is represented by a numeric nonzero, normally
1, and false is represented by 0 (zero) or null.
This IF statement checks to see if the variable NAME contains any data.
The portion of the statement NAME = " " reads: “If the NAME is null (which
means that you simply pressed <cr>), then the conditional expression is true.”
If you entered a <cr>, then the variable NAME will be cleared (set to null). In
PICK/BASIC, the null string is represented as " " or ’ ’. The : (colon) prompt
character previously defined in the PROMPT statement appears to the
immediate left of the cursor.
Here are some sample conditional expressions:

IF ANSWER = "Y" THEN ...

IF AMOUNT > 0 THEN ...

IF OLD.AMOUNT U NEW.AMOUNT THEN ...

Note: The situation where a null value, which is typically represented


by two quotation marks together with nothing between them, is equivalent to 0
(zero) occurs in other places in the PICK System. If, for example, you attempt
to add up fields that normally contain numeric data, such as money amounts,
and one or more fields contain nulls (or any other non-

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:

001 A = " "<cr>


002 B = 0<cr>
003 IF A = B THEN PRINT "YES" ELSE PRINT "NO"<cr>

On most versions of PICK, this will print NO.

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:

IF ANSWER = "Y" OR ANSWER = "" THEN ...

This statement indicates that if either of the conditional expressions evaluates to


true, then the statement (or statements) after the THEN initiator will be
executed.

IF BALANCE.DUE > 0 AND INTEREST. F LAG = "Y" THEN ...

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.

The STOP 017+ IF NAME = ”” OR NAME = "QUIT” THEN STOP Statement


The STOP statement immediately terminates the execution of a program. If the
program was activated from TCL, by entering >RUN BP EX.001 or >EX. 001,
then control returns to the TCL prompt character. If, however, the program
had been executed from a menu, perhaps written in the PROC (procedure)
language, then control automatically returns to the menu. The ABORT
statement is first cousin to the STOP statement. The difference is that when
ABORT is executed, control returns unconditionally to TCL, regardless of
how the program was activated.

Printing 018+ PRINT "HELLO THERE " : NAME


Expressions
This prints the literal, HELLO THERE, on the screen, then prints the current value
of NAME, meaning whatever you entered previously at the prompt to enter
your name. Note that there is a space after the word THERE to force a space
between the word THERE and your name.
This print expression was composed by a concatenation operation. First
the literal, HELLO THERE, was concatenated (or linked) to the current value
of the NAME variable. Once the concatenation was complete, the entire
expression was printed.

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 NUM Function


030+ IF NUM(RESPONSE) THEN
031+ PRINT "ABS VALUE OF " : RESPONSE : " IS " :
ABS(RESPONSE)
032+ PRINT "THE SQUARE IS " : RESPONSE * RESPONSE
033+ PRINT "THE SQUARE ROOT IS " : SQRT(RESPONSE)
034+ STOP
035+ END

The NUM function is one of several “intrinsic" functions considered to be self-


standing “conditional expressions"—i.e., expressions that evaluate to either a
zero or null for false, or a numeric non-zero (normally 1) for true.
This statement tests the string received in RESPONSE to determine
whether or not it is a number. In the PICK System, a number is a string of
digits with an optional period or decimal point. If it is determined to be a
number, then all of the statements, up to and including line 34, are executed. If
the response is not a number, then execution continues after the next END
statement (which occurs on line 35).
An important note: Some, but not all, versions of the PICK System
consider null to be numeric. This adds a level of complexity to your IF
statements when determining whether something is numeric, because it must
additionally be checked to see if it is null or not null, as the case may be.
If you did enter a number, then the following statements are executed:

The ABS Function


031+ PRINT "ABS VALUE OF " : RESPONSE : " IS " :
ABS(RESPONSE)

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:

ABS VALUE OF -123.45 IS 123

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


033+ PRINT "THE SQUARE ROOT IS " : SQRT(RESPONSE)

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 039+ IF ALPHA(RESPONSE) THEN


040+ PRINT "THE LENGTH OF " : RESPONSE : " IS " :
LEN(RESPONSE)
041+ STOP
042+ END

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 LEN Function

040+ PRINT ’’THE LENGTH OF ” : RESPONSE : ” IS ” :


LEN(RESPONSE)

If you enter a string of characters that is composed entirely of alphabetic


characters at the INPUT statement on line 24, then the LEN statement on line
40 will be executed. The LEN function determines and reports the number of
characters in a string or string expression. Suppose you enter ARISTOTLE into
the variable RESPONSE. Line 40 then displays

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 IF . . . THEN Construct

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

If the conditional expression evaluates to true (numeric non zero), then


the single statement after the THEN initiator is executed and program
execution continues on the next line of the program. If it evaluates to false
(zero or null), program execution continues from the next line.
Since statements may be delimited by a semicolon, the next form of this
occurs as:

IF conditional.expression THEN statements statement} statement

When this conditional expression evaluates to true, all of the statements


following the THEN initiator are executed. There is no logical limit to the
number of statements that may be put here, but as a rule of thumb, use the
multi-line form of the IF statement when more than a few statements are to be
executed.
The single-line form is useful when there is only one statement to
execute upon evaluation. There are, however, many instances in programs
where many statements need to be performed on a true condition. Rather than
trying to place these all on one physical line with semicolons between the
statements, the next logical extension to the IF . . . THEN construct is used:

The Multi-Line IF . . . THEN Construct

This has the general form:


IF conditional.expression THEN
statement statement 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) . . .

IF conditional.expression THEN<cr> (starts level 2) statement(s)


...
IF conditional.expression THEN<cr> (starts level 3)

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.

Concluding the PICK/BASIC Chapter


This example illustrated a small portion of the instructions and techniques in
the PICK/BASIC language. In order to successfully manage any PICK system,
you will eventually need to thoroughly understand this language. We hope that
this little venture piqued your interest.

20
7
Controlling Peripherals

One of the PICK System’s best features is portability; it is designed to run on


many different computers. As a result, there are several universal commands
for controlling peripheral devices.

The Terminal Control Commands:


TERM and SET-TERM
Two special commands are provided with the PICK System to allow different
types of CRTs to be handled on the system at the same time. Since each
terminal manufacturer uses different software in performing CRT functions
such as “clear to end-of-line,” special interface programs are embedded in the
PICK System.
Each type of terminal is stored in a table. When a special function is
requested, the system determines which type of terminal is in use, then looks
up in the table the appropriate signals to send to the CRT. The TERM and
SET-TERM commands are provided for this purpose. These commands set the
type-of-terminal parameter for a particular port, or for the entire system.
In addition to the type-of-terminal, other parameters are set with these
commands, including the width and depth of both the CRT and the printer.
PICK uses these parameters to determine how to format each page of output
being routed to the CRT or printer.
The TERM command changes the terminal and printer characteristics of
2
0
7
Chapter
5
the port from which the command was issued. The SET-TERM command, by
contrast, is used to establish the terminal and/or printer characteristics for
every port on the system. The characteristics defined with SET-TERM are
automatically assigned to each user after logging on to the system. The general
form of both commands is as follows:

>TERM 1,2,3,4,5,6,7,8,9 <(R)>

where:

1 is termwidth, the number of print positions (columns) on the terminal.


2 is termdepth, the number of lines (rows) on the terminal.
3 is lineskip, the number of blank lines at the bottom of each page of
output.
4 is If delay, the number of delay characters (nulls) output to the screen
after a carriage return or linefeed (usually zero).
5 is#delay, the number of delay characters (nulls) output to the screen or
printer after a formfeed (usually 8 or 21).
6 is backspace, the decimal number of the ASCII character to echo to
the terminal when the backspace key is pressed.
7 is printwidth, the number of print positions (columns) on the printer.
8 is printdepth, the number of lines (rows) on the printer.
9 is termtype, an alphabetic code that indicates the kind of terminal
being used.
(R) is an option that “displays results” of changes to any of the
parameters.
The number to the left of the parameter indicates its position within the
TERM or SET-TERM command. The termtype parameter requires a little more
explanation. The terminal type codes are single alphabetic character codes that
normally coincide with the first character of the manufacturer’s name. It varies
according to the PICK licensee, but some of the more common terminal type
codes are listed below:
A Adds D Datamedia

I IBM Monochrome Display L Lear Sigler


M Ampex P Pertec
R Regent (Adds) T Televideo
V Adds Viewpoint W Wyse

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>

Changing Printer PRINTER


Width and Depth 132 60

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:

>TER 80,60 (R) <cr>


M

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.

>TERM ,,,,,,132,62 (R)<cr>

TERMINAL PRINTER PAGEWIDTH: 79


132
PAGEDEPTH: 23 62
LINESKIP: 1
LF DELAY: 2
FF DELAY: 2
BACKSPACE: 8
TERMTYPE: V

This changes the printer characteristics to 132 columns by 62 rows and


leaves all other settings intact.

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:

>TERM R79,22 (R)<cr>

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

Magnetic Media Commands


Each PICK System is capable of using magnetic media for backup. Many
PICK implementations now offer more than one form of backup magnetic
media, including half-inch magnetic tape, quarter-inch streaming cartridge
tape, floppy disks, and removable hard disks.
PICK computers that offer multiple backup media, such as floppy disks
and quarter-inch streaming cartridges, typically have implementation-specific
verbs for indicating media choice prior to attaching it. For instance, in the
PICK-on-the-PC version, there is a verb called SETFLOPPY to attach the
floppy disk drive as the “tape” device.
This tutorial assumes that only one type of magnetic media is in use. The
messages that are displayed by the tape-handling commands vary from system
to system. Those shown in the following examples are from the PICK-on-the-
PC version, using a floppy disk as the “tape” device.
Before you begin this section, please obtain the appropriate type of
magnetic media for your system and load it on the appropriate backup device.

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

If the media is attached to another user’s process, the following message


will appear:

TAPE ATTACHED TO LINE linenumber

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>

This command provides a U (for Unconditional) option, with which the


media may be detached from someone else’s process. This is shown in the
following example:

>T-DET (U) <cr>

The U option unconditionally detaches the media unit, regardless of


who has it attached. It is better to check with the other user prior to using this
option, as it may adversely affect a process currently being performed by that
user.
When the T-DET command is attempted while the media is not attached
to your process, the following message is displayed:

[1147] NOT ATTACHED!

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:

L 01F4 12:00:00 26 JUN 1992 STAFF 01

21
3
Chapter
5
where:

The letter L indicates that this is a label.


01 F 4 indicates the block size (in hexadecimal) at which the media was
written.
12:00:00 is the time at which the media was written.
26 Jun 1992 is the date at which it was written.
STAFF is the filename from the process that created the media.
The blank spaces between STAFF and 01 are for an optional 37-
character user-supplier message.
01 is the hexadecimal reel number, used when data requires more than
one tape or disk.

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>

Rewinding diskettes can be surprisingly fast.

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>

BLOCK SIZE: 500


1 106
2 100
3 101
4 102
5 103
6 104
7 105

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>

BLOCK SIZE: 500


1 100
2 101
3 102
4 103
5 104
6 105
7 106

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.

Because there could be multiple files on the media, a series of T- FWD


commands might be needed to move to the end of recorded data. That’s why
the T-EOD command exists.

Moving to the End of


The T-EOD command is used for two purposes: to move to the end of the
Recorded Data (T-
recorded data, in order to write more data at the logical end of the previous
EOD)
data, and to verify the integrity of the media. If the command successfully
reaches the end of the recorded data, it usually means that no media errors have
been encountered. Before testing the command in the following example, issue
a T-REW command to position the media back to the beginning.

>T-EOD<cr> BLOCK SIZE: 500 [921 END OF RECORDED DATA 2


21
5
Chapter
5
FILE(S)

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.

Example 8-1 >T-REW<cr>


Reading the media BLOCK SIZE: 500

>T-READ<cr> BLOCKSIZE: 500


L 01E4 12:00:00 26 JUN 1992 STAFF 01

RECORD = 1

1 :106AHARRIS, FOREST 2345


A
CLOUD NINE DR HOLLYWOOD CA:
A A

51 : 92777A2138765432A5678A 9000A140000 [100 NAIL, RUS:


A A A

101 :TY,A20 LONE PINE TRAILARICHMONDAVAA23230A804667888:


151 :8A4444A-4444A157500A[101APIERCE, CARLAA1565 ORANGE: 201 :AVEACOSTA
MESAACAA92667A7145563691A8777A 7000A1770:
251 :00A[102APOLITAN, C0SM0A100 MADISON AVEANEW YORKANY:
301 : 10012 2124468877 8000 2000 180000 [103 M0RGAN, JU: 351 :LIE BOX 1,
A A A A A A A A

ROUTE 7ANAGS HEADANCA27930A9199987755A8: 401 :111A-1000A155000 [104AP0RTER,


A

MIKEA4435 LAKE BLVD.: 451 :ALAKE ELSINORACAA98764A7146436543A7777A


2000 15000:
A

RECORD = 2

1 :0A[105AD0WNEY, KELLYA2231 MISSION WAYAST. LOUISAMO:


51 : 88876 3147436543 4525 1500 160000 [ X[[[[[[[[[[[:
A A A A A A A

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>

BLOCK SIZE: 500

>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.

The spooler is always established as the last process on the system. To


avoid using up one of the terminal ports, the spooler is started on the line after
the last physical port (e.g., if the system has eight ports, numbered 0 through 7,
the spooler will be on line 8).

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.

Restarting the Spooler


(:START- SPOOLER) The :STARTSPOOLER command is automatically issued during the PICK
cold-start process. This procedure is used when the system is initially started on
a particular computer.
The effect of the command is to bring the spooler back to a normal state
of operation. The reason that this is destructive is because it is also available as
a TCL command that can be issued with options, as we will shortly see.
When the : STARTSPOOLER command is issued by itself (with no
options), it restarts the spooler and retains all of the spooler entries in the
queue.
In its normal (nondestructive) form, the command functions as shown in
the following example. Don’t Do This! Just read and observe.

> :STARTSPOOLER<cr>
SPOOLER STARTED.

Two powerful options may be used with the :STARTSPOOLER


command. The C and I options are a last resort because they cause the spooler
queue to be initialized, losing all of the previous spooler entries. This wouldn’t
be so bad if it were not for the fact that none of the overflow space used by the
lost spooler entries is returned to the overflow table. So, use with caution. To
be more specific, the C option “clears” (deletes) entries that are not hold files. It
also deletes any printers that were started. The I option is the equivalent of
“nuking” the spooler. It blows away everything: normal entries, hold entries,
and printers.

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.

’This is called SP-STARTLPTR on Ultimate Systems.

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>

This starts parallel printer 0 as printer number 0 (on formqueue 0),


skipping 0 pages between output.

>STARTPTR 0,0,0,S2<cr>

This starts serial printer 0 as printer number 0 (on formqueue 0) on port 2,


skipping 0 pages between output.

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:

>BLOCK-PRINT HI THERE (P)<cr>

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>

We can now issue the LISTPEQS command to interrogate the spooler,


as shown in the following example:

>LISTPEQS<cr>
PRINTER LIST ELEMENTS 26 JUN 1992 09:30:34
# STAT LK LN STATUSES CP FO FRMS DATE TIME ACCT

1 8880 0 HC 1 0 12 06/26/92 12:00:00 CLASS


1 QUEUE ELEMENTS. 12 FRAMES IN USE.

The columns have the following meanings:


# The job number assigned by the spooler, typically the
next higher number than the last entry.
STAT The status of the entry—redundant, since a more de
scriptive status follows three columns later.
LK The linkage order of the print jobs or spooling se
quence, which contains the number of the next job that
will print when this report is completed. Since it is not
enqueued for output, there is no linkage.
LN The line (port number) from which the job was gen
erated.
STATUSES The status codes for the entry, which have the following
meanings:
A Available
C Closed; while entries are being sent to the spooler, they
are considered open until the process completes. Once
turned over to the spooler, they are closed and may
now be processed.
H Hold file; indicates that the entry is a hold file, meaning
that it will be “held” until manually spooled and/or

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.

CP The number of copies remaining to spool; changes


dynamically as copies are printed.
FO The formqueue to which the output is assigned.
FRMS The total number of frames used by the entry.
DATE/TIME The date and time the entry was created.
ACCT The account from which the entry was created.

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
>

PRINTER ASSIGNMENTS 12:00:00 26 JUN 1992

PRINTER OUTPUTQUEUES PAGE DEV OR STATUS


TYPE NUMBER SKIP LINE#

SERIAL INACTIVE

The columns have the following meanings:


PRINTER TYPE Either serial or parallel
NUMBER The printer number assigned
OUTPUT QUEUES The formqueue number assigned
PAGE SKIP The number of pages to eject between reports
DEV OR LINE # The physical address for parallel or port number
for serial
STATUS The current state of the device

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
>

LINE # STATUS COP FORM


0 IES 1 #
1 HS 111 0
2 PP 111 0
3 PP 111 0
4 PP 0
5 PP 0
6 P 0
7 0
8 0
9 0
0

22
3
Chapter
5

The columns in this display have the following meanings:


LINE# The port number
STATUS The current spooler assignment options
COPIES The number of copies requested
FORM # The formqueue to which output is routed

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.

About the SP-ASSIGN Options

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>

This sets the output routing specifications to default.

Specifying the Number of Copies

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.

Displaying Spooler Assignment: The ? Option

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

“Choking” Spooler Output: The C Option

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

“Immediate Output”: The I Option

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.

Directing Output to Specific Formqueues: The F Option

Earlier, the concept of formqueues was discussed. Formqueues provide a


means of organizing the reports within the spooler. On many systems, all
reports are routed to one formqueue. There doesn’t have to be a printer
attached to a formqueue in order to route output to it. The F option directs
output to a specific formqueue number, and has the general form illustrated in
the following example:

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.

Creating Hold Files: The H and S Options

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.

Directing Output to Magnetic Media: The T Option

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

LINE STATUS COP FORM


# IES #

0 TS 1 0

Combining Multiple Options

The following examples offer ways in which more than one option may be

22
6
Controlling
Peripherals
used simultaneously.

>SP-ASSIGN 2F1?<cr>

LINE STATUS COP FORM


# IES #

OP 2 1

>SP-ASSIGN 3F1HS?<cr>

LINE STATUS COP FORM


# IES #

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 DISPLAY Prompt

The SP-EDIT command accesses the first available hold file and prompts with
the message:

DISPLAY (Y/N/S/D/X/(CR))?-

These options have the following meanings:


Y Displays the first (virtual) page (depending on the frame size used by
your system). After the display, control transfers to the
STRING prompt.
N Transfers control to the STRING prompt.
S Transfers control to the SPOOL prompt.
D Transfers control to the DELETE prompt.
X Transfers control directly to TCL.

(CR) Transfers control to the next spooler entry or to TCL if no more entries
are present.

22
7
Chapter
5

The STRING Prompt

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.

The SPOOL Prompt

After the STRING prompt, the next prompt deals with spooling the output to a
device.

SPOOL (Y/N=CR/T/TN/F)?~

The SPOOL prompt options have the following meanings:


Y Enqueues the report for output to the device.
N (Or <cr>) Transfers control to the DELETE prompt.
T Spools the report to the terminal screen in PAGE mode, requiring a <cr> at
the end of each page. When the report ends or a <ctl-X> is issued,
control returns to the SPOOL prompt.
TN Spools the report to the terminal screen in NOPAGE mode. When
completed, control returns to the SPOOL prompt.
F Spools the report to a data file in print image. The spooler prompts for a file
and an item-id.

The DELETE Prompt

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.

Although it consists of only a dozen or so commands, the spooler is one


of the most complex (and maligned) pieces of software in the PICK System.
Enough details exist to write an entire book on this one topic. This chapter was
intended to provide you with a general knowledge about the spooler and
enough information to get output to one or more printers. For a real lesson in
humility, try reading the standard system documentation on this subject.

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.

The User’s View


There are three distinct ways to look at the PICK System, according to the
perspective of the viewer. Each is important to an effective understanding of
the system. The first is the “user’s view,” shown in figure 9-1.

2
3
0
The Logical Computer

Figure 9-1 The user’s view of the PICK environment

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.

The Physical View


The more technical view of the system is oriented toward the actual com puter
hardware. This is the “physical view,” so called because it deals with the way
the PICK System uses real computer memory (or RAM), and disk and tape
storage. We discuss the PICK System processes from the physical view
because that is sometimes the best way to understand what is occurring.

Virtual Memory: More Room on the


Inside Than on the Outside
The TCL surface and the ACCESS, PROC, and PICK/BASIC processing
levels are simple to use because they are supported by much more complex
processes within the operating system. Down in the core of the PICK

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).

REAL COMPUTER LOGICAL COMPUTER

VIRTUAL
WORKSPACE

Programs and data are stored on the disk and


copied into main memory on the programmer’s
instructions. The amount of RAM dictates the size
of programs and the amount of data that can be
processed.

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.

Figure 9-2 More room on the inside than on the outside

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 TRACK SECTOR

Figure 9-3 Disk, track, and sector = frame-id

When a user or the system requires a frame of data or program code, or


even PICK System code, the virtual memory software determines where the
data is located and copies the required frame from disk into a frame-sized
buffer in main memory. The next time data or program code is required, the
virtual memory software checks to see if the necessary frame is already in
memory. If the frame is already in place, the system provides the memory
location to the requesting process; otherwise the virtual memory software
“pages in” the appropriate frame from disk, as shown in figure 9-4.

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

The Logical View: Inside the


Looking Glass
Indicative of the PICK System’s ease of use, the PICK technician is usually a
superuser rather than a professional with formal training. The superuser is an
experienced user who is either adequately trained (usually by us) or diligently
self-taught, and has become skilled at operating a PICK System. In addition to
the view of an environment of integrated processes, the superuser has an
additional perspective, based upon what is reported by the PICK System as
occurring inside, in what is known as the logical computer.
The PICK logical computer appears to be a huge block of memory
frames numbered from zero to the hundreds of thousands.
As shown in figure 9-5, the array of used and available frames are
known collectively as the virtual workspace. All programs, data, user pro-
cesses, and even the PICK System itself are simultaneously active in the
virtual workspace. An entity known simply as the System is continuously
storing and retrieving these frames, using them as necessary and returning
discarded frames until they are needed again. This view of a self-contained
environment within the real computer is known as the “logical view” of the
PICK System.

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

Whether they realize it or not, knowledgeable PICK users and


technicians discuss nearly all system functions in terms of this logical
view, simply because the logical view is nearly identical across all PICK-
based computer systems, regardless of the actual hardware. On any
PICK-based computer system, the virtual workspace is the same, with
only slight variations in the beginning and end of each working area. (See
The Map of the Virtual Workspace, this chapter.)

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).

When a file is initially created, a contiguous (logically connected or se-


File “Shape”: quential) block of frames is allocated for the file. The PICK System deter-
Modulo and mines in which frame a particular data item will be recorded, according
Separation to its item-id (see item storage in chapter 2, Item-Ids and Accessing).
Because data in a frame can grow as attributes are changed and
items are added, the frame may eventually overflow, in which case extra
storage will be automatically linked to the frame. Consequently, frames
initially attached to a file are referred to as groups, because each frame
could eventually be the first of a whole chain of frames. The modulo,
stored in attribute 3 of the file-defining item (see chapter 2), is the
number of groups in a file.

23
5
Chapter
5

NEW OR
CONTIGUOUS EXPANDED
FILE FILE

PRIMARY PRIMARY OVERFLOW


FRAMES FRAMES FRAMES
(linkages (explicitly linked
implied) together)

Figure 9-6 File structure: primary and linked frames


The fourth attribute in a file-defining item is the separation, or the
number of frames in each group. This parameter is always 1. Early releases of
the PICK System allowed a different parameter here, but the use of separation
greater than 1 was found to be unnecessary. This is because the system
automatically accesses as many frames as necessary for each group, with little
or no loss of efficiency. The only exception to this rule is reported to be files
that have very large items, such as documents, on computers with disk drives
equipped with something called “disk caches” (CASH-es), and even this
exception has its exceptions. So most users always use 1 as the separation.
Let’s review: data within PICK files, then, is always organized into
groups. The number of groups in a file is known as the modulo. The number of
frames set aside in the primary space of a file for each group is the separation,
and is always at least one frame. As the file fills up, items are written into their
appropriate groups. When the data overflows the frame(s) attached to the
group, the virtual memory software attaches, or “links,” one frame at a time to
the end of the group. This is known as linked overflow, and is illustrated by the
EXPANDED FILE in figure 9-6.

In other words, when data is inserted in the middle of a PICK 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.

The Fundamental Building Blocks: Frame and Item Structure


Now we’ll take a close look at one of the PICK virtual frames. A frame is
the fundamental component of the virtual workspace, the building block
of the logical computer. A frame is a collection of characters, or bytes. In
the PICK world, all data is in bytes; one letter or number is stored in one
byte. In most of today’s PICK-based computers, the data frames are 512
bytes, while the PICK System code is recorded in 2048-byte frames. There
is a trend to increase all PICK frames to 2048 or even 4096 bytes. But at
this writing, the vast majority are 512-byte frames so we will confine our-
selves to this size, at least for the examples in this edition of this book.
The first 12 bytes of a 512-byte frame are a reserved area; the area
is called the Linkage Fields. Linkage Fields are used when a frame has
been attached to a group within a file. They contain information about
how the frame is attached to the other frames in the virtual workspace.
Figure 9-7 depicts the format of the Linkage Fields.

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

Figure 9-7 Format of the Linkage Fields

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.

FID: 29864 :0 0 00( 74A8 : 0 0


0 0 )
Example 9-1
Frame with one item

1 :003B312ASteve VanArsdaLeAPO Box 1105AMt.ProspectAI


51 :LA60056A_...............................................
101 :........................................................
151 :........................................................
201 :........................................................
251 :........................................................
301 :........................................................
351 :........................................................
401 :........................................................
451 :........................................................

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:

003B312ASteve VanArsdaleAPO Box 1105AMt. ProspectAILA60056A

Here is what each of these characters means to the virtual memory software:
003 B Hexadecimal byte count field (decimal 59)

312 Attribute 0, or the item-id


A Attribute mark (ASCII 254)
Steve VanArsda le Attribute 001
A Attribute mark
PO Box 1105 Attribute 002
A Attribute mark

Mt. Prospect Attribute 003


A Attribute mark
IL Attribute 004
A Attribute mark
60056 Attribute 005
A
_ Item terminator (a combination of an attri
bute mark and a segment mark)
_ Group terminator (second segment mark)

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.

Example 9-2 FID: 29864 : 0 0 0 0 ( 74A8 : 0 0


Frame with two items 0 0 )

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.

The Map of the Virtual Workspace


Because all real memory and all disk space is under the control of the virtual
memory software, the PICK System has been called a logical computer, or
virtual machine. The logical computer-within a-computer, or “pseudo-system”
approach, ensures compatibility between computers of different manufacturers.
Regardless of the actual hardware, the PICK System logical computer appears
and operates the same for any user and any application system, on any PICK-
based hardware in the world.
When any PICK System is powered up, the software determines the
hardware configuration, and establishes the virtual workspace consisting of all
real memory and all disk memory. The virtual workspace is always separated
into the same logical areas, shown in figure 9-9, and the location of each area
can be calculated.

VIRTUAL
WORKSPACE

Figure 9-9 The 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.

ABS and the Monitor


Most of the time in the PICK world, we are not directly aware of the inner
levels where the operating system resides. We work on the surface, activating
processes below. The windows created by the Editor reach into the database
files, just above the PICK/BASIC level. Only the System Debugger can crack
into that core of the PICK world, the ABS frames.
We get a glimpse of the ABS area whenever we press the Break key.
The message that comes back is from the Assembly Language Debugger, and
it tells us the frame-id and displacement of the ABS program being executed.
Occasionally, one will observe the technician using this powerful tool to
examine part of the system, and perhaps to change a byte or two. However,
none but the experienced PICK assembly language programmer dares to
venture too far into the ABS frames. This is the domain of the Monitor, a tiny
but powerful process that supports all the levels above.
The PICK Monitor is the single most significant feature of the PICK
System. It has been called the system’s “kernel” or central program. Its
primary function is to retrieve, interpret, and execute the set of software
utilities known as the ABSolute Code. The Monitor is the only part of the
PICK System software that is always resident and running in real memory
when the PICK System is operating. It is this small, specialized program that
makes the PICK System functional, and yet ensures portability.

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.

One unique aspect of virtual memory management in the PICK System,


and the reason that the PICK System is known as a “virtual machine,” is that
the Monitor performs these functions for the PICK System software as well as

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

To increase efficiency even further, each user’s time-slice allocation is


dynamically adjusted during the Monitor’s cycle among the competing processes.
Most of the time, a process is allowed to complete its time slice. The Monitor
terminates a time slice whenever a process requests disk access or voluntarily
relinquishes its own time slice—for example, when a program waits for operator
input on the keyboard. At one of these terminations, the Monitor activates the
appropriate peripheral device, terminates the time slice, and reschedules it for
activation when the disk, keyboard, or another device signals the completion of the
requested task.
However, the Monitor “monitors” the processes to establish priority of
reactivation among competing processes. There are effectively two types of time
slice recognized by the Monitor: batch and interactive. Each user or process on the
system is dynamically labelled as one or the other. The Monitor constantly
“senses” each port to see the type of activation required. If required, the Monitor
program looks for keyboard input to determine whether the process is interactive
or batch. When it determines that the process is interactive (or senses keyboard
input), it allocates a time slice roughly twice as high as the batch time slice that the
port would have otherwise received. This technique is called bubbling up the
process queue. It is incorporated so that interactive processes (such as data entry
tasks) are reprioritized when another user initiates a heavily disk intensive task,
such as a report. So, getting the system technician to increase or decrease the
priority of a particular port or process on a multi-user computer is no longer
necessary on a PICK System.
The load on a PICK System is thus automatically balanced, insofar as it is
possible for the system to do so itself. Users can always help by establishing a
schedule for different types of work. Interactive processes retrieving a few records
at a time tend to be resource efficient, and can be run simultaneously with little or
no impact on the system. Interactive processes can be adversely affected, however,
if batch-type processes access large numbers of items in large files. As a general
rule, batch processes requiring sorts and selections of large files should be run
when few other processes are active. This is a small price to pay for PICK-type
processing, and it ensures that the Monitor can provide batch processes with as
much CPU efficiency as possible.
By far the most striking aspect of the PICK Monitor is its OWN effi-
ciency. On the majority of the PICK software implementations, the entire
Monitor occupies only about 32K, plus about another 32K for the frame
management tables that always remain in main memory. This is about one-
fifth the size of just one application package such as word processing or a
spreadsheet on any fixed-architecture computer, and the PICK System can
simultaneously run dozens of such applications. Furthermore, on a firmware-
based PICK implementation such as McDonnell Douglas or Intertechnique,
where some of the PICK System is microcoded on the CPU processor chip, the
entire Monitor fits in only about 8K of main memory, yet supports hundreds of
terminals and printers.
As the cost of RAM shrinks, and the speed of the processing chips
grows, the power of the PICK System to support more users grows. PICK
computers with 500 users are in service today, and soon there will be PICK
computers supporting thousands of processes. Yet in silicon or in software, the
Monitor is the powerhouse that drives the PICK world.

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.

Native Applications Using the


PICK System
The PICK System provides a standardized user interface (TCL), a systemwide
data editor (Editor), and an English-like database retrieval language
(ACCESS). An unusual aspect of the PICK environment is that a database
application system can be developed using only these intrinsic tools.
Input (Editor)
Process (Dictionary correlatives and conversions)
Output (ACCESS)

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.

Figure 10-1 PICK application system using only intrinsic processes

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

tions. For example, by using conversions and correlatives in the dictionary


attribute-defining items, data such as name and address can be “logically”
added into a data item that contains only the customer number. Here are some
examples.
As illustrated in figure 10-2, a file of customers might contain only customer
name and account number, while the sales file contains the actual transaction for
each customer. The customers could easily be sorted by last name and displayed
with the transaction amount and even an address, perhaps for preparing thank-you
letters. All that is required are attributedefining items in the dictionary of the
CUSTOMERS file that define a relationship between the data in that file and the
other files of data within the account.

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

Figure 10-2 ACCESS statement: LIST THE CUSTOMERS


LASTNAME ADDRESS AMOUNT 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

The correlative specification in attribute 8 returns only the characters


preceding the first comma in attribute 1 of the CUSTOMERS file. (See the
appendixes for a complete discussion of this and other correlatives.) If all
names in the file are in the following format:
last name,fir st name mi
then at each line, the LASTNAME is automatically constructed and added to
the user’s view of the CUSTOMERS file. We say that the data is added to the
user’s view because it is real and available for use just like any other piece of
data. For example, LASTNAME can be used with BY as a sorting criteria, or
with the WITH clause as a selection criteria, just like any other attribute.
Even information that is not part of the CUSTOMERS file can be added
to the user’s view of that file—for example, AMOUNT.

AMOUNT

25
0
Applications

001 A
002 0
003
004
005
006
007
008 TSALES;C;2;2
009 L
010 15

This attribute definition says that AMOUNT is the second attribute of a


corresponding item in the SALES file. Whenever AMOUNT is requested from
the CUSTOMERS file, the system uses attribute 0 in the CUSTOMERS file
(CUSTOMER#), looks up the corresponding item with that value as its item-id
in the SALES file, and returns the second attribute of the corresponding
SALES file item as the AMOUNT.
The same process can be applied to obtain a customer address, even
though there is no address in the CUSTOMERS file. A translation correlative
in attribute 008 “translates” the item-id, in this case CUSTOMER#, into the
the ADDRESS of the customer name and address file.

ADDRESS
001 A
002 0
003
004
005
006
007
008 TADDRESSES;C;1;1
009 L
010 20

Stretching the point a little, an attribute-defining item in the CUSTOMERS


dictionary could translate to a STATE.CODE, which could then be translated into
STATE.NAME, by a pair of translations.

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

In this case, the attribute-defining item first translates CUSTOMER# into


ZIP CODE, then ZIP CODE into STATE.CODE. After any sorting or selecting is
performed, the system translates STATE.CODE into STATE.NAME, and finally,
converts the STATE.NAME to upper- and lowercase (MCT). The ] between the
translation specifications is a Value Mark or ASCII 253—a control-square bracket

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

The Languages of the PICK World:


PROC, PICK/BASIC, and RPL
Programmed applications systems seem to flourish in the PICK world. There
are thousands of them sold around the world, and many more have been
developed for private use. They operate like factories on the TCL surface,
drawing on processes in the lower levels and working on the data held in the
database. Over time they often grow, like crystals, as more features are added
to them.
When they begin, they are programmed in some very interesting PICK-
like programming languages. The majority of application systems on the PICK
world use PROC and PICK/BASIC, or a close cousin of PROC known as the
Real-Time Programming Language, or RPL.

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.

Figure 10-3 The Logon PROC and PICK/BASIC


Whenever a user logs on to the PICK System, the logon process is
activated. It establishes the user’s Process Control Block and activates TCL. But
just before prompting the user with the TCL symbol, the system searches for a
PROC in the user’s MD that has exactly the same name as the user’s logon-id, or
account name. This PROC is called the Logon PROC. TCL always passes control
to the Logon PROC before passing control to the user.
This handy feature is especially useful for PICK/BASIC and RPL
applications. It means that as soon as a user logs on, a predefined process takes
control. The most common Logon PROC is a user menu that prompts the user for
the program processes to activate.
BASIC programs are used to format screens, prompt the operator for
input or update information, and create or change data files. Other programs
might start batch processes that read or update files. Still other PICK/BASIC
processes read data files and print output, such as mailings or invoices. Such

25
4
Applications

application systems are usually composed of many small PICK/BASIC


programs and subroutines, which are easily created and maintained.
The structured use of subroutines is one of the most powerful features of
PICK/BASIC. The language has been criticized as “unstructured” primarily
because it has very few restrictions. But unstructured programs are written by
unstructured programmers; the language rarely has anything to do with it. The
PICK/BASIC language, on the other hand, has the ability to call internal and
external subroutines, which can in turn call themselves or the original
program; this is a fundamental tenet of structured programming. PICK/BASIC
is one of the few fully recursive and reentrant programming languages ever
invented.
Look at figure 10-3 again. A subroutine that calls itself is recursive*, one
that reenters the program that started it is reentrant. Such routines are the
foundation of a good structured system, because they can eliminate redundant
program code and provide consistency. These capabilities establish
PICK/BASIC as one of the more important structured programming languages
in the marketplace today, in the hands of a good programmer.
PICK/BASIC programs have a number of other features inherent in the
PICK System. These include meaningful variable names and complete
freedom from variable typing; PICK/BASIC programs can handle any kind of
value in any variable with any name. Furthermore, file input and output occur
under the control of the PICK Monitor. That means that the virtual memory
and relational database services are made available to the PICK/BASIC
program, simplifying the code. PICK provides some other very special
features as a result, such as dynamic arrays that can be any size and contain
any number of attributes, values, and subvalues. Consequently, the power of
PICK/BASIC is not likely to be duplicated in any other language on any other
computer; and yet, because of its roots in common “Beginners All-purpose
Symbolic Instruction Code,” there are literally millions of people in the world
who are capable of reading and understanding PICK/BASIC programs.
As an example of its power and flexibility, PICK/BASIC even “breeds,”
by means of program generators (see Application Generators, this chapter).

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.”

Regardless of any limitations, the RPL language is marketed in the


midwest and eastern U.S. with an exceptional series of accounting, hotel, and
manufacturing software packages. Those application packages, and its inherent
speed and efficiency, have made the RPL language popular in these areas for
application development. RPL applications are also establishing a presence in
Europe, and the language is now sold and supported by both the Ultimate
Corporation and McDonnell Douglas, two of the largest resellers of PICK
computer systems. The rumors about the pending death of RPL have been
greatly exaggerated.

The Next Generation of Programming Languages: Application


Generators
Dick Pick has said “The last thing that the world needs is another pro-
gramming language. It’s time for the programmers to create tools that the user
can use to solve the problem.” (PICK, UNIX, and OS/2 Panel Discussion,
COMDEX, Nov. 1987)
Just such tools abound in the PICK world. They are called application
generators, and are a program or system of programs designed to create user
processes such as input screens and output reports. Application generators are
generally referred to as “fourth generation languages,” drawing upon the fourth
generation of computing hardware as the model for embedding sophisticated
processing within simple statements in the language itself. (See The Orbit of the
PICK World in chapter 12.)

25
6
Applications

Application generator software is becoming increasingly popular in


computer software markets, and the PICK world is no exception. There are
three distinct types of application generator software in use on PICK Systems
today.

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.

The fourth-generation environment also includes facilities for “linking


in” other application systems, utilizing any or all of the integrated services of
the environment. Two noteworthy examples of this new type of

25
7
Chapter
5

application generator are the Sabre Productivity Center on the Pertec


computers (Scan Optics in Irvine, California), and CUE-BIC, a comprehensive
product developed by the Australian company APSCORE International.

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.

As more users become more active in PICK programming, more application


packages are appearing in the PICK trade publications and magazines. A growing
Professional Use of trend among all software developers is the use of application generator software.
Application The reason for this trend is in the nature of PICK software developers themselves.
Generators They are typically specialized PICK users in smaller companies, with
limited staffing and resources, that specialize in business industries according to
the talents and experiences of the staff. The larger PICK computer suppliers are
usually not developers of end-user software. They have traditionally purchased
rather than built application software.
Therefore, the organizations that create end-user software application
packages are the dealers, value-added resellers, and software development houses.
With their small staffs, they usually prefer to create standardized, consistent PICK
code that can be easily customized and maintained. Application generation
packages provide a high level of maintainability at a low cost, because the same
software that was used to create the application package can be used to modify or
customize the software according to the customer’s needs. Moreover, some
application generators produce standard PICK programs that can usually be
moved to many PICK computers. This provides a high degree of portability, ena-
bling the software developer to sell to a wider market of PICK users. The buyer
purchases an application system created by the generator, which can be quickly
and easily customized by the dealer according to the buyer’s

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

economically. This type of service is indicative of the “coming of age” of the


PICK community. A data processing professional has little excuse for making a
mistake these days with the PICK System, because expert advice is available
around the world.
Most of the time, the information is available for a reasonable amount as
well. PICK professionals are typically users first. When expert advice is
required, most good PICK consultants provide a little research and a
recommendation for a very small fee, saving the user much time and money.
Always remember to ask the professional consultant in the PICK world, “How
would you do this application?” Often the answer is worth many times the fee.

The Reserved Programming Language: Assembly


There is one other programming language in the PICK world, but it is not often
used for application software. This is the language of the PICK ABSolute Code
itself, PICK assembly language. The system is specifically designed to execute
this type of program efficiently and effectively. Assembly language programs
have the ability to directly control all peripheral devices attached to the
computer.
For example, assembly language programs can change the way in which
the disk writes data or the tape operates, thereby improving performance of
these devices. Assembly programs, or “modes,” can bypass the PICK System’s
limitations and create graphics on the CRT screen or the printer. Assembly
language programs are often used for communications and exotic peripherals
such as bar-code readers, laser disks, and telephone systems. However,
assembly language application software is usually not recommended for end-
user software. The reason has to do with the PICK System, not the language.

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

Consequently, application programs that use the PICK assembly language


present some unusual problems for both the developer and the end user.
When an assembly language application system is installed in a PICK
System computer, only the assembled object code is loaded into the system.
After recording the object code as data items in a standard file, the assembly
language programs are copied into the ABS area itself, using a special PICK
command known as MLOAD. From this moment on, the whole operating
system is subtly altered.
Because the operating system cannot be restricted from access to any
virtual memory frame, and the operating system is interpreted PICK assembly
language object code, all PICK assembly language programs enjoy this same
unrestricted access. This can be hazardous if the assembly language
programmer makes a mistake, or even just a bad assumption, about where data
is located. Errant assembly language programs can write on themselves, or on
the operating system, or even on user data. They can destroy data or alter the
operating system in such a way that the system halts and will not operate. And
no one except the original programmer is likely to be able to fix the problem.
When changes are required to the assembly language programs or a new
release of PICK is installed, the assembly language application may require
modification, or even relocation within the system’s ABS area, to operate
properly. Support for these modifications may be difficult to obtain. Only the
assembly language application developer can be certain of the effect that the
application software has on the operating system, since the developer has the
only copy of the original source code. Neither PICK Systems nor the computer
manufacturer will adjust the operating system for every user or developer’s
assembly language programs.
The Pick Systems, Inc. Assembly Language Programming Manual
contains a stern warning that PICK Systems, Inc. will not support any PICK
System in which a user has chosen to program in PICK assembly language.
Neither will most licensees.

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

example, this book was originally prepared on an exceptionally good word


processor (from JET Software Company of Santa Ana), which is written in
PICK assembly language. It worked for us.

Major Application Systems for PICK


Based on past recipients of the annual SPECTRUM “PRO-gramming Awards
For Outstanding PICK-based Application Software,” it is not unusual for PICK
System users to become leading software vendors. With the ease of application
development on PICK, enterprising users often develop their own application
software, and then realize the potential of packaging their software for resale.
With their intimate knowledge of the industry, and the opportunity to test
every aspect of the software in their own companies, it is not surprising that
their software offerings are effective.
In a recent PICK application software survey, over 170 general-purpose,
or “horizontal market” application packages were listed. Here is a list of some
of the types of horizontal or generic packages available for the PICK System,
including the number of each:1

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

Although this should not be considered an exhaustive list, it is an


example of the growing body of commercial quality software being developed
for PICK. These general-purpose “horizontal market packages” provide
generalized business functions for a wide variety of businesses. However,
such generalized software packages do not represent the majority of PICK
commercial software.
Because many PICK software developers were originally users, a much
larger list of specialized “vertical market” packages is available for PICK.
These software systems provide a variety of business functions within a
specific industry, such as accounting specifically for a construction company.
Most businesses have specialized requirements; PICK users in a particular
industry have often created application software tailored to meet those needs.
According to our research, vertical market application software has been
created for the following industries:

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

Vending Voter Registration


Veterinary Warehousing
Video Rental/Sales Welding Supply House
Nearly all of this software is sold by value-added-resellers (VARs).
Statistically 16 percent of all VARs in the United States have chosen to work
in the PICK System. That’s nearly one in five of all the software professionals
in the country.7
The list of software is indicative of the system’s ease of use by users and
professionals alike. And the list grows by the day. According to the annual
report put out by Pick Systems, Inc. in 1987, the United Nations is engaged in
projects that send PICK Systems “to the most remote corners of the world.”
Who can guess what applications will be in this list next year, or ten years
from now?

7Source: “DataQuest” Information Services, reported at COMDEX, Nov. 1987.


26
5
Analysis and Design for
1 PICK-Based Systems

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.

Soft Landing on the PICK World


Any serious consideration of the PICK System for business use involves
application programs. Few organizations can install a multi-user environment
such as PICK, then just leave it lying around to see what happens. Most
visitors to PICK have a specific purpose in mind. They want the system to
perform a particular function that they currently either do by hand or do badly
with some other computer.
While the PICK application is usually easy to implement, it isn’t nec-
essarily always the best that it could be. Because of the ease of creating
databases and programs, design is occasionally slighted in the interest of
getting the job done. A professional programmer once said that design of
PICK software is a waste of the user’s money, since the programmer can

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.

Design Considerations within PICK


It should be recognized by now that an application in PICK is not likely
to operate the same as it would in any other environment. Any system that
provides as many services to the end-user application as PICK does will
quite obviously have an effect on the way applications work. After all,
roads designed for horse and buggy are not likely to be effective for auto-
mobiles.
In fact, the effect of PICK on the whole development process is sig-
nificant. Where the application software of the COBOL/PL-1/PASCAL
era was designed for efficiency in machine terms, the PICK application is
designed for efficiency in terms of people. That means the design process
must be freed from considerations of hardware, accessing methods, file
structure, even current system limitations, before a final solution is se-
lected. This is the limitation of the sequential flowcharting design methods
of the sixties and seventies; their emphasis on the “flow-of control” is
rooted in their assumptions about the hardware that is running the job.
Happily, there is a design technique that seems perfectly suited to
designing systems for PICK-type computers.

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

The reasons are as fundamental as PICK itself. With today’s data-


base tools and inexpensive computer power, the data must be the primary
consideration in designing any application, because nearly any process
can be effectively automated if the data is held appropriately. Therefore,
the design process begins with analyzing the flow of the data. And we will,
along the way.

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.

Figure 11-1 Data flow diagram

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

Figure 11-2 Data dictionary entry

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

001 DATA-ELEMENT ] DATA-ELEMENT ] DATA-ELEMENT...


002 ITERATIONS ] ITERATIONS ] ITERATIONS
003 PROCESS
004 COMMENTS

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:

>SORT DATA-DICTIONARY BY-EXP PROCESS BY TYPE PROCESS TYPE


DATA-ELEMENT ITERATIONS COMMENTS LPTR<cr>

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.

The preferred method is to determine exactly what is required, assemble


the compatible needs into a logical database, and then figure out how to
automate it. Once again, this design approach is particularly well suited to a
PICK-based system, because data can be held in the most advantageous
manner for collection, and then retrieved in nearly any form that a particular
user or process might require.

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

4. Insofar as possible, combine the Input Accesses with the Output


Accesses so that the attributes appear only once in a data store.
5. Where an object has a list of attributes that includes the object in another
data store, isolate the keys of each object in a new data store composed
only of the associated keys; this is known as a “correlation” between
two objects.
Now the list of data stores and the data elements in each store form a
complete set of logical items with a minimum of redundancy, and each has a
specific purpose. Next you actually build the database.

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

■ Processes that can be decomposed should be decomposed into modules that


do only one thing and can be shared with other processses. A good rule of
thumb is that if a program module exceeds 200 lines, too much is going on
in there.
■ A module should have as little dependence on other modules as possible,
yet should provide a clear service to other modules, preferably with little
regard for when or how the module is activated. Information necessary for a
module to carry out its function (“control data”) may be effectively stored in
a dictionary of a data or program file.
■ Data should be stored so that it provides exactly what is required, and little
else, to the processes that access many items at a time. Processes that access
only one or a few items at a time may be allowed to access many data
stores.
■ Small data items usually work better than large ones in PICKbased
computer systems. However, ACCESS is better at large data items than it is
at multifile translations, which is a consideration if the ACCESS commands
LIST or SELECT are part of the anticipated process.
■ Temporary files created for a report or for use with ACCESS do not
invalidate a logical model, provided that such files are regularly trashed to
prevent dependence on such redundancy.
■ Finally, the most important if not the only rule: The very best logical
model is a physical one, or “prototype.”

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

Such a step immediately draws criticism, especially if deadlines are


approaching. But who wants to build a system just to scrap it? And if some
misguided developer does, who wants to pay for it? No level of user
involvement, cooperation, expertise, nor even enthusiasm can equal the
illuminating power of a prototype system. A prototype ensures that the
developer’s knowledge of the environment matches the user’s perception of
the objective, avoiding the all-too-common mistake of “distorting the problem
to fit the preconceived notion of the solution.”
A prototype is such a good way to confirm the requirements of the user
and the designer that virtually any expense could be justified for its creation.
Fortunately, a simple prototype of nearly any system can be extremely
economical in a PICK-based environment, especially with one of the
application generators that we discussed in the preceding chapter.
When all is said and done, and the logical model of the intended system
is completed and the prototype has met with the sweeping approval of all
concerned, an interesting thing happens. At this point the most likely
candidate for the final system is occasionally the PICK System, since the
designers finally understand how the PICK environment really works.
Nonetheless, even if the final system is not PICK, a PICK-based prototype is
an excellent way to iron out the bugs in the conceptual design before they
become cast in code.
But there is an even more interesting effect on the designers. Even if
they had no previous training in design techniques or programming, they often
become practitioners in this advanced form of computer systems design. Even
if they are actually users.
What we recommend to them, and to you, is to look into the works on
Structured Analysis and Design, especially:

DeMarco, Tom. Structured Analysis and Systems Specifications. Prentice Hall,


1979.
Kendall, Penny A. Introduction to Systems Analysis and Design. Allyn and
Bacon, Inc., 1987.
Page-Jones, Meilir. The Practical Guide to Structured Systems Design.
Yourdon Press, 1980.
Yourdon, Ed, and Larry Constantine. Structured Design: Fundamentals of a
Discipline of Computer Program and Systems Design. Prentice Hall,
1979.

The End of the Tour


We now know where PICK came from, what it does, and a little about how to
use it. Now it is time to move on . . . with one last look at where the PICK
world is headed.

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.

Players Who Have Seen the Light


Twenty-nine computer vendors have licensed the PICK System for sale on
seventy different computers. These implementations range from

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

V-Mark Uni-verse (1985) is an emulation of PICK, written in the C pro-


gramming language, to run as a process under UNIX. The system was
originally offered for sale to PICK licensees without the permission of Pick
Systems, Inc. After an amicable lawsuit, V-Mark agreed to pay a royalty for
each system sold and on the use of the PICK name. V-Mark now appears to be
primarily interested in becoming a proprietary software supplier to PICK users,
to allow them to bridge their applications from PICK to UNIX. To date, the
majority of interest in the product is from manufacturers and remarketers of
UNIX computers, such as Prime and Pyramid, rather than PICK licensees.

28
0
Future of the PICK System

PICK Personal Computing on the IBM XT and AT


It is interesting to look back along the long path of the PICK System to its present
spectrum of computing hardware. The PICK System was originally implemented on
a mainframe computer as a personalized environment for a user at a time-sharing
CRT terminal. Since that time, the system has been implemented primarily on
multi-user minicomputers, providing the personalized environment to each user in a
multi-user system. But in 1984, the PICK world completed an odyssey of sorts. In
that year, what began as a personal computer environment for multi-user systems
was implemented as a multi-user system on a personal computer.
The PICK PC XT System was designed specifically for the hard disk version
of the popular XT personal computer. The system was designed to operate on a
standard, off-the-shelf PC with the Intel 8088 processor chip. The PICK System for
the XT required a standard PC XT with a minimum of 256K of main memory,
although 512K of main memory was recommended. No special hardware or other
additional boards were required. All standard PICK features were completely
implemented. The XT version would load and store PICK data files without
modification and would run all PICK-compatible software, including
communications software and PICK assembly language applications.
A fact that usually goes unrecognized is that the PICK System for the XT
supports two additional terminals connected to the XT’s serial ports. Each is a fully
functional PICK user port, sharing virtual workspace and disk storage under the
control of the PICK Monitor. The extended version of PICK for the XT allows ten
users to be connected and operating at the same time. At a time when most
microcomputer users were learning first hand about the shortcomings of a single-
user system, the PICK System offered multiterminal connections and even
background processing to the lowly XT . . . at less than the cost of a CRT terminal.
The PICK System for the IBM PC XT was the first implementation sold
directly by PICK Systems, and was available through dealers for a retail price of
$495, or about half the cost of a single-user database management system. Its low
cost is one more reason why PICK may be the only constant in the continuing
practice of hardware swapping in the business computer marketplace.
In late 1987, IBM stopped shipping the PC XT in favor of the PC AT, based
upon the Intel 80286 processor chip. At this writing, the future for the AT looks just
as limited, as IBM is rolling out the PS/2, an 80386based product. And recent
announcements at the 1987 COMDEX “computer bazaar” confirm that the OS/2
operating system will be single-user for the foreseeable future, presumably to
prevent any impact on IBM’s minicomputer lines.
As of this writing, Pick Systems has announced the PICK System for the IBM
PC AT, PS/2, and all compatibles running on both the Intel 80286 and 80386
processor chips. The price is less than $1,000 for three users, or about $350 each.
The IBM AT version of the PICK System retails for $995 and supports ten (10)
users . . . for less than the cost of the CRT.

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.

Open Architecture: The Universal Host


Soon a new release of the PICK System will be commercially available. Open
Architecture Version 2 has been called the culmination of a twentyyear
development effort on PICK. It seeks to eclipse all PICK innovations of the
past and establish a position for the PICK System in the major computer
marketplace.

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

■ A continuous transaction logging process that records every change to


specified files anywhere in the system.
Open Architecture has had internal changes as well. Substantially
reorganized, OAv2 is more consistent and concise than any previous im-
plementation of PICK. Consequently, there are several new internal features in
Open Architecture:
■ Expanded item size, up to 5 million bytes or more
■ Expansion and standardization of all frames at 1024 bytes, which will
dramatically increase system performance
■ Simplified and enhanced system interfaces, to facilitate new peripheral
devices and input/output processing
■ Dynamic Process Workspaces, allowing increased processing space to users
when required for multitasking
■ Multiple ABS sections, to allow a user to specify different versions of the
PICK System, or to load and run assembly language software without
adverse effect on the other ABS sections of the system. This is useful for
software developers who will write software in the latest version of the
PICK System, and test in an earlier version for compatibility.
The question seems to be: Will existing PICK licensees change to OAv2,
when it involves additional cost and effort? The answer may be yes, if existing
licensees and users seek to use the OA features to implement Assembler routines
for graphics and communications, and for communicating with other systems such
as UNIX.

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

The Orbit of the PICK World


People mark the evolution of computers by “generations.” Each generation is
characterized by a significant advance in the performance of the computing
machine. On this scale, we are in the “fourth” generation of the computer.
The first generation of computers began in the early 1950s, when
computers were digital machines based upon the vacuum tube. Conceptually,
they were the equivalent of today’s computers, but members of this first
generation were huge, slow machines capable of handling only one process at a
time. “Debugging” occasionally included pest control in these oversized
constructions.
The second generation of computers came in the late 1950s with the
transistor, a faster and smaller electronic mechanism. The “logical” archi-
tecture remained about the same, processing data sequentially and performing
one job at a time. Time sharing, or multitasking with more than one job
running at the same time, was limited to job scheduling under the control of a
central operator.
The advent of silicon microcircuitry in the mid 1960s launched the third
generation of computers. “Interrupt driven” architectures opened the door to
multitasking, with CPU resources shared under the control of software. Mass
storage, random access technology replaced sequential tape processing. This
brought a major shift in application philosophy, even though the architecture of
computing machinery remained the same: computer hardware running
computer software in a strictly sequential process.
Early in the 1970s, the fourth generation began, when the distinction
between computer hardware and the operating system software began to blur.
Computer instructions were embedded in silicon as a function of the circuitry
itself, and called firmware. More and more fundamental system processes were
relegated to solid state silicon chips, such as read-only

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.

PICK and UNIX in the Fifth


Generation Computer
This will be the market in which a new standard for user-oriented systems will
emerge. It is here that the PICK Operating System will make its contributions,
after twenty-odd years of quiet patience. It will do so in the form of Open
Architecture.
With each passing day, hardware improvements favor PICK’S original
virtual memory approach, pseudo-system structure, and multitasking Monitor
between the actual operating system and the firmware. Open Architecture
opens the gate for adding new processes such as communications and graphics
by simply adding assembly language to the system to allow it to communicate
with system processes on a lower level than the ABS. One of these processes
will undoubtedly be UNIX.
We are in the midst of a raging controversy over the relative merits of
UNIX, MS-DOS, PICK, and, in some circles, MVS. Such a controversy
generates the confusion that serves only the sellers of these products. UNIX
and PICK are not comparable; they are more complementary, since each
contains things that the other does not.
■ UNIX is composed of a kernal of system code, direct-access device
drivers, and an elementary command processor. PICK has no direct-
access device drivers; all interfacing with the hardware is done through
the limiting capabilities of the Monitor.
■ PICK is composed of layers of user-oriented processes, highly integrated
and simultaneously available to any user or any process running on a
port. In UNIX, application software is added to manage databases, and
report software is needed to generate reports, while editors and compilers
are necessary to create programs. The juxtaposition of products from
third-party sources is rarely synergistic, and often conflicting.

There is simply no basis for comparison. It is impossible to compare the


user-oriented PICK environment with a device-oriented computer control
program. UNIX (and MS-DOS and MVS) are directly comparable only to the
PICK ABS.
Yet here UNIX compares quite well. Its direct access to device registers

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.

Figure 12-1 The next PICK world

PICK’S overall orientation toward the user allows hardware substitution


and technical evolution to occur without affecting the user’s perception of the
system and the data. Soon, instead of a user, it may be an artificial intelligence
application that PICK insulates from the hardware, allowing the AI processes
to concentrate on the data, instead of on the device that is processing it.

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

Magazines & Newspapers


Pickworld Magazine, published by Pick Systems (714) 261-7425.
IDBMA/Spectrum, published by IDBMA (619) 578-3152.
News & Review, published by TMS (714) 855-4442.

Each of these three companies also publishes application software


catalogs describing some of the thousands of packages available for the PICK
System.

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.

Licensee: Altos Computer Systems


San Jose, California (408) 946-6700 Ext. 4935
System: Altos 586
Completed: 1982
Processor: Intel 8086; new models in 1986 offered the 80286.
Profile: The primary marketing strategy of Altos is to offer a “ge
neric” computer on which virtually any operating system will
run. Its other offerings include: XENIX, UNIX, MS- DOS,
CP/M-86, MP/M-86, and OASIS.

Licensee: Applied Digital Data Systems (ADDS)


Hauppauge, New York (516) 231-5400
System: ADDS Mentor
Completed: 1981
Processor: Zilog Z8000

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.

Licensee: Archford Computers International


London, England 01-482-4411
System: Excalibur
Completed: 1986
Processor: Motorola MC68020
Profile: The Archford company was founded by a trust fund
under the direction of Aaron and Iver Gershfield.
Licensee: Aston Technology Ltd.
System: Crystal Excel
Completed: 1986
Processor: MC68000, 68020
Profile: Aston was originally a distributor of the ill-fated Pertec
SABRE computers in the United Kingdom. Recognizing a good
thing, Aston licensed the system for resale on its own computers. In
1987, the company was acquired by General Automation, a long-
time U.S. licensee of PICK.

Licensee: Automatic Data Processing (ADP)


System: Hewlett-Packard 3000
Completed: 1980
Processor: Proprietary
Profile: ADP is probably the largest single distributor of PICK
based systems, primarily to customers of its successful time sharing
services. Since 1973, it has accounted for much of the total installed
base of Microdata (McDonnell Douglas) and Altos systems. Its HP
3000 implementation was completed in 1981 and yet has never
been made available to the commercial marketplace. At this
writing, the company is reported considering additional sources for
its PICK computers, including C.Itoh.

Licensee: CIE Systems


Irvine, California (714) 660-1800
System: CIE 680 Series
Completed: 1983

29
3
Appendix A

Processor: MC68000 Series


Profile: CIE Systems was a California-based subsidiary of the
trading giant, C.Itoh of Japan. In late 1987, the division was spun
off by the Japanese conglomerate and sold to its U.S. distributor,
CIE Computer Systems. The CIE systems are considered one of the
more cost-effective and innovative implementations of PICK,
largely due to the efforts of a former technical director named Ian
Sandler.

Licensee: Climax Computer Systems


Fountain Valley, California (714) 498-5432
System: Climax

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

Licensee: Fujitsu Microsystems of America


San Jose, California (408) 946-8777
System: System 2000
Completed: 1984
Processor: Fujitsu Intel 8086 and MC68000 Series
Profile: Under the direction of PICK insider Wayne Wahlenmeier,
Fujitsu is another Japanese licensee seeking to differentiate its
offering of the PICK System on its Intel-based computers. In
1987, Fujitsu announced a comprehensive set of networking
products with extraordinary networking capabilities between
PICK and MS/DOS-based workstations.

Licensee: Fujitsu Espana


Madrid, Spain (91) 581-8000
System: System 2000
Completed: 1984
Processor: Fujitsu Intel 8086 and MC68000 Series
Profile: As can be expected, this division of the larger Fujitsu
conglomerate operates wholly independent of the American
division, even to owning its own PICK System license.

Licensee: General Automation, Inc.


Anaheim, California (714) 778-4800
System: Zebra
Completed: 1982
Processor: MC68000 Series
Profile: GA is a California-based manufacturer founded in 1968.
It currently offers both the PICK and the Xenix Operating
Systems on the Zebra product line, and is aggressively seeking to
become a major computer supplier. Its primary contribution to the
PICK world has been the unceasing efforts of its former
chairman, Len Mackenzie, to standardize the PICK System for
compatibility across all licensees.

Licensee: IBC Technologies, Inc.


Santa Ana, California (714) 261-5504

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: ICON Systems & Software, Inc.


Orem, Utah
(801) 225-6888
System: ICON
Completed: 1987
Processor: MC68020
Profile:
ICON is a trading partner with Sanyo Electric Company of
Japan. The ICON is a true “multi-user’s multisystem” solution,
implemented by a gifted technician named Chuck Sable.
Through the use of parallel processor boards, the ICON
computer runs PICK under UNIX, and also supports a
simultaneous MS-DOS session. It is anticipated that the
product will pioneer extraordinarily powerful application
software . . . or substantially boost the purchase of MS-DOS
games by PICK programmers.

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.

Licensee: McDonnell Douglas Computer Systems Company (formerly


Microdata Corporation)

29
7
Appendix A

System: Microdata, REALITY, SEQUEL, Series 18, Spirit


Completed: 1973
Processor: Proprietary
Profile: Microdata is a wholly owned subsidiary of McDonnell
Douglas, which acquired the California manufacturer in late 1979.
Microdata was the first implementation of PICK, and in recent
years has focused on providing larger computers to the PICK
marketplace. The REALITY and SEQUEL series of computers
encode much of the operating system on chips, in what is known as
“firmware.” This engineering and the company’s secret weapon,
Henry Eggers, has resulted in some sparkling performance
enhancements despite its ponderous pricing arrangements.

Licensee: Nixdorf Computer Corporation


Burlington, Massachusetts (617) 890-3600
System: Nixdorf 8890 VM
Completed: 1985
Processor: Discrete
Profile: The Nixdorf implementation of PICK is initially planned
for its mainframe systems, but future plans call for the OS to be
implemented across the entire product line. Little has been heard
about the Nixdorf implementation in the United States.

Licensee: Pick Systems, Inc.


System: IBM PC XT, AT, and compatibles
Completed: 1984
Processor: Intel 8088, 80286, and 80386
Profile: Pick Systems, Inc. announced in 1984 the availability of
its operating system for the IBM PC XT. The product is distributed
internationally through a direct dealer network. PICK also provides
an implementation on the IBM PC AT (Intel 80286) and the Intel
80386, two products positioned for multi-user capabilities in the
business microcomputer marketplace.

Licensee: Rexon Business Systems


Culver City, California (213) 641-7110
System: Summit
Completed: 1986
Processor: 80286, 80386
Profile: Rexon, a subsidiary of Hambrecht & Quist, was the first
licensee to ship PICK Open Architecture.

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: Seattle OS, Inc.


System: IBM Series/1 and IBM PC RT
Completed: 1982 and 1987, respectively
Processor: IBM Series/1 and PC RT
Profile: SOS was a Super-VAR for the IBM Series/1 systems.
More recently, SOS licensed the Open Architecture version of
the PICK System for resale on the powerful IBM PC RT. Even
more recently, PICK Systems, Inc. liked the product so much
that they bought a major share in the company, in July of
1988.

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

(Real-Time Programming Language) product. In 1987, SMI sold


the rights to the RPL language, along with its PICK System license
for PICK/370, to the Ultimate Corporation. Now primarily a
software supplier, SMI recently announced a consultative service
called PAR for PICK System users who need to measure just how
effective their systems really are, and ANVIL for companies
seeking to evaluate their PICK applications on various computers.

Licensee: TAU Engineering, Inc.


Tokyo, Japan (03) 234-2711
System: TAU M-68000
Completed: 1983
Processor: Motorola MC68000
Profile: TAU was the first Japanese licensee of the PICK Operat
ing System. Its marketing efforts are primarily concentrated within
Japan. The TAU implementation supports the full Japanese
character set.

Licensee: Toltec Computers, Inc.


Scottsdale, Arizona (602) 998-8860
System: Edge core
Completed: 1988
Processor: Proprietary
Profile: Toltec, a start-up company, was first funded then ac
quired by Edge computers during the project to implement
SYMETRIX, a co-resident PICK/UNIX system. The product is
viewed as indicative of Edge core’s commitment to sell computers
through every distribution channel at its disposal.
Licensee: The Ultimate Corporation
East Hanover, New Jersey (201) 887-9222
System: Ultimate, DEC, Honeywell, Tandem, IBM
Completed: 1979
Processors: Proprietary
Profile: The Ultimate Corporation was founded in 1978 by two
former Microdata dealers, who commissioned PICK to
implement the operating system on the Honeywell Level 6
series of computers. The first Ultimate computer was shipped
in 1979; since then Ultimate has grown to be a major supplier
of new PICK Systems. Under the direction of Theodore
Sabarese, Ultimate has grown to be one of the most successful
companies in the United States, with more than $1 million of

30
0
List
s
revenue per employee in 1986.

Licensee: Xmark Corporation


Costa Mesa, California (714) 556-9210
System: Turboplex
Completed: 1987
Processor: 80286, 80386
Profile: The Xmark Corporation under the direction of Phil
Haines (affectionately known as the “pizza king”) is best
known for its efforts to market a multi-user version of MS
DOS. The company is currently in the process of merging its
TURBODOS with PICK, to provide large companies that use
MS-DOS software with the ability to run PICK and DOS-
based packages on the same system (a little like getting two
pizzas in the same box).

Related PICK Licensees (Authorized Emulations)


Cosmos, Inc.
Seattle, Washington (206) 643-9898

Prime Computer, Inc. Natick, Massachusetts (617) 655-8000


V-Mark Corporation Natick, Massachusetts (617) 655-4506

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.

Decimal Hex Octal Binary EBCDIC ASCII Keyboard

0 00 000 00000000 00 NUL


1 01 001 00000001 01 SOH <ctl-A>
2 02 002 00000010 02 STX <ctl-B>
3 03 003 00000011 03 ETX <ctl-C>
4 04 004 00000100 37 EOT <ctl-D>
5 05 005 00000101 2D ENQ <ctl-E>
6 06 006 00000110 2E ACK <ctl-F>
7 07 007 00000111 2F BEL (bell) <ctl-G>
8 08 010 00001000 16 BS (backspace) <ctl-H>
9 09 011 00001001 05 HT (hor. tabs) <ctl-I>
10 0A 012 00001010 25 LF (linefeed) <ctl-J>

3
0
3
Appendix B

Decimal Hex Octal Binary EBCDIC ASCII Keyboard

11 OB 013 00001011 OB N'T (vert, tabs) <ctl-K>


12 OC 014 00001100 OC FF (formfeed) <ctl-L>
13 OD 015 00001101 OD CR (return) <ctl-M>
14 OE 016 00001110 OE SO <ctl-N>

15 OF 017 00001111 OF SI <ctl-O>


16 10 020 00010000 10 DLE <ctl-P>
17 11 021 00010001 11 DC1 (XON) <ctl-Q>
18 12 022 00010010 12 DC2 (ptr. on) <ctl-R>

19 13 023 00010011 3A DC3 (XOFF) <ctl-S>


20 14 024 00010100 3C DC4 (ptr. off) <ctl-T>
21 15 025 00010101 3D NAK <ctl-U>
22 16 026 00010110 32 SYN <ctl-V>
23 17 027 00010111 26 ETB <ctl-W>

24 18 030 00011000 18 CAN <ctl-X>


25 19 031 00011001 19 EM <ctl-Y>

26 1A 032 00011010 3F SUB <ctl-Z>


27 IB 033 00011011 27 ESC ESC
28 IC 034 00011100 IC FS

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

Decimal Hex Octal Binary EBCDIC ASCII Keyboard

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

101 65 145 01100101 85 e


102 66 146 01100110 86 f
103 67 147 01100111 87 g
104 68 150 01101000 88 h
105 69 151 01101001 89 i

106 6A 152 01101010 91 j


107 6B 153 01101011 92 k
108 6C 154 01101100 93 1
109 6D 155 01101101 94 m
110 6E 156 01101110 95 n
111 6F 157 01101111 96 0

112 70 160 01110000 97 P


113 71 161 01110001 98 q
114 72 162 01110010 99 r
115 73 163 01110011 A2 s
116 74 164 01110100 A3 t

117 75 165 01110101 A4 u


118 76 166 01110110 A5 V

119 77 167 01110111 A6 w


120 78 170 01111000 A7 X

121 79 171 01111001 A8 y


122 7A 172 01111010 A9 z

30
6
ASCII Codes
Decimal Hex Octal Binary EBCDIC ASCII Keyboard

123 7B 173 01111011 co {


124 7C 174 01111100 6A 11
125 7D 175 01111101 DO }
126 7E 176 01111110 Al
127 7F 177 01111111 07 DEL

High-order ASCII (high-order bit on)


128 80 180 10000000 04
129 81 181 10000001 06
130 82 182 10000010 08
131 83 183 10000011 09
132 84 184 10000100 OA

133 85 185 10000011 13


134 86 186 10000100 14
135 87 187 10000101 15
136 88 190 10000110 17
137 89 191 10000111 1A

138 8A 192 10001000 IB


139 8B 193 10001001 20
140 8C 194 10001100 21
141 8D 195 10001101 22
142 8E 196 10001110 23
143 8F 197 10001111 24
144 90 200 10010000 28

145 91 201 10010001 29


146 92 202 10010010 2A
147 93 203 10010011 2B
148 94 204 10010100 2C
149 95 205 10010101 30

150 96 206 10010110 31


151 97 207 10010111 33
152 98 210 10011000 34
153 99 211 10011001 35
154 9A 212 10011010 36
155 9B 213 10011011 38
156 9C 214 10011100 39
157 9D 215 10011101 3B
158 9E 217 10011110 3E

30
7
Appendix B

Decimal Hex Octal Binary EBCDIC ASCII Keyboard

159 9F 220 10011111 41


160 AO 221 10100000 42
161 Al 222 10100001 43
162 A2 223 10100010 44
163 A3 224 10100011 45
164 A4 225 10100100 46
165 A5 226 10100101 47
166 A6 227 10100110 48
167 A7 230 10100111 49
168 A8 231 10101000 4A
169 A9 232 10101001 4F
170 AA 233 10101010 51
171 AB 234 10101011 52
172 AC 235 10101100 53
173 AD 236 10101101 54
174 AE 237 10101110 55
175 AF 240 10101111 56
176 BO 241 10110000 57 1
177 Bl 242 10110001 58 2
178 B2 243 10110010 59 3
179 B3 244 10110011 62 4
180 B4 245 10110100 63 5
181 B5 246 10110101 64 6
182 B6 247 10110110 65 7
183 B7 250 10110111 66 8
184 B8 251 10111000 67 9
185 B9 252 10111001 68
186 BA 253 10111010 69
187 BB 254 10111011 70
188 BC 255 10111100 71
189 BD 256 10111101 72
190 BE 257 10111110 73
191 BF 260 10111111 74
192 CO 261 11000000 75 @
193 Cl 262 11000001 76 A
194 C2 263 11000010 77 B
195 C3 264 11000011 78 C
196 C4 265 11000100 8A D

30
8
ASCII Codes

Decimal Hex Octal Binary EBCDIC ASCII Keyboard

197 C5 266 11000101 8B E


198 C6 267 11000110 8C F
199 C7 270 11000111 8D G
200 C8 271 11001000 8E H
201 C9 272 11001001 8F I
202 CA 273 11001010 9A J
203 CB 274 11001011 9B K

204 CC 275 11001100 9C L


205 CD 276 11001101 9D M
206 CE 277 11001110 9E N

207 CF 280 11001111 9F O


208 DO 281 11010000 AO P
209 DI 282 11010001 AA Q
210 D2 283 11010010 AB R
211 D3 284 11010011 AC S

212 D4 285 11010100 AD T


213 D5 286 11010101 AE U
214 D6 287 11010110 AF V
215 D7 290 11010111 BO w
216 D8 291 11011000 Bl X

217 D9 292 11011001 B2 Y


218 DA 293 11011010 B3 Z
219 DB 294 11011011 B4 [
220 DC 295 11011100 B5 \
221 DD 296 11011101 B6 ]
222 DE 297 11011110 B7 A

223 DF 300 11011111 B8 —


224 EO 301 11100000 B9 1

225 El 302 11100001 BA a


226 E2 303 11100010 BB b
227 E3 304 11100011 BC c
228 E4 305 11100100 BD d
229 E5 306 11100101 BE e
230 E6 307 11100110 BF f
231 E7 310 11100111 CA g
232 E8 311 11101000 CB h
233 E9 312 11101001 CC i

309
Appendix B
Decimal Hex Octal Binary EBCDIC ASCII Keyboard

234 EA 313 11101010 CD j


235 EB 314 11101011 CE k
236 EC 315 11101100 CF 1
237 ED 316 11101101 DA m
238 EE 317 11101110 DB n
239 EF 320 11101111 DC 0

240 F0 321 11110000 DD P


241 Fl 322 11110001 DE q
242 F2 323 11110010 DF r
243 F3 324 11110011 El s
244 F4 325 11110100 EA t
245 F5 326 11110101 EB u
246 F6 327 11110110 EC V

247 F7 330 11110111 ED w

248 F8 331 11111000 EE X

249 F9 332 11111001 EF y


250 FA 333 11111010 FA z
251 FB 334 11111011 FB [ (start buffer)
252 FC 335 11111100 FC [ (subvalue mark)
253 FD 336 11111101 FD ] (value mark)
254 FE 337 11111110 FE A
(attribute mark)
255 FF 340 11111111 FF _ (segment mark)

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

Here is what the attributes in the above item mean.


001 P Indicates that this is a verb.
002 1OBB Indicates the entry point and ABS frame address. The 1 is
referred to as the entry point and is the decimal
displacement (offset branch address) at which execution is
to begin in the ABS frame. The formula used is
(displacement * 2) + 1; hence there can be no entry point
zero in an ABS frame. OBB is the hexadecimal address of
the ABS frame that contains the code for this command.

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:

>EDIT filename itemlist (opt i ons) <cr>


>COPY filename itemlist (opt i on s) <cr>
>BASIC filename itemlist (opt i ons) <cr>

The filename specification may take any of the following forms:


filename: This filename reference defaults to access the
data section of the specified file.
>EDIT STAFF 100<cr>

DICT filename: When the literal, DICT, precedes the


filename reference, this instructs the system to
access the dictionary level of the file.
>EDIT DICT STAFF NAME<cr>

filename,filename: This type of filename specification only occurs in


files that have multiple data sections. The first
filename parameter refers to the dictionary in
which the file pointer will be
found, and the second filename indicates the

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

Here is what the attributes in the above verb-defining-item mean:

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

Here is what the attributes in the above verb-defining-item mean:

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.

Table D-l Conversion/Correlative Codes


Associative Conversion Correlative
(ATTR 4) (ATTR 5) (ATTR 8)
Con version /Correlative

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

This appendix is too brief to cover every possible nuance of the


conversions and correlatives, but a complete listing of the conversion and
correlative codes from “generic” PICK follows, along with the options for
each of the different specifications. (Note: In the following list, the “()”
encloses an expression, while the “op” indicates an optional operand.)

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

are somewhat similar to PICK/BASIC expressions and consist of operands,


operators, and special functions combined together to yield a single resulting
value. Multiple expressions may be present here, provided that each is
separated by a meaningful operator.

Available Operands

An Attribute Number Any whole number implies an AMC (Attribute


Mark Count). This means that the contents of the specified attribute are
retrieved before continuing with the processing of the specification. For
example:

008 A1*2

This causes ACCESS to multiply the contents of attribute 1 by the


contents of attribute 2. Since these are direct references to the data, the AMC
defined in attribute 2 of the attribute-defining item is ignored, although a
number is still required in attribute 2.

9998 This is a special attribute number recognized by ACCESS to


produce a sequential number of the item on an ACCESS report. It may also
appear as an AMC in attribute 2 of an attribute-defining item.

9999 This is another special operand that instructs ACCESS to display


the size of the current item, measured in bytes. It may also be used as an AMC
reference in attribute 2 of an attribute-defining item.

N(attribute name) This type of operand allows a reference to any other


attribute-defining item in the dictionary of the same file. This is sometimes
referred to as an “indirect” reference to a data element, as opposed to a “direct”
reference to a data element using a specific attribute number (AMC). For
example:

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.

N(attribute name)(conversion{]conversion) This form expands on the


previous topic of indirect references to data elements. In this form, an indirectly
referenced data element may immediately be “passed through” one or more
conversions or correlatives prior to returning a value to the A specification. For
example:

AN(DOB)(DWA):N(DOB)(DMA)::N(DOB)(DD):, ”:N(DOB)(DY)

This would produce a date in the form:

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:

A8(DWA):", ”:8(DMA):” ":8(DD):", ”:8(DY)

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”

This example causes ACCESS to retrieve the contents of attribute 8


(presumably a date in internal format), and subtract it from the current system
date. The parentheses indicate the precedence of processing, and cause this
operation to occur as the very first step. After this calculation takes place,
ACCESS divides the result by the constant 365, yielding the approximate age in
years.

NB The NB operand is a very special code used in a sorted ACCESS report


that includes a BREAK-ON modifier for producing control breaks. This code
displays the current break level, starting at zero.

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.

NI The NI operand displays the sequential item number of the item


being processed.

NV This operand displays a count of the number of multivalues


contained in the item being processed.

TVS' The NS operand displays a count of the number of subvalues


contained in the item being processed.

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.

Literal or Numeric Constant Any operand enclosed in single (1) or double


(") quotes is treated as a constant, or literal, including numbers. This can be
useful in scaling numbers or in specifications involving comparisons. For
example:

A(9*"15")/"IO"

This specification means: Take the contents of attribute 9, presumably an


integer number, and multiply (or scale) it by the constant 15. It then takes the
product and divides (or descales) it by dividing the result by the constant 10.
This is effectively like taking the original value contained in attribute 9 and
31
9
Appendix D

multiplying it by 1.5. This is required due to a restriction of ACCESS; it


simply cannot handle any math that requires a decimal, so the principle of
scaling and descaling numbers is currently required in attribute-defining items.

Substring Function This is very similar to the T (Text extract)


specification in that the first parameter specifies the character position at
which the text extraction is to begin, and the second parameter indicates the
number of characters to extract for processing. The general form is:
[“beginning character position”,“length expression”]
Note that the double quote symbols are required around each number and that
the brackets are actually part of the function. For example:

008 A6["1"r"3"J

This instructs ACCESS to retrieve, from attribute 6, the first 3 characters


of the data.

S(expression) This operand produces a summation of all of the


multivalues in the attribute referred to in “expression.” That covers the valid
operands available to the A specification. When multiple operands are used in
an A specification, they are to be delimited by one of the following operators:
Mathematical Operators:
+ add
— subtract
* multiply
/ divide
Concatenation Operator:
: concatenate
Logical Operators:
= equal to
■ not equal to
■ less than
■ greater than
■ = less than or equal to
■ = greater than or equal to
When the logical operators are used, the A specification returns a 1 if the
expression evaluates to true and a 0 if the expression is false. This can be
extremely useful in an ACCESS selection criteria, using an attribute-defining
item with a complex A specification. Remember, however, that such a
specification must appear as a correlative in attribute 8 of the attribute-defining
item, so it is performed before the ACCESS selection criteria are applied.

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:

008 C;1;", ";2;" ";3

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.

Table D-2 Examples of Date Conversions


Conversion Output Format Internal External

D DD-MMM-YYY 8944 26 JUN 1992


D— MM-DD-YYYY 8944 06-26-1992

DO DD-MMM 8944 26 JUN


DO MM-DD 8944 06-26
DD Day of month 8944 26
DI Internal 06/26/92 8944
DJ Julian 8944 178
DM Month (numeric) 8944 6
DMA Month (alpha) 8944 JUNE
DQ Quarter (numeric) 8944 2
DW Day of week (numeric) 8944 5
DWA Day of week (alpha) 8944 FRIDAY
DY Numeric year 8944 1992

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.

With the exception of the “N(attribute-defining item)” operand, all of


the operands listed under the A specification are available in the F speci-
32
3
Appendix D

fication. In addition, any ACCESS conversion may be used as an operator. The


top entry of the stack is used as the source value for the conversion.

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:

LO Displays just the length of the data.


L9 Indicates that the data will only display if the length of the string is less
than 9 characters.
L3,9 Indicates that the data will only display if the length of the data is
greater than 3 characters and less than 9 characters.

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:

M{just} {precision} {scalefactor} {Z} {,signcode} {$} {(formatmask)}

where:

The “just” specification indicates the justification of the string, either L


(left) or R (right).
The “precision” parameter, a number between 0 and 9, indicates the
number of decimal positions to print after the decimal point.
The “scalefactor,” a number between 0 and 9, indicates the power to
which the data is to be descaled.
The “Z” parameter suppresses zero balance fields.
The comma (,) parameter inserts commas in every third position to the left
of the decimal point.
The “signcode” parameter indicates the following:

C Negative results are followed by the literal CR.


D Positive results are followed by the literal DB.
E Negative results are enclosed in angle brackets: (result).
M Negative results are followed by a minus (—) sign.
N This suppresses the leading minus sign on negative numbers. It’s very
useful on Profit & Loss Reports.

The $ specification causes a “$” (dollar sign) to be appended to the data


prior to justification. The “Formatmask” may be any combination of
literals and format operators, such as:
# Fills display with blanks.
* Fills display with asterisks.
% Fills display with zeros.
Each of these parameters is followed by a number, which indi
cates the length of the mask. Table D-3 shows some examples.
32
5
Appendix D

Table D-3 Examples of Money Conversions


Conversion Internal External

MRO 15577 15577


MR2 15577 155.77
MR2,$ 2345678 $23,456.78
MR2,D$ 10000 $100.00DB
MR2,E$ -10000 <$100.00>
MR2,$*15 567890 ******$5,678.90

The MC The MC (Mask Character) function is used to convert alphabetic strings to


Conversion upper- or lowercase, and optionally to suppress the display of numeric or non-
numeric characters. The general format is:
MC{/}charcode
The examples below and in table D-4 show the use of the MC function.
MCA Displays only the alphabetic characters in the attribute.
MC/A Displays only the nonalphabetic characters in the attri
bute and ignores alphabetic characters.
MCDX Converts a decimal data value to its hexadecimal equivalent.
MCL Converts all uppercase characters to lowercase characters and
leaves lowercase characters intact.
MCN Displays only the numbers from a data value.
MC/N Returns all non-numeric characters and ignores numeric
characters.
MCP Converts all nonprintable characters (characters between X‘OO-
1F’ and X‘7F-FF ’) to periods. (Note that characters above
X‘7F ’ display, but actually have different character
meanings as their high order bit is lost.)
MCT Converts uppercase characters to lowercase, starting with the
second character in each word.

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.

Table D-4 Example of MC Conversions

Conversion Sample Data Sample Output

MCA 121 MAIN STREET MAINSTREET


MC/A 121 MAIN ST. 121 . (the is deliberate)
MCDX 400 1024
MCL FRED FLINTSTONE fred FLINTSTONE
MCN 121 MAIN STREET 121
MC/N 121 MAIN STREET
MAIN STREET (the space before
“MAIN” is deliberate)
MCP <ctl>G . (the is deliberate)
MCT BARNEY Barney O’Rubble
O’RUBBLE
MCU betty rubble BETTY RUBBLE
MCXD 1024 400

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:

The H specification in the MT conversion specifies a 12-hour clock. The


default is a 24-hour clock.
The S specification indicates that seconds should be displayed. Table D-
5 shows some examples.

Table D-5 Examples of MT Conversion


Conversion Sample Data Sample Output

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:

Conversion Sample Data Sample Output

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:

Conversion Sample Data Sample Output

Tl,3 7145551212 714


T4,7 7145551212 5551212
Tl,l BARNEY B

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:

Conversion Sample Data Sample Output

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

As a reference tool, we have included this list of some attribute-defining items


used as examples in our tutorials. It has been our experience that one can
usually remember a particular technique by referring to an example. Here is a
quick reference to the attribute-defining items and the conver- sion/correlative
specifications used in the tutorial examples.
Note that these attribute-defining items contain lines that appear blank.
They are, in fact, “null.” This means that there must be no characters
whatsoever on the attributes shown as blank.

Item-id: NAME ADDRESS CITY STATE

001: A A A A
002: 1 2 3 4

003: NAME ADDRESS CITY STATE


004:
005:
006:
007:
008:

009: L T L L
010: 15 20 15 5

3
3
1
Appendix D

Item-id: ZIP A 5 ZIP PHONE HIRE.DATE


001: A A
002: 6 PHONE 7
003: HIRE.DATE
004:
005:
006: R5
007: ML((###) ###-####) 02/
008:
009: L 14 R
010: 8

Item-Id: SALARY CSZ AREA.CODE


001: A A A
002: 9 3 6
003: SALARY CSZ AREA.CODE
004:
005:
006:
007:
008: MR2,$ C;3;"f ”;4;” ”;5 T1,3
009: R L R
010: 10 30 9

Item-id: DATE1 DATE2 DATE3 DATE4


001: A A A A
002: 7 7 7 7
003: DATE1 DATE2 DATE3 DATE4
004:
005:
006:
007: D2/ D D- DMA
008:
009: R R R L
010: 8 11 11 12

Item-id: UL.NAME UL.CSZ UL.ADDRESS


001: A A A
002: 1 3 2
003: UL.NAME UL.CSZ UL.ADDRESS
004:
005:
006:
007: MCT MCT MCT
008: C;3;”f ” ;4;” ”;5
009: L L L
010: 15 30 25

33
2
Dictionary Listings

Item-id: MR.1 MR.2 MR.3 MR. 4


001: A A A A 9 MR.4
9 9
002: 9
MR.1 MR.2
003: MR.3
004:
MR2,$*12
005:
006:
MR2 MR2, R 12
007: D$ MR2,$
008:

009: R R R
010: 8 11 8

Item-id: FIRST.NAME LAST.NAME SALARY+50%


001: A A A
002: 1 1 9
003: FIRST.NAME LAST.NAME SALARY+50%
004:
005:
006:

007: T2,99 MR2,$


008: 61,1 GJ A;(9*"150")/"100"
009: L L R
010: 15 15 10

Item-id: SALARY-25 AGE BIRTHDAY


001: A A A
002: 9 8 8
003: SALARY-25 AGE BIRTHDAY
004:
005:
006:

007: MR2,$ D2-


008: A;(9*"75")/"100" A;(D-8)/"365"
009: R R R
010: 10 5 8

Item-id: STATE.NAME UL.STATE


001: A A
002: 4 4
003: STATE.NAME UL.STATE
004:
005:
006:
007: MCT
008: TSTATES;C;;1 TSTATES;C ;;1
009: L L
010: 15 15

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

takes a <ctl-shift-A> to produce the attribute known as a “tube.”


mark. Fortunately, you won’t have to do this very Delimiter—reserved This is the set of four special
often. characters used to accommodate the variable
length record structure of the PICK system. They
Attribute mark count The relative number of an
are: attribute mark (A), value mark (]), subvalue
attribute within an item.
mark (\), and segment mark (_). Note that all four
Base fid This is the “first” frame of the block of of these characters are control characters.
contiguous frames set aside for a file. Generally, when these characters need to be used
Bit Actually a contraction for binary digit. The in programs, they are obtained through the
logical representation of either a 1 or 0. When CHAR function, with each character referred to
eight of these gang together, they are called a by its decimal equivalent.
byte. Delimiter—non-reserved A delimiter is simply a
Byte A collection of eight bits, which together rep- pre-defined character used to separate other
resent one of the 256 possible characters in the characters in a string. For example, each word in
ASCII character set. this sentence is “delimited” by a space. Any
character may be treated as a delimiter.
Conversion A code native to the ACCESS and
PICK/BASIC languages that performs a “re- Dictionary The level of the file system used to con-
versible mapping,” according to the new defini- tain the attribute-defining items for use in AC-
tion of SMA. More practically, these are special CESS sentences, as well as to define the actual
codes that alter or change the data from one for- location of the data section for a file via its data
mat to another. For example, a money amount definition item, commonly called its “D-
may be “externally converted” so that it displays pointer.”
a dollar sign, commas, and decimal point. When Editor The process through which programs are
a conversion code appears on attribute 7, it oc- entered into the computer. It allows items to be
curs during the “postprocessing” phase, meaning created, changed, and deleted from any file.
right before the data is displayed or printed. ERRMSG File that contains the text of the error
Correlative According to SMA, not a reversible messages of the operating system.
mapping. Many conversion codes and correlative Fid Contaction for “frame-id.” The logical address
codes are interchangeable between attributes 7 of a frame. The number of frames on a PICK
and 8 in an attribute-defining item. This tends to computer is a function of how much disk is
make the process of classifying a code as a present. Each frame is given a unique number be-
correlative or conversion a little difficult. When a tween 0 (zero) and “maxfid,” the “last” address-
correlative resides on attribue 8, it is handled in able frame.
the “preprocessing” phase, meaning before the Files Files are collections of logically related items,
data is sorted or selected. much as a file cabinet contains file folders made
CRT Abbreviation for Cathode Ray Tube. Better up of similar types of information. For example,
33
6
Glossar
y

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

A ASCII codes, 303 BREAK-ON modifier, 136


Assembly, 259 BY-DSND modifier, 137
ABS, 11, 241
Assembly level, 13 BY modifier, 102, 137
ABS, and monitor, 243
Assignment, 183
ABSolute code, 13
Associative specifications, 28
ACC (accounting history file), 23 C
Attaching media, 211
ACCESS, 12, 21, 30, 51, 99 Calculator function command, 38
Attribute(s), 4, 13, 19, 27
command(s), 13, 43, 70
defining format, 316 C associative, 322
file, 73 CATALOG, 191
defining items, 18, 27, 104
modifiers and options, 135
Mark Count (AMC), 28 C correlative, 321
sentences, 103, 109 Chronological history, 6-10
name, 28
tape-handling commands, 132
values of, 25 Connectives, 45
verbs, 99, 100, 124, 313 Changing password, 58
Automatic link editing, 3
Accessing, 24, 27
CHOO-CHOO, 64
ACCfile, 41 Choosing account name, 55
ACCOUNT, 18 B
CIE 680 series, 293
Account names, 32 BACKWARD LINK, 237 CLEAR-FILE, 61, 62
ACCOUNT-SAVE, 41 Base FID. 19, 20, 26 Climax, 293
A correlative, 318 BASIC command, 191 Column output justification, 22
Activating programs, 191 Batch processing, 4 Column width, 9, 22
ADDD command, 38 Binary, 26 Combining expressions, 186
ADDS mentor, 292 BLOCK-CONVERT, 42 Command mode, 65
Adding output field, 102 BLOCK-PRINT command, 49 Compiling programs, 191
Adding password, 58 BLOCK SIZE, 211 Concatenation operator, 321
Algebraic specification, 318 Boolean expression, 186 Constants and literals, 181
ALPHA function, 202 Boolean operators, 118, 199 Control peripherals, 13
Analysis and design, 268 Bottom (B) command, 84 Conversion, 13, 29
Applications generators, 247, 255 BP file, 41 /correlative reference, 315
Arguments, 186 Branching, 166 processing, 15
Arithmetic operators, 185

3
3
9
Exploring the PICK Operating System

COPY command, 52 connectives and modifiers, 45 FIO, 77


delete option, 54 files, 39 Flatfiles, 3
overwrite option, 57 DISPLAY prompt, 226 FOOTING AND HEADING modifiers,
COPY-LIST command, 131 DOC file, 40 139
Copy to printer, 52 (D) option, 139 Formatting reports, 22
Correcting entry errors, 33 Double quotes, 122 FORWARD LINK, 237
Correlation processing, 15 DUMP, 21, 237, 239 FRAME, 20, 236
Correlative, 29 DUMP frame, 22 Frame-id, 23, 27
COUNT verb, 124 DX pointer, 20 Frame paging, 232
CREATE ACCOUNT, 41, 55 Dynamic indexing, 29 FS, 78
CREATE-FILE, 20, 22, 23, 29, 37, FUNKEYS file, 40
39, 59
E
Crystal Excel, 293 G
Cursor control, 35, 40 ED command, 67, 190
CUSTOMER-REPORT, 151 Edge, 299 G correlative, 324
EDIT, 67 Generating T-DUMP tape/disk, 133
Edit file buffers, 68 GET-LIST, 52, 130
D Editing multiple items, 68 GIGO, 167
D associative, 322 EDIT-LIST, 131 GO command, 157
Data, Editor, command glossary, 66 line Go to (G) command, 83
flow diagrams, 268, 269 pointer, 66 utility, 65 Group terminator, 240
retrieval process, 99 END statement, 203
storage, 13 Entering system, 32 H
store analysis, 273 ERRMSG file, 40
Database dictionaries, 5, 265, 269 Escape pods, 199 “Hashed open bucket” access method,
DATABASE level, 12 Evolving standards, 5 30
Data conversions, 180, 323 EX, 79 Hashing algorithm, 26, 27, 102
D/CODE, 19, 20 Excalibur, 292 Hash order sequence, 124
D command, 165 EXPANDED FILE, 236 HEADING and FOOTING options,
D conversion, 322 Explicit reports, 111 140
DE, 89 Expressions, 184, 186 HEADING modifier, 139
DEC, 300 HELLO program, 190
DELETE, 54 Hewlett-Packard 3000, 293
F
-FILE, 62
item (FD), 80 F correlative, 323 I
LIST, 132 FD, 80
Fields, 24 IBM, 300
prompt, 227
FIK, 78 IBM PC, AT, XT, 297
Design considerations, 267
File-defining items, 18-20, 22 IBM PC, RT, 298
Detaching media, 212
Filename, 19 IBM Series/1, 298
DET-SUPP modifier, 139
File pointer system, 17, 18, 39 ICON, 296
Dictionary, 14, 15, 28
File resizing, 23 Identifying a PROC, 146
listings, 331
FILE-SAVE, 41 IF statement, 166, 172
-only files, 60
File signpost components, 20 IF THEN statement, 203
pointer, 19
File structure, 235 Implicit reports, 111
commands, 43, 84
Index accuracy, 4
34
0
Infinite loop, 146
INFORM, 29
Initializing, 183
Input buffer, 172
Input pointer, 163
INPUT statement, 198
Inputting and displaying data, 162
Insert (I) command, 71, 73
Insert/replace mode, 65
Integral database manager, 3
Integrated processes, 12
Intel 8088 processor chip, 281
Interactive mode, 168
Interleaving disk storage, 234
Internal architecture, 6, 17
Internal conversion, 180
Internal format, 74
Intrinsic functions, 184
IP (input) command, 163
Item,
accessing, 24, 27
-id, 14, 18, 26, 27, 32, 53
length, 82
logical structure, 25
physical structure, 25
storage, 26
terminator, 240

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

HAYDEN BOOKS 978067248412490000


A Division of Howard W Sams & Company 4300 IVest 62nd
Street
Indianapolis, Indiana 46268 USA

You might also like