Вы находитесь на странице: 1из 60

The Minimum You Need to Know

to Be an OpenVMS Application Developer

By Roland Hughes

Logikal Solutions

Copyright 2005 by Roland Hughes


All rights reserved
Printed and bound in the United States of America
ISBN 0-9770866-0-7
This book was published by Logikal Solutions for the author. Neither Logikal Solutions
nor the author shall be held responsible for any damage, claim, or expense incurred by a
user of this book and its accompanying CD-ROM as a result of its use or reliance upon the
contents contained in either the book or the CD-ROM .

These trademarks belong to the following companies:


ACUCOBOL
Acucorp, Inc.
CDD
Oracle Corporation
CMS
Hewlett Packard Corporation
DEC
Digital Equipment Corporation
DEC BASIC
Hewlett Packard Corporation
DEC COBOL
Hewlett Packard Corporation
DEC C
Hewlett Packard Corporation
DECSET
Hewlett Packard Corporation
FMS
Hewlett Packard Corporation
HP
Hewlett Packard Corporation
KeaTerm
Attachmate Corporation
IBM
International Business Machines, Inc.
LSE
Hewlett Packard Corporation
OpenVMS
Hewlett Packard Corporation
ORACLE
Oracle Corporation
Purify
Pure Software, Inc.
Reflections
WRQ, Inc.
RMS
Hewlett Packard Corporation
RDB
Oracle Corporation
Windows
Microsoft Corporation
WordPerfect
Corel Corporation
UNIX
The Open Group

All other trademarks inadvertently missing from this list are trademarks of their respective owners. A best
effort was made to appropriately capitalize all trademarks which were known at the time of this writing.
Neither the publisher nor the author can 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.

Acknowledgments
A book of this nature comes about as a result of a nearly 20-year journey through
the career of software development. During the course of that journey your knowledge
and skill are honed by the countless individuals you come in contact with either personally
or electronically. Som e of them you dont remember as time goes on, yet you do remember
the things they taught you.
One definitely must thank their family for allowing them to pursue a passion and
dream even though they didnt really understand the passion or the dream. At some point
it is possible that I didnt fully understand it myself.
In particular I would like to thank M r. Ken Olsen, the founder of Digital
Equipment Corporation. Your company put out the greatest operating system known to
mankind. Thanks for the memories.

Source Code Licence


Any person owning a copy of this book may use the source code from this book and
accompanying CD-ROM freely w hen developing software for their personal use, their
companys use, or their clients use. Such persons m ay include the source code either
modified or unmodified provided that the source delivered makes reference to the original
author and is delivered as part of a fully functional application. It is expressly forbidden
for anyone to post this software on any bulletin board system, internet W eb site, or other
electronic distribution medium without the express written consent of the author. It is
also expressly forbidden to sell this source as part of a library or shareware distribution
of source.
Users of the source code contained within this book and on the accompanying CDROM agree to hold harmless both the author and the publisher for any errors, om issions,
losses, or other financial consequences which result from the use of said source. This
software is provided as is with no warranty of any kind expressed or implied.

Table of Contents
Introduction.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I.1 Purpose of This Book. . . . . . . . . . . . . . . . . . . .
I.2 What You Need to Know to Read This Book.
I.3 Who Should Read This Book. . . . . . . . . . . . . .
I.4 How to Read This Book. . . . . . . . . . . . . . . . . .
I.5 Our Sample Application.. . . . . . . . . . . . . . . . .
I.6 Why OpenVMS?. . . . . . . . . . . . . . . . . . . . . . . .
I.7 The Definition of Application. . . . . . . . . . . . .

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

Chapter 1
Fundamentals of OpenVMS. . . . . .
1.1 Hardware. . . . . . . . . . . . . . . . . .
1.2 Logging In. . . . . . . . . . . . . . . . .
1.3 Symbols. . . . . . . . . . . . . . . . . . .
1.4 Editor Choices. . . . . . . . . . . . . .
1.5 EDT Exercises. . . . . . . . . . . . . .
1.6 TPU and EVE Configuration. .
1.7 LSE. . . . . . . . . . . . . . . . . . . . . . .
1.8 Logicals. . . . . . . . . . . . . . . . . . . .
1.9 ACLs and the UAF.. . . . . . . . . .
1.10 Logical Name Tables. . . . . . . .
1.11 Foreign Commands. . . . . . . . .
1.12 Exercises.. . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

I-1
I-1
I-1
I-1
I-2
I-2
I-4
I-5

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

. 1-1
. 1-1
. 1-3
. 1-5
. 1-9
1-14
1-18
1-20
1-21
1-28
1-38
1-40
1-41

Chapter 2
DCL and Utilities We Need.. . . . . . . . .
2.1 DCL for Application Development.
2.2 FDL and Our Indexed Files. . . . . .
2.3 Indexed File Lore. . . . . . . . . . . . . . .
2.4 Lexical Functions. . . . . . . . . . . . . . .
2.5 The Import Program. . . . . . . . . . . .
2.6 Exercises.. . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

. 2-1
. 2-1
. 2-1
. 2-5
2-12
2-14
2-20

Chapter 3
DEC BASIC. . . . . . . . . . . . . . . . . . . . . .
3.1 Goals. . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Language Data Types. . . . . . . . . . .
3.3 Magic Numbers. . . . . . . . . . . . . . . .
3.4 Group vs. Record. . . . . . . . . . . . . . .
3.5 Creating Our Statistics Files. . . . .
3.6 Data File Reporting. . . . . . . . . . . . .
3.7 Other BASIC Language Features..
3.8 BASIC Features to Never Use. . . .
3.9 The Zero Element. . . . . . . . . . . . . .
3.10 Where Do We Go From Here?. . . .
3.11 Exercises.. . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

. 3-1
. 3-1
. 3-1
. 3-3
. 3-6
. 3-7
3-21
3-28
3-33
3-34
3-35
3-35

Chapter 4
FMS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.1 What is FMS?. . . . . . . . . . . . . . . . . . . . . . . .
4.2 Creating a Data Entry Screen in FMS. . . .
4.3 FMS Object vs. Library. . . . . . . . . . . . . . . .
4.4 Stand Alone Data Entry. . . . . . . . . . . . . . .
4.5 An FMS Browse Program. . . . . . . . . . . . . .
4.6 An FMS Menu. . . . . . . . . . . . . . . . . . . . . . .
4.7 FMS Functions to Never Use. . . . . . . . . . .
4.8 FMS Summary. . . . . . . . . . . . . . . . . . . . . . .
4.9 FMS Function and Subroutine Sum mary.
4.10 Exercises.. . . . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

. 4-1
. 4-1
. 4-2
. 4-5
. 4-6
4-20
4-27
4-38
4-38
4-39
4-53

Chapter 5
CMS Theory and Practice. . . . . . . . . . . . . . . . . . . . . . . . .
5.1 Code Management System. . . . . . . . . . . . . . . . . . . . .
5.2 Logical Environment for CMS Based Development.
5.3 Creating Our CMS Library. . . . . . . . . . . . . . . . . . . . .
5.4 Putting Our Application in the Library. . . . . . . . . . .
5.5 Deleting an Element From the Library. . . . . . . . . . .
5.6 Classes and Deletions. . . . . . . . . . . . . . . . . . . . . . . . .
5.7 Modifying Elements Once They Are in CM S. . . . . . .
5.8 Productionizing the Application. . . . . . . . . . . . . . . . .
5.9 Legacy Build Procedure.. . . . . . . . . . . . . . . . . . . . . . .
5.10 Additional CMS Commands. . . . . . . . . . . . . . . . . . .
5.11 Promotion Between Libraries. . . . . . . . . . . . . . . . . .
5.12 Exercises.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

. 5-1
. 5-1
. 5-1
. 5-9
5-10
5-11
5-12
5-12
5-13
5-16
5-18
5-20
5-29

Chapter 6
CDD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1 What is CDD?.. . . . . . . . . . . . . . . . . . . . . . . . .
6.2 Some Definitions You Need to Know. . . . . . .
6.3 The Different Camps of CDD Configuration.
6.4 Creating a Repository. . . . . . . . . . . . . . . . . . .
6.5 Defining Our Logicals and Directories. . . . . .
6.6 Creating Our Fields and Records. . . . . . . . . .
6.7 Converting Our Include File. . . . . . . . . . . . . .
6.8 Using Variants and Dates. . . . . . . . . . . . . . . .
6.9 Nuking the CDD. . . . . . . . . . . . . . . . . . . . . . .
6.10 Full Build Modification. . . . . . . . . . . . . . . . .
6.11 CDD Usage Summary. . . . . . . . . . . . . . . . . .
6.12 Mass Changes Due to CDD. . . . . . . . . . . . . .
6.13 Exercises.. . . . . . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

. 6-1
. 6-1
. 6-2
. 6-3
. 6-5
. 6-6
. 6-8
6-12
6-14
6-20
6-22
6-24
6-24
6-29

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

Chapter 7
Object and Text Libraries. . . . . . . . . . . . . . . . . . . .
7.1 What We Know About Libraries So Far. . . . . .
7.2 Application Logicals We Need.. . . . . . . . . . . . .
7.3 Creating Our Text Library. . . . . . . . . . . . . . . .
7.4 Converting Our Application to a Single EXE.
7.5 Programming Assignment. . . . . . . . . . . . . . . .
7.6 Exercises.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

. 7-1
. 7-1
. 7-2
. 7-2
. 7-3
7-23
7-24

Chapter 8
MMS. . . . . . . . . . . . . . . . . . .
8.1 The Purpose of MMS. . .
8.2 The Correct Way to Use
8.3 Putting It All Together.
8.4 Exercises.. . . . . . . . . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

. 8-1
. 8-1
. 8-1
. 8-8
8-12

Chapter 9
Message Utility, Mail and Phone. . . .
9.1 Message File Definition. . . . . . . . .
9.2 VMSMAIL Overview. . . . . . . . . . .
9.3 Sending M ail From Inside Server
9.4 Programming Assignment. . . . . .
9.5 VMSPhone Overview. . . . . . . . . . .
9.6 Creating Your Own Messages.. . .
9.7 Testing Your Messages. . . . . . . . .
9.8 Programming Assignment 2. . . . .
9.9 Exercises.. . . . . . . . . . . . . . . . . . . .

............
............
............
Applications..
............
............
............
............
............
............

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

. 9-1
. 9-1
. 9-2
. 9-5
9-10
9-10
9-12
9-14
9-21
9-21

Chapter 10
FORTRAN. . . . . . . . . . . . . . . . .
10.1 Yes, Its Still Out There. . .
10.2 Basics of Fortran. . . . . . . .
10.3 Our Sample Application. .
10.4 Programming Assignment
10.5 Using Message Files. . . . .
10.6 Our Quadword Example. .
10.7 Sending Mail. . . . . . . . . . .
10.8 Programming Assignment
10.9 Exercises.. . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.

......
......
MMS.
......
......

..
..
..
..
1.
..
..
..
2.
..

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

. 10-1
. 10-1
. 10-2
. 10-7
10-53
10-53
10-54
10-56
10-60
10-60

Chapter 11
COBOL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.1 Overview.. . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2 Interview Questions That Are Red Flags. .
11.3 The Myth of the COBOL SORT Verb. . . . .
11.4 The DCL SORT Command. . . . . . . . . . . . .
11.5 Our Sample Application. . . . . . . . . . . . . . .
11.6 Programming Assignment. . . . . . . . . . . . .
11.7 The Rest of the Language. . . . . . . . . . . . . .

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

. 11-1
. 11-1
. 11-2
. 11-4
. 11-4
. 11-6
11-58
11-59

11.8 Our Quadword Example. . .


11.9 Sending Mail. . . . . . . . . . . .
11.10 Programming Assignment
11.11 Exercises.. . . . . . . . . . . . . .

..
..
2.
..

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

11-61
11-62
11-67
11-68

Chapter 12
C/C++. . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.1 Overview.. . . . . . . . . . . . . . . . . . . . .
12.2 Some Differences on OpenVMS. . .
12.3 Our Sample Application in C. . . . .
12.4 C++ Philosophy and Terminology..
12.5 Our Sample Application in C++. . .
12.6 C/C++ Follow Up. . . . . . . . . . . . . . .
12.7 Debugging Notes for C/C++.. . . . . .
12.8 Sending Mail. . . . . . . . . . . . . . . . . .
12.9 D_FLOAT Example. . . . . . . . . . . . .
12.10 Programming Assignments. . . . . .
12.11 Exercises.. . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

. . 12-1
. . 12-1
. . 12-6
. . 12-9
. 12-69
. 12-71
12-139
12-146
12-147
12-152
12-156
12-156

Chapter 13
MySQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.1 Why MySQL?. . . . . . . . . . . . . . . . . . . . .
13.2 Getting and Installing MySQL. . . . . . .
13.3 Our Application Database. . . . . . . . . . .
13.4 Creating the Tables. . . . . . . . . . . . . . . .
13.5 Com piling and Linking With M ySQL..
13.6 Our Sample Application. . . . . . . . . . . .
13.7 MySQL Follow-up. . . . . . . . . . . . . . . . .
13.8 Programming Assignments. . . . . . . . . .
13.9 Exercises.. . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

. 13-1
. 13-1
. 13-4
. 13-9
13-10
13-13
13-17
13-65
13-67
13-69

Chapter 14
RDB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14.1 Why RDB?. . . . . . . . . . . . . . . . . . . . . . . . .
14.2 Whats in the Book and Whats on Disk. .
14.3 Table and Database Definitions. . . . . . . .
14.4 The Drawbacks. . . . . . . . . . . . . . . . . . . . .
14.5 Our SQLMOD Implementation. . . . . . . .
14.6 Programming Assignment 1. . . . . . . . . . .
14.7 SQLMOD Follow Up. . . . . . . . . . . . . . . . .
14.8 EXEC SQL Implementation. . . . . . . . . . .
14.9 RDB Follow Up. . . . . . . . . . . . . . . . . . . . .
14.10 Programming Assignment 2. . . . . . . . . .
14.11 Exercises.. . . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

. 14-1
. 14-1
. 14-4
. 14-5
14-14
14-15
14-29
14-37
14-38
14-54
14-55
14-55

Chapter 15
Ruminations and Observations. . . . . . . . . . . . . . . . . . . . . . . . . .
15.1 Overview.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.2 What Do You Do?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3 Keep Your Eye on the Sparrow.. . . . . . . . . . . . . . . . . . . . . .
15.4 Have You Ever Wondered Why Y2K Happened?. . . . . . . .
15.5 Optimal Technology.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.6 The Self-Defeating Business Model. . . . . . . . . . . . . . . . . . .
15.7 Offshore Computing The Death Knell of IT in the U.S. .
15.8 Avoiding a Hell-Hole. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

. 15-1
. 15-1
. 15-1
. 15-5
. 15-6
. 15-9
15-11
15-14
15-17

Introduction

I.1 Purpose of This Book


The purpose of this book is to be an aid for developers sw itching platform s to
OpenVMS. It is also designed to be useful to college level students who have had at least
one of the programming languages covered in this book as course work. Anyone who is
currently successful at writing applications on the lesser platforms, namely Windows and
UNIX, should be able to use this book and in a relatively short period of tim e becom e
productive on the much more robust and stable platform of OpenVM S.
There are quite a few third party books which have been written over the years
on/about the OpenVMS platform. Those books go into great detail about very specific
areas of this platform. What you should glean from this book is a very broad
understanding of developm ent tools and techniques you will encounter when working on
the OpenVMS platform. While we will delve into some of the obscurities a developer
needs to be aware of as we cover each topic, we will not cover all of the m inutiae.
This book is not intended to be the last and final word on OpenVMS developm ent, nor
is it intended to replace the dozens upon dozens of manuals written for OpenVMS by its
owners. (Currently HP at the time of this writing.) You should know enough when you
finish with this book to both not be afraid of developm ent, and know where to look for
further information. Upon completion of this book you will have more than enough
knowledge and skills to become a maintenance programmer at many shops running
OpenVM S.

I.2 W hat You N eed to Know to Read This Book


This book is intended to be used by applications developers, consultants, and to som e
extent system s analysts. You should have had at least one course in logic and be
com fortable with at least one of the programming languages covered in this book or a
language very similar to it. Managers will find much of the information useful when
making technical direction decisions. Those developers whose only language is Visual
something or other didnt learn a language and will flounder miserably with this book.

I.3 W ho Should Read This Book


Anyone who plans to become em ployed or a consultant using the OpenVMS platform
should both own and read this book. No matter how seasoned you are on a platform, even
if OpenVMS is your current platform, it is nice to have a cheat-sheet to flip through when
the mind gets a little foggy. As I get older, I find I cheat more when having to go back and
maintain some of the really old stuff at client sites. Hence, it was part of the incentive to
write this book.

I-2

Introduction

I.4 How to Read This Book


This book is meant to be read from front to back initially, then serve as a reference
manual on your desk. Each chapter builds upon the previous chapter. Once we talk about
DCL in Chapter 2 we use it and talk about it throughout much of the book. Likewise, once
we talk about BASIC, we will continue talking about it most of the way through the book.
Some books cover only one topic like a single language. They bombard you with the
mass of the syntax in such a general way as to be useless when taken in the context of any
single platform. This book is not a dry and sterile treatise on the syntax of languages.
This book starts you out with the minimum you need to know just to log on and use the
platform . Then it builds one application teaching m any different aspects of the platform
as you need to know them during the course of the development. Where appropriate, the
historical reasons for the way things are get passed along as well.
It is the hope of the author that using a single application which requires all of the
basic skills needed to be a maintenance developer on this platform w ith each of the
languages covered will teach you more than just those skills. Following the journey
through to the end will also give you an idea of the trade offs you make using each tool.
There is no one tool which is perfect for all jobs. There are many reasons you will find
shops using 4 or more languages. Sometimes they bought a package written in a language
they currently werent using, other times they wrote the package them selves in that
language or tool because it was the best tool for the job even if they had to encounter a
learning curve to make it work.
At the end of your journey is a rew ard. The chapter entitled Ruminations and
Observations is a series of essays about IT topics and life in general. This chapter is m y
reward for writing this book. Some of the sections there may offend you beyond any scope
of reason good. Others may provoke thoughts which keep you lying aw ake at night
trying to figure out a solution also good. The topics I choose to cover in this chapter are
problems and concepts which must be addressed in IT for the good of the industry. How
they actually get addressed will be up to you the reader, and you the voting shareholder
of corporations. There are sections in that chapter covering information gathering,
optimal technology, the reason Y2K happened and off shore computing.

I.5 Our Sam ple Application


We will have a single sample application redeveloped in all languages. Im not going
to bore you to tears with a contrived and hokey inventory or order entry system which
seems to be the bane of academia. Lets face it, we have all read books like that, and we
never spent any time after we finished the book playing with the application because it
was boring. Im also not going to create a useless paint application which you will find
touted in almost every GUI platform book on the market.

I-3

Introduction

Our sample application will track the Mega-Zillionare lottery. No, that is not its
official name. There are several different multi-state lotteries with similar rules and
official web sites where you can download data. The test data for this application will be
provided on the CD-ROM and be called DRAWING_DATA.TXT. Once you are comfortable
with using the various editors you can download and format your own bulk data file for
import.
Initially we will use RMS indexed files to store the data. One for the drawing data,
and two for statistical data. Dont get nervous; we will only be doing some crude stats on
the data. Mainly we will count the number of hits, percentage of hits, sequence of hits,
average and m aximum of misses between hits. Calling it statistics is probably being too
grandiose.
The input data file is a CSV (comma separated values) formatted file. It contains one
record per line in the format: drawing date, number 1, number 2, number 3, number 4,
number 5, and the mega number. The primary indexed file will be laid out in much the
same way.
We will have the following main components in each application:

Import program to create a new data file from a bulk import file.

Stats generation program to create two new indexed statistics files.

Report programs to print off numbers based upon their statistical ranking.

A form of data entry to add additional drawing data on a single record basis.

A browse program to scroll through the drawing data.

As you can see this little application will encompass all of the core functionality you
need to know to begin being productive with each tool set described. By redeveloping the
same application with different languages and different tools you will get a feeling for the
design tradeoffs each tool set has. When we get to the relational database chapters the
indexed files will be replaced by tables. Hopefully you will experiment yourself with each
of the tool sets to find improvements to make the application more to your liking. As I
said, Ive chosen an application you might actually wish to play with if for no other reason
than the new data is available every week.
As stated, we will have 3 indexed files for this application. The first will be an indexed
file containing the drawing data, the second will contain stats for the main drawing
numbers, and the third will contain stats for the m ega/power number. Below are the file
layouts. The tag of k0 to the right of a field is my way of flagging the primary key.
Drawing_Data
Dr a w _ d t
No _ 1
No _ 2
No _ 3
No _ 4
No _ 5
Me g a _ n o

c h a r [ 8]
i n t e g er
i n t e g er
i n t e g er
i n t e g er
i n t e g er
i n t e g er

k0

I-4

Introduction

Drawing_Stats
El m _ n o
Hi t _ c o u n t
La s t _ d r a w _ n o
Si n c e _ l a s t
Cu r r _ s e q
Lo n g e s t _ s e q
Pc t _ h i t s
Ma x _ b t w n
Av e _ b t w n

Mega_Stats
i nteger
i nteger
i nteger
i nteger
i nteger
i nteger
d ouble
i nteger
d ouble

k0

Elm_no
Hit_count
Last_draw_n o
Since_last
Curr_seq
Longest_seq
Pct_hits
Max_btwn
Ave_btwn

integer
integer
integer
integer
integer
integer
double
integer
double

k0

I.6 W hy OpenVM S?
Many of you reading this will be coming from other platforms you are comfortable
with and believe they can be used to do anything. M ost of these platforms havent existed
as long as OpenVMS. Few , if any, had the number of operating system s and hardware
changes which culminated with OpenVMS. Near the dawn of the computer age (you know
you are really old if you can rem em ber the dawn of an age) som e of the first platform s
m ade by Digital Equipm ent Corporation (DEC) were the DEC-10 and DEC-20 tim e
sharing computers. I never had the privilege of working on those platforms but have
talked with some that did. They performed exceptionally well for their era running
TOPS-10 and TOPS-20 operating system s.
Later DEC came out with the PDP line of computers. These computers ran various
operating systems: RSTS/E, R SX-11 and RT-11 among them. (Those coming from the
U N IX side of life may also remember that UNIX was originally developed on the PDP
hardware platform.) Each of the previously m entioned OSs still have their followers
today. Though the job opening advertisements for those operating systems may be few
and far between now, you will still find some PDP hardware running today. There are
even som e manufacturers m aking PDP-11 em ulators to use inside various other boxes.
Each of the operating systems was designed to handle some niche applications incredibly
well; so well, some companies have opted not to replace them as long there is some method
of keeping them running.
When DEC came out with the VAX platform they had over a decade of seasoning and
think tanking by some incredible minds behind them. Both the platform and the
operating system were designed from the ground up to create a seamless network. Today,
with the Internet available to the masses for a fee, most would say so what. OpenVM S,
however, wasnt designed today; it was originally laid out in the late 1970s for platform s
selling in the early 1980s. With OpenVMS came the original definition of clustering.
Many operating systems today claim clustering capabilities and m any application
packages claim to be cluster aware on m any platforms, but once you become accustomed
to the power, stability and flexibility of clustering in an OpenVMS environment, you will
see just how hollow those claims really are. We wont cover much on clustering in this
book, not because there isnt much to cover, but because once a system manager sets up
a cluster, the application developer really doesnt care w here the nodes are. When a
system manager chooses to mount a disk drive on one node as available to the cluster it
looks just like a local disk drive to the application developer no matter what node they are

Introduction

I-5

working on. By nodes Im not just talking about servers in the sam e building. These
machines can be anywhere in the world. I have personally consulted for companies that
had nodes scattered across the US, England, Ireland, Germany and other countries. From
time to time you may see some lag accessing one of the drives due to congestion on the
network, but you dont access them any differently.
Batch queues, print queues, and ACM S (Application Control and Management
System) applications can be defined so that any node in the cluster can use them without
the faintest idea of where they are. Admittedly, you m ight want to know where the
printer actually is which is servicing a print queue, but you dont have to. More
importantly, that printer could very well be on a different continent from the cluster node
servicing it. Indexed, sequential and other file types can be shared by multiple users from
any node in the cluster.
The Records Managem ent System (RMS) on OpenVMS provides a feature developers
can choose to use called RMS Journaling. This works in unison with a component/product
called DTM (Distributed Transaction Manager). DTM keeps everything in sync and rolls
partial transactions back. This allows a developer a great amount of both freedom and
security. You can have a single transaction which encompasses multiple RMS Journalled
files and m ultiple RDB tables and know profoundly that nothing will be updated until you
actually commit the DTM transaction. If the power grid drops on your machine while
your program is running, when the OS comes back up and starts the DTM portion, DTM
cleans itself up. If you develop your application correctly, you can simply restart the
application once the system has com e up and rejoined the cluster.
OpenVMS doesnt suffer from the e-mail and other viruses which plague other
platforms. It has passed num erous DOD security tests. Some hacker conferences have
even declared the OS unhackable. While I would never go so far as to make that claim
about any OS, coming from groups like that it is quite a statement.
A concept which was pioneered on the PDP platform has become a force of
unprecedented power - logicals. We will cover logicals in C hapter 1. They are a truly
amazing creation which provide security, simplicity and complexity all at the same time.
A person could write almost an entire book just covering the concept and implementation
of logicals. This book will give you enough understanding about them to both use and
respect them.

I.7 The D efinition of Application


For the purposes of this book and the possible follow up book I am defining application
as a single hosted program or set of programs running on a single cluster. While many
people would call these systems, I do not. In m y view, systems developm ent requires
a data interface to the outside world.

I-6

Introduction

While one could make the argument that an application which gets tapes loaded via
sneaker net is a system using a tape interface, in todays world those types of systems
dont usually exist. (Sneaker net refers to operators wearing sneakers running around a
computer room gathering print outs and handling tapes.) Systems in todays world
interface via a communications library (MQ Series, Tibco, DECNET, Tuxedo, and if
desperate, TCP/IP) to non hom ogenous platforms. They feed each other in real time or
batch mode. Their function and failure is visible outside the com pany. Application failure
is only visible inside the company.

Chapter 1

Fundamentals of OpenVMS
1.1 Hardw are
Covering all the hardware produced by DEC and third party com panies over the years
would be a book of massive size and provide you w ith little information needed by an
application developer. W hat an application developer really needs to be aware of is the
terminals they will log in with. Occasionally you will need to know how to hit the
OFF-LINE button on a system printer, hit FORM FEED a few times, then hit OFF-LINE
again to put the printer back on-line, but those buttons are clearly m arked on all printers
so I think you can figure it out.
M any types of terminals exist. The DEC series of terminals are referred to as VT
term inals for Video Terminal. (Some say it stands for Video Tube as all such devices were
called tubes; others say it stands for Video Text but many of these terminals handle
graphics.) Today all standard terminal models have 3-digit model numbers. The 4-digit
numbers are generally VXT terminals for multi-session X window type interfaces. The
granddaddy of them all is the VT-52. This was a massive black and white (monochrome)
term inal norm ally communicating at a whopping 150 or 300 baud working in upper case
all of its life. Yes, they could communicate faster, but the cable length had to be very
short. There were older terminals and paper consoles (yes, a printer with a keyboard built
into it) but the VT-52 seems to be when things were finally catching on. The VT-52
definition for the m ost part is the AN SI TTY definition with added formatting controls for
cursor movement. It's replacement, the VT-100, became the ANSI standard terminal and
is supported by a plethora of non-DEC operating systems. My first exposure to it was on
a PDP-11/70 running RSTS/E. This was also my first exposure to DEC equipment.
Today, regardless of the VT model, it will generally support VT-100 escape sequences
and functionality. Some newer models only go back as far as VT-220 which was one of the
first models supporting the enhanced keyboard used by later DEC term inals. Below is a
picture of the DEC style keyboard attached to my Alpha machine.
Of special interest
to us is the numeric
keypad on the right
hand side. When we
get to the section on
u s in g th e v a r io u s
editors available on
OpenVMS you will see
that they are the
primary interface.

1-2

Chapter 1 - Fundamentals of OpenVMS

Terminals are going the way of the abacus though. Most places today purchase a VT
term inal emulation package for a personal com puter. I use one alm ost exclusively on m y
notebook com puter when traveling to client sites. The advantages of the em ulator are
many. Most notably you can communicate over the office network at full network speed.
You can have multiple sessions opened on multiple machines and use your m ouse to paste
between terminal windows. Emulators also give us the ability to paste to/from PC based
applications into the terminal. Above all, you can customize the colors almost anyway you
wish to make your computing experience enjoyable.
Notice the keyboard
layout.
The numeric
keypad on the right has 4
PF keys across the top and
3 keys down the right side
below them .
PC based
keyboards are short one
key in this area which can
make for some interesting
problems. The numeric
k e y p a d is h o w y o u
n avigate throu gh th e
d ifferen t tex t ed itors
available on OpenVM S.
When we get to the section
on using the EDT version
of the editor we will cover
this in significant detail.
Another point worthy of note are the [HELP] and [DO] keys at the top. In the TPU
version of the editor (and many OpenVM S applications) these two keys are used heavily.
The keys [F1]. [F2], [F3], and [F5] are quite significant. [F1] is the Hold key. This
stops the terminal scroll. You hit it again to turn scrolling back on. It does not stop an
application that is running or turn off output. This key is also mimicked by <ctrl><S>
(hold) and <ctrl><Q> (end hold) combinations. [F2] is the screen print key. If your
terminal has a printer attached to the back of it (or a network printer setup via the
SETUP key) when you hit this key it causes the contents of the screen to be dumped to the
printer. You can turn on a scrolling print by pressing <ctrl>[F2] and turn it off by hitting
the same key combination again. [F3] is known as the SETUP key. When you hit it, one
or more menus will pop up that you can navigate through setting all the possible
configuration parameters for your terminal. There are too many to go into here and they
vary term inal to term inal. Basically all aspects of how the term inal communicates with
the outside world and appears to you are controlled here.
[F5] is a key of special importance. Unless your terminal is hooked up to a LAT or is
a multi-session enabled terminal you should N EVER hit this key. When the terminal is
hardwired as the console for many systems (central terminal used by operators on a

Chapter 1 - Fundamentals of OpenVMS

1-3

special port on the m achine) hitting the BREAK key can halt the entire system for all
users. You will know you have done this when you see the following prompt: >>>. If you
do not type RES and hit <return> before an internal tim e-out occurs on the box you will
have crashed the entire system for all users. Don't play with this key unless you know
what you are doing. On old paper terminals hooked up as system consoles the
combination of <ctrl><p> used to duplicate this function. More than one operator went
to hit <ctrl><o> to turn output off for something and accidentally hit <ctrl><p>.
The com bination of <ctrl><o> is used to turn output off. This is not like hold which
simply stops the scrolling so you can read it. This combination routes the output to the
bit bucket until the command interpreter regains control.
Most of the remaining function keys across the top are available for application usage.
Their function will vary based upon what program you are running.

1.2 Logging In
The first term s you need to becom e fam iliar with are Logging On and its counterpart
Logging Off. (Also called Logging In and Logging Out.) Logging In is the process
of getting Logged In. (Sorry, I couldn't resist doing a Webster on you.) We will start
with the easy scenario assum ing you have a single session terminal hooked up via a serial
connection. We will also assume that you have been assigned a user ID of FRED with a
password of MY_PASSWORD. (Neither user names nor passwords are case sensitive in
the OpenVM S environment.) Your password will not be displayed while it is typed.
<r e t u r n >
Us e r n a m e : F R E D
Pa s s w o r d :
W e l c o m e t o ....yada yada yada
$

The $ is the default prompt on a OpenVMS system. Most system managers will
have changed the prompt to be the name of the node you are logged into followed by
->. So you see something like
Ki r k - >

instead of the $ prompt. In fact let me show you how to change the prompt so it shows
your node name instead of the default $. Doing this requires the use of a lexical function
which we will talk about later on. If you are exploring on your own for a while you can
type HELP LEX at your command prompt to display the lexical functions available to you.
$ s e t p r o m p t = ' f $ g e tsyi(nodename)->
LG K L 1 - >

Once logged into a system you should take a few moments and explore the HELP
command. This command will bring up a wealth of system help information and allow you
to navigate through it. H elp is very intuitive. When you want out of HELP just keep
hitting <return> until you get back to your system prompt.

1-4

Chapter 1 - Fundamentals of OpenVMS

After you have finished (or gotten tired of) going through HELP take a few moments
and get familiar with the disk structure on your system. To do this use the SH O W
DEVICE D command. The command will respond with a list of all devices starting with
the letter D attached to your system . Both disk drives and CD-ROM drives will be
reported.
$ show dev d
De v i c e
Name
LG K L 1 $ D K A 1 0 0 0 :
LG K L 1 $ D K A 1 2 0 0 :
LG K L 1 $ D K B 0 :
LG K L 1 $ D V A 0 :

Device
Status
Mounted
Mounted
Online wrtlck
Online

Error
Count
0
0
0
0

Vo lume
La bel
SYS
DEV

Free
Blocks
15184692
16248006

Trans
Count
467
1

Mnt
Cnt
1
1

Many different configurations exist for DEC equipment. You can have shadowed
drives, logical drives, etc. The topic fills an entire chapter in OpenV M S system s
managem ent guides so we won't go into it any further. From the application developer
standpoint a disk is a disk (as long as it is mounted and write enabled).
Error count is the number of soft or hard errors a drive has logged since system boot.
D rives under OpenVMS should be error free. When a bad spot is encountered it is
mapped out by the disk subsystem and logs a soft error. If a drive starts logging a lot of
errors it is going bad and needs to be replaced. You should get everything you have on it
backed off to tape so the drive can be swapped out.
Had we chosen to look at devices starting with m instead of d the error count could
be anything. While many types of devices can start with an m, traditionally you will see
the tape drives at the top of the listing. A tape drive will log an error any time it
encounters a dirty or bad spot on the tape and has to skip over it. Back in the days of mag
reel tapes it was not uncom m on to see this count be well up into the thousands. Even
when we cleaned the tape drive heads every day there was still enough paper dust floating
around the computer room to cause issues. Keep in m ind that up tim e for OpenVM S
boxes is measured in years, not days. The error count isnt cleared until the system
reboots.
Volume label is the name the disk was initialized with. Normally sites label drives
for their intended purpose. SYS is obviously the system boot disk. Similarly, drives with
labels DEV would be for developers use, WARHSEn would be for warehouse use, etc. As
an application developer you need to be aware of such things only if your system s
manager hasn't already created a directory on a drive for you to use when testing your
application.
Free blocks is the number of blocks rem aining for use on the drive. A block on disk
is 512 bytes. On VAX systems a disk block was equal to a page size in memory. On alpha
systems the page size can be any number of pagelets that your system manager specifies.
A pagelet, however, is still 512 bytes.
Every disk drive has a root directory [000000]. Under OpenVMS directory
inform ation is enclosed in square brackets. OpenVMS also has a concept foreign to most

1-5

Chapter 1 - Fundamentals of OpenVMS


computing environments known as versioning.
LOGIN.COM file could well be like:
DUA1:[FRED]LOGIN.COM;4

The full file specification for your

DUA1 is the disk where your directory resides; [FRED] is the directory; LOGIN.COM
is the file name; and 4 is the version. If you were to edit this file and save it, the new file
specification would be the same, but the version would be 5. In order to get rid of older
file versions, you can use the PURGE command. (Please refer to the information in HELP
on the PURGE command.) File versioning is an incredibly powerful tool and one of the
many reasons OpenVM S (RM S) has thrived for so long. (RM S = Records Management
System.) Every time you create a file, it gets a version number attached to it. If it is the
first time that file has been created at that current location (no other file exists with the
same name), it gets a version of 1. If you are executing a directory command and only
want the top most level of files, you do as follows:
LG K L 1 - > d i r
Di r e c t o r y D K A 1 2 0 0 : [HUGHES.MEGA_ZILLIONARE]
DR A W I N G _ D A T A . T X T ; 1
DRAWING_NUMBERS.TXT;1
ILLINOIS_MEGA.FDL;1
IL L I N O I S _ M E G A . I D X ; 5 ILLINOIS_MEGA.IDX;4 ILLINOIS_MEGA.IDX;3 IMPORT_MEGA_CSV_FILE.C;30
IM P O R T _ M E G A _ C S V _ F I LE.DIA;6
IMPORT_MEGA_CSV_FILE.EXE;20
IM P O R T _ M E G A _ C S V _ F I LE.EXE;19
IMPORT_MEGA_CSV_FILE.OBJ;18
IM P O R T _ M E G A _ C S V _ F I LE.OBJ;17
MEGA_IDX_FILE.IDX;1 M_ZILLIONARE.H;2
To t a l o f 1 4 f i l e s .
LG K L 1 - > d i r * . * ; 0
Di r e c t o r y D K A 1 2 0 0 : [HUGHES.MEGA_ZILLIONARE]
DR A W I N G _ D A T A . T X T ; 1
DRAWING_NUMBERS.TXT;1
ILLINOIS_MEGA.FDL;1
IL L I N O I S _ M E G A . I D X ; 5 IMPORT_MEGA_CSV_FILE.C;30
IMPORT_MEGA_CSV_FILE.DIA;6
IM P O R T _ M E G A _ C S V _ F I LE.EXE;20
IMPORT_MEGA_CSV_FILE.OBJ;18
ME G A _ I D X _ F I L E . I D X ; 1 M_ZILLIONARE.H;2

When you want to get rid of older versions of files, you can specifically delete those
versions or you can use the PU RGE command. You can purge entire directories, trees of
directories or single files. There are qualifiers which can be used on the PURGE
command; the most commonly used is /KEEP=n. This allows you to specify how many
versions to leave lying around. Some directories get set up by the system manager to have
no version limit which means you could get m any thousands of the same file name in the
directory. Most system m anagers tend to set the version limit to 3 when creating
directories for developers, since we tend to be the ones creating the most files and the ones
most likely not to purge.

1.3 Sym bols


One of the simplest concepts under O penVM S is symbols. A sym bol is much like a
program variable name in other languages. A sym bol can store either string text or
integer values. Sym bols are declared when they are first assigned and have either local
or global scope. Regular sym bols which contain string values should have those values

1-6

Chapter 1 - Fundamentals of OpenVMS

assigned in quotes (more on this to follow shortly). A sym bol can be assigned another
symbol value without putting the other symbol in quotes. Some exam ples:
$ a = 255
$ a : = = e d i t / e d t a .lst
$ show symbol a
A = 255
H e x = 000000FF
$ s h o w s y m b o l / g l o b al a
A = = E D I T / E D T A .LST

Octal = 00000000377

Notice that the sam e sym bol name was used but the values are stored separately?
That is because a single = means local scope while a double == means global scope.
You can view the scope as being two separate boxes w e put things in. These boxes also
have two different lifespans. The local symbol dies with the command file that created it.
The global symbol exists for the life of the parent process and can be accessed by any child
process. If there are symbols you want every user to have on your system then you need
to put their creation in the command file SYS$MANAGER:SYLOGIN.COM
$ s h o w s y m b o l / g l o b al a
A = = E D I T / E D T A .LST
$ show symbol a
A = 255
H e x = 000000FF
$ delete/symbol a
$ show symbol a
A = = E D I T / E D T A .LST
$ s h o w s y m b o l / g l o b al a
A = = E D I T / E D T A .LST

Octal = 00000000377

What happened? When OpenVM S is asked to retrieve a sym bol value it first looks
through the local box, then the global box and returns as soon as it finds the first
definition. W hen w e deleted the local sym bol 'a' that left only the global definition. In
other words, our local definition of 'a' hid the global definition of 'a' from the command
interpreter. BE VERY CAREFUL when m ixing global and local symbols. A single typo
can render the definition you want invisible.
Let's explore another example before we get into the other difference you should have
noticed above.
$
$
$
$
$

c = This is my
d := This is my
e = c
f = d
show symbol c
C = This is my
$ show symbol d
D = THIS IS MY
$ show symbol e
E = This is my
$ show symbol f
F = THIS IS MY

text
text

text
TEXT
text
TEXT

There are lots of little information nuggets to be mined from this example. The line
assigning a value to the symbol 'c' creates a local symbol storing text as does the line
assigning 'd', but m y! aren't they different? Notice when we display their values with the
SHOW command one is exactly as it was entered and the other is converted to upper case.
Even odder is the fact that these values were directly assigned to the 'e' and 'f' symbols

Chapter 1 - Fundamentals of OpenVMS

1-7

created below, or is it?


OpenVMS does not alter the case of text found within quotation marks. (Keep in mind
the EXACT phrasing of that when looking at examples to come later.) W hen := is used
instead of = for the assignment this tells OpenVMS to treat all values following the := to
end of line as literal text characters. When OpenVMS interprets the values supplied to
such an assignment it converts the literal text characters to uppercase and does not
perform any symbol substitution.
What is symbol substitution? The assignments into the symbols 'e' and 'f' caused one
form of sym bol substitution to happen. W e will discuss some others in later exam ples.
The technical definition of symbol substitution is when the value of a symbol (be it
integer or text) is substituted in place of the symbol.
$ f := d
$ show symbol f
F = D

See the difference in the second assignment of 'f'? Use of the := instead of the = caused
OpenVMS to interpret the character d as literal text and perform no symbol substitution.
Let's try a few more examples of symbol substitution.
$
$
$
$
$
$
$
$

x = blue
y = red
z = green
s e n 1 = m y f a v o r ite color is ''x'
s e n 2 = m y f a v o r ite color is ''y'
s e n 3 : = m y f a v orite color is ''z'
s e n 4 : = m y f a v o r ite color is 'x'
show symbol sen1
S E N 1 = m y f a v o r ite color is blue
$ show symbol sen2
S E N 2 = m y f a v o r ite color is red
$ show symbol sen3
S E N 3 = m y f a v o rite color is green
$ show symbol sen4
S E N 4 = M Y F A V O R ITE COLOR IS BLUE

Your first question probably revolves around ''x'. Even though it may look like a
double quote in front of x it is really two single quote characters (i.e. ' ' x ' without any
intervening spaces). When the command interpreter encounters two single quote marks
(also called a tick) inside of a fully quoted text string it tries to interpret the following
value as a sym bol and perform sym bol substitution for it. On m any new releases of
OpenVMS the trailing tick (single quote) is not required, but I highly recommend you use
it for both readability and portability back to older OpenVMS versions.
The last two examples were given to stress operation of the := operator. You can put
quotes around the literal string following this operator to tell OpenVMS not to convert its
case. If you don't put the quotes as the last example shows, the text gets converted to
upper case. Why were there only single ticks around x in the last assignment? Because
we weren't inside of quotation m arks. When doing a straight sym bol to sym bol
assignment you can put the tick marks around the source symbol, but they aren't
required.

1-8

Chapter 1 - Fundamentals of OpenVMS

$ k = sen4
$ show symbol k
K = M Y F A V O R I T E COLOR IS BLUE
$ l = s e n 1 s e n 2 s e n3
%D C L - W - E X P S Y N , i n v alid expression syntax - check operators and operands
$ l = s e n 1 + s e n 2 + sen3
$ show symbol l
L = m y f a v o r i t e color is bluemy favorite color is red my favorite color is green

I give this example to show that OpenVMS doesn't perform concatenation by default.
You can, however, concatenate string symbols with the + operator. The following example
should astound you.
$ k = k - f a v o r i t e
$ show symbol k
K = M Y F A V O R I T E COLOR IS BLUE
$ k = k - F A V O R I T E
$ show symbol k
K = MY
C O L O R I S BLUE

Yes, OpenVMS allows you to do string subtraction. As this exam ple shows, however,
the string must match exactly, including case. This makes it handy to build sym bols
which can be used to define logicals pointing to specific directories, such as follows:
$ J = F$DIRECTORY()
$ K = J - ] + . DATA]
$ SHOW SYMBOL J
J = [ROLAND]
$ SHOW SYMBOL K
K = [ R O L A N D . D A T A]

For now, just keep the above example in the back of your mind. We will discuss lexical
functions, et al. later in this book. At this point I need to give numeric symbols a onceover lightly.
$
$
$
$
$

a = 3
b = 2
c = a / b
d = b / a
show symbol
C = 1
Hex
$ show symbol
D = 0
Hex

c
= 0 0 000001
d
= 0 0 000000

Octal = 00000000001
Octal = 00000000000

You can only do INTEGER m ath. That m eans there is no rounding or decimal point
values stored.
$ pi = 3.414

%DCL-W-IVOPER, unrecognized operator in expression - check spelling and syntax


\.414\

The standard math symbols of * (multiplication), - (subtraction), / (division), and +


(addition) are supported, but be careful about trusting your results from division, as it is
integer math. Values are assum ed to be decimal but can be hex or octal. You can
explicitly force a representation by preceding the value with % and the base letter D =
decimal, X = hex, O = octal.

Chapter 1 - Fundamentals of OpenVMS


j = %d32
k = %x32
l = %o32
show symbol j
J = 32
H e x = 0 0000020
$ show symbol k
K = 50
H e x = 0 0000032
$ show symbol l
L = 26
H e x = 0 000001A

1-9

$
$
$
$

Octal = 00000000040
Octal = 00000000062
Octal = 00000000032

We do need to make a brief mention of binary symbols at this point. They are quite
different from num eric. Please examine the following:
$
$
$
7
$

n o r m a l _ b e l l = % x 07
bell[0,7] = %x07
w r i t e s y s $ o u t p u t normal_bell
w r i t e s y s $ o u t p u t bell

When you type the above 4 lines in you will notice that the warning bell beeps after
you hit return on the last line, but the line above it printed out a 7. The subscript told
OpenVM S which bits to stuff the value of hex 7 into. If you were lucky enough to have
been forced through a COBOL course during your education then this concept is not
unfamiliar to you. It is the difference between PIC 9 and PIC 9 USAGE IS COMP. The
first is a character representation restricted to numeric values and spaces, while the
second is a platform specific binary representation. Both hold a number, yet they are in
completely different forms.
The bell sym bol is one you will put in almost every production command file you
write. I almost wish OpenVMS would m ake it a constant sym bol. Normally when
providing your own error handling you will wrap the display of error messages within a
specific series of bells to obtain the users attention.
You can do many wonderful things with OpenVMS sym bols once you have mastered
the creation of command files. We will cover many more sym bol capabilities later. First
we must show you the tools that will be used to create both command files and text files.

1.4 Editor Choices


There are quite a few editors available on the OpenVMS platform. Depending upon
whether you are developing on a VAX or an Alpha platform your system default editor will
either be EDT or TPU. A third editor LSE is a phenomenal programmers editor. If your
company has installed the DECSet product which includes MMS and CM S it should be
available to you. You m ay have to declare a sym bol to invoke it though as som e
installations dont define the LSE sym bol. If you type LSE at the command line and get
an error, then type LSE :== $LSEDIT. (colon followed by 2 equal signs). If it has been
installed on your system you should then be able to invoke LSE by typing LSE.

1-10

Chapter 1 - Fundamentals of OpenVMS

EDT is one of the editors which has existed since the days of PDP running RSTS/E.
It was/is a line editor originally designed for use with paper terminals. Dont worry, it has
a very powerful screen m ode. Years ago EDT used to look for an initialization file called
EDTINI.EDT. Somewhere along the way this has changed to be a logical called EDTSYS
then a fall back logical called EDTINI. Since Im an old tim er we will set it up the old
way.
Hopefully nobody did you a favor when setting up your account as I am going to take
you through setting up your LOGIN.COM and EDTINI files. EDT was the default system
editor for the longest time on OpenVMS, but most newer releases seem to make TPU the
default editor. While TPU can handle much larger files and many more file types, its
name comes from Text Processing Utility. Those of us who grew up with EDT dont like
TPU, only using it when we have to. LSE is the pride of the line for developing software,
but EDT still has a few features which LSE either lacks or has so hidden I have never
found them. Log into your account and type the following:
$E D I T / E D T E D T I N I . E DT

If nobody set anything up for you there will be a * prompt which appears. At that
prompt type the letter C and hit <return>. Doing so will take you to screen m ode. If you
cam e up in screen mode then you probably already have a few lines in this file. Just
follow along and add what you feel is missing from your INI file. If you get an error
saying EDT is unavailable on your system please skip down to where we start setting up
TPU. I like to have the following lines in m y EDTINI.EDT file:
se t m o d e c h a n g e
se t s c r e e n 1 3 2
se t t a b 4

Once entered hit <ctrl>-Z on your keyboard to bring up the * prompt. At that
prompt type EX for EXIT and hit return. You may wish to skip the SET TAB 4 command
as some places dont like you to change your TAB size from the default of 8. When
working with C and other languages I find the default TAB setting of 8 characters is just
too deep. An 80 column (the default) screen width is also just too narrow for serious
programming with lots of right margin comments.
Now, hit the up arrow on your keyboard while sitting at the prompt. You will see the
command recalled for EDT. H it enter. If all was entered correctly your screen should
come up in screen m ode and you should see the contents you chose to type.
W hen you first bring up EDT it looks for the logical EDTSYS. If it doesn't find
anything it will look at the logical EDTINI. Should that logical be defined it will execute
that command file; if not defined it looks for EDTINI.EDT in your current working
directory. When neither are defined it defaults to line mode which is the little * prompt.
The entire bunch of searching is completely overridden when the /COMMAND qualifier
is used.

Chapter 1 - Fundamentals of OpenVMS

1-11

Here is the definition of the commands you provided: set mode change causes the
editor to come up in change mode just as if you had typed c at the * prompt; set
screen 132" causes the editor to change your terminal display to 132 column mode while
editing; set tab 4" causes the editor to change the default tab fill size to 4 characters
instead of the term inal default (norm ally 8). A tab size of 4 makes nesting IF statements
and other logic structures much more endurable. Since EDT doesn't allow us (the
programmers) to shift the screen right and left as LSE and other editors do this is
necessary.
Now we need to set up a symbol in your LOGIN.COM file so you don't have to type so
much each time you wish to edit. Type the following:
$ E D I T / E D T L O G I N . C OM

Enter the following into your LOGIN.COM file (near the top if the file isn't empty):
$ E D T : = = E D I T / E D T /COMMAND=SYS$LOGIN:EDTINI.EDT

Once again hit <ctrl>-Z to obtain the * prompt and type EX to exit. A new version
of your LOGIN.COM has been created. Type the following:
$ SHOW SYMBOL EDT
%D C L - W - U N D S Y M , u n d efined symbol - check validity and spelling
$ @LOGIN.COM
$ SHOW SYMBOL EDT
ED T = = E D I T / E D T / C OMMAND=SYS$LOGIN:EDTINI.EDT

@ tells OpenVMS to run a DCL command file in the current process. We will discuss
this later. Now log out of your OpenVMS system and log back in. Then type the show
symbol command again. You will see that EDT is defined now each time you log in.
EDT is your friend. You will spend many hours using it and its operation sets the tone
for many other applications on the OpenVMS platform. EDT is not without limitations.
It doesn't like record/line lengths exceeding 255 bytes and shouldn't be used for data files
with binary data. EDT has file size limits, which you will never hit writing program code,
but you can hit if you try to work with data files.
The world of EDT is opened up by the keypad. Below is the standard help screen you
get when you hit the [PF2] key on the top of the numeric keypad when using a VT
term inal. (If you are using an em ulator, you will need to check your emulator keyboard
m apping.) When you look at the numeric keypad layout on the right, you read it as
follows for dual function keys: top function is default function; bottom function is used
when the GOLD key has been hit just prior to this key.

1-12

Chapter 1 - Fundamentals of OpenVMS

Thus, to find some text in a program or command file, you would hit [PF1] followed
by [PF3] (GOLD then FIND, not together as in <ctrl>-Z). You would then be prompted
at the bottom of the screen for the text to find. If you want to search for the text
backwards from where you are, you follow the entry by hitting the [5] key on the keypad.
To search forward you hit the [4] key. If you just hit [ENTER] from the num eric keypad
(not <return> from the keyboard), then the direction you last set with the keypad will be
used.
Remember, EDT used to be a command line editor before there were Video Tubes. A
wealth of command line functions exists. You can get EDT to tell you about them by
hitting [PF1] (GOLD) and [7] from the keypad. This will give you a little * prompt at the
bottom of the screen. At that prompt, type HEL and hit [ENTER] from the keypad. A
short help screen giving general commands will be displayed. Regrettably, you cannot
navigate this help screen as you can the keypad help. This is due to the fact it is for the
command line interface.
You can get help on a topic by typing HELP topic. If a topic is abbreviated, HELP
displays the text for all topics that match the abbreviation. Below are the results of typing
HELP HELP.
H E L P t o p i c s u b topic subsubtopic...
A t o p i c c a n h a v e o ne of the following forms:
1 . A n a l p h a n u m eric string (e.g. a command name, option, etc.)
2 . T h e m a t c h - a ll or wildcard symbol (*)
Ex a m p l e s : H E L P S U B STITUTE NEXT
H E L P C H A NGE SUBCOMMAND
HELP CH
If a t o p i c i s a b b r eviated, HELP displays the text for all topics that
ma t c h t h e a b b r e v i a tion.

1-13

Chapter 1 - Fundamentals of OpenVMS


Ad d i t i o n a l i n f o r m a tion available:
CH A N G E
FI N D
PR I N T
SU B S T I T U T E

CLEAR
HELP
QUIT
TAB

COPY
INCLUDE
RANGE
TYPE

DEFINE
INSERT
REPLACE
WRITE

DELETE
EXIT
JOURNAL
KEYPAD
RESEQUENCE SET

FILL
MOVE
SHOW

Pr e s s r e t u r n t o c o ntinue

Perhaps you should feel some sense of accomplishm ent here. You are already familiar
with some of the commands (i.e. CHANGE, EXIT, and SET). Rem ember when you had
to type C at the * prompt to get into screen mode? That was the CHANGE command
to get into screen editing m ode. EXIT saved your file when you were done editing. (If you
want to get out without saving use QU IT.) You were also exposed to the SET command
when you created your EDTINI.EDT file. Notice that some of the command line
commands have SET synonyms? SET MODE CHANGE is the same as CHANGE at the
* prompt. This is not an accident. It allows you to do wonderful things with EDT from
inside of batch jobs with no term inal attached to the process.
TYPE is a command you will never use. It was there from paper terminal days and
allow ed you to type out a range of lines to the display so you could use the other edit
commands to make changes to the code/text.
FIND is a command that doesn't do what you might think. ED T is a multi-buffer
editor. You can edit only one file at a time, but can have many files open in other buffers
which w ill be opened in read mode. This is extremely handy when you wish to cut and
paste between programs. If you decide you would like to save your changes from inside
another buffer you can use the W RITE command to write the contents of the buffer to a
file. (You can also just write the contents of a selected range to a file.) To bring a file into
one of these buffers you use the INCLUDE command.
SUBSTITUTE is the command you need to be m ost familiar with. You can do mass
text substitutions over selected ranges, to the top or bottom (REST) of the file depending
on direction set from keypad. EDT is not a case sensitive editor. When you issue either
a SUBSTITUTE command or use the [PF1] [PF3] combination to find text it finds the text
regardless of case. EDT does not convert case on a substitution. If you enter lower case
text as the replacem ent text, it will be put into the buffer exactly in that manner.
WRITE is an incredibly useful command. It allows you to save the entire file or a
selected range of lines to either your current file or a new file. Im sure you have heard
the old adage save early, save often. Well this command allows you to do that
without exiting the editor.
INCLUDE is useful when you are using W RITE to save selected lines from one file
into a new file. The INCLUDE command inserts the contents of a file directly at the line
your cursor is on. Let us say you need to thieve a routine out of one large program to use
as the basis for a function in your new program. You open the original program in read
mode (so you dont accidentally change it), select the lines of the routine you need, write
them to a new file (A.A), then quit out of the read mode edit session. Now you open the
program you are working on, goto the line where you want the routine to appear, then

1-14

Chapter 1 - Fundamentals of OpenVMS

use INCLUDE A.A to bring the source file in.


By now your head is probably spinning from all of this. Take a few moments to go
through the HELP for command line functions. We will then begin an exercise to show
you a lot of tricks you will normally use when editing.

1.5 ED T Exercises
Let's start with some simple EDT editing. At the $ prompt (or system prompt if your
sysadm in has changed the $ prompt to be something else) type EDT TEST.COM. If you
have modified your LOGIN.COM file as instructed above this should bring up the EDT
editor in full screen mode with an [EOB] indicator at the top of the screen and Input file
does not exist m essage displayed at the bottom. Type the following so your screen looks
like this:
$ show symbol edt
[E O B ]

Your cursor will be sitting after the t in edt. Now hit the F12 key on your keyboard.
On VT terminals this is the Backspace key and most VT emulators set the F12 key up this
way as well. If not, find out how to change your emulator to do such. (Reflections and
KeaTerm both allow you to do this via the Keyboard entry in the Options pull down
menu.) The cursor will be over the $. The Backspace key takes you back to the
beginning of the line. W hat we want to try now is selecting the text to paste it back in.
Although this example is mundane it will show you the basic skills you need. Hit the
period key on the numeric keypad. This is the Select key. Then hit the 2 key on the
num eric keypad. The 2 key is the End of Line (EOL) key. You will see the cursor jum p
to the end of the line and the entire line enter some reverse video color state (depending
upon your emulator it will be reverse or color change). Hit the 6 key on the numeric
keypad. This is the Cut key. The line will disappear into the paste buffer and your [EOB]
will be all that is left. Now hit the Gold key. If you are running an emulator this should
be the Numlock key on your keypad. On a regular VT terminal this is the PF1 key.
Follow that by hitting the 6 key from the numeric keypad. The line will be pasted back
into the buffer and your cursor will be right where it was. The cursor will be at the end
of the line of text like it was.
Keypad operations in EDT are direction sensitive. When the editor is first started it
defaults to Forward or Down direction. You can change this to Reverse or Up direction
by hitting the 5 key on the keypad. Forward direction can be restored by hitting the 4 key
on the num eric keypad. Nothing visibly changes when you hit either of these keys so you
just have to remember what direction you are in. We will give an example shortly.
Nuking a line is even easier, provided you know what you are doing. Hit the F12 key
to get us back to beginning of line. Your cursor should be sitting on the $ character of
this line. Hit the PF4 key (on most em ulators this is the - key on the numeric keypad).
Notice how the line disappears AND the [EOB] marker m oves up as opposed to just the
line disappearing when you deleted before? This is because you actually removed the line

Chapter 1 - Fundamentals of OpenVMS

1-15

including the internal indicators used by EDT/RMS to mark the end of the record. Is this
a dangerous single key? It can be if you aren't careful. But there is som e relief for
ignosecond moments built into the editor. Hit the G old key and the PF4 key again.
Presto, the line is back.
Undo levels are limited to one for each of the delete operations. That means one undo
for single line, selected text, single character, and single word deletions. You get these
items back by hitting the Gold key and the key used for the deletion.
Single word and single character deletions? This is where VT emulators need a little
help. The - key on the VT numeric keypad and the , are used for single word and
single character deletions respectively. They are direction sensitive as discussed above.
The PC keyboard is simply one key short. I always modify my + key in my emulator to
be the , key equivalent and the <CTRL>+ version to be the - key equivalent. How you
do this depends on your emulator of choice. Both KeaTerm and Reflections offer a sim ple
keyboard mapping interface from the Options pull down menu. While you are there you
will probably have to override the default behavior for the backspace key on the PC
keyboard to be Delete not Backspace. You m ay or may not have to set up your F12 key
to be the same as the F12 key on the VT keyboard depending upon what version of the
products you are using. Please take a few moments to do this now.
If your keyboard emulator is running in VT 220 mode or higher you will see that
the following rectangular block of PC keys are normally mapped kind of funky too:
INSERT
DELETE

HOME
EN D

PAGEUP
PAGEDOW N

When mapped as a 1 for 1 m atch against the VT keyboard they map as follows:
FIND
SEL

INS
PREV

REM
NEXT

Most VT emulators w ill graciously map page up and page down to be PREV and
NEXT. DEC was into document setup at the time it created the 220 keyboard layout.
PREV and NEXT mapped the way they are fit beautifully with the scenario of turning
pages in a book. The rest of the world went with page up and page down because PCs and
other systems didn't get into document processing until years after the keyboard layout
had been standardized.
REM, however it is m apped, sends the Del character as you are used to with the PC
backspace key. SEL is the equivalent of the . on the keypad. FIND is a key combination
we haven't covered yet, but it allows you to search for text. While these keys have becom e
supported in EDT they were really meant for use with All-In-One (a DEC office products
package) and the TPU editor.
By now you should have set up your keypad so the + key is the , from the VT and
the <CTRL>+ combination is the - from the VT. Your cursor should be sitting over the

1-16

Chapter 1 - Fundamentals of OpenVMS

$ in our entered text and you should be in Forward/Down mode. Hit the 1 key on the
numeric keypad twice. This should place your cursor over the top of the s in symbol.
H it the equivalent of the , key on your numeric keypad. The s disappears. Hit the
Gold key then the , key. You will see the s reappear. Now hit the 5 key on the numeric
keypad. Then hit the , key. Now hit the Gold , combination to restore the character.
Even though keypad operations are direction sensitive the single character delete only
deletes the character which is directly under the cursor.
Now hit the - equivalent on your keypad. You should still be in Reverse mode. See
the word symbol disappear. Just like single character deletions, word deletions delete
up to the next word. A word in EDT is defined by blank space or a tab character. Other
editors like LSE and TPU allow you to define words to be punctuation characters and
other such things. Indeed, LSE defines these for you automatically depending upon what
type of source file you are editing.
There are some handy CTRL key combinations you need to know when working with
EDT. <CTRL>H takes you to the beginning of line (just like F12). <CTRL>J deletes to
the beginning of the current word. <CTRL>U deletes to the beginning of the line. There
is no undo level for these keys so use them with caution. <CTRL>J is the ASCII
equivalent of the Line Feed character. <CTRL>F will insert a Form Feed character into
your text. The form feed character is ignored by most language compilers and is useful
to break your program listings up across pages.
EDT is a single file editor, but has multi-buffer capabilities. To explore this we
need some more text to work with. Type the following lines so your text looks like this
in EDT:
$
$
$
$

show
show
show
show

symbol edt
l o g i c a l s y s $login
l o g i c a l s y s $error
default

Using your newly gained knowledge (or the arrow keys and brute force determination)
place the cursor at the $ character of the line $ show logical sys$error. Select the text
(using the period key and the 2 key to go to end of line) then cut it with the 6 key. Now
hit GOLD and the 7 key from the keypad. This will drop you to the ED T line mode
prompt *. Type F=PASTE and hit the enter key on the numeric keypad not the
typewriter keys. You will be taken to the PASTE buffer. (EDT is not case sensitive so you
can type the above in either lower or upper case.) Whenever you FIND a buffer this way
you are taken to the top of the buffer. You can go back to the original line you were on by
ending the buffer name with the character .. Hit the Gold 7 combination again and type
F=MAIN. making sure to include the period at the end of the buffer name. The file
which you are currently editing and which will be saved upon exit is always kept in the
MAIN buffer. When you hit the ENTER key from the keypad you will be taken back to
the line you were currently on with the cursor where it was. Hit the Gold 6 combination
to paste the line back into the buffer. H it Gold 7 again and type F=PASTE without the
period. See, the line is still in the paste buffer. This allows you to re-paste a block of text
as many times as you wish. Hit Gold 7 and find your main buffer again.

Chapter 1 - Fundamentals of OpenVMS

1-17

The multi-buffering capabilities of EDT allow for some astounding source file editing
to occur. Hit the Gold 4 combination from the keypad to go to the bottom of our text. Now
hit the Gold 7 combination and type INC SYS$LOGIN:LOGIN.COM then hit the enter key
from the keypad. You will see that EDT includes the contents of your login.com file
exactly where your cursor is. If you will be writing a new program that is really close to
an existing program you can edit a new file then use this technique to pull in the source
from the other program and begin making changes.
Say you want to only include part of a file into your new or existing file. Hit the Gold
7 combination and type INC SYS$LOGIN:LOGIN.COM =SCND then hit ENTER. Presto!
You have a shiny new read-only buffer which includes the file LOGIN.COM. You can then
use your select & cut knowledge to cut the lines you want to the PASTE buffer. Once done
you can find your MAIN buffer, then paste the contents of the PASTE buffer right where
you want them. Give it a try. If you are uncomfortable in doing it this way you can type
F=SCND to create the new buffer and then use the INC command to pull in the file. Both
methods work.
No matter which buffer you are in, if you are in write m ode when you exit EDT the
contents of MAIN will be saved upon exit. If you do not wish to save the contents use
either QUIT to exit EDT. How do you exit EDT? You can type either Gold 7 or <CTRL>Z
to get to the EDT command prompt. Then type EXIT and hit ENTER from the numeric
keypad.
If you are used to GUI editors in PC environments this may seem somewhat crude.
One has to realize that EDT has been around since the days of the PDP series com puters
of the 1970's. It hasn't changed m uch since those days either. We haven't even gotten
into how to search for text or change case or do mass substitutions yet. You can also edit
a file in Read mode w hich only allows you to Quit out of it so there is no chance of
accidental change to the source file. EDT also has one feature which is indispensable to
BASIC programmers. It allows you to search for a target that contains a carriage return.
Most im portant if you wish to search for a line number and not have to skip through all
the branches to it.
EDT also has the capability to run without a terminal. You can execute any of the line
commands from within an EDT command file. If you happen to have a bunch of files
which need several substitutions done on them for the same text you can create an EDT
command file to loop through processing all of the input files. You have already done a
small EDT command file with EDTINI.EDT when you set up your LOGIN.COM file. EDT
command files are invoked when EDT is started by adding the /COMMAND=file.name to
the edit command.
Hopefully you still have your TEST.COM file open in the editor. If not, open it now.
Arrow down and use the keypad to select two of the lines beginning with $ show. Once
that is done hit the Gold 7 keys on the keypad to get to the command prompt. Type the
command exactly as shown below:
S| s h o w | S H | s e l

1-18

Chapter 1 - Fundamentals of OpenVMS

You can use any separator character which is not contained in the text you are
substituting or search. I use the | (pipe) character because it normally doesn't occur in
source code. Many programmers use the ! character. The syntax of this editor command
is Substitute separator search_text separator replacement_text separator range. We used
a range of sel to indicate we wanted the substitution to occur in only the selected range
of lines. The default is to substitute on the line you are on only. (You may rem em ber I
mentioned before that EDT had some features LSE doesnt. Range substitution is one of
them.) Other options are wh for whole and rest for the rest of the file. (Rest is
direction sensitive.) When you hit the ENTER key on the keypad to execute the command
you should see a report that two substitutions have occurred and be prompted to hit
return. Notice that no matter what case you used to type the show text in your file EDT
found it and did an EXACT replacement. EDT is a program file editor, not a document
text editor. It replaced show with SH where it found it. Other editors like TPU are
case sensitive when doing searches and unless told to do otherwise will alter the text case
to match the case which was replaced. This is a major difference between program editors
and word processing type text editors.
If you have a very large source listing or text file, and you wish to get to a specific
editor line (notice I say editor line instead of source line number) you simply hit the Gold
7 combination, at the prompt, type in the line number, then hit Enter from the keypad.
You will be taken to that line in the editor buffer.

1.6 TPU and EVE Configuration


Many of the sites you go to as a OpenVM S consultant or employee will have only the
system default editor, which is currently TPU in m ost versions of OpenVMS. While you
can make TPU work for you, it initially had way too many word processorisms to be useful
as a programming editor. TPU came out around the same time as an office package called
All-In-One. As an office package, for the time it came out, All-In-One was landmark. As
a programming environment, it made us old-timers grind our teeth down past the
jawbone. The keypad is/was completely different from the keypad layout for EDT. (Layout
was called WPS for Word Processing System.) TPU had word wrap automatically turned
on. TPU did case sensitive substitution and searches. Most environments that make
developers use an All-In-One environment never let them get to a dollar sign prompt.
On the upside, All-In-One did allow for true document collaboration. If the accounts
were set up correctly for the word processing group, they could all work on the sam e
documents. It did put a wrapper around OpenVM S mail and provide a common menu
interface with system security from which to hang both canned and homegrown
applications. For those of us old enough to rem em ber, there was very little out there
which could do collaboration. Novell NetWare was just starting to make inroads into the
corporate world and most desktops were still running DOS on a 286 if you had a desktop
at all. On top of that, the standard ability of RM S to do file versioning and a system s
group that was doing nightly backups gave you a very reliable system . Laser printers
were just coming out and were priced high enough that they had to be am ortized as a
capital asset.

Chapter 1 - Fundamentals of OpenVMS

1-19

The real killer was the menu system allowed for program development functions to
be hung off it as w ell. You will find advertisements from time to time asking for an
All-In-One programmer. Deductive reasoning will do you no good with that title. They
arent looking for someone to write extensions to All-In-One; they are looking for someone
that has spent their entire development life in a captive account doing all of their
development from an All-In-One menu. Som eone that has never had to create a batch
queue, define their own system level logicals, and who doesnt even know that the
AUTHORIZE utility exists, let alone what it does. (Dont worry if some of those concepts
are strange to you; they wont be by the time you get to the end of this chapter.) In short,
sheep have more backbone and awareness about their environment than the person they
are looking for.
TPU really isnt an editor itself. The editor is called EVE (Extensible Versatile Editor)
and TPU is the default configuration. You will want to get it out of the default
configuration as quickly as possible. Once again, you do this with an initialization file.
EVE looks for an initialization file called EVE$IN IT.EVE in the local directory, then in
your SYS$LOGIN directory, then it looks at the logical EVE$INIT. (SYS$LOGIN is the
logical defined for every process that actually logs in. It points to your home directory.)
You can override this by invoking TPU with a /INITIALIZATION=some.file. Im an oldtimer, so my initialization file is called TPU $INIT.TPU. (If you end up working with a
very old version of OpenVMS, it will help you to remember that nam e; but hopefully, most
of you will work for com panies that are not a full 10 years or so behind on OpenVM S
releases.)
$ E D I T S Y S $ L O G I N : T PU$INIT.TPU
se t k e y p a d e d t
se t w i d t h 1 3 2
se t t a b s e v e r y 4
!s e t t a b s s p a c e s
se t t a b s v i s i b l e

Once you have entered the above, use <CTRL>-Z to save the file. The first line sets
the keypad to EDT compatibility mode. The second line sets the screen width to 132. The
third line sets tab spacing to 4 instead of the default 8 characters. The fourth line is
commented out. If you plan on writing code on the OpenVMS platform which will need
to be transported to other platforms you may wish to have the editor insert the
appropriate number of spaces instead of the TAB character. The fifth line is a line you
may or may not wish to use. This makes text you type in look as follows (blank spaces
preceding ... has an H over T displayed to indicate horizontal tab):
01 2 3 4 5 6 7 8
s o m e n e w t e x t here
e v e n m o r e indented text here
T h i r d level indent here
[E n d o f f i l e ]

Remember above in the EDT section how we created the ED T symbol in our
LOGIN.COM file? Well, we are ready to create a TPU symbol. Add the following line to
your LOGIN.COM file:

1-20

Chapter 1 - Fundamentals of OpenVMS

$ t p u : = = e d i t / t p u /init=sys$login:tpu$init.tpu

There are quite a few differences between TPU in EDT mode and EDT itself. You
should try the EDT exercises above to see for yourself which work and which dont. TPU
will handle much larger files that EDT. You can actually edit multiple files. TPU will
actually edit data files m uch better than EDT will. You can define keys for functions and
you can use LEARN to set up a series of repetitive keystrokes. If you are really into it you
can write your ow n extensions (look at the on-line help for EDIT and the examples in
SYS$EXAMPLES:*.TPU.) TPU has a callable interface, and is DEC WINDOWS aware
so if you are writing an application which needs the user to be able to look at or edit the
contents of a file you can call it and have all of the dirty work done for you.

1.7 LSE
In the world of editors on OpenVM S, LSE is the best at what it does. LSE (Language
Sensitive Editor) is part of the DECSet program m ing tool set which includes M MS
(Module Management System) and CMS (Code Management System) among other things.
LSE is aware of both old fashioned character cell term inal interfaces and DEC Windows.
If you are developing in a language supplied by HP on the OpenVMS platform, it has
built-in language sensitive help. The keypad is mostly the same as EDT so old-timers can
be highly productive with it from day one. You can even compile your code from within
the editor and review the errors. Control keys allow you to toggle between the next error,
and the line of source code that produced the error. You can even check source code out
of CMS and put it back in all from within the editor. You can split windows horizontally
editing two different locations in the same source file, or look at an entirely different file
in the other window. If you have LSE on your system, please spend a full hour now going
through both the on-line help from the OpenVMS command prompt and the help built into
the editor. No matter how many times you go through the help built into the editor it
seems there is always som ething useful that you overlooked in previous readings.
The first thing you will need to do is add a symbol to your LOGIN.COM file for LSE.
One oddity I have noticed is that a symbol doesnt exist at most sites for it. Add the
following line to your LOGIN.COM file then @ the file to define the symbol.
$ LSE :== $LSEDIT

While you can override the use of the logical LSE$INITIALIZATION by using the
/INIT=some.file qualifier, with LSE I tend to use the logical. First you need to create the
initialization file.
$ E D I T S Y S $ L O G I N : L SEINIT.LSE
se t t a b 4
se t s c r e e n h e i g h t = 30
se t s c r e e n w i d t h = 1 32

Once again use <CTRL>-Z to exit and save the file. The first line sets the TAB size
to 4 instead of 8 characters. The second line you will not be able to use if you are using
a very old VT terminal for access to OpenVMS. The very old terminals supported only 24

Chapter 1 - Fundamentals of OpenVMS

1-21

lines. When using a term inal emulator I have been known to set the screen to as much
as 50 lines so I could look at almost a full page of code. The fourth line sets the screen
width to 132.
Now you need to add the logical definition to your LOGIN.COM file. We will cover
what logicals are a little later; for now , just take it on faith and add the following line,
then @ the command file.
$ d e f i n e l s e $ i n i t i alization sys$login:lseinit.lse

When you type LSE some.file at the command prompt it should run the file without
error. If you do get errors and have not made any typos it is because your installation set
PORTABLE as the default command language. You can try adding set command
language VMSLSE as the first line of the init file to see if that clears up your errors.
Some of you m ay wish to use the PORTABLE language version. It does have one distinct
advantage. A command exists called VIEW _FILE which allows you to type this command
followed by a file name. It will read the file into a non-modifiable new buffer. If you
already have your screen split you will see the buffer immediately. Our version of the init
file in portable looks as follows:
se t
se t
se t
se t
se t

c o m m a n d l a n g u a ge portable
height 30
width 132
tabs hard off
b u f f e r t a b i n c rement 4

Spend som e time now and get comfortable with LSE. Try the EDT exercises and learn
for yourself which work and which do not work.

1.8 Logicals
You have read various nam es like SYS$LOGIN, SYS$ERROR, etc. in this book so far.
These are called logicals. OpenVMS and its file access system RMS utilize logicals
extensively. A logical is much like an alias only m uch more powerful. Som e of them are
provided by the system and others you can create yourself as a programmer. Logicals
occur at what are called levels. A level is nothing m ore than a logical name table in your
logical search path. Your search path is defined by a logical known as LNM$FILE_DEV.
Every logged in process starts out with a default version of LNM$FILE_DEV which is
found in the logical name table LNM$SYSTEM_DIRECTORY. Various levels of
privileges are required to define logicals, but every process can define its own process
level logicals. If your account has sufficient privilege on your system you should be able
to execute the following command and get som ewhat similar results.

1-22

Chapter 1 - Fundamentals of OpenVMS

$ s h o w l o g / t a b l e = l nm$system_directory lnm$file_dev
L N M $ F I L E _ D E V = LNM$PROCESS (LNM$SYSTEM_DIRECTORY)
= LNM$JOB
= L N M $ G R O UP
= L N M $ S Y S TEM
= D E C W $ L O GICAL_NAMES
1
L N M $ S Y S T E M = LNM$SYSTEM_TABLE (LNM$SYSTEM_DIRECTORY)
= L N M $ S Y S CLUSTER
2
L N M $ S Y S C L U S T E R = LNM$SYSCLUSTER_TABLE (LNM$SYSTEM_DIRECTORY)
1
D E C W $ L O G I C A L _ N AMES [table] = (LNM$SYSTEM_DIRECTORY)

That was a lot to swallow, so let's start small and work forward. Get to the $ prompt
and type SHOW LOGICAL SYS$LOGIN. You should see something sim ilar to the
following:
$ s h o w l o g s y s $ l o g in
S Y S $ L O G I N = DKA1000:[HUGHES] (LNM$JOB_80D0FE00)

You will notice to the right that it says this is a job level logical (LNM$JOB_jobid).
Job level logicals are passed to all child and sub-processes you create. SYS$LO G IN is
defined for each process when it is created. It points to your default drive and directory.
$ s h o w l o g i c a l s y s $output
S Y S $ O U T P U T = _LGKL1$TTA0: (LNM$PROCESS_TABLE)

SYS$OUTPUT is a logical which gets defined for each process. It points to the default
output device for the process. Since it is a process level logical you can override it no
matter what your privileges (called privs) are set to.
Type the following at the command prompt:
$
$
$
$

d e f i n e s y s $ o u t p u t junk.txt
show dev d
d e a s s i n g s y s $ o u t put
type junk.txt

De v i c e
Name
LG K L 1 $ D K A 1 0 0 0 :
LG K L 1 $ D K A 1 2 0 0 :
LG K L 1 $ D K B 0 :
LG K L 1 $ D V A 0 :

Device
Status
Mounted
Mounted
Online wrtlck
Online

Error
Count
0
0
0
0

Volume
Label
SYS
DEV

Free
Blocks
15184350
16248006

Trans
Count
468
1

Mnt
Cnt
1
1

You now have a file in your local working directory called JUNK.TXT which contains
the output of the SHOW DEVICE D command. Normally SYS$OUTPUT points to your
term inal device. My term inal is hooked up through a standard serial port so the device
is a TT device. You may see your device as an RT type device for a rem ote terminal
session through a network interface or LAT. The _lgkl1 in front of my TT device is the
node I'm on. Even if a node isn't in a cluster it usually has a node nam e. While we are on
this topic type the following:
$ show log tt
T T = T T A 0 : (LNM$PROCESS_TABLE)

Chapter 1 - Fundamentals of OpenVMS

1-23

All terminal processes have the TT logical defined to point to their logical or physical
term inal device depending upon connection type. Many programmers use this feature to
direct output to printers which are attached to serial ports. The technique isn't that
common today as most printers on are networks, but some applications require the ability
to open a printer port and write inform ation to it real time rather than sending output to
a file for later printing.
SYS$PRINT is another logical you need to be familiar w ith. In the old days when
systems had a defined main printer for all jobs this logical was set up for everybody by the
systems manager. These days with the prevalence of networked printers it is up to
individual users to define this in their LOGIN.COM. They have to find the nam e of a
print queue which spools to a printer close to them then define SYS$PRINT. In an effort
to maintain sanity most systems managers give print queues nam es based upon printer
location and type. If you are in room 510 and the printer is an HP laser you may have a
queue name like RM 510$HP_LASER. Assum ing you want your printouts to normally go
to this printer you would put the following in your LOGIN.COM file.
$ D E F I N E S Y S $ P R I N T RM510$HP_LASER

Then whenever you type something like PRINT LOGIN.COM it would go to that
printer automatically, unless you override the logical SYS$PRINT by putting a
/QUEUE=queue_name on the print command line. There are many qualifiers to the
PRINT command which we will go into later. My point here is that SYS$PRINT is an
important logical to understand.
I have mentioned your default logical search path here. Unless otherwise overridden,
your default logical search path will be Process Level, Job Level, Group Level and System
Level. Each of these levels is a logical name table defined on the system. Your specific
process and job tables are created each time you log in. They disappear each time you log
out. If you type SHOW LOG LNM$FILE_DEV at the command prompt you will get a long
list of all the logicals viewable by you.
Looks like there is no dancing around this topic. Fetch a caffeinated beverage of your
choice and get ready to delve into the meat of logicals.
Before, when I showed you the definition of LNM$FILE_DEV, it was a Clinton
Truth. You can see it if you know where to look. Type the following and you should
see similar results depending upon your system :
$ s h o w l o g / t a b l e = l nm$system_directory
(L N M $ S Y S T E M _ D I R E C T ORY)
C L U $ I C C _ O R B S _ I C C$ [table] =
C L U $ I C C _ O R B S _ L G KL1" [table] =
D E C W $ L O G I C A L _ N A MES [table] =
D E C W $ S E R V E R 0 _ T A BLE [table] =
I C C $ R E G I S T R Y = ICC$REGISTRY_TABLE
I C C $ R E G I S T R Y _ T A BLE [table] =
L M F $ L I C E N S E _ T A B LE [table] =
L N M $ C L U S T E R = LNM$CLUSTER_TABLE

1-24

Chapter 1 - Fundamentals of OpenVMS

L N M $ C L U S T E R _ T A B LE [table] =
L N M $ D C L _ L O G I C A L = LNM$FILE_DEV
L N M $ D I R E C T O R I E S = LNM$PROCESS_DIRECTORY
= L N M $ S Y S TEM_DIRECTORY
L N M $ D T _ F O R M A T _ T ABLE [table] =
L N M $ F I L E _ D E V [ super] = LNM$PROCESS
= LNM$JOB
= L N M $ G R O UP
= L N M $ S Y S TEM
= D E C W $ L O GICAL_NAMES
L N M $ F I L E _ D E V [ exec] = LNM$PROCESS
= LNM$JOB
= L N M $ G R O UP
= L N M $ S Y S TEM
L N M $ G R O U P _ 0 0 0 0 0 1" [table] =
L N M $ G R O U P _ 0 0 0 0 3 0" [table] =
L N M $ G R O U P _ 0 0 0 2 0 0" [table] =
L N M $ J O B _ 8 0 D 1 4 0 8 0" [table] =
L N M $ J O B _ 8 0 D A 4 F C 0" [table] =
L N M $ J O B _ 8 0 D A 8 5 4 0" [table] =
L N M $ J O B _ 8 0 D A B 2 8 0" [table] =
L N M $ J O B _ 8 0 D A B 9 C 0" [table] =

You will see that LNM$FILE_DEV is actually viewable in this listing. It has two
separate definitions and it is multi-pathed (has more than one translation value). How
can a single logical have two separate definitions in the same table? It can have three in
the sam e logical name table.
Those definition levels would be USER_MODE,
SUPER_MODE, and EXECUTIVE_MODE.
A user_mode logical should never be created by you from the com mand line. They are
a brief life entity designed to exist only for the duration of a single executable image.
When a command file is invoked or the executable which creates them exits the logical is
deleted from existence. They do serve a legitimate purpose from a program m ing
perspective. Logical name tables have a maximum size defined for them based on the user
account which created the table. If you have an executable which needs to define a set of
logicals for temporary files it can call a system service routine to create those logicals. You
then don't have to pass these values to called external subroutines, they can simply know
the logical name and be coded to use it. When the program exits, all of the tem porary
logicals it created are gone. Let us use a physical example to show the short life span of
this logical mode. Type the following:
$
$
$
$

c r e a t e / d i r [ . j u n k2]
reca define
d e f i n e / u s e r j u n k 2_dir dka1000:[guest.junk2]
s h o w l o g j u n k 2 _ d ir
J U N K 2 _ D I R = DKA1000:[GUEST.JUNK2] (LNM$PROCESS_TABLE)
$ @login
$ s h o w l o g j u n k 2 _ d ir
%S H O W - S - N O T R A N , n o translation for logical name JUNK2_DIR

In order to get the above to work you will need to substitute your default drive and
directory for the dka1000:[guest portion of the define statement. Notice that once you
run your LOGIN.COM the logical goes away. Also notice that unless the translation value
for a logical is entered in quotes DCL converts it to all upper case.

Chapter 1 - Fundamentals of OpenVMS

1-25

$ d e f i n e / u s e r j u n k 2_dir dka1000:[guest.junk2]
$ s h o w l o g j u n k 2 _ d ir
J U N K 2 _ D I R = dka1000:[guest.junk2] (LNM$PROCESS_TABLE)

You can force DCL to keep the lower case value, but unless you have a reason to do
so I recommend against it.
EXECUTIVE_MODE logicals require your account have the SYSNAM privilege to
create them. (W e will cover privs in the section on Authorize Basics; please bear with me.)
The logical name table where the logical gets defined must have the same or higher priv
level in order for the EXEC mode logical to be created in it. If the table does not, then
OpenVMS simply creates a SU PER_M ODE logical and goes on. There are cases where
a logical needs to be in EXECUTIVE_MODE to be used. Unless you take to writing
system services or very intense system s utilities you won't need to know those cases.
From a normal programmers perspective EXEC mode logicals provide a default value
which cannot be walked on or easily deleted by an average user.
SUPERVISOR_MODE is the default mode for a logical when it is created. When you
have two logicals defined in the same table, the SUPER mode logical wins. In my previous
exam ple of LNM$FILE_DEV found on m y system you see the SUPER mode logical has
the logical name table DECW$LOGICAL_NAMES at the end of it. When I enter SHOW
LOG DECW$* I see the Decwindows logicals. If Decwindows is shut down on my system
it deletes the SUPER mode logical leaving the EXEC logical in place. As I stated before,
the primary purpose of an EXEC level logical is to provide a default value which can be
overridden by the user (or other applications) without being walked on. Only a privileged
user can delete an EXEC mode logical.
Deleting logicals is an interesting topic. One would think you could type something
like DELETE/LOGICAL my_logical and have the definition go away. That would be nice,
but it isn't the case. A logical must have its value deassigned. This is because the original
command for defining logicals was the ASSIGN command back in the days of RSTS/E and
other DEC operating systems. You may run into command files which use ASSIGN
instead of DEFINE. Get this difference down! ASSIGN is backwards from DEFINE.
$ A S S I G N D K A 1 0 0 0 : [ GUEST.JUNK2]
JUNK2_DIR
$ DEFINE JUNK2_DIR
DKA1000:[GUEST.JUNK2]

Both of the above accomplish the same thing. The ASSIGN command will probably
never really go away in OpenVMS. Its use and origins are too heavily rooted in DEC
operating systems past. You should never use ASSIGN in new developm ent. There has
been a movem ent over the years to break away from its use so the command may
eventually disappear. Better to be safe than sorry. Besides, when you get into defining
multi-pathed logicals DEFINE looks cleaner.
$ D E F I N E / T A B L E = L N M $PROCESS_DIRECTORY
L N M $ P R O C E S S, LNM$JOB, LNM$GROUP, LNM$SYSTEM

LNM$FILE_DE V -

1-26

Chapter 1 - Fundamentals of OpenVMS

is more readable to some than


$A S S I G N / T A B L E = L N M $ PROCESS_DIRECTORY L N M $ P R O C E S S, LNM$JOB, LNM$GROUP, LNM$SYSTEM
LNM$FILE_DEV

You will note the - at the end of each line except the last. This is how you tell the
CLI (Command Language Interpreter) to interpret a broken line as a single command.
Really old input terminals allowed for 80 characters on a line, period. You had to have a
method of breaking up long commands across lines back then and it works well today.
The above exam ple is also how you define m ulti-pathed logicals. Both OpenVM S
and RMS will interpret all translations of a logical until they find what they need or
exhaust the list. When you are writing application programs which need to do more
than hand the logical off to RMS to find a file, you have to do this translation yourself.
Multi-pathed logicals work well for file opens, directory searches, etc., they do not
work well for file creations. If you have a multi-pathed logical defined as follows:
$ d e f i n e m y _ d i r 1 d ka1000:[guest.my_dir1]
$ d e f i n e m y _ d i r 2 d ka1000:[guest.my_dir2]
$ d e f i n e m y _ d i r 3 d ka1000:[guest.my_dir3]
$ define my_dir

m y_dir1, my_dir2, my_dir3

When you type EDIT M Y_DIR:SOME_FILE.TXT the file will always be created in
MY_DIR1 (unless the disk is full, then it will fail). There is no good way around this. File
creation uses the first translation found. It is the responsibility of the system manager
to stage directories in such an order that file creation won't fail due to a lack of disk space.
If you are the systems developer writing a new system which uses m ulti-pathed logicals
it is your duty to inform the systems manager which logicals will be used for file creation
so they can allocate disk space accordingly.
OpenVMS provides quite a comprehensive piece of help for the DEFINE, ASSIGN,
and DEASSIGN commands. Take few minutes now and go through it. When in
OpenVMS and in doubt, just type HELP. It really will help if you look at that prior to the
rest of this explanation. The world of OpenVM S is completely and totally intertwined,
unlike the lesser operating system s of Windows and UNIX. It is almost impossible to
discuss logicals w ithout discussing UIC (User Identification Code), UAF (User
Authorization File), and ACL (Access Control List). We will be covering each of these
things later, but I need to give you the fundamentals of logicals now so the other starts to
m ake sense. Remember this OS was designed from the ground up to be a secure
multi-user networked OS.
Logical names occur in 3 levels just like there are 3 modes: Directories, Tables and
plain old logicals. Directories contain both logicals and tables. In the earlier example
showing you the definitions for LN M$FILE_DEV you saw the directory
LNM$SYSTEM_DIRECTORY contained both multi-pathed logicals like LNM$FILE_DEV
and names that had [table] after them . This indicates that the item is really the nam e

Chapter 1 - Fundamentals of OpenVMS

1-27

of a logical name table which can contain 0-n logical names. The logical name itself is the
lowest level of this entity, but in a vicious twist of fate it could define one of the other
entities.
Hopefully you saw the DEFINE qualifiers of /PROCESS, /JOB, /GROUP and
/SYSTEM while you were going through the online help for DEFINE. In the dark old
days we programmers used to write command files which defined only process level
logicals. The previous example of the my_dir series of logicals is a good exam ple of
process level logicals. End users running applications from a DCL application never
logging out all had their own copy of the logicals. W hile this is the m ost secure way it does
eat up a lot of system RAM. It was not unusual to develop on an old VAX box which had
less than 4 MEG of physical RAM and was handling 30 users simultaneously.
Thankfully, in the old days, w e had data islands. When a user logged into their
captive account they ran one main menu all day long. This menu gave them access to the
one application they typically used, along with e-mail and a few other tidbits. A person
who did order entry all day had no access to accounting or shop floor scheduling. Likewise
the people on the shop floor only had access to the orders once they had been m unched on
and handed off to the scheduling application. This environment melded perfectly with the
user account creation for OpenVM S. Every user account is a two piece code called the
UIC. Both parts of this code are octal numbers. The first part is the octal group and the
last part is the octal id. The com bination of these two must be unique. System managers
then started creating separate groups for each data island. All users were put into the
group for their data island. A separate batch user ID was created under each group.
The batch account was given GROUP privilege, along with one or two users who were the
supervisors or team leaders for the group. At system startup batch jobs were subm itted
under the batch ID which executed a full series of DEFINE/GROUP statements to define
all of the logicals needed for the application group. Now only one copy of the logicals
existed and all of the users for that group had access to them .
When writing batch jobs we programmers got in the habit of always defining logicals
with the /JO B qualifier. If your batch job was all in one stream and it didnt need to
execute any other command files, you could get away with process level logicals, but it was
safer to use /JOB in case you had to create another process from within your process.
In m ost cases process level logicals are inherited by child processes; there are cases where
you can execute an image which is installed with its own process, but it does becom e part
of your job. Remember the default definition for LNM$FILE_DEV?
[Process, Job,
Group, System]. There is a setting on each user account called JTQUOTA which controls
the size in bytes the users job table can reach. U sers didnt have to pester systems
managers to fix this problem, simply log out and log back in. They would get a shiny new
job level logical table. The problem only really flared up when users wanted to watch
reports get created interactively on their screen rather than subm itting them off to batch
with no method of checking on them as they had captive accounts. (Perhaps the last few
paragraphs have begun to make you see how a product like All-In-One was conceived?)

1-28

Chapter 1 - Fundamentals of OpenVMS

Companies grew, people moved around, m ore applications were added, and people
started needing access to more than one data island at a time. The old m ethods
employed by a good many OpenVM S shops had simply run into a wall. Thankfully, the
good people at DEC had a habit of looking 20+ years down the road when doing system s
work and before m any shops started expanding exponentially enough to run aground we
turned to the pages in the manuals covering ACLs. This was the next great layer in
security, and for many shops the end of users needing multiple accounts.

1.9 ACLs and the UAF


In simple terms an Access Control List is little m ore than a token and a rule. The
token in this case is a rights identifier which gets assigned to your user ID. When a
process with your user ID attempts to access an item which has ACL security assigned to
it, the OS takes each rule in the list and looks at your processs bag of rights identifiers
to see what kind of rights you have. When it finds a m atch, that is what you get for
access. Be very careful in how you define rights identifiers within an access control list.
When it comes to the list, order can be very important. I have seen instances where an
account was assigned the rights identifier for read access to an item and the identifier
for write access. When the ACL was placed on the item the read access rule was listed
prior to the write access rule. The account which had both identifiers could only read.
Confused? Sorry. I told you it is all intertwined. You have to understand a little about
ACLs, then we can look at the UAF, and finally make sense of it all.
An ACL can be attached to most things in the world of OpenVMS. Disk directories,
data files, RDB databases, tables within an RDB database, and logical name tables tend
to be among the most common places you will see ACLs used. Most shops will typically
develop a naming schema for rights identifiers. They will tend to start with what many
places call an Application System Code (ASC). This code will be 2 to 4 characters and
identify the primary system. These codes can be as simple as OE for Order Entry, SC for
supply chain, and AC for accounting or they could be something which seems to have no
meaning whatsoever to the layman. Each ASC will then get an underscore appended to
it and a 1 to 2 letter code to indicate the type of access; _RO for read only, _RW for read
write, _S for supervisor, etc.
Im going to log into the SYSTEM account on my machine, create a new user, create
som e rights identifiers, then create an ACL on a file in my own (not the new users)
directory. The new non-privileged user will not normally have access to my directory, but
the ACL will give them access to that file alone.

N
o
a
cc
e
ss
re
ts
irc
ito
n
s

S
a
t
S
u
n

S
e
co
n
d
a
ry
d
a
y
:s

M
o
n
T
u
e
W
e
d
T
h
u
F
ri

P F
irm la
g
a :s
ry
d
a
y
:s

L D
G e
IC fa
Mu
D lt:
: D
K
A
1
2
0
0
:[
G
U
E
S
T
]

T
a
b
le
:s
D
C
L
T
A
B
L
E
S

U
se
rn
a
m
e
:
G
U
E
S
T

U
IC
:
O
[2 w
0 n
0
,2 re
0 :
1
]
(
[G
U
E
S
T
])

A
cc
o
u
n
D t:
C
L

C
L
:I

U
A
F
>
sh
o
w
g
u
e
ts

% % %U
U U U A
A A A F
F F F >
I-- I-- I-- co
R C P p
D O Wy
B P D d
A M L fe
D S E a
D G S lu
M, S t
S u M g
G se IN u
e
s
Ur
, r , t/
id ce n
e iu
w
c
e o
n r p =
iitf cd a [2
e o ss 0
r p w ,0
Gi o 2
U e
d rd 0
1
E
is ]/p
S
T
sh a
s
va
o s=
lu
tre g
e
r u
[0
th se
0
a t
0
n /d
2
me
0
0
i
n ivc
,0
i
me
0
=
0
u d
2
mk
0
1
p a
]
a 1
a
ss 2
0
d
w 0
d
e
o d
rd /d
to
le ire
n tc
irg
g
h
th ryo
ts
=
d
[g
a
u
ta
e
b
s
t]
a
/
se
lfa
g
=
n
o
d
is
u
se
/rn
o
p
w
d
e
xp
ir
e
d

U
A
F
>

[2
0
0
,1
6
0
]
D
E
C
N
E
T
V

[3
7
6
,3
7
2
]
D
E
C
N
E
T
V

[3
7
6
,3
6
7
]
D
E
C
N
E
T
V

[3
7
6
,3
7
4
]
S
Y
S
T
E
M

[1
,1
0
]

H
U
G
H
E
S

S
Y
S
T
E
M
M
A
N
A
G
E
R

[3
6
3
,3
6
3
]

D
C
E
$
S
E
R
V
E
R

N A
o l
rm l
a
l

[2
0
0
,2
0
0
]

D
E
F
A
U
L
T

D
C
E
$
S
E
R
V
E
R

A
cc
o
u
n
t

[2 IU
0 C
0
,2
0
0
]

A U
C s
Me
S rn
X am
P
_e
S
V
R

O
w
n
e
r

S D
Y is
S u
$ se
S r
Y
S
R
O
O
T
:[
S
Y
S
M
G
R
]

S
Y
S
$
S
Y
S
D
E
V
IC
E
:[
S
C
A
$
D
E
F
A
U
L
T
]
S S S
Y Y Y
S S S
$ $ $
C C C
O O O
M M M
M M M
O O O
N N N
:[ :[ :[
R R R
D D D
M M B
S A $R
T IJ E
T ] M
]
O
T
E
]
S
Y
S
$
S
P
E
C
IF
IC
:[
P
H
O
N
E
$
S
E
R
V
E
R
]
S S D
Y Y K
S S A
$ $ 1
S S 2
P P 0
E E :0
C C [
IF IF H
U
IC IC G
:[ :[ H
MM E
IR A S
]
R IL
O $S
$ E
S R
E V
R
V E
E ]R
R
]
D D
is is
u u
se se
r r

S
Y
S
$
S
P
E
C
IF
IC
:[
C
M
L
$
S
E
R
V
E
R
]
[U iD
S re
E tc
R o
] ry

LGKL1$TNA3:

S
Y
S
$
S
Y
S
D
E
V
IC
E
:[
T
C
P
IP
$
F
T
P
]

$
m
rc
a
u
th
o
ri
ze
De v i c e s a l l o c a t e d :

S S
Y Y
S S
$ $
S S
P Y
E S
C D
IF E
IC IV
C
:[ E
V
P :[T
MC
$ P
SI
E P
R$
V T
E F
RT
] ]P

U
A
F
>
sh
o
w
/*b
ri
e
f

TNA3: (Host: 216.59.61.99


[SYSTEM]
4
SYS$SYSROOT:[SYSEXE]
1

N N P
o o r
rm rm ivs
a a
l l

D
E
C
N
E
T
V

[3
7
6
,3
6
6
]

C
M
L
$
S
E
R
V
E
R

C
M
L
$
S
E
R
V
E
R
D
e
fa
u
lt
Te r m i n a l :
Us e r I d e n t i f i e r :
Ba s e p r i o r i t y :
De f a u l t f i l e s p e c :
Nu m b e r o f K t h r e a d s :

N A N N N N N A
o ll o o o o o ll
n
rm rm rm rm rm
e
a a a a a
l l l l l

D
E
C
N
E
T

[2
0
0
,1
6
2
]

[3
7
1
,3
4
5
]
[2
0
0
,1
6
1
]

R R
D D
M M
S A
T I
T J

S
C
A
$
D
E
F
A
U
L
T

P M M
H IR A
O
I
N R L
$
E $O S
$ S E
S E R
E R V
R
E
V V
R
E E
R R D
e
D
D
f
e e a
fa fa ltu
u lu
lt t
R P M M
D H IR A
B O R IL
$ N O $
R E
E $ $S S
M S E E
R
O E
R V
R V
E
T V
E E E R
R R
User: SYSTEM
Node: LGKL1

4 8 8 4 4 4 4 1 4 4 4 4 4 4 4 4 4 P
5
ir

N
o
rm
a
l

[3
7
0
,3
5
5
]

N N N A
o o o l
rm rm rm l
a a a
l l l

T
C
P
IP

T
C
P
IP

D
E
C
N
E
T
V

[1
,4
]

S
C
A
$
S
E
R
V
E
R

D D
E E
C C
_ _
S S
C C
A A
_
S
E
R
V
E
R

D
E
C
N
E
T

[3
6
5
5
,1
]

[3
6
5
5
,2
]

[3
7
6
,3
7
0
]

S
Y
S
T
E
M

S
Y
S
T
E
M
M
A
N
A
G
E
R
29 - N O V - 2 0 0 4 1 5 : 1 6 : 22.53

S
Y
S
T
E
M

T
C
P
IP
$
F
T
P

T
C
P
IP
$
F
T
P

V T
P C
MP
$ IP
S $
E T
R F
V T
E P
R

V T
P C
M P
$ IP
S $
E T
R F
V T
E P
R
D
e
fa
u
lt

Chapter 1 - Fundamentals of OpenVMS


1-29

We l c o m e t o O p e n V M S (TM) Alpha Operating System, Version V7.2

Us e r n a m e : s y s t e m
Pa s s w o r d :

* * * * * * * * * * * * * * ***************************************
*
*
*
WELCOME.TXT
*
*
*
*
W e l c o m e t o the Alpha node LGKL1 run by Logikal
*
*
Solutions.
*
* * * * * * * * * * * * * * ***************************************

L a s t i n t e r a c t i ve login on Wednesday, 24-NOV-2004 09:14:11.07


L a s t n o n - i n t e r active login on Thursday, 18-NOV-2004 07:33:04.27
$ s e t d e f s y s $ s y s t em
$ show process
Process ID:
000000A2
Process name: SYSTEM
Port: 3538)

1-30
0

P
w
d
m
in
im
u
m
:
6
L
o
g
in
F
a
ils
:

(
n
o
n
e
)

D
N e
E f
T a
u
Ml
B tP
X ir
ilve
g
T e
Ms
P :
M
B
X

A
N u
E t
T h
o
Mr
B ize
X d
P
ir
T ilv
M e
P g
M se
B :
X

C
P
U
:

Q
u
e
p
iro
:

P
iro
:

P M M ML
r a a a a
lcm xd xa jx ts
L
: te cc o
b
s o
g
a
ch jto : in
:
: sb
:

(
n
o
9
n
e 4 4 8 0 0 0 (0
n 0
0
E T A D B S F o
:
n Q S IO IO h ill n
e 0
q
fr m ) 0
l
l m lE lT
l
i
m
m
l
:
m m
l
(P
: : : : : m
:
i w
d
1 tn
e
2
c
0
1 1
0 1 2
5 5 0 0 ra h
a
0 0 5
0 0 0
0
ticv n
g
e
e
W
P
B
W
W
J
:
P
)
g S S S T yb ty , 2
l
flq e q d q
9
u lt m
u
x
e
m
o
:
N
u te o f: t
a :
o
O
:
: tn :
V
:
6 (2
0
4
5
4
n 0
4 2
0 1
0 0 0
0 0
4
0 o
0 6
9
0 0
0 n
0 3
e 1
0 0 6
0 8
) :5
4
2
(6
n
o
n
i-n
te
ra
c
itv
e
)

P E
w x
d p
ilfe ira
t
itm io
n
e :
:

Chapter 1 - Fundamentals of OpenVMS

Notice that the first thing we did after logging in was to set default to SYS$SYSTEM .
You must be in that directory to actually update the correct database. If you are in a
directory other than SYS$SYSTEM your session will look something like the following:
$ mcr authorize
%U A F - E - N A O F I L , u n a ble to open system authorization file (SYSUAF.DAT)
-R M S - E - F N F , f i l e n ot found
Do y o u w a n t t o c r e ate a new file?

I told you before I was an old-timer on this platform. MCR is no longer needed to use
authorize. I could simply have used the RUN command. In the very old days you had to
use MCR to bring up authorize. It has been so many years I dont even remember what
MCR stands for. There is no help for that command on OpenVM S any longer. I believe
it has become nothing more than a synonym for the RUN command.
Once inside of AU THORIZE I displayed all of the accounts created on this system .
Notice the colum n titled UIC? This is pretty much the only place you will see it anym ore.
Security and ease of human use have caused it to be replaced by the account nam e. If
your site is still implem enting group strategies this is a real pain. Most sites today are
not implem enting group strategies with account creation. When they do a full directory
on a file they want to see the name of the account that created it, not an octal number they
have to look up.
The account I chose to use as the starting point is found on m ost OpenVM S system s
and it is called DEFAU LT. You cannot do anything with this account as it is flagged
DISUSER in the SYSUAF file. It is so much easier to copy another account changing it
than to create a completely new account from scratch. You can ADD a new user but you
have to specify every account parameter by hand. It takes a long time.
Since I chose to copy the account I had to give it a new password /pass=guest and a
new UIC /UIC=[200,201]. Remember that the UIC must be unique in the SYSU AF
(System User Authorization File). The flag had to be turned off so this user could becom e
active /flag=nodisuser. I did not wish the password to be expired which will force the
user to change their password at there very first login /nopwdexpired. This user will
have an actual d irectory for SYS $LO G IN definition /D EVICE=dka1200
/directory=[guest]. Note: you have to specify the drive separate from the directory.

1-31

Chapter 1 - Fundamentals of OpenVMS

Alert readers will notice that I got an information message about the password being
below system mandated minimum length. AUTHORIZE is the only place where you can
set the password on an account below the system m inimum length, the SET PASSWORD
com mand will force the minimum length rule on the user.
Finally I showed the full details of the shiny new account we just created. Please
remember how the UIC is listed in this display. The actual UIC is listed first with the
synonym listed after it. Later, we will show you that the synonym (not the actual U IC
value) is all the system functions return. Notice that the only privileges this account has
are NETMBX and TMPMBX. This is the absolute minimum for an account to be able to
do anything. MBX is an abbreviation for mailbox. It will be a long time before we
mention mailboxes again, but if you want the full names they are Network Mailbox and
Temporary Mailbox.
The account is not yet ready for general use.
directory.

We must create the users hom e

UA F > e x i t
%U A F - I - D O N E M S G , s y stem authorization file modified
%U A F - I - N A F N O M O D S , no modifications made to network proxy database
%U A F - I - R D B D O N E M S G , rights database modified
$ c r e a t e / d i r e c t o r y dka1200:[guest]/owner=[guest]
$ d i r / o w n d k a 1 2 0 0 : [000000]guest.*
Di r e c t o r y D K A 1 2 0 0 : [000000]
GU E S T . D I R ; 1

1/18

29-NOV-2004 15:58:25.35

[GUEST]

Notice I had to set the owner when creating this directory. If I had not done so the
owner would be SYSTEM (the username from the process which created the file) rather
than GUEST. Since GUEST doesnt have any privileges it wouldnt be able to get to its
own home directory. Lets give it a try now!
$ set host 0
W e l c o m e t o O p e n V M S (TM) Alpha Operating System, Version V7.2
Us e r n a m e : g u e s t
Pa s s w o r d :
* * * * * * * * * * * * * * ***************************************
*
*
*
WELCOME.TXT
*
*
*
*
W e l c o m e t o the Alpha node LGKL1 run by Logikal
*
*
Solutions.
*
* * * * * * * * * * * * * * ***************************************

WooHoo! It works! If you had your own system and were playing along creating this
account you should be able to log in as well. The command SET HOST is a DECNET
command. If you are logged into one node on a cluster and wish to log into another node
without disconnecting your current process you issue the SET HOST command with a
node name. Using a node nam e of zero tells DECN ET to let you log back into the sam e
node you are on. Though it is not generally cost effective to buy a DECNET license for a
m achine which will never be part of a cluster, it can be handy to have for system s

1-32

Chapter 1 - Fundamentals of OpenVMS

manager types.
We need to cover this UIC thing just a little bit more, then we can get on with rights
identifiers. While still logged in as GUEST I shall issue the following:
$ a = f $ g e t j p i ( , UIC)
$ show symbol a
A = [GUEST]

The lexical function F$GETJPI() is a function to get job process inform ation. The first
parameter tells it the PID (Process ID) of the process you wish to find out about. Using
a pair of double quotes tells it to use the PID from the issuing process. The second
parameter is quoted text telling it what you wish to know about the process. Notice that
it returns the synonym and not the actual UIC code.
Using the editor I created a one line text file in this account.
$ dir/own
Di r e c t o r y D K A 1 2 0 0 : [GUEST]
TE S T _ F I L E _ 1 . T X T ; 1

[GUEST]

To t a l o f 1 f i l e .
$
$ s e t f i l e / o w n = [ 2 0 0,201] *.txt;0
$ dir/own
Di r e c t o r y D K A 1 2 0 0 : [GUEST]
TE S T _ F I L E _ 1 . T X T ; 1

[GUEST]

To t a l o f 1 f i l e .

The SET FILE command allows you to change things like the owner and security of
a file. There are actually a lot of things you can change but we will only be concerned with
these two for the time being. You will note that even when you force in the numeric value
for the owner it still displays the synonym .
We must now touch on basic file security. Every file, even a directory file, has four
access paths which provide default security. These paths are: System, Owner, Group and
World. They are listed in that order when you tell the directory command to show you the
security on something. Up to four types of access can be specified for each path: Read,
Write, Execute and Delete. When a directory is created it doesnt have delete access
turned on for any path. You need either a highly privileged account to delete a directory
file or you need enough privilege to turn delete access on for your access path. When a file
which is not a directory file is created the access path is (S:RWED, O:RWED, G:RE). Lets
do a few examples to try and clear things up.

1-33

Chapter 1 - Fundamentals of OpenVMS


$ dir/sec
Directory DKA1200:[GUEST]
TEST_FILE_1.TXT;1

[GUEST]

(RWED,RWED,RE,)

$ d i r / s e c d k a 1 2 0 0 : [000000]guest.dir
Di r e c t o r y D K A 1 2 0 0 : [000000]
GU E S T . D I R ; 1
[GUEST]

(RWE,RWE,RE,E)

Now, lets change the security on the directory, then use the editor to create another
one line text file.
$ s e t f i l e / p r o t = ( s :rwe,o:rwe,g,w) dka1200:[000000]guest.dir
$ d i r / s e c d k a 1 2 0 0 : [000000]guest.dir
Di r e c t o r y D K A 1 2 0 0 : [000000]
GU E S T . D I R ; 1

[GUEST]

(RWE,RWE,,)

$ dir/sec
Di r e c t o r y D K A 1 2 0 0 : [GUEST]
TE S T _ F I L E _ 1 . T X T ; 1
TE S T _ F I L E _ 2 . T X T ; 1

[GUEST]
[GUEST]

(RWED,RWED,RE,)
(RWED,RWED,RE,)

To remove group and world access I had to specify the identifiers without a colon or
qualifiers. If you issue the SET FILE/PROT command and leave one or more access paths
out of it they remain unchanged once the command is executed, not removed like many
think. Notice that the shiny new file (TEST_FILE_2.TXT) created after the security
change still got created with the same access path restrictions as the first file. We will
encounter a distinction before we finish talking of ACLs.
Now comes the fun part, creating and granting a rights identifier. From my system
account I bring AUTHORIZE back up and create a rights identifier, then grant it to
GUEST.
$ s e t d e f s y s $ s y s t em
$ run authorize
UA F > a d d / i d e n t g s t _ro
%U A F - I - R D B A D D M S G , identifier GST_RO value %X80010001 added to rights database
UA F > a d d / i d e n t g s t _re
%U A F - I - R D B A D D M S G , identifier GST_RE value %X80010002 added to rights database
UA F > a d d / i d e n t g s t _s
%U A F - I - R D B A D D M S G , identifier GST_S value %X80010003 added to rights database
UA F > g r a n t / i d e n t
%U A F - I - G R A N T M S G ,
UA F > g r a n t / i d e n t
%U A F - I - G R A N T M S G ,
UA F > g r a n t / i d e n t
%U A F - I - G R A N T M S G ,

g st_ro guest
i dentifier GST_RO granted to GUEST
g st_re guest
i dentifier GST_RE granted to GUEST
g st_s guest
i dentifier GST_S granted to GUEST

1-34

Chapter 1 - Fundamentals of OpenVMS

UA F > s h o w g u e s t
Us e r n a m e : G U E S T
Owner:
Ac c o u n t :
UIC:
[200,201] ([GUEST])
CL I :
DCL
Tables: DCLTABLES
De f a u l t :
D K A 1 2 0 0 : [GUEST]
LG I C M D :
Fl a g s :
Pr i m a r y d a y s :
M o n Tue Wed Thu Fri
Se c o n d a r y d a y s :
Sat Sun
No a c c e s s r e s t r i c t ions
Ex p i r a t i o n :
(none)
Pwdminimum: 6
Login Fails:
0
Pw d l i f e t i m e :
90 00:00
Pwdchange: 29-NOV-2004 15:26
La s t L o g i n : 2 9 - N O V -2004 16:05 (interactive),
(none) (non-interactive)
Ma x j o b s :
0
Fillm:
100
Bytlm:
64000
Ma x a c c t j o b s :
0
Shrfillm:
0
Pbytlm:
0
Ma x d e t a c h :
0
BIOlm:
150
JTquota :
4096
Pr c l m :
8 DIOlm:
150
WS def:
2000
Pr i o :
4 ASTlm:
250
WS quo:
4000
Qu e p r i o :
4 TQElm:
0
WS extent:
16384
CP U :
(none)
Enqlm:
2000 Pgflquo:
50000
Au t h o r i z e d P r i v i l e ges:
NETMBX
T M P MBX
De f a u l t P r i v i l e g e s :
NETMBX
T M P MBX
Id e n t i f i e r
Value
Attributes
GST_RO
%X80010001
GST_RE
%X80010002
GST_S
%X80010003

The com mand ADD/IDENTIFIER is used to add a new rights identifier. There are
lots of things w hich can be added as qualifiers on that command line which we will not
cover as they are more the dom ain of a system s manager than a system s developer. Once
the identifiers were added we had to grant them to the user. The results of the SH O W
command now displays the identifiers on the account. Those rights will only be available
to sessions which log in after the rights identifiers were granted. C urrently logged in
sessions will not have them .
Before:
$ s h o w p r o c e s s / r i g hts
29 - N O V - 2 0 0 4 1 7 : 1 0 : 53.13

Pr o c e s s r i g h t s :
GUEST
INTERACTIVE
REMOTE
Sy s t e m r i g h t s :
SYS$NODE_LGKL1

User: GUEST
Node: LGKL1

resource

Process ID:
000000A3
Process name: GUEST

1-35

Chapter 1 - Fundamentals of OpenVMS


After:
$ set host 0
W e l c o m e t o O p e n V M S (TM) Alpha Operating System, Version V7.2
Us e r n a m e : g u e s t
Pa s s w o r d :
* * * * * * * * * * * * * * ***************************************
*
*
*
WELCOME.TXT
*
*
*
*
W e l c o m e t o the Alpha node LGKL1 run by Logikal
*
*
Solutions.
*
* * * * * * * * * * * * * * ***************************************
L a s t i n t e r a c t i ve login on Monday, 29-NOV-2004 16:05:25.63
$ show proc/rights
29 - N O V - 2 0 0 4 1 7 : 1 1 : 32.75

User: GUEST
Node: LGKL1

Pr o c e s s r i g h t s :
GUEST
INTERACTIVE
REMOTE
GST_RO
GST_RE
GST_S

Process ID:
000000A5
Process name: _RTA2:

resource

Sy s t e m r i g h t s :
SYS$NODE_LGKL1

Now we need a directory to play in. This directory must be owned by a privileged
account so we can show the real power of ACLs. I created a command file called
THE_WRONG_WAY.COM to add the ACL security to this directory.
$ c r e a t e / d i r d k a 1 2 00:[acl_test]/own=hughes
$ @ t h e _ w r o n g _ w a y d ka1200:[000000]acl_test.dir
$ d i r / s e c d k a 1 2 0 0 : [000000]acl_test.dir
Di r e c t o r y D K A 1 2 0 0 : [000000]
AC L _ T E S T . D I R ; 1
1/18
29-NOV-2004 17:37:24.04 [HUGHES]
( I D E N T I F IER=[*,*],OPTIONS=DEFAULT,ACCESS=NONE)
( I D E N T I F IER=GST_RO,OPTIONS=DEFAULT,ACCESS=READ)
( I D E N T I F IER=GST_RE,OPTIONS=DEFAULT,ACCESS=READ+EXECUTE)
( I D E N T I F IER=GST_S,OPTIONS=DEFAULT,ACCESS=READ+WRITE+EXECUTE+DELETE)

(RWE,RWE,RE,E)

THE_WRONG_WAY.COM
$ s e t s e c u r i t y / c l ass=file / a c l = ( ( i d e ntifier=[*,*], option=default, access=none), ( i d e ntifier=gst_ro, option=default, access=read), ( i d e ntifier=gst_re, option=default, access=read+execute), ( i d e ntifier=gst_s, option=default, access=read+write+execute+delete)) 'p1'

1-36

Chapter 1 - Fundamentals of OpenVMS

Notice the search order of the ACL. Only the first entry will ever be used. The
command SET SECURITY/ACL pushes each identifier onto the list from the top but it
processes the list in reverse order if you put more than one identifier clause in the
command. Now we need to remove this ACL list and put on the correct list.
$ s e t s e c u r i t y / a c l /clas=file/delete=all dka1200:[000000]acl_test.dir
$ d i r / s e c d k a 1 2 0 0 : [000000]acl_test.dir
Di r e c t o r y D K A 1 2 0 0 : [000000]
A C L _T E S T . D IR ; 1
(R W E , R W E , R E , E )

1/18

29-NOV-2004 17:37:24.04

[HUGHES ]

$ @ t h e _ r i g h t _ w a y d ka1200:[000000]acl_test.dir
$ d i r / s e c d k a 1 2 0 0 : [000000]acl_test.dir
Di r e c t o r y D K A 1 2 0 0 : [000000]
AC L _ T E S T . D I R ; 1
1/18
29-NOV-2004 17:37:24.04 [HUGHES]
( I D E N T I F IER=GST_S,OPTIONS=DEFAULT,ACCESS=READ+WRITE+EXECUTE+DELETE)
( I D E N T I F IER=GST_RE,OPTIONS=DEFAULT,ACCESS=READ+EXECUTE)
( I D E N T I F IER=GST_RO,OPTIONS=DEFAULT,ACCESS=READ)
( I D E N T I F IER=[*,*],OPTIONS=DEFAULT,ACCESS=NONE)

(RWE,RWE,RE,E)

THE_RIGHT_WAY.COM
$ s e t s e c u r i t y / c l ass=file / a c l = ( i d e n t i f i er=[*,*], option=default, access=none) 'p1'
$ s e t s e c u r i t y / c l a ss=file / a c l = ( i d e n t i f i er=gst_ro, option=default, access=read) 'p1'
$ s e t s e c u r i t y / c l a ss=file / a c l = ( i d e n t i f i er=gst_re, option=default, access=read+execute) 'p1'
$ s e t s e c u r i t y / c l a ss=file
/ a c l = ( i d e n t i f i er=gst_s,option=default, access=read+write+execute+delete) 'p1'

So now you can see the correct way. There are actually two correct ways. We could
have changed the order in the original command file to be exactly the order we wanted to
appear. If you find an ACL list on a directory where you need to just swap the order of
one item or change it slightly, there is an ACL editor you can invoke. This editor operates
much like TPU.
$ e d i t / a c l d k a 1 2 0 0 :[000000]acl_test.dir
(I D E N T I F I E R = G S T _ S , OPTIONS=DEFAULT,ACCESS=READ+WRITE+EXECUTE+DELETE)
(I D E N T I F I E R = G S T _ R E ,OPTIONS=DEFAULT,ACCESS=READ+EXECUTE)
(I D E N T I F I E R = G S T _ R O ,OPTIONS=DEFAULT,ACCESS=READ)
(I D E N T I F I E R = [ * , * ] , OPTIONS=DEFAULT,ACCESS=NONE)
[E n d o f A C L ]

In case you were wondering about the p1 item, it is the symbol for the first command
line parameter. You can have up to eight parameters passed on the command line (or in
the /PARAM qualifier on the SUBMIT statement). They become sym bols p1 through p8.
Each sym bol can contain up to 255 characters of data. All values are passed in character
form, but it is a simple matter to convert them to integers using the lexical function
F$IN TEGER().

Chapter 1 - Fundamentals of OpenVMS

1-37

Now, we need a source file and an executable file to conduct our test. Many of you will
recognize the adaptation of hello_world. I created this program in m y own account, then
copied it to the test directory.
#i n c l u d e < s t d i o >
#i n c l u d e < s t d l i b >
in t m a i n ( i n t * a r g c, char **argv)
{
p r i n t f ( H e l l o World!\n);
return 1;
}
$ cc hello_world
$ link hello_world
$ run hello_world
He l l o W o r l d !
$ c o p y h e l l o _ w o r l d .c dka1200:[acl_test]*.*;0/log
%C O P Y - S - C O P I E D , D K A1200:[HUGHES.MEGA_ZILLIONARE]HELLO_WORLD.C;1 copied to
DK A 1 2 0 0 : [ A C L _ T E S T ] HELLO_WORLD.C;1 (1 block)
$ c o p y h e l l o _ w o r l d .exe dka1200:[acl_test]*.*;0/log
%C O P Y - S - C O P I E D , D K A1200:[HUGHES.MEGA_ZILLIONARE]HELLO_WORLD.EXE;1 copied to
DK A 1 2 0 0 : [ A C L _ T E S T ] HELLO_WORLD.EXE;1 (7 blocks)

Remember that the GUEST account currently has all of the rights identifiers. It will
be able to type out the source file and run the executable but it will not be able to issue a
directory command against that directory or create a file in that directory.
$ set host 0
W e l c o m e t o O p e n V M S (TM) Alpha Operating System, Version V7.2
Us e r n a m e : g u e s t
Pa s s w o r d :
* * * * * * * * * * * * * * ***************************************
*
*
*
WELCOME.TXT
*
*
*
*
W e l c o m e t o the Alpha node LGKL1 run by Logikal
*
*
Solutions.
*
* * * * * * * * * * * * * * ***************************************
$ r u n d k a 1 2 0 0 : [ a c l _test]hello_world
He l l o W o r l d !
$ t y p e d k a 1 2 0 0 : [ a c l_test]hello_world.c
#i n c l u d e < s t d i o >
#i n c l u d e < s t d l i b >
in t m a i n ( i n t * a r g c, char **argv)
{
p r i n t f ( H e l l o World!\n);
return 1;
}

1-38

Chapter 1 - Fundamentals of OpenVMS

$ d i r d k a 1 2 0 0 : [ a c l _test]
%D I R E C T - E - O P E N I N , error opening DKA1200:[ACL_TEST]*.*;* as input
-R M S - E - P R V , i n s u f f icient privilege or file protection violation
$ d i r / s e c d k a 1 2 0 0 : [000000]acl_test.dir
Di r e c t o r y D K A 1 2 0 0 : [000000]
AC L _ T E S T . D I R ; 1

insufficient privilege or object protection violation

$ d i r d k a 1 2 0 0 : [ a c l _test]hello_world.c
Di r e c t o r y D K A 1 2 0 0 : [ACL_TEST]
HE L L O _ W O R L D . C ; 1
To t a l o f 1 f i l e .
$ d i r d k a 1 2 0 0 : [ a c l _test]hello_world.c
Di r e c t o r y D K A 1 2 0 0 : [ACL_TEST]
HE L L O _ W O R L D . C ; 1
To t a l o f 1 f i l e .

You can see that the user must know exactly what they have access to in order to be
able to use it. Remember we are trying to access from an account with no privileges.

1.10 Logical N am e Tables


We got to the discussion of ACLs because we were discussing logicals. As was stated
before, every logical is stored in either a directory or a table. Duplicating logicals as job
level logicals within user processes consumed a lot of resources and opened up the
possibility of a logical definition getting changed in a single user environment making it
difficult to track down. The solution was to create application level logical nam e tables.
When everyone was in the same group that needed access to the table we simply set the
protection on the table to allow group read. Once users started needing more than one
application this left a tough choice. System managers could make the tables world read
(not very secure) or they could install ACLs on the table.
As a general rule, logical name table creation should be done during system startup.
If you dont put it in the site specific startup file, when the system reboots the table will
be gone. Population of the table can occur any time after startup, but is generally done
at the same time as table creation and usually all from the same command file. A logical
name table which is to be available to anyone having access to it needs to have a parent
logical directory of LNM$SYSTEM _DIRECTORY. If you create a logical name table and
dont sp e cify th e p a re n t d ire cto ry table it w ill be placed in your
LNM$PROCESS_DIRECTORY and it will disappear when your process goes away.

1-39

Chapter 1 - Fundamentals of OpenVMS


CREATE_NAME_TABLE.COM
$ c r e a t e / n a m e _ t a b l e/parent_table=lnm$system_directory
my_app_tbl
$!
$ s e t s e c u r i t y / c l a ss=logical/acl=(identifier=gst_re,access=read+execute)
$!
$ s e t s e c u r i t y / c l a ss=logical/prot=(w) my_app_tbl
$!
$ d e f i n e / t a b l e = m y _ app_tbl first_logical sys$login
$!
$ exit

my_app_tbl

$ @ c r e a t e _ n a m e _ t a b le
$ s h o w l o g / f u l l / t a ble=my_app_tbl
(M Y _ A P P _ T B L )

[ s uper] [shareable]
[ P rotection=(RW,RW,R,)] [Owner=[HUGHES]]
(IDENTIFIER=GST_RE,ACCESS=READ+CREATE)

F I R S T _ L O G I C A L [super] = SYS$LOGIN

I created and performed the above from my privileged account. Notice that we took
world read access off the logical name table. We want to restrict it to only those users who
should be running the application which will need this table. The default when creating
a logical name table is to allow world read access. You should get into the habit of turning
off world read access when creating logical name tables. Admittedly in this little example
it is hard to understand why you would want to, but what if this application was payroll
or accounting you were creating the name table for? Now we need to edit the GUEST
account login so it will map onto this table.
LOGIN.COM for GU EST account
$ d e f i n e / t a b l e = l n m $process_directory lnm$file_dev
l n m$process, m y _app_tbl, l n m$job, l n m$group, l n m$system
$ exit
$ @login
$ s h o w l o g f i r s t _ l ogical
F I R S T _ L O G I C A L = SYS$LOGIN (MY_APP_TBL)
1
S Y S $ L O G I N = DKA1200:[GUEST] (LNM$JOB_812D2F40)

N otice that I placed the table MY_APP_TBL after the process table. You should
always place application logical tables after the process and before the job level table when
defining LNM$FILE_DEV. This allows for process level overrides of logicals by running
applications, but does not allow for job or higher level definitions to clobber one of your
logicals.
The definition of LNM$FILE_DEV must be placed in the table
LNM$PROCESS_DIRECTORY if you wish it to be used.
Notice how the translation of FIRST_LOGICAL is displayed. The very first definition
shown is another logical. OpenVMS then went and found the next definition for you. It
will keep doing this until the logical is completely defined all the way out or until it
encounters a logical which was defined with the /TRANSLATION=TERMINAL qualifier.
This is a security feature which gets em ployed at a lot of shops.

1-40

Chapter 1 - Fundamentals of OpenVMS

$ d e f i n e / t a b l e = m y _ app_tbl/trans=terminal second_logical sys$output


$ s h o w l o g i c a l s e c ond_logical/full
S E C O N D _ L O G I C A L [super] = SYS$OUTPUT [terminal] (MY_APP_TBL)
$ s h o w l o g s y s $ o u t put
S Y S $ O U T P U T = _LGKL1$RTA1: (LNM$PROCESS_TABLE)

1.11 Foreign Com m ands


Those of you coming from platforms like Windows and UNIX are used to running an
executable by simply typing in its name. You have seen that here as well with respect to
the editors and such. That is not the norm al method of invocation though. In order to
pass command line parameters to any executable it m ust be defined as a foreign
command. If you went through the section on setting up LSE you saw us define one
foreign command.
$ LSE :== $LSEDIT

Many times you want only a tem porary definition or your own special definition so
sticking this definition in a batch file (or your LOGIN.COM) works just fine. Your system
manager has another m ethod at their disposal. They define a logical called DCL$PATH
to point to one or more directories where executables exist. On m y system it is defined as
follows:
$ show log dcl$path
D C L $ P A T H = D KA1000:[SYSTEM_UTILITIES] (LNM$ SYSTEM_TABLE)

Any executable in that directory can be invoked by simply typing its name. Command
line parameters can be passed as well if the executable accepts them. If you are writing
programs in C and designing them to accept command line input it can be useful to put
them in a directory in this path.
There is one thing worthy of note with respect to foreign commands. On many
operating systems the first command line parameter is the full path to the executable
image. This parameter is inserted by the OS and the developer has to code around it. On
OpenVMS prior to changes which occurred with version 7.x that does not happen. I
wanted to bring this up now before we get into the chapter on C so you are aware of it.

Chapter 1 - Fundamentals of OpenVMS

1-41

1.12 Exercises
1.

What is the purpose of the [F1] key on the VT terminal keyboard?

2.

What command changes the prompt you see on the terminal?

3.

What value should norm ally be in the error count column for disk drives?
Is this the sam e value for tape drives?

4.

How big is a disk block?

5.

How big is a memory page?

6.

What is the root directory of every disk device?

7.

What is the maximum file version number OpenVMS will allow?

8.

What command gets rid of older versions of files?

9.

What are the three types of data a sym bol can store?

10. What are the two classes or storage spaces for symbols?
11. What is the difference between = and == when assigning a value to a symbol?
12. Given the following:
$ S 1 == My big dog
$ S 1 := The purring cat

What will be displayed when typing


$ S H O W SYMBOL S1

13. Given SYS$LOGIN is defined to be DUA1:[FRED], what is the value of CURR_DIR?


$ c u r r _ d i r = f$trnlnm(SYS$LOGIN)
$ c u r r _ d i r = curr_dir - ] + .cars]

14. What is the difference between := and = when assigning sym bol values?
15. Is the following a legal symbol assignment?
$ d i a m e t e r = 10
$ a r e a = 3 .414 * diameter

16. What is the difference between:


$ t i n g = % x07
$ t i n g [ 0 , 7 ] = %x07

17. What is the initialization search order that EDT follows at startup?
How do you override it?
18. When in CHANGE mode in EDT, how do you get back to command mode?
19. When are device error counts reset?

1-42

Chapter 1 - Fundamentals of OpenVMS

20. What is the GOLD key?


21. If EDT starts with the command prompt * how do you get into screen m ode?
22. What does the FIND command do in EDT?
23. How do you save a selected range of lines with the WRITE command in EDT?
24. H ow do you save lines 10 - 15 of a given file using the WRITE command without
selecting them ?
25. Which key on the VT style numeric keypad deletes a single character?
26. What numeric keypad combination takes you to the bottom of the file in EDT?
The top?
27. What does the INCLUDE command do in EDT?
28. In EDT, what is the syntax for the SUBSTITUTE command to change ABC to DEF for
a selected range of lines?
29. How do you m ake EDT take you to a specific source line?
30. What is the initialization search order for EVE?
How do you override it?
31. What does LSE stand for?
32. What are the two command languages supported by LSE?
33. How do you switch between the two languages?
34. What logical does LSE use to find its initialization file?
35. What one logical controls the logical translation search path for your process?
36. What is SYS$LOGIN? Not a value, what does it represent?
37. What does the logical SYS$OUTPUT represent?
38. If you enter the command:
$ P R I NT MY.FIL

What logical is used to determine the print queue?


39. What PRIV level is required to create an EXECUTIVE_MODE logical?
40. How long does a USER_MODE logical live?
41. If you override the definition of LNM$FILE_DEV where must you place its definition?

Chapter 1 - Fundamentals of OpenVMS

1-43

42. What is the difference between ASSIGN and DEFINE?


43. How do you continue a DCL command line onto the next line?
44. Given the definition:
$ D E F INE PROJ_DATA

DUA1:[DATA1], DUA2:[DATA2], DUA3:[DATA3]

Where would the command


$ E D I T/EDT PROJ_DATA:NEW_FILE.TXT

create the file?


Why?
45. What are the five qualifiers you can put on a DEFINE or ASSIGN statement to control
the placement of the logical?
46. What account setting controls the amount of job level logicals you can have?
47. What does ACL stand for?
48. What flag do you set on an account in the UAF to leave an account defined by
unusable?
49. What error message do you get when you try to run AUTHORIZE from the wrong
directory?
50. What does the command $ SET HOST 0 do?
51. What does the nam e of the lexical function F$GETJPI stand for?
52. What command is used to change the owner of a file?
53. What are the 3 levels in which logicals exist?
54. How can you create a password which is shorter than the system m inim um ?
55. What are the 4 protected access paths to an object on OpenVM S?
56. What must a user account posses to gain access to an object via an ACL?
57. In what order are ACLs added to objects?
58. How many parameters can be passed on a command line to a COM file?
59. What is the search order for ACLs?
60. What is the maximum length for the contents of a symbol passed as a param eter?
61. What lexical function converts a string value to a number?
62. What command removes all ACLs from a file?
63. What command shows the ACLs on a file?

1-44

Chapter 1 - Fundamentals of OpenVMS

64. If you own the directory DUA1:[ME] how do you add a subdirectory named MYSELF
to it?
65. What is the syntax of the command required to create a logical table which everyone
can read?
66. What command will add the logical name table INVEN TORY_APP_TBL to your
default translation search path?
67. When defining a logical, what qualifier or command parameter causes the iterative
interpretation of the logical to cease?
68. What is a foreign command?
69. How is a foreign command different from an executable invoked by the RUN
command?
70. What is different between parameters passed on the command line to an executable
between OpenVM S and DOS or Unix?
71. What are the two methods of declaring foreign commands?

Вам также может понравиться