Issue 4, 1991

IBM Personal Systems Technical Solutions----- ---- -- ----------·-®

$10.00IBM Personal Systems Technical Solutions ispublished quarterly by IBM United Statestechnical support center, International
Business Machines Corporation, Roanoke,
Texas , U .S.A.
EditorConsulting Editor
Communications
DesignIllustrator
Manager

Libby Boyd
Ed Bamberger
Elisa Davis
Corporate Graphics
Bill Carr
Bill Hawkins

To correspond with IBM Personal Systems
Technical Solutions, please write the editor at:

IBM Corporation
Internal Zip 40-A2-04
One East Kirkwood Blvd.
Roanoke, TX 76299-0015
To subscribe to this publication, request IBM
System Library Subscription Service (SLSS)
from an IBM branch, and specify form number GBOF-1229.
Copying or reprinting material from this magazine is strictly prohibited without the written
permission of the editor. Titles and abstracts,
but no other portions, of information in thispublication may be copied and distributed bycomputer-based and other information-service
systems.

IBM believes the statements contained herein
are accurate as of the date of publication ofthis document. However, IBM hereby disclaims all warranties as to materials and workmanship, either expressed or implied,
including without limitation any implied warranty of merchantability or fitness for a particular purpose. In no event will IBM be
liable to you for any damages, including any
lost profits, lost savings or other incidental orconsequential damage arising out of the use
or inability to use any information provided
through this service even if IBM has been advised of the possibility of such damages, orfor any claim by any other party.
Some states do not allow the limitation or exclusion of liability for incidental or consequential damages so the above limitation or
exclusion may not apply to you .
This publication could contain technical inaccuracies or typographical errors. Also, illustrations contained herein may show prototype
equipment. Your system configuration may
differ slightly.

IBM has tested the programs contained in thispublication. However, IBM does not guaran-

action. IBM expressly reserves the right tochange or withdraw current products that may
or may not have the same characteristics orcodes listed in this publication. Should IBM
modify its products in a way that may affectthe information contained in this publication,
IBM assumes no obligation whatever to inform any user of the modifications.
IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does
not imply giving license to these patents.
It is possible that this material may containreference to, or information about, IBM products (machines and progran1s), programmingor services that are not announced in yourcountry. Such references or information mustnot be construed to mean that IBM intends toannounce such products, programming or services in your country.
IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation
whatever.

tee that the programs contain no errors.

All specifications are subject to change without notice.

This information is not intended to be a statement of direction or an assertion of future© Copyright 1991 by International Business
Machines Corporation

OUR COVER: Nine hundred years ago, the men and women of a small
Viking ship, led by Leif Eriksson, pushed their knowledge and technology to
the limits. Their courage and skill landed them on the shores of North
America four hundred years before Christopher Columbus. Today, the men
and women of IBM continue this tradition of exploration and leadership,
keeping IBM at the frontier of computing technology.

Hardware
1 Power Factor: Non-Linear Loads and the Power Distribution System
Software
6 Database Manager: Highlights and Direction_________. . ,__1_3__o_ s _,2_®_ c_o_m_m_ u_n_ic_a_t_io_n_s_M_a_n_a_g_e_rT_M_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __23 Improving OS/2 Application Performance
33 Creating PM Windows with Dialog Templates
38 REXX Program for OS/2 LAN Server

49 Micro Focus® COBOL/2 and the DOS Database Requester
54 IBM DOS 5.0 Facts and Features
61 IBM DOS 5.0 Upgrade
65 DOS 5.0 Performance Improvements
70 DOS Memory Management Facilities

7 4 Disk Caching Under DOS
77 NetWare® Client-Server Interaction
89 LANACS Protocols
Random Data

95 New Book: Client-Server Programming with OS/2 Extended Edition
96 Little Solutions
99 New Products

Personal Systems/ Issue 4, 1991

Trademarks
IBM, AIX, Audio Visual Connection, Micro Channel, Operating System/2, OS/2, Personal
Computer AT, AT, Personal System/2, PS/2, PROFS, and RT are registered trademarks ofInternational Business Machines Corp.

AIXwindows, Application System/400, AS/400, A VC, C/2, COBOU2, Communications
Manager, DB2, ETHERAND, FORTRAN/2, OS/400, NetView, Pascal/2, Personal
Computer XT, PC X_T, PS/1, Presentation Manager, QMF, RlSC System/6000, SQL,SQL/DS, Systems Application Architecture, SAA, SNA, System/370, System/390, VTAM,
and 3090 are trademarks of International Business Machines Corp.
ARCserve is a registered trademark of Cheyenne Software, Inc.
PostScript is a registered trademark of Adobe Systems Inc.
Intel is a registered trademark, and i860, 386, i486, 486, 80286, 80386, 80386SX, and80486 are trademarks of Intel Corp.
Microsoft and MS-DOS are registered trademarks, and Windows is a trademark ofMicrosoft Corp.
Micro Focus is a registered trademark of Micro Focus Limited.
Novell and NetWare are registered trademarks of Novell Inc.
OSF and Open Software Foundation are trademarks of Open Software Foundation Inc.
Sytos Plus is a registered trademark of Sytron Corp.
Xerox and Ethernet are registered trademarks of Xerox Inc.
X Window System is a trademark of Massachusetts Institute of Technology

1Power Factor:
Non-Linear
Loads and thePower
Distribution
SystemRoger Cox
IBM Corporation
Boca Raton, Florida
Power management is commonlya major concern to companies installing large numbers of personal
computers. This article discusses
problems that may be encountered after installation.

One of the major issues with powerelectronics today is how harmonic
currents are generated by the
non-linear load of Switch Mode
Power Supplies (SMPS) used in
PS/2® computers and othernon-linear load products.
The effect of a non-linear load froma single SMPS or other non-linear
load is usually of little consequence
to a home or office installation or to
the utility power distribution system.
When non-linear loads become an
appreciable portion of the load on athree-phase distribution transformer,
problems can occur. When a business wants to install hundreds or
thousands of PS/2s in its office building along with the other non-linear
loads, various forms of overloading
can occur. The following overview

discusses the problems and somepossible solutions.

What Are Non-Linear
Loads?
Maybe the easiest way to explain a
non-linear load is to describe what a
linear load is. A linear load produces
a current that is directly proportional

Personal Systems/Issue 4, 1991

to the line voltage. For alternating
current, the current increases or decreases proportionately as the voltage increases or decreases. This
current can be in-phase or out-ofphase, which are discussed later, but
in either event, the sine wave of voltage produces a sine wave of currentof the same frequency.

2

A non-linear load produces a current
that is not directly proportional to
the line voltage and is not a sine
wave of the same frequency. Often
the current is not continuous and canbe switched on for only part of thecycle.
A simple comparison helps illustrate
the difference between the two. A
non-linear load can be compared toa linear load like a fluorescent bulb
to an incandescent light bulb. The
major difference between the two isthat the fluorescent bulb's current
pulsates not directly proportional tothe voltage, and the incandescentbulb's current varies directly proportional to line voltage.

AC Power Terminology
There are a large number of singlephase, two-phase, and three-phasepower distribution systems throughout the world. Single-phase stands
by itself, even though it could be
supplied from any of the three systems just mentioned; that is, it could
be line-to-neutral (L-N) from a threephase system, and so on. There are
numerous grounding schemes usedaround the world; for example,
grounded wye; corner groundeddelta; tap-grounded delta; floatingwye, delta, and tee; impedance
grounded wye; and grounded open
delta. This discussion is limited to
the wye configuration for threephase systems, and the content is independent of the grounding scheme.
Although U.S. voltages may be discussed, the general principle applies
to all countries and voltages.

Single-Phase Systems: Singlephase sinusoidal (sine wave) 50 or
60 Hz is the power supplied to all
PC-type products. The voltage waveform provided by the utility company is a sine wave, which isusually of good quality, and it maintains its waveshape. The shape ofthe current waveform is entirely afunction of the load. A resistive-type
load provides a sine wave of current
that is in phase with the voltage sine
wave. The term in phase means that
corresponding points of the voltage
and current waveshapes occur at thesame time on the time scale: positive peaks, negative peaks, as wellas positive and negative zero crossovers. An inductive or capacitive
load also provides a sine wave of
current, but it it is lagging or leadingwith respect to the voltage. They are
not in phase and are called, ofcourse, out of phase. Any combination of resistive-, inductive-, and capacitive-type loads always provides
a sine wave of current and the loads
are considered linear loads.

l'hree-Phase Systems: A threephase system is just three singlephase systems that are displaced intime phase from one another. The
time displacement between phases is
one-third of a cycle or 120 degrees
of a complete cycle of 360 degrees.
The discussion of the sine wave current that could be lagging or leading
or in phase applies equally to thethree-phase system. In building distributions, the wye connection isusually used for the transformer secondary that uses four-wire distribution: line 1, line 2, line 3, andneutral. The single-phase voltage ismeasured from any one of the lines
to neutral.
The neutral in the three-phase system is the common point and the return for the three phases. It conducts
the total return current for the threephases. An interesting fact in threephase theory is that the neutral current in a balanced linear load system
is zero. Even though each phase hasa return current, the addition of threeequal currents, each 120 degrees
apart, makes the return current zero.
That is why building wiring used to

Personal Systems/Issue 4, 1991

allow the neutrals to be wired at a
50 percent reduction in current carrying capacity. This is the root of the
problem associated with building
wiring, which is discussed later.

Power and Volt-Amperes: Power
is measured by a wattmeter and represents the amount of work being
done (or heat generated). In power
distribution books, the terms real
power and reactive power are used.
Real power represents the amount ofwork being done, is generally referred to as simply power in thecomputer industry, and is measured
by watts. Reactive power is really amisnomer because is not power. It
does not represent any work being
done and does not contribute to thewatts measured by a watt meter.
This reactive power comes from theinductive and capacitive loads that
produce the out-of-phase currents
mentioned previously.
The term volt-amperes is the productof the voltage and the current being
measured. It is a combination of thereal power and the reactive power. It
is called volt-amperes to distinguishit from the real or the reactive powers. Because it is a combination of
the real and reactive power, it has alarger val ue than either. Present-day
watt meters give readouts of the total current and the voltage as well as
the watts. Multiplying the total current and the voltage gives you thevolt-amperes.

Power Factor: Power factor is defined two different ways today, depending on the type of load. The
traditional definition is concernedwith the sine wave of voltage andthe sine wave of current. When an
inductive or capacitive load produces a load current that is displacedin time from the line voltage, the cosi ne of the angle of displacement isdefined as the power factor. When3

the equations are worked out, power
factor is also the power (watts) divided by the volt-amperes (VA) .

P.F. = Cos Angle = Power/VoltAmperes
For non-linear loads, which were defined in the section "What Are NonLinear Loads?" there is no single"angle of displacement" that can beused to represent the power factor.
The second half of the previous
equation is what is used for
non-linear load power factor,
power/volt-amperes.

Average Root-Mean-Square(RMS), Peak RMS, and True
RMS Measurements: Many measurement techniques assume that thevoltage and current waveforms areapproximately sinusoidal . When thisis not true, as in the case of non-linear loads, errors result from themeasurements. There are three common measurement techniques used
for AC voltages and currents: average RMS , peak RMS , and true RMS.
The average RMS measures averagevoltage and current over one half cycle, then converts the measurement(1. 11 X average) to be representative for a sine wave becausethat is what is normally encountered.
Most inexpensive digital voltmeters
use average conversion because it is
the least expensive to implement. It
is also the approach used in olderstyle analog meters.
The peak RMS measures the peakvoltage and current over one cycle
and then converts the measurement(0.707 X peak) to be representative
for a sine wave because that is what
is normally encountered. As the
RMS indicates, the average RMS
and peak RMS are calibrated toequal true RMS on sine waves.

Waveform Description

Average RMS

Peak RMS

True RMS

Sine Wave

100.0A

100.0A

100.0A

Square Wave

100.0A

63.6A

90.0A

Triangle Wave

100.0A

125.7A

103.3A

Non-Linear Load

100.0A

400.lA

199.4A

Figure 1. Voltage, Current, P.F., and Spectrum Measurements on Non-Sinusoidal AC
Power Circuits (Reference 1)

The RMS value of an AC waveform(voltage or current) is equivalent to
the DC (direct current) value that
produces the same heating (or work)in a purely resistive load. Therefore,a true RMS circuit makes accurate
measurements even if the waveform
is non-sinusoidal (or non-linear).
So on sine waves, all three measurement techniques give the same reading. On non-sinusoidal waveforms,
the readings of line voltages andcurrents can vary dramatically, as
shown in Figure 1.
For non-linear load currents, measurement with the average RMS meter can give a reading of one-halfthe actual value, or the true value istwice the average RMS meterreading.

Harmonics and Non-Linear
Loads
Harmonics, as related to our subject,
are multiples of the fundamental line
frequency (60 Hz in the U.S.). The
second harmonic is two times 60 Hz
or 120 Hz. The third harmonic isthree times 60 Hz or 180 Hz. Any
non-sinusoidal waveform can be represented by an infinite series of sine
waves at integers of the fundamental . With our non-linear load current,
the waveshape of the current is usually composed of the fundamental
and up to the fiftieth harmonic withthe third, fifth, seventh, and ninth being the largest. The even harmonics

Personal Systems/Issue 4, 1991

are very small and usuallyinsignificant.
Earlier it was shown that a threephase balanced linear load had zerocurrent in the neutral. In a threephase balanced non-linear load, theneutral current is not zero but consists of the third harmonic and odd
multiples of the third. This is thethird, ninth, fifteenth, twenty-first,
and so on. What we find is that theodd multiples of the third do not cancel at all in the neutral but are
additive .
In examining the typical input current of an SMPS, the current pulse
waveform can be run through a program to do a harmonic analysis on
it. The output of the analysis provides a breakdown of the fundamental and the individual harmonics up
to the 25th or the 50th, dependingon the program. The output can belisted as current in rnilliamps oramps or can be listed in percent of
the fundamental. The fundamental is
the single frequency component at
the line frequency. A typical percentage listing is shown in Figure 2.
Since the third, ninth, and other odd
multiples of the third harmonic add
in the neutral wire, the neutral wire
winds up carrying a current that ismuch greater than it had been designed to carry.
Types of loads that are sources ofharmonics are all types of AC-to-DC

4Harmonic

Percentage

Fundamental

100

3rd

70 to 90

5th

50 to 70

7th

20 to 409th

5 to 20

Figure 2. Typical Percentage Listing

converters such as motor speed controllers and rectifiers for DC loads,
fluorescent lamps, motor-driven computer peripherals, and the fairly recent entry of the SMPS used inalmost all computer and entertainment equipment. The conversion to
SMPS has been accomplished with areduction in size, weight, and cost,which has been the key to its universal acceptance.

noise can be intense enough tocorrupt digital circuit signals andcause malfunctions.

former currents usually indicate currents within ratings .

• Transformer overheating, insulation damage and failure .

Because of the harmonic problem,
all measurements should be madewith true RMS meters and all ancillary equipment (such as current
transformers) should have frequency
bandwidths to cover the probableharmonics. If peak current readings
are also made, transformer deratings
can be calculated using the formulaprovided by CBEMA in their 1988
information letter. This measurement
data can then be compared to the facility ratings to detect problem areas.

• Distortion (peak voltage reduction) of line voltage waveshapes
severe enough to impair the ridethrough capability of computersand related equipment.
• Overheating of motors operating
on a distorted voltage source.
• Nuisance tripping of circuit
breakers.
• Burned wires in manufactured office partitions.
• Power factor correction capacitors
overheated and damaged.
(See Reference 2.)

Problems Caused by
Harmonics
This universal acceptance of SMPS
and the attendant acceptance of personal and other computers has led to
the generation of a large problem
list. When companies connect hundreds and thousands of PCs in abuilding, the triplen (odd multiplesof the third) harmonic currents add
to those of the other non-linear
loads, creating unexpected electricalproblems. Power line harmonics
have been well documented to be
the cause of:• Overheating of the neutral conductor wires and connections, leading
to failure of neutral conductorsthat could cause overvoltage damage to computers and electronic
office equipment. This is amplified by the wiring practice of reducing the wire size of the neutral
conductor.
• Intermittent electrical noise fromconnections that have been loosened by thermal cycling. This

When companies connect
hundreds and thousandsof PCs in a building, thetriplen harmonic currents
add to those of the othernon-linear loads, creating
unexpected electricalproblems.
Detection of Problems
The traditional measurement technique for facility power distribution
systems has been using average
RMS meters. From the previous discussion, the average RMS current
meters provide a reading of about
one-half of the true RMS high harmonic non-linear load. Measurements with average RMS meters
made on building wiring and trans-

Personal Systems/Issue 4, 1991

Equipment is available that measures the true RMS currents and provides a printout of the harmonic
content of the currents. Thi s measurement can be made on individual
SMPS and other harmonic loads orcan be made on the building distribution wiring showing the total effects
on wiring and transformers.

Possible Solutions
The possible solutions fall into fourmain categories. They are:• Passive fi Iters• Filter traps• Active filters• Other facility changes
Passive filters usually consist of a series inductor and a third harmonic
tuned filter and are located between
the wall outlet and the offending
non-linear device. They operate atline frequency so they are relatively
bulky. They must be fairly wellmatched to the size of the load sothat they do not cause an increase in
RMS line current, even though harmonic currents are reduced.
Filter traps are generally known aszero sequence filters or zig-zag transformer filters, not the passive filter

5just described. This filter is placed
as close as possible to the offending
load and at a point where threephase wiring is available. Carefulconsideration must be given to theplacement and sizing of the filter fora given power distribution system because the filter attracts currents fromother offending loads powered fromthat distribution net. This can be aneffective method of correcting the
problem with existing high harmonicloads. When distribution transformers have to be replaced or added,
this type of filter can be built into
the transformer.
IBM Canada Ltd. has recently usedthe zig-zag transformer to dramatically reduce the harmonic current in
the distribution panel of the officearea of their Toronto manufacturing
plant. The neutral current was reduced 90 percent in their installation.
Active filters add current to the existing input current so that it gives asine wave. They can work very well,
but they are best for a high-power
three-phase system, and they arevery expensive, bulky, and complex.
Some of the other facility changes
mentioned in the CBEMA lriformation Letter are:• Derate the distribution
transformers• Use individual neutral wires foreach phase• Use dual neutral wires for sharedneutral wiring• Use low impedance delta-wye distribution transformers• A void the use of power factor correction capacitors

As is usually the case, the lowestcost solution is probably a combination of the solutions described.
There should also be a periodic inspection of the electrical system, especially after additions of hardwareor changes of system configurations.
These inspections should include
measurements of phase and neutral
currents, temperatures of transformers, their connections and the connections in the total distribution
system. Filter traps should also be
looked at when system configurations change because the amount of
current could possibly exceed its
rating.

System Power Supplies with
Power Factor Correction
An obvious question one could ask
is, "Why not reduce the harmonics
at the source?" The answer, ofcourse, is that one can. There are circuit approaches that force the input
current to appear resistive and proportional to the line voltage and bein-phase. These approaches can be
designed into new products for future sale and add some cost to thesystem. In Europe, an IEC 555-2
standard is being changed to add harmonic limits. This standard applies

to all household and other equipment (which includes the PC
products). When this standard isapproved and adopted, all PC
products for Europe have to include
power factor correction to meet theharmonic limits.
Reference I: Figure by A. McEachem. Contributed by BM!, Foster City, California,(415) 570-5355, University of Wisconsin-Milwaukee Conference on "Effects of Non-Linear Loads on the Power Distribution System,"
April 5-6, I 989.
Reference 2: Computer Business Equipment
Manufacturers Association (CBEMA) Information Letter, 1988, and "DP Experience
with Switching Supplies" by John M.
Roberts, IBM. University of Wisconsin-Milwaukee Conference on "Effects of Non-Linear Loads On The Power Distribution
System," April 5-6, 1989.

ABOUT THE AUTHOR
Roger Cox is a senior engineer atIBM's Entry Systems Division. He
has worked in the Systems Power
Development department since hejoined IBM in 1984. He has been
involved in system power-relatedareas since the beginnings of PS/2
design, and is the power technicalintetface to IBM plants.

Further Reading
Any good college text on Alternating Current Circuits will cover threephase systems.

Magnetic Circuits and Transformers,"Harmonic Phenomena in Three
Phase Circuits," MIT Staff. MIT Press, 1943.
Magnetic Circuits and Transformers, "Zigzag Autotransformers," MITStaff. MIT Press, 1943.
"Three Phase Power Source Overloading Caused by Small Computers
and Electronic Office Equipment" CBEMA Information Letter, 1988.

Personal Systems/Issue 4 , 1991

6

Database
Manager:
Highlights andDirection
Philip J. Sullivan
IBM Corporation
Austin, Texas
Database Manager is IBM's relational database management system for Operating System/2®
(OS/2). It offers a robust application development and run-time
platform for a variety of OS/2 and
DOS database applications. This
article describes the capabilities
and scope of Database Manager,
and IBM's intentions for futureversions of the product.

IBM OS/2 Extended Edition Version
1.3 includes a Systems Application
Architecture™ (SAATM) relational
database management system,
named Database Manager, that supports the SAA Structured Query Language (SQUM). Database Manager
can operate as a multiple-userdientserver distributed relational databasemanagement system attached to a local area network (LAN) or as astand-alone single-user relational
database.
Database Manager has benefited
from IBM Research-developed database technologies and architectures,
including the relational model ofdata and SQL. These IBM technologies and architectures, coupled with
the new technologies and architectures developed expressly for Data-base Manager, have positioned thisproduct to be an industrial-strength
relational database. It provides highperformance, concurrent data access,robust data integrity and protection
facilities, and consistency with thefamily of IBM SAA relational database management systems.

Relational Model of Data
Database Manager is predicated on
the relational model of data. The relational model of data was invented
by E. F. Codd at the IBM San Jose
Research Center in the late 1970s.
Today, the relational model has been
widely accepted as an industry standard by the marketplace. The relational model has been designed tobe easy to understand and use. Information is presented to the user in aneasy to recognize and easy to use table format. A table is a logical data
structure consisting of rows
(records) and columns (fields). The
user defines and accesses data interms of tables and performs operations on these tables.
The main advantage of the relational
database model is the clear separation between the user perception ofdata, that is, tables consisting of columns and rows, and the internal implementation of data, which ishidden from the user. The simple table format, along with SQL andhigh-level application development
tools, means that the application developer and the database administrator do not have to understandcomplex physical data structures andaccess methods, which are characteristics of hierarchical file manage-

Personal Systems/Issue 4, 1991

ment systems. The benefits are easeof use and productivity.

Structured Query Language
SQL is the common interface toDatabase Manager and all IBM
SAA relational database management systems. SQL, originally developed at the IBM San Jose ResearchCenter, has also become a standard
in the industry. SQL is a high-level
data defmition and data manipulation language, used for defining, accessing, and changing data in tables.
SQL is considered simple to learn,
yet powerful in expressing sophisticated queries. A single statement in
SQL can perform the same function
as many lines of application code developed with a conventional programming language, such as C,
COBOL, FORTRAN, or Pascal.
All data accesses to Database Manager are performed with SQL statements through the SQL common
interface. SQL supports arithmetic
operations on retrieved values. The
query functions support selective retrieval from single or multiple datatables and dynamic sorting of the setof resulting rows. Built-in functions
include summation, grouping, ordering, and basic statistics (for example, calculating an average of thevalues in a column).
SQL statements can be entered interactively (through Query Manager,
described later in the article), embedded in a precompiled application program written in a high-level
programming language, or embedded in an application program writ-

7

I

.. l

.

ten with IBM Procedures Language
2/REXX. Database Manager provides language precompilers to prepare embedded SQL statements for
subsequent application program compilation and execution by Database
Manager. Precompiler support isprovided for IBM C/2, IBM
COBOU2™, IBM FORTRAN/2™,
and IBM Pascal/2™,
Database Manager supports both
Static SQL and Dynamic SQL statements embedded in an application
program. The difference between
Static SQL and Dynamic SQL is theinstance when compilation of thestatements occurs at the database.
For Static SQL statements, the compilation occurs during precompilingor binding of the application to Database Manager. The compilation isdone only once, no matter how
many times the statements are executed during the course of running
the application. Dynamic SQL statements are compiled each time thestatements are executed during thecourse of running the application .
Static SQL is a more efficient process and will, in most instances, provide better performance than
Dynamic SQL However, if the application must issue arbitrary SQL
queries, Dynamic SQL is required.

Client-Server Distributed
Database Architecture
Database Manager has been designed to be a multiple-user clientserver distributed databasemanagement system for IBM OS/2
local area network environments.
The architecture provides for separa-cARR .5tion of the application program fromthe database itself.

rent, and easy access to consistent
data.

Database Manager remote-unit-ofwork functions provide OS/2 andDOS client applications with the capability to transparently access data(read and update) in a single remote
OS/2 database server, per unit-ofwork. A client application can also
serially access multiple databases.

Performance

Database Manager client-server distributed database architecture provides a cost-effective solution to awide-range of applications, such asdecision-support and personal productivity applications, which require
multiple users to have fast, concur-

Personal Systems/Issue 4, 1991

Database Manager has demonstrated
excellent performance. In October
1990, the National Software Testing
Laboratory (NSTL) published resultsof benchmark tests of Database Manager. The purpose of the tests was tocompare the performance of Database Manager with three competitive
offerings, each one a participant in
the OS/2 client-server database marketplace. The test results showed Database Manager to have comparable
or superior performance capability
to the competitive offerings in threeof four client-server application see-

8narios. In the fourth scenario, Database Manager, while not faster thanthe competition, was competitive.
IBM database technologies havebeen applied to enhance performance; for example, query optimization techniques, join algorithms, andindexing and Jocking techniques.
Record Level Locking allows maximum concurrent access to data andis especiaJly important to databasetransaction processing performance.
Granular levels of data isolation areprovided to enhance performance.
These include Repeatable Read,
Cursor Stability, and Uncommitted
Read.
Database Application Remote Interface may be used to enhance performance. It allows a developer towrite an application program where
the application processing can be
split between the database client andthe database server on a local area
network. When the application isrun, some of the application processing load can be transferred from theclient to the server, resulting in a reduction of data traffic on the LAN
and a significant improvement in
database application performance.

Robust Data Integrity andProtection
Database Manager has extensive
data integrity and protection featuresto preserve the integrity of data,
thereby ensuring users that information being accessed is consistent.
Transaction Management is a feature that allows multiple applications
to run concurrently against common
tables in Database Manager.
Through the use of transaction management, Database Manager provides a high level of data control
and protection against serialization
problems and database transaction

failures in a multiple-tasking, multiple-user database environment. If an
application accesses Database Manager and terminates normally, a
COMMIT statement is issued, whichallows the database updates to become permanent. If an application isinterrupted in the midst of a transaction, the system can perform a
ROLLBACK on all uncompleted
work after an application failure, oron the next system restart after a system failure. These functions help ensure the integrity and consistency ofthe database information.

Database Manager has
extensive data integrityand protection features.

Database Manager provides transaction management through the use oflocks, multiple levels of data isolation, and a Recovery Log. The lockfunction and the specified level ofdata isolation are used to prevent another application from updating adata record while a transaction ispending against that record. Allchanges to data tables and indexes
have entries written to the Recovery
Log that provide sufficient information to allow Database Manager toback out of an update before anychanges are written to the data.
Through the use of the Recovery
Log, updated during normal database processing using a write-ahead
logging scheme, Database Manager
can return the database to a consistent state after system failures, suchas a power failure, a user-initiatedsystem reset, or a software failure

Personal Systems/Issue 4, 1991

(except in some instances where logical media failure has occurred). In
the event of such a failure, Database
Manager can undo and redo the necessary database operations to returnthe database to a consistent state byretrieving and reconstructing committed data and rolling back uncommitted data using the Recovery Log.
Database Manager is also capable ofrestoring a backup copy of a database, where data on the media, disk
or diskette is destroyed by physicalor logical damage. Physical media
failure can occur due to a bad sector
on the disk or diskette. Logical media failure can occur when data isover-written by another program andbecomes unrecognizable to Database
Manager. Logical media failure canalso occur if a system fails during adata update, such that some sectors
are left unchanged while some are
updated. Database Manager attempts
to recover from logical media failures using the Recovery Log. If thisattempt fails, the backup copy of thedatabase must be restored.
Referential Integrity is another important feature used to provide robust data integrity and protection. It
ensures the consistei:icy of data values among related columns of different tables. For example, a user may
define an EMPLOYEE table that
contains employee and department
numbers and a DEPARTMENT table that contains department numbers. In addition, the user may wantto ensure that for every department
number in the EMPLOYEE table
there must be an equal and uniquedepartment number in the DEPARTMENT table. Such a constraint defined on the EMPLOYEE table iscalled a referential constraint. The
department number in the DEPARTMENT table is called a primary key,
and the department number in the
EMPLOYEE table is called the for-

9eign key in this constraint. Enforcement of this constraint provides referential integrity. The Database
Manager records and enforces thisdata relationship, and enforcement
by application logic is not necessary.

other user must be specificallyauthorized to access and update a database object. These rights can also
be revoked as required. A creatoralso has the option to allow publicaccess to all database objects.

In addition to ensuring the consis-

IBM SAA Relational
Database Consistency

tency of data, Referential Integrity
can also improve application development productivity by allowing thisfunction to be moved out of each application program and into the Database Manager.

Data Security
In any database environment, there

is a need to protect information fromunauthorized access. Database Manager provides for protection fromunauthorized access of data by agranular grant/revoke privileges
scheme.
SQL Grant/Revoke Security prevents
unauthorized access by coordinating
security functions through an OS/2
Extended Edition component called
User Profile Management andthrough SQL GRANT/REVOKE
Authorization statements. User Profile Management establishes accesslevels used by Database Manager.
In order to access and use objects inthe Database Manager, the user mustbe identified to User Profile Management and be validated by a password on the first use of the Database
Manager. The user is then associatedwith a valid user ID. Access to a specific database and the objects within
it (for example, tables, views, andaccess plans) is controlled by SQLGRANT/REVOKE statements. A
creator or other specifically authorized user of a database object (suchas a systems administrator or database administrator) may protect theobject by only granting access rights
to specific users and/or groups. An-

Database Manager is a member ofthe family of IBM SAA relational
database management systems: IBM
Database 2 (DB2) and IBM Structured Query Language/Data System(SQUDSTM), which run on IBM System/390™ and IBM System/370™
mainframe and mid-range systems,
and IBM OS/400™ database manager, which runs on the IBM Application Systern/400™.
Syntax and Semantics of the Database Manager SQL interface functions are designed for consistency
with the family of IBM SAA relational databases. For example, theconsistent handling of host variables,
precompile, bind, and query optimization simplifies the application
developer's work in writing heterogeneous cross-system applications
for an enterprise-wide distributed database environment.

Import Data from DB2 andSQL/DS Databases
Database Manager provides a facility, named SQLQMF, which allows
users to import table data stored in
DB2 or SQUDS into a Database
Manager database. The SQLQMF facility takes host data exported by the
IBM Query Management Facility(QMFTM), stored in QMF format,
down loads the data, and converts it
into a file that can be imported intoa Database Manager table.

Personal Systems/Issue 4, 1991

Database Manager
Components
Database Manager consists of threemajor components: Database Services, Remote Data Services, andQuery Manager.
Database Services: Accesses to
Database Manager are performed by
Database Services through the SQL
common programming interface(CPI) and utility application programming interfaces (APls). Database Services manages the datastored in the database, generates access plans to the data, and includes
transaction-management, data integrity and protection, multiple-user
concurrency, and security functions.
Database Services also provides anumber of utility functions thatassist the user in maintaining andmanipulating the contents of a database. These utilities include functions to import and export data froma DOS or OS/2 file, save and restore
individual data tables, perform database backup and restore functions,and optimize system performance.
Remote Data Services: Remote
Data Services provides database connection services to allow Database
Manager to function as a client-server distributed database management
system on a LAN. This capability allows multiple OS/2 and DOS personal computer client applications totransparently access a remote OS/2
distributed database server attached
to a LAN, or stand-alone OS/2 personal computer clients not attached
to a LAN, to access a remote OS/2
distributed database server.
Remote Data Services supports thefollowing LAN environments: IBM
Token-Ring, IBM PC Network
LAN, or ETHERAND™ and IEEE
802.2. OS/2 database clients and10servers utilize the APPC communication protocol, provided by Communications Manager, or the SQL
LAN-Only Option (SQLLOO) toconnect in a LAN environment.
APPC is also used to connect remote OS/2 database clients to remote OS/2 database servers. DOS
database clients attached to a LAN
utilize the NetBIOS communication
protocol to connect to a remote
OS/2 database server.

Query Manager: Query Manager
provides database tools and functions that allow users to access,manipulate, and administer data in
Database Manager.
Query Manager provides an easy touse prompted user interface, which
is based on the SAA Common User
Access (CUA) guidelines and takes
advantage of the OS/2 Presentation
Manager™ windowing and graphic
services. The prompted interface
hides SQL from the application user,
so the user does not have to learn
SQL syntax. However, once a
prompted query has been created, its
SQL syntax can be viewed optionally . This allows users to learn SQL
syntax so they can enter SQL statements in a non-prompted mode, if
desired.

Query and Report Writing Tools provide functions to create a database
query (inquiry), initiate the data access request, and display the resultsof the query via the report feature.
The user may save the query andreport objects and save or print theaccessed information. A Business
Graphics Interface allows the user tooptionally install and use a third
party business graphics program written to this interface. This permits
graphic presentation (pie, line, bar,
tower graphs, and so forth) of report
data that was accessed by the queryand report features .

Custom Application Tools provide
functions that allow a user to createcustom database applications. Panels
may be used to create custom data
entry and edit formats . Procedures
may be used to create Query Manager commands or procedure language statements to executepreviously defined query and form
(report) objects, or to combine andautomate several panel operations.
Menus may be used to create a customized list of application selections. Items listed on the menu may
be selected to initiate and automatically run queries, generate reports,
run and call procedures, panels, andother menus.

Query Manager provides
an easy to use prompteduser inte,facemands directly. These commands include functions such as print, get, import, and display. These commands
may be used to execute Query Manager objects, such as Procedures, directly from the command line.

Future Versions andReleases of Database
Manager
Future versions and releases of Database Manager will focus on providing industrial-strength distributed
relational database solutions forstand-alone LAN environments and,in concert with other IBM SAA relational database products, enterprisewide distributed relational databasesolutions for interconnected LANs,
and host systems. Emphasis will beplaced on data integrity and protection, concurrency, connectivity andinteroperability, database administration , usability , security, performance, capacity, and availability.

1991 Direction
Database Administration Tools provide functions to administer andmanage a database system; for example, creating, altering, and droppingtables, views, indexes; entering andediting data; defining referential constraints; importing and exporting
data; reorganizing tables; monitoring
database activities. One of the Database Manager features that is supported through Query Manager is
Operational Status, which provides
a snapshot of information about current database activity . This featureprovides information about where
the databases are located, alias
names, the time and date a database
was last backed up, and how many
applications are currently connected
to a specific database.
A command line is also provided forusers to issue Query Manager com-

Personal Systems/Issue 4, 1991

OS/2 Database Manager Access to
IBM SAA Host Databases: As
IBM begins the roll-out of heterogeneous SAA distributed relational database functions, Database Manager
will initially provide functions to
support heterogeneous remote-unitof-work (RUOW) databaseapplications.
Support for RUOW and the IBM
Distributed Relational Database Architecture (DRDA) will allow Database Manager client applications(OS/2, Windows 3.0, and DOS) totransparently access (read and update) a single remote IBM SAA host
distributed relational database perunit-of-work. A Database Manager
client application will also be able toserially access multiple SAA hostrelational databases.

11

Distributed Database Application
Gateways, as single-user and multiple-user offerings, will provide thetransparent connection between personal computer database clients andan IBM SAA host relational database server, such as DB2, SQL/DS,or the OS/400 database manager.
Forward Recovery: Data protection is essential to customers who
have mission-critical database applications, such as an online order entry application. Database Manager
capabilities will be enhanced
through the addition of Forward
Recovery functions.
Forward Recovery, also known as"Archival Log," will allow the user
to recover lost online data due tomedia failure, such as a disk crash.
During normal online database transactions, information necessary tomaintain data integrity and consistency is preserved on log journals.
Journals are normally kept on
separate media from the database.
Should media failure occur, abackup off-line copy of the database
may be loaded on the system andrestored as the online database. Forward Recovery provides the means
to apply log journal information
against the restored database. Log
journals contain changes made to theonline database since the last backup(off-line copy) of the online database was made. After forward recovery has been completed, the state of
the online database is as it was prior
to the media failure and subsequentloss of data.
The addition of Forward Recovery is
consistent with IBM's direction tocontinue to focus on providing leadership in database functions. Forward Recovery enables Database
Manager to be used for a variety of
mission-critical applications, such as

online transaction processing(OLTP).
Microsoft® Windows™ 3.0
Support: Database Manager DOS
Database Requester functions will
be enhanced to provide support for
applications developed for the Microsoft Windows 3.0 environment.
With this capability, Windows 3.0
client applications written to the
Database Manager SQL CPI will beable to transparently access a remote
Database Manager server attached toa LAN.
NetBIOS Support for OS/2 Clients:
NetBIOS support for OS/2 clients
will be provided as an optional LAN
communication connectivity protocol to an OS/2 database server.
NetBIOS is a popular personal computer protocol for connecting personal computers together. NetBIOS
will require less random access memory (RAM) than APPC, which will
result in a reduction in the amountof memory required for client workstations. This option will also simplify database installation andconfiguration.
Database Tool Enhancements:
Database Administration Tools will
be provided as a separate installable
option. The tools will include functions to configure Database Manager
and a database, backup and restore a
database, perform forward recovery,
and configure remote client-server
and gateway connections. The Database Administration Tools will havegraphical user interfaces that provide
an easy-to-use prompted interface
based on SAA CUA guidelines andtake advantage of the OS/2 Presentation Manager windowing andgraphic services.
Database Manager Command Interface will allow users to create andrun SQL statements, database envi-

Personal Systems/Issue 4, 1991

ronment commands, and databaseutilities from the OS/2 commandline interface and from OS/2 command files. Included with the Database Manager Command Interface isa facility (Re-Org Check) to informthe database administrator that it isbeneficial to reorganize a table inthe database, so that performance
may be improved.
Support for Non-IBM Personal
Computer Platforms: Database
Manager will be enabled to run on
selected IBM-compatible personal
computer hardware systems. Support
for non-IBM systems will extend theversatility of Database Manager andprovide additional flexibility inselecting hardware platforms: IBM
PS/2 solutions, non-IBM hardware
solutions, or mixed IBM and nonIBM hardware solutions.
SAA Relational Database
Compatibility Enhancements:
SAA enhancements will improve
Database Manager compatibility
with the IBM family of SAA relational database products.
SQL Date and Time Arithmetic andScalar functions will allow applications to add and subtract the following data types: TIME, DATE, and
TIMEST AMP. An example of theuse and value of SQL
DATE/fIME/TIMEST AMP is an application designed to track and monitor the elapsed time of a commercial
airline flight from the originatingcity and gate to the destination cityand gate.
SQL State will provide applications
with diagnostic information that iscommon across the family of IBM
SAA relational database management systems. This capability makes
possible the development of error
handling routines that are consistent12

with and portable across the SAA
database family.

amples of the types of programs that
may use Database Manager code.

User Defined Collating Sequence
will allow the database user to specify methods that will be used to sortand compare character data. This option may be used to ensure collating
results that correspond to IBM hostsystems, such as System/370.

Database Manager code can provide
the software developer with industrial-strength relational databasemanagement services, distributed
database application connection
services to OS/2 database servers
attached to a LAN, and distributed
database application connection
services to IBM SAA host relational
databases.

Translate: Translate will allow theuser to transform character data invarious ways; in particular, it allows
characters to be converted to their
uppercase or lowercase equivalents.
This capability makes possible caseinsensitive searches.
Database Manager "Front-Ends"(Database Applications and Tools):
IBM will continue to provide Database Manager technical support tocomplementary independent application developers and to business partners. This support will be provided
through developer assistance programs, whose purpose is to provide
assistance in the design and development of a variety of OS/2 Presentation Manager, Windows 3.0, andDOS database applications andtools, such as general purpose queryand report writers and customizing
tools that work with Database
Manager.
Make Available Database
Manager Code to Selected
Software Developers: IBM's direction is to make components of Database Manager code available tocomplementary software developers
who meet IBM's selection criteria.
Selected software developers may integrate, package, and market Database Manager code with application
programs they develop. General-purpose database query and report writing programs, and industry-specificcustom application programs are ex-

Future Direction
Distributed Database
Enhancements: Over time, Database Manager will be enhanced toprovide additional distributed database functions. Support will be provided for increasingly more complex
data access, such as distributed unitof-work, distributed (SQL) statements, and distributed tables.
Compatible 32-Bit OS/2 andAIX® Database Managers: IBM's
direction is to provide compatible 32bit client-server SAA and AIX Database Managers that fully exploit the
32-bit OS/2 and AIX platforms. The
32-bit OS/2 Database Manager will
be provided for Intel®-based PS/2
computers and IBM-compatible personal computers. The 32-bit AIX Database Manager will be provided for
IBM RISC System/6000™ platforms.

The OS/2 Database Manager and the
AIX Database Manager will be optimized for LAN performance and interoperability, conform to industry
and defacto standards, and provide
enhanced capabilities.
Parallel Database Processing:
IBM's direction is to enhance
Database Manager to provide 32-bit
parallel database processing. Parallelism will support multiple systemprocessor nodes, such as multiple

Personal System s/Issue 4, 1991

PS/2 computers, or multiple RISC
System/6000 computers, that arelinked together to present asingle-system image.
Database Manager parallel functions
will provide customers with highthroughput rates, fast response
times, access to very large (gigabytes) amounts of information, andfault-tolerant functions. Databaseparallelism will be especially beneficial to online transaction processing
applications where fast responsetime and high availability are essential. Parallelism will also offer significant benefits to advanced
complex-data applications, such asimage and multimedia, where accessto large amounts of data are application characteristics.

ABOUT THE AUTHOR
Phil Sullivan is a senior productplanner in the IBM Personal
Systems Programming Center inAustin, Texas. He joined IBM in
1966 as a marketing representativeand has held various management
and staff positions in marketing andproduct planning. For the past 10
years, Phil has been involved in the
product planning of personal
computer software products. He iscurrently responsible for IBM
personal systems database productand market strategy. Phil holds a
B.S. in economics from Mount St.
Mary's College.
Much of this information concerns future products, or future releases of products currently
commercially available. The discussion on
Windows 3.0 is based on information that Microsoft Corporation has made publicly available and is subject to change. The descriptionof IBM's future products, performance, functions, and availability are based upon IBM's
current intent and are subject to change.

13

Communications Manager (CM) is
one of the major components of Operating System/2 Extended Edition(OS/2 EE). CM provides a rich setof terminal emulation, LAN gateway, host connectivity, and workstation communication capabilities. CM
exploits vital functions of OS/2 suchas preemptive multitasking and VO
overlapping and is intended to facilitate the development of applications
that require communications between two or more systems or workstations. By including most of therequired communications functions
within one component, application
developers are relieved of understanding the low-level detail of communication tasks and may rely on
CM to accomplish them quickly andefficiently. Additional services in theform of emulation functions areavailable to the end user, and facilities are included for use by the Net-

05/2
Communications
ManagerRich Harrison
IBM Corporation
Austin, Texas
This is an updated version of a
Communications Manager document
distributed by IBM April 16, 1991.

Communications Manager is IBM's
strategic workstation-based communications offering. It provides
many concurrent networking capabilities. This article describes thewide range of services offered by
Communications Manager, thevalue of its features to the userand developer, and IBM's plansfor enhancements to be includedin the OS/2 2.0-based version.

.
0

0

0.,

Personal Systems/Issue 4, 1991

work administrator who may be dealing with the management and control of large numbers of end users.
OS/2 EE is part of the IBM Systems
Application Architecture (SAA) family, which itself provides the platform for the development of
portable applications for, and the interconnection of, cooperative SAA
systems. As we move further into
the 90s, customers will increasingly
take advantage of the opportunities
offered by "distributed processing";that is, the ability to undertake processing on whichever system is mostappropriate, with all systems being
interconnected across a network.
This environment will make evenheavier demands on communications
and increase the need for a versatileand robust communications subsystem such as CM.

14

What distinguishes CM from othercommunications offerings is its design and integration with the OS/2
environment and SAA. CM provides
multiple concurrent connectivities,
supports multiple concurrent protocols, allows concurrent emulationsof different terminal types, and allows simultaneous file transfers. It
also supports several APis designed
for the traditional and the contemporary program development environments, and has requisite interfaces
for network management. AJI these
aspects will be elaborated upon in
the remainder of this article.
In short, CM provides the opportunity for productivity improvements
for the program developer, the end
user, and the network administrator.
In particular, when the user is
integrated into the network and hasaccess to the organizational information processing assets, CM is
extremely attractive.
IBM plans to make CM more openby allowing it to run on both IBM
and other manufacturers' Intel-based
hardware using the vendor's OS/2
Standard Edition (SE).

Systems Application
Architecture (SAA)
Communications Manager, in conjunction with OS/2 SE, participatesin SAA, which provides the framework for consistency in the userinterfaces, the programming interfaces, and the underlying communications support. The workstation is
the window to the customer's enterprise-wide information system. It isvital that the user see a consistentand familiar means of access to andpresentation of information regardless of the location of the system.
Applications written to SAA specifications ensure that this occurs. This
makes it easier for users to learn

new applications and to move fromone application to another.
SAA can take these concepts one
step further. It provides the capability for programs to be written acrossthe computing environments of System/370, AS/400, and the Personal
System/2®. The implication is not
only that programs can work cooperatively across these hardware
platforms, but also that programs
written for one may be actually transferred to another. This is importantbecause it allows workloads to be
shifted as they grow or evolve overtime.
Programming interfaces are coveredby SAA, too. The strategic interface
for distributed processing is Common Programming Interface - Communications (CPI-C). By writing to
CPI-C, developers may confidently
know that their applications will continue to be applicable within the
SAA family into the future. CPI-C iscurrently available through a companion product - Networking Services/2. IBM's plan is to integrate
this support into CM in the future.
Also avai lable are interfaces to Presentation Manager. These interfaces
enable developers to write high-performing, full-function applications
that can be tailored to a specific user
or environment. Calls may be used
to control the program groups that auser sees and can access. This allows personalization of the system
to a specific user or group of users.
Presentation Manager has utilities
for the printing/plotting, display, andinterchange of picture files.
CM contains the Common Communications support that allows program interchanges among various
systems. This takes place transparently to the end user and it is important because it ensures that such

Personal Systems/Issue 4, 1991

interchanges take place efficiently
and reliably. It is also very important to developers because it relieves
them from having to write the routines that accomplish the communications functions. In complex
environments with multiple transfersof data taking place simultaneously,
all the power of CM and the preemptive multitasking capability of OS/2
are required to ensure that everything works smoothly. By using thefacilities of CM, this process istaken care of in whichever communications environment the application
is run. The details of this process aredescribed the sections that follow.

Connectivity Support
Various methods have been usedover the years to allow systems, controllers, terminals, and workstations
to talk to each other. IBM's Systems
Network Architecture (SNA) is a robust architecture that has become acknowledged as an industry standard.
SNA supports both hierarchical andpeer type networks. SNA networks
are very prevalent today and are typically based on links using the Synchronous Data Link Control (SDLC)
protocols between the host and othersystems or controllers, and Distributed Function Terminal (DFT) protocols for terminals coax-attached totheir controller. CM supports boththese environments, the latter in thecontext of PCs being substituted forthe fixed-function terminals (3270).
In recent years, there has been astrong trend toward the use of local
area networks (LANs) to tie together
the proliferating number of PCs in
the workplace so they could shareresources and access each other'sdata. Many different approaches
were introduced before the leadingindustry LANs were identified. IBM
initially introduced the PC Network
LAN before adopting the Token-

15

Ring LAN as its strategic offering.
Both the Ethernet™ and Token-Ring
LAN have achieved very broad
acceptance by the industry. Ethernet
comes in several forms, the mostpopular of which are known as DIX
Version 2.0 and IEEE 802.3. Inorder to allow its applications to run
in the LAN environment, CM supports all the LANs mentioned in thisparagraph.

The applications can be used simultaneously with those developed by others, without having to take any
specific action other than designingand developing the application with
CM. This function, along with therich networking capabilities described in the preceding section,
represent a robust workstation communications offering.

Other ways for systems to communicate over a wide area network(YI AN) include X.25 and ASYNC.
The X.25 Packet Switched Data Networks (PSDNs) are available worldwide, generally through the official
telephone and telegraph providers in
Europe and elsewhere, and throughprivate utilities and corporations in
the U.S. They are an alternative andoften cheaper way of transmitting
data over a distance and use theirown, standardized, link level protocols to interface with subscribers.
CM supports the use of X.25 services both through the PSDNs andalso using direct connection.

Three distinct families of terminals
may be emulated using the functionsof CM on a PS/2 workstation. They
are: 3270 to a Systern/370 host,5250 to an AS/400 host, and ASCII
to a variety of IBM, and selected
IBM-compatible and non-IBM, hosts.

Terminal Emulation

ASYNC is a simple, inexpensive
way to access many of the financial,news, and informational bulletinboard services that are springing up
everywhere. Many systems, including several from IBM, use ASYNC
either as a primary or secondary
approach for communications. All
PS/2s are equipped with ASYNC
capability as part of the base productand CM provides essential ASYNC
support. IBM plans to extend support to include the DMA ASYNC
capability provided in the PS/2
Models 90 and 95.
From the preceding it should be evident that CM has a broad range of
networking capabilities that allow
communications across a range ofIBM systems, as well as many heterogeneous non-IBM environments.

Multiple 3270 sessions
can be active at any one
time.

3270 Emulation: Interactive access to a Systern/370 host is supported through 3270 terminal
emulation using the IBM LU2.0 protocol and can be defined to emulate
the more commonly installed terminals. Connection may be via any ofthe previously described links, withthe exception of ASYNC. In thecase of LAN connections, someform of gateway is required (this is
described in the section "LAN
Gateways").
All 3270 base data stream functions
are supported together with extended
attributes and extended data stream
functions (with seven colors and extended highlighting, plus online
choice of fonts for the EGA, VGA,
XGA, and IBM 8514/A displays).

Personal Systems/Issue 4, 1991

The 3270 terminal emulation supports multiple interactive screensand keyboard remapping, as well as
Emulator High Level Language API(EHLLAPI), which is described in
more detail under the API section.
This means that 3270 terminals may
be replaced by PS/2s, and the 3270
programs may be run with no loss offunction. However, considerably
more advantage can be taken of thepower of the PS/2 compared to its
fixed-function terminal counterpart.
For example, Presentation Manager
windowing provides the ability tosave and restore panel characteristics
and clipboard editing functions. Windowing allows multiple simultaneous applications typical of OS/2, as
well as applications in other windows that can be monitored at thesame time that 3270 emulation isrunning.
The editing functions allow data to
be transferred among applications
running in different panels. Simple
text, text with attributes, and bit images are supported for the mark, cut,copy, and undo operations, whereas
simple text is supported for the paste
operation. This means that information can be combined from different
sources for purposes such as input toa report.
Multiple 3270 sessions can be activeat any one time. Each of these sessions can support terminal emulation, host-directed print, or filetransfer, and they can use an API(EHLLAPI or Server-Requester Programming Interface [SRPI]) at any
time regardless of the method of connection. Each active 3270 session
runs in its own window, and selecting between sessions is done withthe mouse or keyboard . This meansthat a user may be servicing a payroll enquiry, transferring a file con-

16

taining a report, and printing the latest price list, all at the same time.
This capability can enable substantial productivity gains.
An active 3270 session can be used
to move data between a workstation
and a System/370 host (in either direction). This file transfer capability
provides appropriate translations (ifrequired) when data is exchanged
with the host. File transfer to andfrom an MVSffSO, VM/CMS,
CICS, or VSE/SP host can be performed through any active 3270 session; the only prerequisite is that the
IBM 3270 PC File Transfer program
must be installed and made accessible on the host computer. (Note:
IBM plans to make long file names up to 255 characters - already supported in OS/2 SE, part of 3270 filetransfer support in the future.)Multiple file transfers can be performed concurrently. Because 3270
file transfer may be going on in the
background while the user is free tocontinue with other work, this is a
powerful and efficient method ofshipping files, reports, and documents around an organization.
Communications Manager also contains a keyboard remap function thatallows the user to modify the default
keyboard layout in a 3270 terminal
emulation session. The remap facility supports key swapping, key disabling, and assignment of a string of
keystrokes to a single key combination (accelerator keys). With these facilities, the keyboard layout can bearranged to be consistent with a previous application, keys rearranged to
put those most frequently used at themost accessible positions, or frequently used combinations reduced
to a single keystroke. These functions all enhance productivity.

3270 Emulation supports 3270 hostdirected print, 3270 Graphics support enabling, and Presentation
Space Print (3270 local copy). 3270
host-directed print allows (LUI,
LU3, and non-SNA) printer data
streams to be printed at the workstation printer. Multiple printer sessions
are supported. 3270 Graphics support works with the GDDM-OS/2
Link program product which adds
graphics support to the 3270 emulator. This allows the workstation tofunction as a GDDM mainframe
graphics terminal. In addition,
GDDM pictures may be printed andplotted or saved to a Presentation
Manager metafile. Presentation
Space Print may be either host- or
user-initiated. The entire Presentation Space or a user-selected portion
may be printed. All these facilities
extend the scope of the workstation
to participate in graphics- or printoriented applications in addition tointeractive ones.
In summary, 3270 Emulation support provides all the essential function of the 3270 terminals and also
adds many more functions from theOS/2 platform.
ASCII Terminal Emulation: Two
ASCII terminal emulators are provided. OS/2 workstations connected
through an asynchronous link to asuitable host can emulate either ofthese terminals: IBM 310 I (Model20) and DEC VT 100.

The asynchronous link can beswitched, leased, or direct, and iscompatible with the 1984 CCITTV24N28 (RS232C) recommendations as implemented by IBM. Multiple asynchronous sessions can be
configured, and up to three asynchronous ports may be used. However,
only one ASCII terminal emulation
session can be active at any one
time. The active asynchronous session runs in its own OS/2 panel.
The ASCII terminal emulators support 7-bit (any parity) and 8-bit (noparity) asynchronous character data
streams. The modem command
strings provided for the explicitly
supported modems, or their equivalents, may be edited by the user.
This allows support for a variety ofmodems with different commands.
It is also possible through the use ofa single key to have a "snapshot"
copy of the display screen contents
saved on a logfile. An "ABC"switch can be connected to any asynchronous communications port toprovide user switching between amodem and other serial 1/0 devices(such as printers and plotters). The
port is shared on a sequential use
basis.

These terminal emulators provide:

File transfer is supported and occurs
through the active asynchronous terminal emulator session; therefore,
only one asynchronous file transfer
can be active at a time. However,
the asynchronous file transfer can be
concurrent with 3270 file transfers.

• Asynchronous access to a System/370 or System/390 hostthrough a protocol converter

There are three ways that files canbe transferred:• Access to other IBM or non-IBM
hosts that support either IBM
3101 or DEC VTI00 terminals• Access to a range of network dataservices, such as news, mail, andother online information services.

Personal Systems/Issue 4, 1991

• Asynchronous file transfer to an
IBM host
When an ASCII terminal emulator is running via a protocol converter to a System/370 host, files
can be transferred using the IBM

173270 PC File Transfer Program.
This program includes 4-byte
CRC error detection. The hostmust be running MYS/TSO,
VM/CMS, or VSE/SP and the filetransfer program must be installed
and accessible.
• Asynchronous transfer of files
using the XMODEM protocol
Files can be transferred using
XMODEM protocol to any otherworkstation that supports this protocol, whether IBM or non-IBM.
The remote workstation musthave a suitable file transfer program loaded when the file transfer is initiated, and the transfer isin 128-byte blocks with one byte
checksum error detection.
• Asynchronous file transfer using"Send ASCII Text File"ASYNC terminal emulation canbe used to send ASCII data froma file, in addition to placing received data into a file.
The default keyboard layouts for
310 l terminal emulation or VT I 00
terminal emulation can be changed
through a remap procedure similar
to that for 3270 terminal emulation.
The procedure supports key swapping, key disabling, and assignmentof a string of keystrokes to a single
key combination. Also the clipboard
functions of mark and copy are provided by Presentation Manager.
These functions allow data to betransferred from the ASCII terminal
emulation window to another application. Simple text, text with attributes, and bit images are supported
for these editing commands.

In summary, the ASCII emulation
support provides basic ASCII terminal and file transfer capability. It canalso support ASCII applications andhas an associated API, known as the

Asynchronous Communications Device Interface (ACDI). The ACDI
characteristics are described in the
API section.
Both the 3270 and ASCII terminal
emulators use the Presentation Manager and its windowing facilities toallow user interaction with the system and to take advantage of theonline choice of fonts for most displays. Each logical terminal appears
in a separate window, which can be
individually started, stopped, moved,and sized by the user. Window characteristics can be saved for futureuse. Because the operating environment can be tailored to suit individual user preferences, users achieve
greater productivity.

rently. All of these sessions do nothave to be with the same host, but
can be with any combination of
AS/400s and System/36s in the
network.
Communications to the AS/400 System allow IBM Token-Ring, X.25,
Twinaxial, and remote connection
via the IBM 5294 Remote Control
Unit links, in addition to SDLC
links. System/36 supports X.25,
SDLC, and IBM Token-Ring. All
these use LU6.2 protocols.

5250 Work Station Feature andSupport for the AS/400 and
System/36: The 5250 Work Station
Feature (WSF), provided by Communications Manager, allows an OS/2
workstation to be used in place of a
5250 terminal or printer, or both.
Support is provided for connections
to an AS/400 or System/36 for 5250
WSF application programs. These
applications may be used unalteredor they may be enhanced throughthe use of EHLLAPI in a manner
similar to that used with 3270.
EHLLAPI supports additional functions that can be called from an
OS/2 program. (Refer to the API
section for more details.)

Unlike the other two terminal emulators under Communications Manager, 5250 WSF does not support
file transfer between the workstationand the host computer. However,file transfer support is available using the AS/400 PC Support Program(release 2.0 or later) on an AS/400
or System/36 host. The AS/400 PC
Support Program also provides
shared folders, virtual printer, text assistance functions, and other usefulfacilities. Shared folder support allows workstation files and programs
to be stored on the host disk and accessed as a normal workstation disk
drive. Virtual printer allows output
from workstation programs to beprinted on host printers. Text assistance functions are required when using the AS/400 Office functions on
a workstation. The AS/400 PC Support program should be installed if
the user needs these functions.

The 5250 WSF program supports
the functions of 5250 display terminals and printers. It supports sessions that make the workstation
appear as an IBM 3196 or 3197 display terminal. A full-screen environment is used for the display. Printersessions emulate the functions of a5256, 5224, or 5219 host printer onmany OS/2 workstation printers. A
combination of up to five display or
printer sessions is suppo1ted concur-

The 5250 WSF program allows the
AS/400 and System/36 terminals tobe replaced with PS/2s. The use of
PS/2s brings the power of the workstation directly to the operator. This
support may be in operation simultaneously with other CM applications
and emulators. Many organizations
use IBM mid-range systems such as
the AS/400 for their departmental
host and System/370s for headquarters functions. The CM enables them

Personal Systems/Issue 4, 1991

18

to interact with both hosts simultaneously in order to be responsive tobusiness demands.

LAN Gateways
In the LAN environment, individual

workstations do not need their own
communications adapters and modems. They can share those of a"gateway." A gateway is a separate
box on the LAN that directs the data
traffic passing through it from workstation to host (or another system) or
vice versa. CM workstations can access gateways to System/370 architecture hosts, other hosts supporting
LU6.2 protocols, and ASCII hosts.
By using a gateway, line and modem costs can be reduced.
Traditionally, access to a System/370 host has been via a controller such as the 3174, which acts as aconcentrator or a gateway. In the
LAN environment, CM provides
gateway functionality within the
PS/2. The CM SNA Gateway support allows access to an IBM System/370 host by multiple users
attached to the gateway via an IBM
Token-Ring, IBM PC Network
LAN, ETHERAND LAN, SDLC
switched link, or an X.25 network.
The link between the gateway andthe host may be SDLC, X.25, or an
IBM Token-Ring.
The gateway PS/2, which does nothave to be dedicated to the gateway
task (in contrast to the controllers),
appears to the host as a single physical unit (PU2.0) with up to 254 logical unit (LU) sessions that may beshared among the workstations. Up
to 256 workstations may be configured on the LAN, with 64 active at
one time, each with multiple LUs.
(Note that IBM plans to increase thenumber of active workstations.) The
workstation appears to the user as if
it were directly attached to the host.

LUs may be pre-assigned to workstations ; or they may be "pooled" toallow greater efficiency in their allocation among workstations, and to
reduce the configuration and start up
requirements in the host. The protocols supported by the gateway between the workstation and the hostare LUO (often used in specialized
industry applications), LUs 1, 2, and3 (which represent 3270 operations),and LU6.2, which is the strategic distributed processing protocol.

CM workstations canaccess gateways to
System/370 architecture
hosts, other hosts
supporting LU6.2
protocols, and ASCII
hosts.
In most environments, LAN worksta-

tions may use the same gateway
when operating with:• OS/2 EE• IBM PersonalCommunications/3270• 3270 Emulation Program
Version 3.0• 3270 Workstation Program
Version 1.1• APPC/PC Version 1.11
In summary, use of the CM gateway
provides an efficient way to allow
workstations to communicate with
the System/370 host. In fact, it is so
efficient internally that in many scenarios the workload associated withthe gateway function will leave ample capacity for other services to be

Personal Systems/Issue 4, 1991

accomplished on the same system.
LAN Server or Database Server are
likely candidates to be used there.
The use of a gateway does not disrupt applications written for a directconnect environment, provided theuser system is properly configured.
Communications Manager does notprovide a LAN APPN gateway toother IBM hosts; but a complementary product - the IBM SAA Networking Services/2 program (NS/2)- may be used in this capacity. By
configuring the gateway as a PU2. lnode, links may be established to
any IBM system supporting LU6.2
protocols. This allows LU6.2 sessions between the LAN workstationand the host. For example, the 5250
WSF could be used on the workstation through the gateway to an
AS/400. In the future, IBM plans tomake all the function of NS/2 available directly within CM.
For asynchronous connection to offLAN hosts, databases, and services,a CM-based workstation can use thedial-out capabilities of the IBM
LAN Asynchronous Connection
Server (LANACS) Version 2.0. This
provides line- and modem-poolingfacilities for OS/2 EE and DOS
workstations with the appropriate
level of support. In this case theDOS-based LANACS gateway does
have to be dedicated to the gateway
function. Note also that the OS/2
workstation can use it only to dialout from the LAN; a remote OS/2
workstation cannot dial in.

Application Programming
Interfaces (API)CM has several APis used by the
OS/2 communications facilities andavailable to the application programmer. These APis support a wide variety of communication functions
between workstations and hosts, as19well as between LAN workstations
functioning as servers or requesters.
The EHLLAPI interface provides
programming access to the workstation applications of 3270 terminal
emulation or the 5250 Work Station
Feature. EHLLAPI allows complex
functions to be manipulated underprogram control, while the user sees
the process as a single function. In
this way, interactions with the hostcan be simplified and made easier touse. Another advantage of
EHLLAPI is that data can be processed before being transmitted to thehost application, thereby taking
advantage of the power of theintelligent workstation.
EHLLAPI can also be used to perform an automatic logon, to intercept and respond to host messages,
or to translate keystrokes into more
complex requests. This interface cancurrently be called from IBM C/2,
COBOU2, P ASCAU2, BASIC/2,
and Macro Assembler/2 languages.
IBM plans to enhance EHLLAPI
and increase flexibility by allowing
more than one program to access it
simultaneously, including calls fromDOS programs running in one of theMultiple Virtual DOS machines under OS/2 SE 2.0. Also, the interface
itself is planned to be extended tosupport structured fields that will
facilitate such operations as filetransfer.
APPC, together with its SAA counterpart, CPI-C, is IBM's strategic
API to provide distributed transaction processing capabilities. An
APPC application consists of two
programs, usually at different SNA
nodes, that cooperate to carry out aparticular processing function. Bothprograms can exchange data andthus share each other's local resources such as processor cycles, databases, and work queues, as well as

each other's physical components
such as keyboards and displays.
APPC uses the LU6.2 interface architecture. The LU6.2 architecture has
been developed to provide a peer-topeer communication protocol between SNA applications (intelligent
systems). LU6.2 allows sophisticatedcommunication between workstations and other systems for distributed function processing.
LU6.2, as defined in the APPC architecture, is a particular type of SNA
logical unit. Each LU provides a connection, or port, between its application programs and the network
resources available to its programs.
The resources may be physical, suchas processor machine cycles anddisk or tape files, or logical, such as
sessions and queues. Some of theseresources are attached to the same
LU as the program. Other resources
are remotely attached to other LUs.
APPC provides the following:• A programming interface for basic and mapped conversations• A confirm synchronization level• Security support at session andconversation level• Multiple LUs• Parallel sessions with the ability
to change the number of sessions
with remote systems• Concurrent multiple links
Currently, APPC applications underOS/2 EE cannot utilize a coaxial attachment to a 3x74 controller. IBMplans to enhance support for OS/2
workstations COAX-attached to asuitably configured 3174 to allow
APPC applications to run over the
COAX link. These applications will
be able to communicate to otherworkstations similarly attached tothe 3174, to whom the connection
will appear as a direct LAN link.

Personal Systems/Issue 4, 1991

The COAX-attached workstation
can also utilize the 3174 as a gateway to a host or a bridge to a TokenRing LAN attached via the
Token-Ring adapter.

Note: SAA CPI-C is a variant of
APPC that is consistent across the
SAA family. Programs written to
CPI-C may be easily migrated fromone family member to another, forexample, from an OS/2 platform toan OS/400 platform. CPI-C is notsupported directly by OS/2 but is
supported by the complementary
product IBM SAA Networking
Services/2. In the future, this product, which also has APPC performance improvements and an extension
to the APPC interface, is planned to
be incorporated into Communications Manager. This interface cancurrently be called from IBM C/2,
COBOU2, PASCAL/2, and Macro
Assembler/2.

SRPI: This is the programming interface for the Enhanced Connectivity Facilities. It enables the writingof simple, communications-independent, requester programs that cancal I to host server programs, withsynchronous returns. It is supported
over links using LU2 protocols.
Host server support is available under MYS/TSO and VM/CMS. Although SRPI is sufficient for a large
number of tasks, APPC should be
used if more extensive capabilities
are needed. SRPI can currently becalled from IBM C/2, COBOU2,
PASCAL/2, and Macro Assembler/2.
X.25 is an SAA common communications support protocol. Before describing the API associated with it,
the scope of CM support for thisimportant facility will be outlined.
OS/2 EE X.25 Packet Switched Data
Network (PSDN) support allows a
PS/2 (Model 50 or higher) equippedwith one or more IBM X.25 Inter-20

face Co-Processor/2 adapters to attach to one or more X.25 PSDNs
and communicate with other systems
or hosts having appropriate X.25 support. Connection to public and private networks conforming to CCITI
1980 or 1984 X.25 recommendations is supported. Multiple IBM
X.25 Interface Co-Processor/2 adapters are supported, depending on theavailable slots in the system unit.
The software enables each adapter tooffer either an X.21, X.2lbisN.24,
or an X.2lbisN.35 interface, andsupport speeds up to 64K bps. The
software can support a mixture of up
to 128 Switched Virtual Circuits(SVC) and Permanent Virtual Circuits (PVC). SNA Communications
is supported by the Qualified Logical Link Control (QLLC).

X.25 Non-SNA API: This interface
at OSI level 3 provides facilities forappropriately programmed non-SNA
Data Terminal Equipments (DTEs)
to communicate with each otheracross one or more X.25 connections. Both SNA and non-SNA communications are possible over thesame physical link, and up to 40
X.25 applications (SNA and nonSNA) can execute concurrently in asingle workstation. The interface iscurrently supported by IBM C/2,
PASCAL/2 and Macro Assembler/2.
Thus the API allows non-SNA (inaddition to SNA) applications to operate over the X.25 PSDNs.
ACDI: This interface is provided toallow the writing of applications(such as asynchronous emulators or
file transfer programs) to exchange
data over asynchronous links. The interface provides a high degree of independence from the asynchronous
hardware used. Device-specific programming modules are required foreach supported device type and areincluded in the product. They aretransparent to user applications. Sup-ported functions include the ability
to manipulate the line characteristics
and connection control (connect anddisconnect) without having to deal
with physical device-specificcharacteristics.
ACDI may be used to manipulate
modem command strings to customize and automate dialing procedures,or to use an alternate modem. One
ACDI application can share a V.24
(RS232C) ABC switch with serial
devices such as printers or plotters.
Recent enhancements allow the redirection of ACDI calls (across aLAN) to an ASYNC gateway, for example. This is currently done fromthe command line but IBM plans tomake it accessible from programsfor greater flexibility. ACDI is currently supported by IBM C/2, PASCAL/2, and Macro Assembler/2.

Local Area Network (LAN)
Programming Interfaces: Both
IEEE 802.2 and IBM NetBIOS aresupported for program-to-programcommunications. The IEEE 802.2
protocol is a lower-level communications interface. The APPC support
provided by CM uses the IEEE
802.2 interface to access the LAN.
Application programmers may access the IEEE 802.2 API for greater
control where higher performance iscritical. The NetBIOS programming
interface provides an additional interface for communication across aLAN. NetBIOS is a name-oriented
program-to-program interface that
may be used for application restricted to the LAN environment.
The NetBIOS protocol can be usedconcurrently with the IEEE 802.2
LAN access. Both of these APis are
currently supported by IBM C/2,
P ASCAL/2, and Macro Assembler/2.
IBM plans to restructure the OS/2
LAN Transport function to improve
the performance and resource utiliza-

Personal Systems/Issue 4, 1991

tion. The Network Device Interface
Specification (NDIS) will be provided to support high performance
media access control device drivers
for Token-Ring, Ethernet, PC Network, and LAN Over Coax connectivity. In addition, new NetBIOS and802.2 protocols will be included that
support the NDIS interface and programming interfaces, and provide
performance improvements.

Conventional LU Application(LUA) Interfaces: These may be
used for:• Communications support for LUO
terminal functions• A migration path for LUO-based
applications• Workable replacements for
LUO-based control units• Base communications for LUO, 1,
2, and 3 emulators (this is in addition to the LU I , 2, 3, and 6.2 support already available in
OS/2 EE)
The LUO protocol allows greater programming flexibility than the othersupported LUs and has been widelyused in the finance and retail industries. The recommended protocol for
future applications is LU6.2. CM
support for LUO is to allow existing
programs to continue operating during the migration period.
LUO communication is enabledthrough the use of two programming
interfaces. The Session Level Interface (SLI) is a higher level data
stream interface that will normallybe used by customer applications.
The SNA Request Unit Interface(RUI) is at a lower level and is intended for system programming but
is also available for customer use.
Programming language support for
both SLI and RUI is currently fromthe IBM C/2, COBOU2, PASCAU2

21

and Macro Assembler/2 compilers.
Collectively, SLI and RUI are ref~rred to as conventional LU applicat10n (LUA).
Common Services Interface:
CM provides functions for gatheringand processing problem determination data. These functions include
tracing of programming interfaces,
data units, and/or system events; displaying and printing of all or selected error logs from file; system
dumping; and displaying of all or selected message logs. These services
can be invoked from the console or
via a Common Services API, whichallows all these Communications
Manager RAS functions (trace,
dump, errors, and messages) to be
performed under program control
and not require an operator. A
user-written program can monitor errors and messages selectively, andtake appropriate action. Message
pop-ups on the screen can be suppressed. The same API also supports
ASCII/EBCDIC conversions, code
pages conversion, and the transferals
of diagnostic data to a host. For example, applications can use this service to alert a NetView® operator of
conditions requiring action.
Subsystem Management Interface:
CM allows a system administrator tocontrol and obtain status informationon the SNA communication resources maintained by CM. As amanagement tool, it displays the programs being used, the sessions being
used by the programs, detailed information about the sessions, and resources that are active. It allows theactivation or deactivation of sessions
and data link controls. It also can beused to start and stop an attach manager that allows applications to be remotely started. These services are
invoked in some cases from the console and in others via an API, as appropriate.

Installation andConfiguration
Configuring (tailoring the requiredcomponents) and installing Communications Manager is accomplishedby one of several options.
The Custom Install option enables
the system or network administrator
to design an installation diskette that
installs only those components andfeatures required at each workstation. A Custom Install diskette also
provides the configuration fileneeded for the installed components
and features. This option is particularly beneficial to novice users or
when installing OS/2 Extended Edition on multiple workstations, because it allows the installation to becompleted with minimal user interaction. Because each user does notneed to have all the functions installed, the amount of memory anddisk storage required at the workstation can be reduced.
~he Ba~ic Configuration Services option assists users who do not havethe support of a system administrator and who are relatively inexperienced in communications. It helps
them install the program and have it
running for a number of communications environments. Basic Configuration Services may be used for one ormore of the following:• 3270 emulation, directly connected via SDLC, LAN, or DFT• 5250 Work Station Feature connected via Twinax, SDLC, or
LAN (Token-Ring only)• ASCII emulation to single host
• Database Manager's Remote Data
Services configuration between
one OS/2 Database Requester andServerBasic Configuration Services may
be supplemented with Advanced

Personal Systems/Issue 4, 1991

Configuration Services to coverother environments and additional
Remote Data Services connections
as required.
For those not using a Custom Install
diskette or Basic Configuration Services, a process known as the Advanced Installation can be used.
With Advanced Installation, the components and features are selected ina certain sequence. In addition topermitting the selective installationof various OS/2 components, the installation program allows the addition, removal, or reinstallation of
OS/2 components and features at
any time after the initial installation
has been completed.
Finally, for system administratorswith large numbers of similarly configured workstations, a Batch Configuration utility is provided. Basicor Advanced Configuration is used
first to establish an individual representative prototype configuration
file. Then, the system administrator
creates an ASCII file that contains
the essential differences between individual end users. This file and theprototype are processed by the utility to build a configuration file foreach user. The support allows thecreation, modification, and deletionof a subset of the parameters for the
profiles in the following areas:• Workstation Profile• 3270• SNA/APPC• SDLC• Twinax• X.25• SNA Network• SNA Gateway• LUO• 802.2• NetBIOS

22

Typically, the files would be generated under program control for use
with the Custom Install option or
one of the more automated forms of
install offered by complementary
program products such as NetView/DM and the SAA Delivery
Manager.
IBM plans to open up the entire
configuration file to programmed
access, to further facilitate the configuration and installation of large
numbers of workstations.

Network Management
CM provides extensive network
management support.
When errors occur at the workstation level, messages can be sent to
the operator and are logged for subsequent analysis. Trace and dump facilities are provided as diagnostic
tools. Online help is available to assist in local problems resolution, or
to suggest contacting an administrator or service coordinator as
appropriate.
At the LAN level, network management may be facilitated by the IBM
LAN Manager Version 2.0. This program uses CM for sending and receiving information across the LAN
and monitors the activity and statusof the workstations and the links. An
alternative approach is to use NetView PC when NetView PC is
installed.
With wide area network links and a
System/370 or System/390, the IBM
NetView program at the host computer can be used. This provides acentral point for control. CM sup-ports a NetView-managed network
by automatically forwarding alerts
generated by the hardware or software associated with data links. Support for SDLC, asynchronous,
Token-Ring, ETHERAND, PC Network, twinaxial, and X.25 connections is included. CM requires
APPC to be installed on each workstation for the forwarding of alerts,
and the links to the host must be
SDLC or Token-Ring.
The NetView operator can also request vital product data pertaining to
the workstations, such as machine
type, serial and model number, andthe name, version, release, and modification of the installed OS/2 EE
software components.
Exchanges with the NetView hostare accomplished by the Common
Services Interface (CSI). This is a
published programming interface
that can be used by user applications
to notify (through the alert mechanism) a central monitoring facility.
The CSI may also be used to remotely invoke diagnostic tools, suchas running traces and dumps, without involving the workstation user.
IBM plans to extend this support toallow the NetView operator (or aprogram at the NetView host using
CLISTs or REXX execs) to issue
most OS/2 commands remotely forexecution at the PS/2. This will provide powerful manipulative and
LAN management capabilities fromthe host.
In APPC application environments,
subsystem management is provided
to the system administrator to con-trol and obtain status information on
the resources maintained by CM. It
allows the activation and deactivation of sessions, and supports the remote starting or stopping of theattach manager.

Conclusion
Communications Manager is IBM' s
strategic workstation-based communications offering. It is accepted as
the platform of choice by many IBM
workstation-based products, including OSI/CS, TCP/IP, CICS, and Office Vision. CM is designed for use
within the SAA framework. It provides many concurrent networking
capabilities, which represents significant productivity savings for both developers and users. CM is thedevelopment and distributed processing workstation communications platform for the 1990s.

ABOUT THE AUTHORRich Harrison is a senior productplanner at IBM 's Personal Systems
Programming Center in Austin,
Texas. He has been associated with
Communications Manager since its
inception. Rich joined IBM in 1956
and has held a variety ofprofessional and management
positions in systems engineering,
application development and, more
recently, communications softwaredevelopment. He holds a B.A. inmathematics from Cambridge
University (United Kingdom).

Much o f thi s in formation concerns future prod-

ucts or future releases of products currentl ycommerciall y available. The description of
IBM 's future products, performance, functi ons, and availability are based on IBM 's current in tent and are subjec t to change.

Personal Systems/Issue 4, 1991

23

Performance goals were set for the
product using usability studies andother benchmarking information. At
the highest level these goals were to:

Improving OS/2
Application
Performance• Reduce the elapsed time taken to
perform the most important product functions

Mark W. Brooks andGary S. Kaufman
IBM Corporation
Markham, Ontario, CanadaThis is a project history. It describes the experiences of a teamassembled to improve the performance of an OS/2 application underdevelopment.

The development team of a mediumsize (45 KLOC) OS/2 project identified performance as a problem thatwould inhibit satisfaction with the
product.

,,.

environment, the information presented in this discussion might provevaluable to any technical group concerned with performance issues.

Objectives• Reduce the amount of system resources used by the application

To reduce performance problems,
the team believed it was necessary
to minimize memory working set
and maximize speed.

A performance team was formedthat achieved a significant performance improvement: an overall reduction in elapsed time of more than
300 percent across the product, andas much as 600 percent in several
instances.

Memory Working Set: Memory
working set is the minimum amountof memory required to run a particular scenario without frequent swapping and still achieve acceptableperfonnance.

While the performance team worked
in a specialized OS/2 environment,
and the following is specific to that

This means a given working set
measurement is always scenariodependent. The size of the application's working set was one of theo~···.
"·

L,,-:

..

"I''
\I,

,,

"'

,,.

"'

l'•

\u

Personal Systems/Issue 4, 1991

.,

24

key factors in its overall
performance.
The working set of an applicationconsists of a series of code and data
segments that need to be loaded intomemory while a function is executing. In OS/2, a code segment is normally loaded into memory when afunction in the code segment needs
to be executed by the process. Oncethe function in the code segment has
finished executing, the operating system can discard the segment if it isshort of memory. Therefore, thelarger the working set of the application, the more likely it will need todiscard and reload code segments
into memory from the much slower
fixed disk. When the operating system does not have enough memory
to hold all the code segments, it will
be forced to constantly load and discard code segments. This situation iscalled "overcommitment" (or thrashing) and can affect the performanceof not only the application causing
the problem but any other application that may be running.
A similar problem occurs with data
segments; however, instead of being
discarded, a data segment is writtenout to and, when required, reloaded
from the OS/2 swapper file. Therefore, a swapped data segment is atleast twice as costly, in terms of disk
I/O, as a similiarly sized code
segment.

Measuring Memory Working Set:
The MAP file produced by the OS/2
linker provides:• An approximate size of your codeand data segments• An idea of the maximum possible
size of an application's workingset• A list of the size and type of appli cation segments that could be
loaded into memory

Using the sum of these application
segments, as well as the size of any
data segments allocated dynamicallywithin the program, it is possible tocalculate the maximum possibleamount of memory required by anapplication to run without swapping
or reloading. It is unlikely that thismaximum memory requirement will
be reached as only a fraction of thetotal code and data segments should
ever be loaded at once in a wellstructured application.
The working set calculation is more
complicated if multiple processes
are sharing code or data segments.
In general, the following rules apply:• If multiple copies of an applica-tion are loaded and running simultaneously, only one copy of eachcode segment is loaded andshared between the processes• Even if a code segment is marked
as unshared, the code segment isstill shared• On the other hand, multiple versions of a data segment areloaded unless it is marked as"read-only" or non-shareable
To get a more accurate working set
measurement, the performance teamused an IBM internal tool with functions similar to IBM System Performance Monitor/2 (SPM/2)
Version 1.0.

In summary, the larger the working
set of an application, the longer ittakes to run. An application with alarge working set also affects the
speed of other executing applications.

Strategies for Improving
Performance
Because the opportunity to improve
performance came so late in the development cycle, the performanceteam was restricted by time limita-

Personal Systems/Issue 4, 1991

tions. Therefore, the team initially focused on problems with the mostcommonly used code.

Identifying Problems: The firststep towards performance improvement is to identify the bottlenecks inthe code. To do this, the performance team used several tools:• Simple file dump
First, the team used a simple filedump system. In this system, astatement was inserted at the entry point of every function and at
every exit point throughout the entire function. The entry dump
wrote the name of the function
and an identifying number andstarted a timer for that entry
point. The exit point ended thetimer and wrote the function
name and elapsed time to thedump file.
These trace dumps identified:- How often each function was
likely to be called, thereby allowing the performance team
to concentrate on the criticalcode.
- The elapsed time for each function call. While this was somewhat inaccurate, it helped
identify heavy processing routines and helped indicate thesuccess of the tuning
techniques.
The data from this type of tracesystem provided a good enoughbase for many of the initial performance decisions.
• Complex Tracing
The team also tried a more sophisticated IBM internally used tracing system with features similar
to IBM SPM/2 Version 1.0. Thissystem gives a precise timing
breakdown for a long sequence ofactions and their related function
calls. Because of the complexity

25of this trace data we found it particularly useful when analyzing
an already identified problem.
Similar systems are also available
from non-IBM sources.

If an application's design inherently
dictates poor performance, noamount of code tuning will save it!

Traditional Code Tuning

Once the problems were identified,
the team decided to meet its performance goals by "fine-tuning" existing
code, and by redesigning part of the
product.

The goals of code tuning are to:

Reducing the Memory Working
Set: It is important to maintain theworking set at the lowest possiblelevel to control and improve thespeed of the application. For example, for the first few releases of the
product, the overall working set was
extremely large. Therefore, even on
a loaded 16 MB PS/2, the application could easily slip into a condition known as thrashing (constantly
accessing the hard disk to load orswap code/data segments).

• Decrease the number of memory
fetches

To reduce the memory working set,
the performance team looked at restructuring code/data segments andtuning dynamic memory allocation
and usage.

Improving Speed: To improve
speed, the performance team
examined:• Decrease the number of processor
cycles required by the program• Decrease the number of address
calculations performed• Decrease the size of the object
code
Traditional optimization deals withimproving the compiler translationof C code into the machine language
end product.

• Database tuning
Later sections on tuning will discussthese areas in detail.

Design Considerations
The design of an application is themost important influence on performance. During the low-level designphase of the application development cycle, performance must be
considered when making design
decisions.

Structural alignment is so effective
because, in many cases, the numberof memory accesses required for an
operation is cut in half. This is because a memory fetch retrieves four
bytes of data at a time, aligned on
four-byte boundaries. Therefore, if afour-byte pointer is to be retrieved
and the structure was aligned, thepointer could be retrieved in one
memory fetch instead of two.
The requirements for aligning structures are as follows:• The structure has a starting address on a four-byte boundary

Aligning data structures
can make significant
peiformance
improvements to an
application.

• ''Traditional" code tuning• OS/2 tuningthat by simply aligning an application's structures, the speed of memory accesses can increase as muchas 25 percent over that with unaligned structures.

Because development environments
and compilers are now more sophisticated, some of these methods may
be automatically implemented by thecompiler.
If implemented correctly, the following suggestions should not affect theclarity of the code and should increase the speed of any application
running on a PC AT or PS/2.

Structural Alignment: Aligning
data structures can make significant
performance improvements to an application. Some measurements show

Personal Systems/Issue 4, 1991

• Every element in the structurethat is four bytes or fewer in size
does not cross a four-byte wordboundary• The structure elements that are
greater than four bytes should bestarted on a four-byte wordboundary
Figure 1 shows examples of unaligned and aligned structures.

Data Conservation: In most cases,
it is advisable when creating datatables or retrieving data from a LAN
server or flat file, to hold this data inmemory for as long as possible because LAN communications (anddisk I/0) are very expensive interms of elapsed time.
For example, the given product involved a client-server architecture,and in the initial design two roundtrips to the server were made whenin many cases, one would have been
sufficient (with a minor designchange).

26

To solve this problem, the team constructed a refresh cache that cachedsome of the server data in certain instances, thereby doubling the speedof many major functions.
Register Variables: Tagging a variable as a register variable essentially tells the compiler which
variables are most commonly used.
This allows the compiler to preload
several CPU registers with commonly used data.
The variables most commonly
tagged were the pointers used toaccess the major data structures
throughout a module. Making thispointer a register variable eliminatedthe need to load the pointer frommemory each time a structure element was referenced. Making thispointer a register variable increased
speed by up to 20 percent in someroutines.
Other heavily used variables, suchas loop counters, were also tagged
as register variables.
A small decrease in the size of thecode produced by the compiler is another added benefit of the appropriate placement of register variables.
This reduction averages about 1 percent for the entire application.
Tagging a variable as a register variable is completely portable to othermachine architectures.
While some developers believe that
the IBM C/2 compiler will properly
place register variable tags automatically, the performance team felt it
was necessary to place the tags
manually so that no variables were
missed. For example, any variable
that has a pointer placed in front of
it cannot be tagged by the compiler
as a register variable, because if thecompiler must take a pointer from a

Example of an unaligned structure:

struct nonal (int
one:
1ong two;int*three;1ong four;/* two bytes in size
I* four bytes in size!* four bytes in size/* four bytes in size

*!
*I
*I
*I

Example of the above structure as an aligned structure:

struct al(1 ong two;int
*three:1 ong four:
int
one:
int
bufl:

/*
/*
/*
/*

*/

four bytes in size
four bytes in size
four bytes in size
two bytes in size
I* two bytes in size

*I
*I
*!
*I

I* two bytes in size/* two bytes in size!* four bytes in size/* four bytes in size/* four bytes in size

*I
*I
*I
*I
*I

or

struct al(
int
one:
int
bufl:
1ong two;int*three:1 ong four:

Figure I. Unaligned and Aligned Structures

variable, this variable must have a location in memory. To tag this variable as a register variable, the codeshould be modified to use a temporary pointer value.

In this product, the compiler was informed of what system functions tomake intrinsic, using a set of pragma
statements at the beginning of eachsource code file (Figure 2).

Intrinsic Function Calls:
It is possible to force the compiler toplace system (library) functions inline, rather than making a function
call. This eliminates the overhead inherent in function calls.

The declaration of the intrinsic functions marginally increases the size ofthe final application, but it is worth
the space if the application is moving or copying small amounts of#ifndef CODEVIEW#pragma intrinsic(memcmp,memcpy,memset,strcat,strcpy,strcmp,strlen)#pragma message("Code now optimized for speed ")#pragma loop_opt(on)#end ifFigure 2. Pragma Statements

Personal Systems/Issue 4, 1991

27

memory with each strcpy or
memcpy call.
See the C compiler manuals formore detail about these statements.

Loop Optimization: In a "for awhile" loop, it is possible to increase
speed by restructuring the compare
statement of the loop.
Comparing a variable against a number or another variable requires three
separate machine language
instructions:
Scenario 1• Load the first variable frommemory• Load the second variable (orstatic number)• Compare the variables
If, instead, you compare one variable against the value 0, the compiler will:

Scenario 2• Load the first variable frommemoryThis optimization works best forsmal l, tight loops (loops that contain
only a few statements). If the loop islarge, the loop processing time far
outweighs the termination condition
processing.
In addition, all loops should be opti-

mized such that any "loop invariants" are moved outside of the loop.
A "loop invariant" is something that
does not change throughout the lifeof the loop. For example, a statement such as "le~gth = 10" should
not appear inside a loop, because it
is completely invariant and slows
down the entire loop by repeating
the identical action multiple times.
Some loop optimization was done in
the code, but because the code did
not contain many "tight" loops, it
had no measurable impact on the performance of the application.

Array Index Optimization:
When using subscripts into arrays,
for every index operation the compiler produces assembler code that:• Loads the pointer to the array• Compare the variable to 0

• Loads the value of the subscript(if it is a variable)

An example of these is:• Adds the two to find the index
variable

Scenario 1
for

(i -

O;

i

<-

32; ++i)

For this comparison the C/2 compiler produces five assembler instructions and would be slower than:

It is best to avoid array subscripts
whenever possible. This can be done
inside loops or other situations
where pointers and pointer arithmetic can be used instead.
For example:

Scenario 2for ( i-32; -i> - 0;)For this comparison, the C/2 compiler produces four assembler
instructions.

for(i - O; i < 320; ++i)
array(i) - i;is slower than:cp - &array(O);i - -1;for (j - 320; -j*cp++ - ++i;

> -

O;

Personal Systems/Issue 4, 1991

Code Path: There are several issues
regarding code paths to consider for
performance improvements.
• Reduce path length
The path length of the code is an
important performance factor.
The more function calls (or PM
messages) that a particular code
path invokes, the slower the application will run. This is because of
the inherent overhead in function
calls/returns and message
processing.
• Remove dead code
This is code that is in the application but is never executed. This
code increases the working set(and therefore decreases the
speed) of the application.
• A void identical logic
Duplicating a function or piece of
logic that already exists can also
contribute to performance problems. During the final code reviews for the product, several
functions were discovered that
duplicated, or almost duplicated,other existing functions.

Return Codes: Return codes fromboth system and application callsshould always be checked for errors.
If, however, there is a case where
this does not apply, then do not codea statement such as:re -func();

if the return code will not bechecked. The additional assignment
to re causes unneccessary statements
to be executed and has a detrimental
impact on performance.

Levels of Indirection: When using
several levels of indirection (pointers), each pointer in the indirection
chain must be loaded and examined
to get to the final data item. Therefore, some CPU cycles can be saved

28

if a temporary variable is used tohold a data item that is repeatedlyaccessed.
For example, if the statement
Varl->var2->var3 = x; is repeatedly executed (inside a "for" loop,
for example), replace the statement
with:

pVar = &Varl->var2->var3;

Other Techniques: Because of therequirements for easy maintenanceand the ongoing development of the
product, several code optimization
methods were not used by the performance team. This does not meanthat such approaches would not bevalid for other projects, but simply
that in some cases the costs outweigh the benefits.

*pVar - x;
While this type of tuning can help
the performance of the application,
it can also make the code harder tounderstand.

Variable Initialization:
Unnecessary initialization should not
be present in application code (forexample, filling a structure withnulls and then assigning values tomost or all of the structure elements). Instead of filling the whole
structure with nulls, consider assigning values to each remaining field if
you are already assigning other values to most of the structure elements.

When multiple small
pieces of memory are
required, it is far better
to use DosAllocSeg toallocate a large segmentof memory and then use
DosSubAlloc to break thissegment into usable
chunks.

Alternate methods include:
Also remember that a character
string only needs to have its first element initialized with a null.
For example, if you initialize a character string with strcpy( String,"");,
you can replace it with the following:
String(Ol -• Near pointers - Using near pointers whenever possible to savememory fetches

OS/2 Tuning'\O';-or*String -• Supercharging - Using in-line assembler for key functions'\O';

Also, using "" as a zero-length
string causes a pointer into the static
data segment to be loaded, which isadditional overhead (especially if thedata segment is swapped out at thetime).

OS/2 Memory Management:
Minimizing the number of data segments that an application creates is
the most important consideration
when designing an application's
memory management strategy. Multiple small segments can adversely
affect both the application's performance and any other applications running in the system.

Personal Systems/Issue 4, 1991

One of the reasons that multiple
small segments have a negative effect is that the machine 's memory
becomes fragmented as these segments get swapped out. Therefore,
the OS/2 memory compaction algorithm must run more often when
new memory is required.
Second, if the segments are shared,
space is reserved in every process's
LDT (Local Descriptor Table) forthat segment. This causes a large
amount of system overhead for otherapplications and possible systemshortages due to limited LDT space.
Here are some important points to remember when using OS/2 dynamic
memory allocation:• Use DosAllocSeg and
DosSubAlloc.
When multiple small pieces ofmemory are required, it is far better to use DosAllocSeg to allocatea large segment of memory andthen use DosSubAlloc to breakthis segment into usable chunks.
This helps minimize the numberof segments in the system.
Another advantage of using
suballoc is that there is only one
segment to be freed.
• Only use the OS/2 memory manager API calls to allocate memory. Never use the C calls(Malloc, Calloc, Strdup, and soforth). The reason is that Malloc,
Calloc, and Strdup each allocate
one segment for each call, andyou end up with a lot of small segments, causing the OS/2 memory
manager to thrash.
Also, do not allocate a heap, because Malloc and Calloc do notuse it.
• Allocate only the amount required. A segment can always be"grown" (increased in size).

29• DosAllocSeg should be a multipleof 4 KB up to 63.5 KB. Note:
Suballocs can be any size.

Code segments should be managed
as follows:

Never allocate more than 63.5
KB, because a 63 .5 KB segment
is swapped (read or write) in one
action, while a 64 KB segment
takes two swap actions. It is expected that this problem will be
resolved with OS/2 2.0.

• Frequently used routines grouped
together• Do not use the OS/2 API call
DosMemAvail. This call currently
gives invalid results when OS/2
undertakes memory compaction,or swapping, or the system isovercommitted in its memory use.
• Memory leakage (allocating memory but not releasing it when finished) caused several performance
impacts on the product. A careful
review of dynamic memory allocation and its release is always agood idea. Functions with multiple exit points are usually thecause of memory leaks.

Note: Shared memory has an associated usage count. All processes accessing a shared segment must
release it before the memory is freed.

Segment Packing: For a large application, it is unlikely that all code segments will be loaded into memory at
one time. Therefore, the arrangement and distribution of functions
within the code segment has a significant effect on performance.
The linker, by default, packs thecode into multiple segments of 64
KB each. This causes problems
when swapping (see comments on
memory) and usually means that almost all of the code segments areloaded into memory at once (if there
is enough memory), giving the application the largest working set requirements possible. This causes
thrashing, large swap files, and aslow application.

• One segment to process messages• Related routines grouped together• Infrequently used routinesgrouped together• Pack segments to 4 KB multiples
A first attempt at code segment packing is to split segments along sourcecode module boundaries. This canbe accomplished as follows:• During the compile of eachsource module into its object file,specify the "/NM
SEGMENTNAME" compiler option, where SEGMENTNAME is
the name you want to assign toeach code segment. If you do not
use the /NM flag, the default segment name will be
MODULE_TEXT, where
MODULE is the name of thesource code file.
• List the defined segment names in
the program's .DEF file. For
example:SEGMENTS
FILEl_TEXT
IN IT
FILE2_TEXT
FILE3_TEXTINITWINDOWBLUEMOON

Logically grouping functions within
the given code segments can improve a segment arrangement. This
logical grouping can be accomplished either by physically moving
code to different source files or byusing the pragma statements.
If you include a pragma statement
before the body of each function but
after the prototype statement, the Ccompiler automatically splits thecode into the named segment.
In the example in Figure 3, the function "error_mess" is moved from its
default code segment (the name ofits source code file) to the code segment called "BLUEMOON." Thepragma statement is ifdef'ed withthe define "CODEVIEW" so that if
the program is compiled with theCode View options and the/DCODEVIEW define, the code is
not moved, and Code View is able towork correctly.

The segment information at the topof an application's map file, which
is produced by the linker (if specified), can be used to analyze thecode segment packing. This information consists of a list of all the codeand data segments and their sizes.

DynaLink (DLL) Considerations:
Here are some points to consider
when using DLLs:#ifndef CODEVIEW#pragma alloc_text(BLUEMOON, error_mess)#end if
int error_mess(char *s){

Body of function

Figure 3. Moving Code into a Named Segment

Personal Systems/Issue 4, 1991

30

• Minimize the number of DLLs in
the application. Too many separate DLLs can cause performance
problems because each DLL (regardless of size) adds to:- The initialization time needed
to start a process

threadfunc()(

thread body
DosEnterCritSec() ;DosSemClear( Waiting_ parent_sem);
DosExit();- The search time required toload a new code/data segment- The system resources/memory
used as overhead
Note: Too many help files cancause similar problems.

• Do not allocate stack and heap
segments from DLLs. A DLL always uses the stack and heap of
the calling process that islaunched from an EXE file. Although a DLL's stack and heap
segments are never used, they arestill packed into the DLL's datagroup along with its static andglobal variables. Therefore, simply removing the unused stacks
from the DLL can reduce theworking set considerably.
• Do not declare functions that do
not access DLL data as "expentry" or "_loadds" . This unneccessarily loads the DLL's data
segment along with the code.
• Set up the LIBP ATH in
CONFIG.SYS so that most used
LIB directories are near the frontof the search path.
Also, do not put non-DLL files in
LIB directories because this increases the system search time for
DLLs.
• Declare DLLs as
LOADONCALL. This delays
loading of a DLL from disk until
it is actually required, thereby saving memory.
Note: This is not valid in all situations, but is a guideline.

• The caller should free DLLs
when finished with them.

Figure 4. Method for Freeing a Thread Stack

This is usually true, but in somecases it may be better to keep the
DLL loaded throughout the life of
the application.
Multitasking Considerations:
Multitasking is an extremely powerful feature of OS/2 that is all but ignored by many applications. In an
application where concurrent processing is possible, spawning multiple threads (or processes, in somecases) can significantly increase theapplication's performance.

In Presentation Manager (PM) applications, multiple threads are necessary because the main thread (thread1) should perform only message handling (no disk 1/0, no semaphore
handling, no lengthy processing). Allowing any of the preceding can not
only affect performance, but cancompletely hang the system.
Here are some points to consider inmultitasking applications:• Do not create and destroy threads
on demand. Thread and processspawning is expensive in terms ofelapsed time. Wherever possible,
create a "hot pool" of threads thatwait for work and activate whenrequired.
• Thread priority adjustment should
be used sparingly. Any thread canraise its own priority, but oneupmanship could occur, resulting

Personal SystemsJlssue 4, 1991

in all threads executing at thehighest priority. This gives the operating system no opportunity forproper thread management.
• It is important to free the thread's
stack space when it terminates.
The proper method for freeing athread stack is shown is Figure 4.
Note: The DosExit does an implicit DosExitCritSec. At thatpoint, the parent thread that is
waiting on the semaphore canfree the thread 's stack. This procedure is so that the parent thread
does not free the stack until thechild thread is completely
finished.

Minimizing Message Event
Initialization: In the OS/2 PM environment, a lot of messages are often
generated within an application.

In our application, the number ofmessages was not the problem;
rather, the amount of unnecessary initialization taken to process eachmessage needed improvement. For
example, some parts of the code had
initial ization logic at the beginningof the window procedures. Although
the initialization in question was required, it was being executed at the
beginning of a WinProc statement
before the type of message was determined (and, often, whether or not
the WinProc should even process the31message). An example is shown in
Figure 5.
In the preceding case, the initialization of the variable Pvar is taking
place before the window procedure
has determined if Pvar will be used.
In this example, Pvar should be initialized inside the switch case
MSG 1. Even if Pvar is used in several or almost all of the switch's
case statements, it should be initialized only when it is needed.

MRESULT EXPENTRY WinProc(HWND hwnd,USHORT msg,MPARAM
mpl. MP ARAM mp2){

Pvar - *mpl;
switch( msg{Case MSGl:<Pvar used here> .
Case MSG2 :Default:

This type of approach to initialization in window procedures will increase the size of the code and may
add to its complexity, but it is definitely worth the effort for
performance.

Other Techniques: Because of therequirements for easy maintenanceand the ongoing development of the
product, several OS/2 optimization
methods were not used by the performance team. This does not meanthat such approaches would not bevalid for other projects, but simply
that in some cases the costs outweigh the benefits.

Database Tuning
Reorganizing: Reorganizing a database is one of the simplest and mosteffective methods of improving database performance. The "Reorg"
operation physically rearranges therows in each table to optimize
search time. When performing a
Reorg it is important to choose themost heavily used index as the
Reorg key. The Reorg can be done
through the Query Manager interface.
After reorganizing the database, it isnecessary to perform the database
operation "RUNSTATS." This operation updates the system tables that
the OS/2 Database Manager uses to}

Figure 5. Message Event Initialization

determine optimum searchalgorithms.
Also, after the first two steps, the application program should be rebound to the database. This updates
the access plans stored in the system
tables to take advantage of theReorg.

Database Design: Table design has
an extremely large impact on performance. An efficient design is thebest approach to good database
performance.
For example, this project had aunique situation where a database
query that required matching of twocolumns was required. This caused a
performance problem when the database exceeded about 3,000 entries.
Creating an additional table thatcoalesced the two fields into one(for search purposes only) seemed tobe the best solution. This improved
performance by more than 10 seconds on a large database.

Indexes: Indexes can also greatly
improve database performance, butthere are associated costs. Each addi-

Personal Systems/Issue 4, 1991

tional index on a table requires an
update each time the table ischanged. Therefore, in many cases,
an index improves data retrieval, but
negatively impacts table updates. It
is important, therefore, to carefully
consider the use of indexes. Also, if
an index is used, consider the number of columns used in the index;
the more columns, the greater the
performance impact.

Database Locking: Database locking refers to the control of concurrent access to the database. Because
this product did not gain much of aperformance improvement by changing Jocking strategies, this techniquewill not be discussed in detail. For
more information, refer to the OS/2.
Database Manager Programming
Guide.

Conclusion
The performance team found thatthe most effective techniques for performance improvements were as
follows:• Partial redesign - The refreshcache eliminated many calls tothe server

32

ABOUT THE AUTHORS• Memory management• Database tuning• Structure alignment
Figure 6 shows the relative effectiveness of each method used to improve the performance of thisproduct. Although this chart can be
useful to any project, the effectiveness of each method used will varyfrom project to project. This variance wi ll depend on the type andsize of the product. In general, improving the performance of an OS/2
application depends not on the useof a set of tec hn iques, but on the understanding and effective use of theresources being used by theapplication.

The performance teamconsisted of project leader
Yat-Fai Lee, Mark Brooks,
Henry Galas, and Gary
Kaufman.

Design Phase

Coding Phase

Mark Brooks is currently the project
leader of an application
development project at IBM CanadaLtd. He holds a B.S.C. in computing
science from Simon Fraser
University in British Columbia,
Canada.
Gary Kaufman works in OS/2 2.0
application development at IBM
Canada Ltd. Gary holds a B.S.E.E.
in electrical engineering from the
University of British Columbia.

Tuning Phase

B
E
N
E
F
I
T

Memory Multi- DataMgmt. Tasking base
DesignData
Cons.

Array Loop
Index Optim.
Optim .

Code Register Intrinsic Struct. Segment DLL DataReorg. Locking
Path Variables Fune.
Align. Packing Mgmt. base
Runstats
Calls
Indexing Re-bind

TUNING TECHNIQUES

Figure 6. Relative Perfor mance Improvements

Personal Systems/Issue 4, 1991

33

Creating PM
Windows with
Dialog Templates

y

V

11

~-(1

/~.J,..-t' t J:=

Scott Sorensen
Provo, Utah
There are advantages to using atemplate structure and theWinloadDlg( ) function call to defi~e Presentation Manager (PM)windows. This article explains
how programmers can use thismethod of window creation.

Most programmers use theWinCreateStdWindow( ) and
WinCreateWindow() functions tocreate window panels in their OS/2
PM programs. There are, however,alternative methods. One of these isto create dialog templates with thedialog box editor.
Window panels can be createdefficiently with the dialog box
editor or defined manually in a
DLGTEMPLATE or
WINDOWTEMPLATE structure ina resource file and then called with
the WinLoadDlg( ) function. Thismethod has some advantages overcreating windows with the
WinCreateStdWindow( ) and
WinCreateWindow( ) functions. The
two most obvious advantages are:
• The window panels will have thesame relative dimensions on all
display monitors, regardless of
their resolution.
The dialog box editor allows you
to design screen panels that will
have the same relative dimensions
on all display monitors, regardlessof their resolution. This is because the screen panels are savedin dialog units, and dialog units
are defined in terms of the systemfont. One dialog unit is equal to

.

.

.

~~

'.
.

~-

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

. . . . . .1. . . .,,.

,.

...
one-fourth the width of the average system font character by oneeighth the height of a system fontcharacter. (Because system fontcharacters are approximately onehalf as wide as they are tall, thewidth and height of a dialog unit
are also approximately equal.) On
the other hand, the WinCreateStdWindow() and WinCreateWindow( ) functions define thewindow position and the window
size in terms of pixels. This requires more complicated coding
to give screen panels the same appearance on display monitors withdifferent resolutions.
• Panel creation is faster and easierwith the dialog box editor.
The dialog box editor has a
WYSIWYG display that makes it
easy to create window panels andposition control windows. It automatically stores the size and position information in your window

Personal Systems/Issue 4, 1991

template. This eliminates the needto create, size, and position thecontrol windows in your program
code.

The DLGTEMPLATE or
WINDOWTEMPLATE
Structure
PM defines windows in window template structures. The dialog box editor saves the window panel in a typeof window template called a
DLGTEMPLATE. This file has theextension .dlg. The
DLGTEMPLATE can then be included in the resource file and modified, if necessary, to add additional
items that could not be created withthe dialog box editor. The
DLGTEMPLATE structure can also
be created manually and inserted
directly into the resource file. It is
important to have a general understanding of this structure, regardlessof which method you use to create
the DLGTEMPLATE.

34

DLGTEMPLATE ID MAINBDX LDAD0NCALL MOVEABLE DISCARDABLEBEGINDIALOG "VM File Transfer", ID_MAINB0X, 21, 38, 336, 181, FS_N0BYTEALIGN
FS_DLGB0RDER
FS_DLGB0RDER
WS_VISIBLE
WS_CLIPSIBLINGS
WS_SAVEBITS , FCF _SYSMENU
FCF _TITLEBARFCF _MIN BUTTON
FCF MAXBUTT0N
BEGIN
CONTROL "Help" , ID_HelpPB, 160, 10, 27, 13, WC_BUTT0N, BS PUSHBUTTON
BS_DEFAULT I WS_TABST0P I WS_VISIBLE
CONTROL"", ID_StatusMLE, 22, 31. 199, 40, WC_MLE, MLS_BORDER I
MLS_WORDWRAP
WS_GR0UP
WS_TABST0P
WS_VISIBLE
CONTROL "Transfer file", ID_TransferGB, 18, 96, 298, 74, WC_STATIC,
SS_GR0UPB0X I WS_GR0UP I WS_VISIBLE
CONTROL'"', ID_SessionEF, 131. 145, 21. 8, WC_ ENTRYFIELD, ES_ LEFT
ES_MARGIN I WS_TABST0P I WS_VISIBLE
PRESPARAMS PP_BACKGROUNDC0L0RINDEX CLR_BLUE
CONTROL"", ID_SourceEF, 131, 123, 164, 9, WC_ENTRYFIELD, ES_ LEFT
ES_AUT0SCR0LL
ES_MARGIN
WS_TABST0P
WS_VISIBLE
PRESPARAMS PP_BACKGR0UNDC0L0RINDEX CLR_RED
CONTROL"", ID_DestinationEF, 130, 104, 165, 8, WC_ENTRYFIELD,
ES_LEFT
ES_AUT0SCR0LL
ES_MARGIN
WS_TABST0P
WS VISIBLE
PRESPARAMS PP_BACKGR0UNDC0L0RINDEX CLR_GREEN
I

I

I

I

I

I

I

I

/* Additional

I

I

I

I

I

I

I

I

I

CONTROLS ... */

END
END

Figure 1. Dialog Template with Presentation Parameters

The keywords DLGTEMPLATE andWINDOWTEMPLA TE are almost
synonymous and can be interchanged in most cases. Every window in a PM program can be
defined in a DLGTEMPLATE or
WINDOWTEMPLATE structure.
The template starts with a
WINDOWTEMPLATEoraDLGTEMPLATE statement, whichtells the resource compiler that awindow definition is to follow. It
also specifies the resource ID, load
options, memory options, and code
page to be associated with that window. The dialog box editor specifies
the following options for thisstatement:• The resource ID is defined by theuser in the dialog box editor• The load option is
LOADONCALL• The memory options are
MOVEABLE andDISCARD ABLE

These options will not need to bechanged for most programs.
The DLGTEMPLATE or
WINDOWTEMPLATE statement
is followed by one or more
CONTROL, WINDOW, or
DIALOG statements. These statements can be nested. The
CONTROL and WINDOW statements specify the text associatedwith a title bar or window text, awindow ID, position, size, and class,window styles, and control data. The
DIALOG statement is the same as
the CONTROL and WINDOW statements with the exception that no
window class is specified. With the
DIALOG statement, the
WC_FRAME class is implicit.
The dialog box editor uses the
CONTROL statement to specify allcontrol windows that are children of
the dialog box. There is also a set ofpredefined control statements thatcan be used to specify certain con-

Personal Systems/Issue 4, 1991

trol windows such as CTEXT for
centered static text and
ENTRYFIELD for an entry field
control. A control window must be achild of either a WINDOW or a
DIALOG.
The WINDOW statement or control
statement can be used to specify
user-defined windows if the window
is registered with the
WinRegisterCiass( ) function before
the WinLoadDlg( ) function call is
made.
The template can also contain presentation parameters that define additional characteristics of a window.
To do this, specify the keyword
PRESPARAMS followed by thepresentation parameter identifier andits value.

Using the Template
The example DLGTEMPLATE
structure (Figure 1) defines a dialog

35

void cdecl main()(/* Declarations and Initializations */hab - Winlnitialize((UHORT)NULL);
hmq - WinCreateMsgQueue(hab, O);
hDlg - WinloadDlg(HWND_DESKTOP,HWND_DESKTOP,(PFNWP)MainDlgBoxWndProc,(HMODULE)NULL,
ID_MAINBOX, ( PVOID)NULL);
WinProcessDlg(hDlg);/* Clean up and terminate*/

Figure 2. Loading and Disp laying a Window

window that owns several control
windows.
The dialog box editor was used tocreate the window panel and position the control windows. The structure was then copied into theresource file, and the statements forthe presentation parameters wereadded. The presentation parameterssimply change the color of each entry field to demonstrate how presentation parameters are set in atemplate structure. The keyword
PRESP ARAMS was used, followedby the
PP_BACKGROUNDCOLORINDEX
identifier and a value such as
CLR_RED. In the main( ) function,
the WinCreateStdWindow( ) function call is replaced with the
WinLoadDig( ) and
WinProcessDlg( ) function calls.
There is no longer any need for message queue processing, but a message queue must still exist or theapplication wiJI not run. The main( )function is very simple, as shown in
Figure 2. This skeleton example
demonstrates how the dialog box editor can be used to create a main window that will display the same on all
display monitors.

The window will look like Figure 3.

Adding Icons and ActionBars
An action bar can be added to a dialog window, and an icon can be associated with a dialog window in the
WM_INITDLG part of the dialog
window procedure.

Once a resource ID has been definedin a header file, and the icon has
been associated with this resource
ID in the resource file, then the icon
can be loaded with a call to the
WinLoadPointer( ) function. This
call must be followed by sending amessage to the default dialog procedure with a WM_SETICON
message.

Figure 3. W indow Defined in Figu re 1 a nd Called in Figure 2

Personal Systems/Issue 4, 1991

36

case WM_ INITDLG:
hDlgBoxicon - WinLoadPointer(HWND_ DESKTOP,
NULL,
ID_ DLGBOX);
WinDefDlgProc(hwnd, WM_ SETICON,(MPARAM)hDlgBoxicon,(MPARAM)O);
hMenu - WinLoadMenu(hDlg, NULL, ID_ MENU);
Wi nSendMsg(hDl g, WM_ UPDATEFRAME, (MPARAM)O,(MPARAM)O);

break;

Figure 4. Associating an Icon with a Dialog Template Window

WINDOWTEMPLATE ID_MAINBOX
BEGIN
FRAME NULL, 0, 50, 34, 285, 190, WS_ VISIBLE,
FCF_ TITLEBAR I FCF_ SYSMENU I FCF_ SIZEBORDER I FCF_MINMAX I
FCF _ TASKLISTBEGIN
WINDOW"", ID_ CLIENT, 0, 0, 285, 180, WC_MYCLASS, WS_ VISIBLE, FCF_ TITLEBAR
FCF_ SYSMENU
BEGIN
CONTROL"", ID_ TASKLIST, 166, 9, 134, 78, WC_ COMBOBOX, CBS_ SIMPLE I
WS_ GROUP I WS_ TABSTOP I WS_ VISIBLE
CONTROL "Remove/Restore Options", ID_ TASKGROUP, 24, 62, 87, 56, WC_ STATIC,
SS_ GROUPBOX I WS_ GROUP I WS_ VISIBLE
CONTROL "Icon", ID_ TASKICON, 33, 96, 74, 10, WC_ BUTTON, BS_ AUTORADIOBUTTON
WS_ TABSTOP I WS_ VISIBLE
CONTROL "Program", I D_ PROGRAM, 33, 81. 7 4, 10, WC_ BUTTON, BS-AUTO RAD IOBUTTON
WS_ TABSTOP I WS-VISIBLE
CONTROL "Both", ID_ BOTH, 33, 67, 74, 10, WC_ BUTTON, BS-AUTORADIOBUTTON
WS_ TABSTOP I WS-VISIBLE
CONTROL "Program Name", 65535, 171, 100, 73, 8, WC_ STATIC, SS_ TEXT I
DT_ LEFT I DT_ TOP I WS_ GROUP I WS_ VISIBLE
CONTROL "Restore", ID_ REMOVE, 25, 45, 86, 13, WC_ BUTTON, BS_ PUSHBUTTON
WS_ TABSTOP I WS-VISIBLE
CONTROL "Remove", ID_ REMOVE, 25. 32. 86, 13, WC_ BUTTON, BS_ PUSHBUTTON
WS_ TABSTOP I WS-VISIBLE
CONTROL "Cancel", ID_ CANCEL, 25, 10. 86, 13, WC_ BUTTON, BS_ PUSHBUTTON
BS_ DEFAULT I WS _ TABSTOP I WS_ VISIBLE
END
END
END

Figure S. Window Template with a Frame and Controls

Personal Systems/Issue 4, 1991

37

When an action bar is needed, it canbe added by putting a menu template
into the resource file and then making a call to the
WinLoadMenu( ) function. After thecall to the WinLoadMenu( ) function , a WM_UPDATEFRAME message must be sent to the dialog
window. The code required to add
an action bar and an icon is shownin Figure 4.
The last bit of sample code demonstrates how to use a template to define a typical window with a frame,a client, and some control windows(Figure 5).
It is necessary to register
WC_MYCLASS with a
WinRegisterClass( ) function call before making the call to
WinLoadDlg( ). The menu is loadedwith the WinLoadMenu( ) functionin the WM_INITDLG case. Thismenu is defined in a menu templatein the resource file.
The window will look like Figure 6.

Improved Usability with
OS/2 2.0
This method is not appropriate for
all applications. Programs with only
one screen panel and multiple control windows are particularly well

Tasklist Mani ulator

CancelRemoveRestoreFigure 6. Window Defined in Figure 5 and Called in Figure 4

suited for this method. (The Presentation Manager control panel utility isa good example of this.)
The dialog box editor is a powerfultool. OS/2 version 2.0 will provide
even better usability, making window panel creation easier and fasteryet. Ease-of-use, along with the device independence offered by defining windows in window templates,
are two of the advantages of using
this method to create windows.

Personal Systems/Issue 4, 1991

ABOUT THE AUTHOR
Scott Sorensen is part of IBM's
OS/2 Application Assistance Center
team, working through thecooperative education program. He
specializes in OS/2 programming,with emphasis on Presentation
Manager. Scott is a senior studying
computer science at Brigham Young
University.

38

REXX Programfor OS/2 LAN
Server
Carolyn Easter
IBM Corporation
Austin, Texas
In OS/2 LAN Server environments,
an administrator needs the ability
to create user IDs that have identical logon resources. The program
described here does just that. It
uses REXX, OS/2, and LAN Servercommands to create a new user
ID modelled from another createduser ID.

REXX is a language included in
OS/2 Extended Edition 1.30.1 andStandard Edition 1.30.1 and is ideal
for those interested in creating sophisticated batch programs. LAN
Server does not interact directly with
REXX, but because it has a command line interface, the REXX programming language can be used tocreate useful tools.
An example of a REXX program follows this article (Figures 6a through6g). The functions provided by this
REXX program are:
• Create a user ID modeled after adefined user ID• View user IDs defined to thenamed domain controller server• View specific user ID details• Delete a specific user ID

Data Structures
This REXX program is interactive,
relying on users to input information
to the program. The program requires that the output from some of
the commands be stored in a convenient place for processing. REXX provides a dynamic data constructcalled a rxqueue, where output from

'NET ADMIN \\IBMDS2SlICNET USERS

I rxqueue /FIFO'

Figure 1. Example of a Command Where Output ls in the Queuecommand Iine commands or program data can be stored. Because
OS/2 LAN Server command output
is either printed to the screen or redirected to a file or printer, the rxqueue is an ideal place to store theoutput.
An example of a command where
the output of the command is placedin the queue is shown in Figure 1.
The command is enclosed in single
quotes. Double quotes can also be
used. The pipe character " I" is usedin the command string to direct output to program files. The NET
USERS command returns a Iist of
the defined users on the server
named IBMOS2S 1. Now that thedata is in a REXX queue structure,
the REXX commands PULL and
PUSH can be used to remove queueelements from the queue (PULL) or
place elements in the queue (PUSH).

In this REXX program, a subroutine
called PULLQUEUE removes thequeue elements and places them in adata structure accessible to all portions of the REXX command file.
The PULLQUEUE subroutine isshown in Figure 2. The first executable statement in the subroutine copies the number of the queued
elements into the first variable of LI(the zero index). LI is called a stem
variable and is similar to an array.
One function not available using
stem variables that is available whenusing arrays is the arithmetic operations on the array index. With stem
variables, the index number (.I) cannot be incremented, decremented, orotherwise manipulated inside thestem variable declaration. The opera-

Personal Systems/Issue 4, 1991

tion 1 = 3*1 can be used, then I used
as an index (LI.I).

In the next line, the PULL function
is used to pull the data from thequeue into the variable LI.I where .I
is a value 1 to the number of queueelements. By using the PARSE statement with the PULL function, thedata from the queue is not uppercased, but remains in its originalstate. The PULL function by itself
will uppercase the entire data string.

Program Flow
Figure 3 shows the program flow.
The program is started by typing in
the name of the command file.
There are no parameters. The file isnamed LANUSER2.CMD.
Before presenting the main menu for
selection, it is important for the program to have two major pieces of
information:
1. What is the name of the domain
controller? When creating user IDs,the domain controller must be theserver updated with the new usernames because this server replicatesthe user names and group names tothe other servers in the domain. The
server name is validated as a domain
controller using the NET VIEW

PU LLOU EU E:
LI.O - queued();
DO I - 1 TO LI . 0
PARSE PULL LI. I
END
RETURN

Figure 2. PULLQUEUE Subroutine

39

command and NET ACCOUNTS
command.
2. Where is the administrator
logged on? This is important whenissuing LAN Server commands tothe domain controller, because the
NET ADMIN command must precede each command. It is also important for other OS/2 commands that
may or may not support redirected
or UNC file requests.

Start

l
Present Information Screen

Prompt for Domain
Controller Server Name

No---

End

Validation of Server Name
One of the first actions done by the
program is to prompt the administrator for the name of the server.
Granted, that if a utility like this program were going to be used on only
one domain, the name of the server
could be hard coded onto the variable name SERVER. For flexibility,
the program was written to be usedin any domain.
The NET VIEW command is used
to list the server names available
and to validate that the name of theserver machine entered is one of themachines in this list. It is possible toadministrate another domain while
logged on to the default domain.
This requires that the administrator
has added the domain name to the
IBMLAN.INI file,othdomains=xxxxxxxx, of the requester being used as the administrator's workstation and that theadministrator's user ID and password are known to the other domain. When the NET VIEW
command lists the server names
available, the other domain's servers
will also be listed, and validation of
the server name will succeed.
After the server name is validated,
the server account information ischecked using the NET
ACCOUNTS command to ensurethat it is a domain controller. If theYeslPresent Menu
I. Create User
2. View Users
3. View a User
4. Delete User
5. Exit----Create User Routine
View Users Routine
View Single User Routine
Delete User Routine
Exit Program

Figure 3. Initialization and Main Panel Program Flowrole is PRIMARY, the server is a domain controller and the program cancontinue. Otherwise, the program issues an error message and exits.

Location Checking for
Administrator
The only additional informationneeded before proceeding to themain menu is determining the location of the administrator executing
this program. If the administrator is
running the program at the domain
controller, then the NET ADMIN
prefix is not needed for the OS/2
LAN Server commands. If the user
is remote, the NET ADMIN prefixmust be issued in front of the commands. A variable LANFRONT is
set up to reflect this situation. If
LANFRONT is null, the administra-

Personal Systems/Issue 4, 1991

tor is at the domain controller; otherwise, LANFRONT is the value'NET ADMIN \\servername /c'. During the executable phase of the program, this variable is tested for NUL
to indicate the location of theadministrator.
The NET ACCOUNTS command isissued to determine if the administrator is located locally or remotely. If
the role of the local workstation is
PRIMARY, the administrator is at
the domain controller. Otherwise,
the administrator is remote.

Create User
The program has several functions.
All except the create user are trivial.
The program flow for this function
is shown in Figure 4.

40This discussion focuses on themodel user function and how it is accomplished using the NET USER
command and knowledge of the directory structure of the domain control database.
The administrator selects "Create
new user" from the menu and theprogram prompts for the user nameto use as a model. This user ID ischecked against a created list of users to make sure it exists in the domain. The program then prompts forthe user name to create and ischecked to make sure the ID does
not exist. The program then loops
each time a user is created and asks
for another user ID to create. This allows many user IDs to be createdfrom the model user. Each new user
ID can be created as either an administrator or user, can have a uniquepassword, and can have a uniquecomment string. These parameters
are then used on the NET USER
command.

I SelectedlPresent Create User
information Screen
Prompt for New User Name

Prompt for Model User
Name

u~

Exits?

No

Yesl

After the user specifications are determined, the cloning of the model
user ID environment takes place.
This is accomplished by duplicating
the user directory of the new model
user ID. The user environment files
are contained in the\IBMLAN\DCDB\USERS\username where username
is the name of the user. The list of
files that might be present in thissubdirectory are shown in Figure 5.
All files in the subdirectories arecopied to the new user's newly created subdirectory.
The program uses the MD commandto create these subdirectories, using
the variable ROOT to specify thepath. The program uses the fact that
an automatic share occurs at eachserver and is named\\servemame\lBMLAN$. Therefore,
the value of ROOT is

Prompt for:
User Type
User Password
User Comment

Create User ID

Create..\DCDB\USERS\name\ ..\ ..\ .. \ .. \BATCH

Copy Setup Filesfrom..\DCDB\USERS\modelto.. \DCDB\USERS\narne

Add New User to Groups

Figure 4. Program Flow for Create User Function

Personal Systems/Issue 4, 1991

41\\servemame\IBMLAN$. This sharename is one of several that occur
when the SERVER service starts.
All drives are shared as\\servemame\d$ where d is the drive
letter.
The next task is copying the files
from the model ID subdirectory to
the new user ID subdirectory. NET
COPY is used because this command supports local and remote
COPY commands.
The user is then added to the group
IDs to which the model user has
membership.

user' s name, another like subdirectory is created using the new user'sname as the subdirectory name.
2. Otherwise, the same subdirectoryis used as the new user's home
directory.
Home directories no longer have an
ALIAS, but if desired, the administrator can create one.
The program returns for the user toenter another user ID to be created,using the same model user ID nameentered for the previous user ID.

Other Functions
If the model user has a home directory, the program determines where
the new user's home directory willbe by following these guidelines:

Several other functions are available:• View valid users for the domain• View a user ID profile• Delete a userl . If the model user's home directory name ends with the model

LIST.A - DOS Private Applications
LIST.S - Served Applications panel entries

The delete user process removes theuser ID, the user definition subdirectory on the domain controller, andassociated access control profiles.
The User Profile Management deleteuser function does not delete the access control profile for the user definition subdirectory, only thepermissions and leaves an empty access control profile in the NET.ACC
file.

Summary
The REXX programming language
is flexible and can be used to create
effective tools for administrating an
OS/2 LAN Server domain. Imagine
what could be done with the error
logs, message logs, and audit trails
provided with the LAN Server. Eachof these logs gives valuable information to the administrator and can beused in an integrated way to provide
better problem determination, statistical reporting, and generaladministration. Food for thought:
this information could be formatted
by a REXX program and imported
to Database Manager.

LIST.U - Logon Assignments for DOS

ABOUT THE AUTHOR

USER.A - OS/2 Private Applications
USER.L - Logon Assignments for OS/2
USER.S - Desktop Manager, Public Applications window entries
EXTERNAL.OFF - present if user has ever attached to an external resource
EXTERNAL.ON - present if user detaches from an external resource or logs
off when attached to an external resource
PROFILE.CMD - a file run when logon occurs on an OS/2 machine (notmandatory)
PROFILE.BAT - a file run when logon occurs on a DOS machine (notmandatory)

Figure 5. List of Files in \IBMLAN\DCDB\USERS Subdirectory

Personal Systems/Issue 4, 1991

Carolyn Easter is an advisory
programmer in IBM's Entry Systems
Division in Austin, Texas. She joined
IBM in 1980 and was assigned toprogram the files and data basesystem on the 5520 Administrative
System. She has a B.S. inmathematics from Southern
Methodist University and a B.A. in
computer science from the
University of Texas at Austin.

42/****************************************************************************/
/*
/*
/*
/*

S74a-xxa CC) COPYRIGHT IBM CORP. 1990
ALL RIGHTS RESERVED
LICENSED MATERIALS-PROPERTY OF IBM
SEE COPYRIGHT INSTRUCTIONS, Gl20-20a3

*/
*/
*/
*/

/****************************************************************************//*LANUSER2.CMD/* REXX exec for creating user IDs on LAN Server 1.30.1 domains/* Assumptions: User is logged on as an administrator/* VERSION 2.0/*
This version supports the enhanced architecture and/*command line support for the home directory.
Messages/*
have been separated for ease of translation.

*/
*/
*/
*/
*/
*/
*/

/****************************************************************************//* initialize */MODEL- ''ROOT-''R-'.
SERVER-''
NAME-''/* MESSAGES BLOCK - TRANSLATE THESE BLOCKS OF TEXT TO OTHER LANGUAGES*/GREET.a - a
GREET.l
This module will allow you, the administrator. to: •GREET.2 GREET.3
Create user IDs on a domain cont roll er and model the·GREET.4
new user on a previously created user.·GREET.S See what users IDs are valid for the domain.·
GREET.6
See information about a specific user •GREET.7
Delete a user·
GREET.a
CREATE.O - S
CREATE.l
CREATE.2
This routine wil 1 create a user modeled after another user.·
CREATE.3
This means all logon assignments and user attributes are copied'
CREATE.4
to the new user as wel 1 as creating a home di rectory i f the •CREATE.S
model user has a home di rectory.
Thank you!'
THANKS -·A - 'A'us - . u.
QUEST.l - 'ENTER THE NAME OF THE USER TO DELETE'QUEST.2 - 'ENTER THE NAME OF THE USER'QUEST.3 - 'ENTER THE MODEL NAME.
QUEST.4 - 'ENTER THE USER NAME. 'QUEST.S - 'DO YOU WANT TO RETURN TO THE MENU (Y/N)?.'QUEST.6 ='DELETE?
(Y/N)'QUEST. 7 - 'TYPE IN THE USER COMMENT';QUEST.a - 'IF THE USER IS TO HAVE A PASSWORD, ENTER THE PASSWORD';QUEST.lo -·rs THE USER ADMIN OR USER? (A/U)';QUEST.11 -'WHAT IS THE NAME OF THE SERVER WHICH IS THE DOMAIN CONTROLLER?'
YES - 'Y'
NO - 'N'
INFOl - 'THESE ARE THE VALID SERVER NAMES:'
INF02 - 'PROGRAM WILL EXIT.'
INF03 - 'Name being used as a model is: •INF04 - ' DELETING USER. 'INFOS - ' CREATING USER.'
INF06 - • Last name used was:
INF07 - "Wait 30 seconds if users home di rectory is on an additi anal server.·
ERRORl - 'THE SERVER NAME YOU ENTERED IS NOT THE DOMAIN CONTROLLER'ERROR2 - 'THE SERVER NAME IS NOT VALID'ERROR3 - 'ENTER A VALID CHOICE, PLEASE'ERRORS - 'USER DOES NOT EXIST.
RE-ENTER NAME PLEASE.'
ERROR6 - 'USER ALREADY EXISTS. RE-ENTER NEW USER NAME'

Figure 6a. Source Listing for LANUSER2.CMD

Personal Systems/Issue 4, 1991

43

MENU. 0 - 7
MENU. l=' SELECT THE FUNCTION YOU WISH TO PERFORM
MENU.2-''
MENU.3- ' 1. CREATE USER(S) USING A MODEL'
MENU.4- ' 2. SEE WHAT USERS ARE DEFINED'
MENU.5 - ' 3. SEE INFORMATION ABOUT A SPECIFIC USER'
MENU.6- ' 4. DELETE A USER'
MENU.?=' 5. EXIT THIS UTILITY'/* BEGIN */'@ECHO OFF'
'CLS':DO I - 1 TO GREET.O
SAY GREET.I
END'PAUSE';SAY
SAY QUEST .11
SAY
PARSE UPPER PULL SERVER;SERVER=STRIP(SERVER);SAY THANKS/****************************************************************************//* VALIDATE SERVER NAME*//****************************************************************************/' NET VIEW
j rxqueue /FIFO'CALL PULLQUEUE;
DO I - 1 TO LI . 0
PARSE VAR LI. I '\ \' SERV COMMENT
IF SERV=SERVER THEN LEAVEENDIF SERVSERVER THEN DO
SAY ERROR2
SAY INFOl
NET VIEW'PAUSE';EXIT
END
ELSE DO'NET ADMIN \\'SERVER' le NET ACCOUNTS j rxqueue /FIFO';CALL PULLQUEUE:PARSE VAR LI .6
FUNCTION ':' ROLE .
ROLE - STRIP(ROLE):
IF ROLE'PRIMARY' THEN DO
SAY ERRORl
SAY INF02
EXIT:
END
END
/ *FIND OUT IF USER IS USING DOMAIN CONTROLLER*/LANFRONT- 'NET ADMIN \\'SERVER' le';ADMINQ- '\'"
ROOT- '\\'SERVER'\IBMLAN$';' NET ACCOUNTS j rxqueue /FIFO'CALL PULLQUEUE:PARSE VAR LI.6
FUNCTION ':' ROLE
ROLE - STRIP( ROLE):
IF ROLE - 'PRIMARY'
THEN DO /*USER IS AT DOMAIN CONTROLLER */LAN FRONT=''ADM INO= ""END/* DETERMINE DRIVE LETTER OF DOMAIN CONTROLLER*/LANFRONT 'NET SHARE IBMLAN$ jrxqueue /FIFO'CALL PULLQUEUE

Figure 6b. Source Listing for LANUSER2.CMD

Personal Systems/Issue 4, 1991

44

PARSE VAR LI.2 P PATH
PA TH- STRIP (PATH)PARSE VAR PATH
DD ':\' IBM/****************************************************************************//*SET UP A LIST OF USERS TO USE IN VALIDATION*//****************************************************************************/CALL SETUPUSERS;/****************************************************************************//* BRING UP THE MAIN MENU*//****************************************************************************/DO FOREVER'CLS';DO I - 1 TO MENU.O
SAY MENU.I
END
KEY - ''DO WHILE KEY - ''PARSE PULL KEY ;END
SELECT
WHEN KEY-1 THEN CALL CREATEM
WHEN KEY - 2 THEN CALL DU SERS
WHEN KEY-3 THEN CALL USERINFO
WHEN KEY-4 THEN CALL DELETE
WHEN KEY - 5 THEN EXIT
OTHERWISE DO /* need a valid selection */SAY ERROR3'PAUSE ' ;
END
END
END
/******SUBROUTINES*********************************************************//****************************************************************************//* CREATE LIST OF USERS*//****************************************************************************/SETUPUSERS:LANFRONT ' NET USERSCALL PULLQUEUE
USERS . O - 0

I rxqueue /FIFO'

C- 1
DO I - 3 TO LI. 0
PARSE VAR LI.I
NAMES.1 NAMES.2 NAMES.3 .
NAMES . 1
STRIP(NAMES . 1)
NAMES . 2 - STRIP(NAMES . 2)
NAMES . 3 - STRIP(NAMES.3)
IF NAMES . 1' THE' THEN DO
DO U
1 TO 3
IF NAMES.LI
THEN DO
USERS . C - NAMES.LI
C - C + 1
USERS . a - USERS.a+ 1
END /*IF*/
END /*DO*/
END /*IF */END /*DO */RETURN ;/****************************************************************************//* LOOK AT INFORMATION ABOUT A SPECIFIC USER*//****************************************************************************/USERINFO:SAY
SAY QUEST.2; PARSE UPPER PULL INFO;LANFRONT 'NET USER' INFO 'IMORE';
Figure 6c. Source Listing for LANUSER2.CMD

Personal Systems/Issue 4, 1991

45

'PAUSE';
RETURN/****************************************************************************//* LOOK AT CREATED USERS*//****************************************************************************/DU SERS:LANFRONT' PAUSE';'NET USERS';

RETURN/****************************************************************************//* DELETE A USER*//****************************************************************************/
DELETE:DO FOR EV ER
R-GETUSER( l, 1);
IF R-0 THEN DO
SAY QUEST.6
PARSE UPPER PULL ANS;IF ANS= YES THEN DO
SAY INF04;
LANFRONT
NET ACCESSLANFRONT' NET ACCESSLANFRONT ' NET USER
RET-MLIST(NAME,0)
END
END
ELSE LEAVE
END /*DOFOREVER*/
RETURN'DD':\IBMLAN\DCDB\USERS\'NAME ' /D ''DD':\IBMLAN\DCDB\USERS\'NAME'\BATCH
NAME ' /D'/D'/****************************************************************************//* CREATE A USER - MODELS AFTER ALREADY CREATED USER*//****************************************************************************/
CREATEM:'CLS';DO I = 1 TO CREATE.O
SAY CREATE.I
END'PAUSE';'CLS';
R-GETUSER( 3, 1);
MODEL-NAME
NAME - ''IF R-0 THEN DO
LANFRONT 'NET USER 'MODEL'
rxqueue /FIFOCALL PULLOUEUE;GROUP. - ""GROUP.O - 0
GR - 0
LI. 0 - LI. 0 - 1
PARSE VAR LI.27 GP MEMB LI.27
DO I = 27 TO LI.O
PARSE VAR LI.I G.1 G.2 .
DO J - 1 TO 2
G.J - STRIP(G.J,, '*')IF G.J'' THEN DO
GR= GR+ 1
GROUP.GR - G.J
END
END
END
GROUP.O = GR
DO FOREVER/* GET USER INFORMATION */'CLS';'

Figure 6d. Source Listing for LANUSER2.CMD

Personal Systems/Issue 4, 1991

46

SAY INF03 MODELSAY INF06 NAME
R- GETUSER(4,0);
IF R - 0 THEN DO
AU - 0
DO WHILE AU - 0 /* GET USER TYPE*/SAYQUEST.lO;PARSE UPPER PULL AU;
IF AU
A & AU
US THEN AU - 0
END
PASSWORD- ''SAY QUEST.8; /**GET PASSWORD */PARSE UPPER PULL PASSWORDCOMMENT -•';SAY QUEST.?; /**GET COMMENT*/PARSE PULL COMMENTSAY INFOS
IF AU- A THEN DO
AU-'ADMIN';END
ELSE DOAU - 'USER' ;END
IF PASSWORD- '' THEN DO
PASSREO-'NO';END
ELSE DOPASSREO='YES';ENDLANFRONT' NET USER' NAME PASSWORD/ADD /PRIV:'AU '/PASSWORDREQ:'PASSREQ/USERCOMMENT: 'ADMINQj jCOMMENTI IADMINQ; /* THIS LINE CONTINUED FROM PREVIOUS, ENTER AS ONE */R=MLIST(NAME, 1)'MD ' ROOT'\DCDB\USERS \ 'NAME;'MD ' ROOT'\DCDB\USERS\'NAME'\BATCH';
DIRY - DD':\IBMLAN\DCDB\USERS\'NAME;
R-ACCESSPRO(SERVER,DIRY);
IF R- 1 THEN DO
LANFRONT
NET ACCESS 'DD':\IBMLAN\DCDB\USERS\'NAME '/GRANT ' NAME':RWCXDAP'LANFRONT
NET ACCESS 'DD':\IBMLAN\DCD8\USERS\'NAME'\8ATCH /GRANT ' NAME':RWCXDAP';ENDELSE DOLANFRONT ' NET ACCESS 'DD':\IBMLAN\DCDB\USERS\'NAME '/ADD ' NAME':RWCXDAP'LANFRONT ' NET ACCESS 'DD' : \IBMLAN\DCDB\USERS\'NAME'\BATCH /ADD ' NAME':RWCXDAP';ENDNET COPY ' ROOT'\DCDB\USERS\'MDDEL' ' ROOT'\DCDB\USERS\'NAME;
NET COPY ' ROOT'\DCDB\USERS\'MODEL'\BATCH' ROOT'\DCDB\USERS\'NAME'\BATCH';
DO I - 1 TO GROUP . O
IF GROUP.I - 'USERS' THEN ITERATEIF GROUP.I - 'ADMINS' THEN ITERATELANFRONT 'NET GROUP 'GROUP.I
NAME' /ADD'
END
R- GETHOME(MODEL)/* find out if user has home di rectory */IF R - 1 THEN DO /* MODEL USER HAS HOME DIRECTORY */PARSE VAR HNAME N. l '\' N.2 '\' N.3 '\' N.4 ' \ ' N.5 '\' N.6'\' N.7 ' \ ' N. 8
DIRH- ''DO I - 1 TO 8
IF N. I - "" THEN LEAVEIF MODEL - N.I THEN LEAVEDIRH - DIRH'\'N.I
END
PARSE VAR DR DR '$'IF MODEL- N.I THEN DO
DIRH - DIRH' \ 'NAME

Figure 6e. Source Listing for LANUSER2.CMD

Personal Systems/Issue 4, 1991

47

'MD \\'SERV'\'DR'$'DIRH
END
SAY INFO?
'PAUSE'DIRY - DR':'DIRH
R=ACCESSPRO(SERV,DIRY);
IF R=l THEN 'NET ADMIN \\'SERV ' l e NET ACCESS 'DIRY NAME':XRWCDAP /GRANT'ELSE 'NET ADMIN \\ 'SERV ' le NET ACCESS 'DIRY NAME';XRWCDAP /A'HDIR = HDIRI IDIRHLANFRONT ' NET USER ' NAME ' /HOMEDIR : 'HDIREND
END
ELSE LEAVE
END /*DO FOR EV ER
END
RETURN;*//****************************************************************************//* GET USER NAME ENTERED BY ADMINISTRATOR*//****************************************************************************/GETUSER:ARG PROMPT ,S
FLAG = 0
DO WHILE FLAG= 0
SAY QUEST.PROMPTPARSE UPPER PULL NAME;
L- length(NAME);
IF L-0 THEN DO
SAY QUEST. 5
PARSE UPPER PULL ANS;IF ANS=YES THEN DO
FLAG=!;RU-1
END;
ELSE NOPEND
ELSE DO;RET - USEREXIST(NAME)
IF RET- 0 & S - 1 THEN DO
SAY ERROR5'PAUSE'END
ELSE DOIF RET - 1 & S - 0 THEN DO
SAY ERROR6'PAUSE'END
ELSE DOFLAG - 1
RU
0
END
END
END
END /*DO WHILE*/
RETURN RU/****************************************************************************//* CHECK EXISTENCE OF A DEFINED USER*//****************************************************************************/USEREXIST:
ARG U
RES-0
DO I = 1 TO USERS.O
IF U - USERS.I THEN DO
RES=l
LEAVE
Figure 6f. Source Listing for LANUSER2.CMD

Personal Systems/Issue 4, 1991

48

END
END
RETURN RES;/****************************************************************************//* ADD OR DELETE USER FROM CREATED LIST OF USERS*//****************************************************************************/
MLIST :ARG U,ACTIF ACT - 0 THEN DO
DO I = 1 TO USERS.O
IF U - USERS.I THEN DO
USERS. I
LEAVE
END
END
END
ELSE DO
USERS . O - USERS.O + 1
URS=USERS.O
USERS.URS - U
END
RETURN O;/****************************************************************************//* CHECK EXISTENCE OF AN ACCESS CONTROL PROFILE*//****************************************************************************/ACCESSPRO:ARG S,DIR'NET ADMIN \\'S' /C NET ACCESS 'DIR'CALL PULLQUEUE;
RES-0
PARSE VAR LI .1 NETMSG '·'IF NETMSG'NET2222' THEN RES - 1
RETURN RES;

I rxqueue /FIFO'/****************************************************************************//* GET HOME DIRECTORY INFORMATION*//****************************************************************************/GETHOME:ARG NAMMODLANFRONT 'NET USER 'NAMMOD'
rxqueue /FIFO 'CALL PULLQUEUE;PARSE VAR LI.22 HO DI HDR '\' SERV '\'DR'\' HNAME.
HDIR- HDR'\'SERV'\'DR
IF HDR - '' THEN DO
PARSE VAR LI.22 HO DI'\\' SERV ' \' DR '\' HNAME .
HDIR-'\\'SERV'\'DR
END
HDIR - STRIP(HDIR)IF SERV = '' THEN RES - 0
ELSE RES - 1
RETURN RES/****************************************************************************//* PULL QUEUE ROUTINE*//****************************************************************************/PULLQUEUE :LI.O = queued();
DO I = 1 TO LI . 0
PARSE PULL LI. I
END
RETURN

Figure 6g. Source Listing for LANUSE R2.CMD

Personal Systems/Issue 4, 1991

49

Micro Focus
COBOL12 andthe DOS
Database
RequesterAndrew Morbitzer
Dallas, Texas
Although IBM OS/2 EE Database
Manager only supports IBM
COBOL12™, today it is not rare tofind that a combination of different
vendor packages and languages
is used. The use of Micro Focus
COBOL12 is demonstrated here
using a sample program.

Many customers are finding the
DOS Database Requester a desirable
step in the evolution from DOS to
OS/2 systems. Some are choosing

Micro Focus COBOL/2 to implement DOS Database Requester applications. Because Micro Focus does
not develop the OS/2 Database Manager, some programmers may wonder if there are reasons not to use
Micro Focus COBOL/2 to develop
applications. The following demonstration should alleviate insecurities
about using Micro Focus COBOL/2
to produce DOS Database Requester
applications to run against a database server running IBM OS/2 EE
1.3 and Database Manager.
The program in Figures la and lb
was developed to illustrate the useof Micro Focus COBOL/2. It runs
on a DOS Database Requester andcatalogs the SAMPLE database,which is included with IBM OS/2
EE 1.3 and exists on a database server. The environment for this application is:• A PS/2 Model 80-A31 running
IBM OS/2 EE 1.3• A PS/2 P70 running DOS 4.01
and IBM Local Area Network
Support Program 1.2• An 8228, which provides the to-

ken ring connection between theserver and requester
Note: The environment is best set up
and understood with the help of thearticle "Installing and Using the
DOS Database Requester" in Issue
2, 1991, of IBM Personal Systems
Technical Solutions, 0325-5011.
The procedure described here would
follow the steps in that article.

The DOS machine used to run the
program had Micro Focus COBOL/2
with updates to version 2.4.37.
(When installing Micro Focus
COBOL/2, choose to install for
DOS only.) Also installed on the,,-//No~ I m e a n ~ - - -Put 5ome doth~:> on c1nd ad like.
adults, o~!our federationtnember.5nip b history\

~.,

~

t~
d1

.,-;,.fHl.. S

Personal Systems/Issue 4, 1991

\Iii

1wi "
l+1J

50

DOS machine were the IBM C/2 libraries. No fixes were applied to thelibraries, and they were set up forreal mode. Installing the IBM C/2 libraries is required to give your program access to LLIBCA.LIB during
the LINK step. The machine used
for compiling these programs had
Micro Focus COBOL/2 installed in
the C:\ COBOL directory. The following files were copied into thisdirectory:gram is ensuring that the databasecalls and parameters the programmer
wants to use are supported by DOS
Database Requester. A few calls thatrun on an OS/2 database requester
will either not be available to a DOS
Database Requester, or need to bemodified to run properly on a DOS
machine. The program in Figure I,
which catalogs a database, is an example of this.

• LLIBCA.LIB• PCDRSTAT.LIB• SQLCA_.CBL.
The SQLCA_.CBL and
PCDRSTAT.LIB files are located in
the \DBDRQLIB. The
SQLCA_.CBL file is the only .CBL
file needed for the program in Figure 1, however, other .CBL files
from the \DBDRQLIB directory
may be needed for your Micro Focus COBOL/2 programs. One such
file is the SQLDA_.CBL file used toprocess dynamic SQL statements.
These files must be copied into the
C:\COBOL directory to ensure thatthe compile and link steps have access to the proper external files. If
you do not copy the external files
into the directory where the compiling will be done, you must ensurethat the environment gives access tothese files. Adding the directories
where the external files are locatedto the ' PATH = ' statement in the
AUTOEXEC .BAT file on the DOS
Database Requester will give the required access. This alJeviates theneed to copy all the required files
into one directory.
Once the machines have been properly configured, the following steps
are required to actually get the program running.
The first step to creating a successful DOS Database Requester pro-

After the program has
been written, the second
step is precompiling itwith the SQLPREP
instruction.

On an OS/2 database requester, oneof the parameters for the catalog
function calJ lists whether the database is local or remote. If local is indicated, another parameter lists thedrive on which the local database exists. The same call for DOS Database Requester ignores the local or
remote parameter, because DOS machines cannot have local databases,
and the call uses the drive parameterto list whether adapter O or adapter 1
is to be used for the communications.
After the program has been written,
the second step is precompiling itwith the SQLPREP instruction. The
program must end with ' .SQB ' . The.SQB signals the precompiler that a
COBOL program needs to be precompiled. The precompiling of thecatalog program for this article used
the IBM precompiler included withIBM OS/2 EE 1.3. The Micro Focus
precompiler was not tested.

Personal Systems/Issue 4, 1991

The SQLPREP does many things forthe program. SQL inside the program is replaced with COBOL function calls to be used by the COBOL
compiler. SQLPREPing the program
can also allow the OS/2 Database
Manager optimizer to build an access plan to the data according to
the current statistics that Database
Manager holds about the database.
During SQLPREP, you have the option to defer binding, which meansthat your program will not build anaccess plan to the data in the database. Deferring the bind step meansthat you must go back and perform
an SQLBIND later, but before running the program.
Many programmers and programming shops choose to defer binding
to ensure the access plan for theirprogram is up to date. Care should
be taken that first-time programmersof OS/2 database requester applications be sure to bind their executables if they have previously chosen
to defer binding. Whether binding isdeferred or not, the output of theSQLPREP is a .CBL file that will be
used when compiling.
The third step is compiling the application. Two versions of each copy
file are needed to compile a COBOL
database requester application. One
version includes no underscore, suchas SQLCA.CBL, and is intended foruse on OS/2 applications. The otherversion includes an underscore, suchas SQLCA_.CBL, and is intended
for use on a DOS application. Examination of the SQLDA_.CBL andSQLDA.CBL files included with
OS/2 EE 1.3 shows that these are
identical files. SQLCA.CBL andSQL CA_.CBL are also identical forthe 1.3 release. The other .CBL files
are different for DOS; OS/2 will notwork as intended all of the time if
the incorrect version is used. The
programmer should inspect the .CBL

51

files in the \SQLLIB directory for
differences before assuming that thefiles required for DOS Database Requester applications will work on
OS/2 Database Requesters.
Performing the precompile, compile,and link steps on an OS/2 machinefor testing may make program development simpler by removing someobstacles that may be present whenmoving back and forth between
DOS and OS/2. Precompiling andbinding can be done only on an
OS/2 machine. Compiling the application for introduction into the production environment is best done on
the DOS machine after Micro Focus
COBOU2 has been installed according to the instructions in the beginning of this article.
No special compile options wereused for the test programs run forthis demonstration. The testing done
fo und that including many compil er
directives can cause problems thatare not easily traceable. A good recommendation is to begin with a simple program before adding complex
procedures and directives. Nochanges should be made to the
COBOL.DIR file after installation
until a DOS database requester program is running with the default
COBOL.DIR.
Once compiling is complete, link the
program. You can use either the Micro Focus LINKer or the IBM OS/2
LINKer. The IBM LINKer should
be used if you intend to use the IBM
support path. The only link libraryspecified is the PCDRST AT.LIB. If
you choose, you can explicitly
specify the PCDRSTAT.LIB,LCOBOL.LIB, and LLIBCA.LIB
when asked for libraries on the
LINK step; however, the LINKer
will automatically make use of the
LCOBOL.LIB and the LLIBC

A.LIB. No other special link options
were used for the program in Figure
1. Again, use only the basic libraries
and wait until a simple application isrunning before adding more libraries.

Compiling the application
for introduction into the
production environment isbest done on the DOS
machine after Micro
Focus COBOU2 hasbeen installed.
Before running the programs, youmust issue SQLLOGON from the
DOS Database Requester commandprompt. This is so that when the'start using database' is issued fromyour program, the database server
can verify that the user has access tothe database. The SQLLOGON.EXE
is one of the files that is copied onto
the DOS Database Requester fromthe \DBDRQLIB directory on the database server. Once the program isprecompiled (SQLPREP), compiled,and linked, you can begin trying to
run it. To look for the errors in the
COBOU2 DOS Database Requester
programs, make generous use of display statements and the SQLCODE.
(A few examples of error handlingin COBOL programs can be referenced in the IBM OS/2, Extended Edition Database Manager Version 1.3
Programming Guide and Reference,
Volume 2 (S0lF-0292) in the section on programming with
COBOU2.)A concern when compiling Micro
Focus COBOU2 is the size of the

Personal Systems/Issue 4, 1991

executable module. Care must be
taken to ensure that this module canbe loaded and run in the memory
left after any device drivers and
IBM DOS have been loaded. Micro
Focus has a memory management
facility caJled XM that is available
with the Toolset and the Workbench. It allows for programs requiring more space than DOS provides
under the 640 KB barrier. However,
you should be familiar with the useof relocatable .GNT or .INT codeand the runtime environment provided by the Toolset and Workbench
products before creating applications
too large for the available memory
in DOS. Micro Focus COBOU2DOS Database Requester applications can be developed with no more
effort than that required to develop
an OS/2 database requester application. You must ensure that the
COBOU2 environment is using
DOS. Once Micro Focus COBOU2
is set up, you should find its environment very robust for developing
DOS Database Requester applications, and you will be able to use theMicro Focus tools available for
COBOL application development.

ABOUT THE AUTHOR
Andrew Morbitzer is part of IBM 's
OS/2, Application Assistance Center
team, working through thecooperative education program. He
spends much of his time on OS/2,
Database Manager pe,formance andproblem management at customer
locations. He holds a B.B.A. inmanagement information systems
from Texas A&M University and iscurrently studying for his M.B.A. inbusiness computer information
systems at the University of North
Texas.

52

IDENTIFICATION DIVISION.
PROGRAM - ID.

DOS-DB-REQUESTER.

*************************************************************************************

This COBOL program is an example of how to catalog a remote
database from a DOS Database Requester.

*************************************************************************************ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION .

***********************************************************************************

*

*

SQLCA

***********************************************************************************EXEC SOL INCLUDE SQLCA END-EXEC.

***********************************************************************************

*
*
*
*
*

SQLENVThe SQLENV _ is special to the DOS DB Requester.
The OS/2 SQLENV
does not include the underscore character.
When the .CSL file
is compiled on the DOS machine, this file will be copied fromthe \DBDROLIB directory.

*
*
*
*
*

***********************************************************************************COPY SQLENV _ .

************************************************************************************

VARIABLES TO PASS TO CALLS************************************************************************************
77
77
77
77
77

COMMENT-LENGTH
NN- LENGTHALIAS- LENGTH
DB- LENGTH
CMT - CODE - PAGE

PIC
PIC
PIC
PIC
PIC

S9(4)
S9(4)
S9(4)
S9(4)
S9(4)

VALUE
VALUE
VALUE
VALUE
VALUE

22
8
6
6
0

COMP-5.
COMP - 5.
COMP-5.
COMP-5.
COMP-5.

************************************************************************************ I used DRIVE so that my example wi 11 use the same variable names as the* IBM OS/2 Ex tended Edit i on 1.3 Database Manager Programming Guide and* Reference Volume 2: Reference on page 3-11. However, the DRIVE should* contain the reference to either adapter O or 1 for a DOS DB Requester.

*
*
*
*

***********************************************************************************
77 D
77 DRIVE
77 T
77 DTYPEPIC X.
REDEFINES D
PIC 9(4)COMP-5.

PIC X.
REDEFINES T
PIC 9(4)COMP - 5.

77 COMMENTPIC X(23) VALUE 'REMOTE SAMPLE DATABASE ' •77 NODE-NAME
PIC X(9)VALUE 'ANDREWCM'.
77 ALIASPIC X(7)
VALUE 'SAMPLE'.
77 DATABASEPIC X( 7)
VALUE 'SAMPLE'.
PROCEDURE DIVISION.
PERFORM 7000-CATALOG

Figure la. Sample Program

Personal Systems/Issue 4, 1991

53

THRU 7000-EXIT.
PERFORM 8000-TERMINATE
THRU 8000-EXIT.
STOP RUN .
7000 - CATALOG.

**********************************************************************************

*
*
*
*

The following MOVE statements mo ve O for the adapter number to D
and move 1 to database type T.
The database type of 1 indicatesa remote database.
The database type is for an OS/2 requester andis not used by DOS DB Requester .

*
*
*
*

**********************************************************************************MOVE O TO D.
MOVE 1 TO T .

*************************************************************************************The COBOL form of the following call to catalog a remote database isshown on page 6-17 of the IBM OS/2 Extended Edition Version 1.3
Database Manage r Programming Gui de and Reference Volume 2: Reference.

*************************************************************************************CALL •SOLGCATD. USING DATABASEALIASNODE - NAMECOMMENTSOLCA
BY VALUE DTYPEBY VALUE CMT - CODE - PAGEBY VALUE DRIVEBY VALUE DB - LENGTHBY VALUE ALIAS - LE NGTHBY VALUE NN-LENGTHBY VALUE COMMENT - LENGT H.

DISPLAY'This is the SOLCODE from Cataloging -'SQLCODE .

7000 - EXIT.
EXIT.
8000 - TERMINATE.
IF SQLCODE - 0
DISPLAY 'The program has ended normally 'ELSE
GO TO 9000 - SQL-ERROR .
MOVE O TO RETURN-CODE.
8000- EX IT.
EXIT.
9000 - SOL-ERROR.
DISPLAY 'A fatal SOL error has occured with SQLCODE: 'DISPLAY 'The program has ABNORMALLY ended'.
GOBACK.

Figure lb. Sample Program

Personal Systems/Issue 4, 1991

SQLCODE.

54

IBM DOS 5.0
Facts andFeatures
Midge Portney
IBM Corporation
Boca Raton, Florida
If you are a DOS user and have experienced RAM CRAM (notenough room in conventional
memory to run everything you
want to run at the same time),
then IBM DOS 5.0, the tenth andlatest version of IBM's single tasking operating system, is for you.

Memory, memory, memory ....
Memory relief with DOS 5.0 can bequite dramatic. If your system is an80286 or higher with at least 1 MBof memory, parts of DOS can be
moved into an area outside of theconventional 640 KB memory area.
Thjs means your operating system isusing less than 20 KB of conventional memory. For other hardware,
DOS 5.0 is approximately 49 KB,
using a little more memory than
DOS 3.3, but less than DOS 4.0.
IBM DOS 5.0 replaces and is upwardly compatible with IBM DOS
3.3 and IBM DOS 4.0. The featuresof DOS 5.0 are improved memory
and file management, and improvedand expanded utilities.
DOS 5.0 is available in two separate
packages:• The IBM DOS 5.0 Upgrade (U.S.
offering) for U.S. users who havea previous level of IBM DOS(between 2.1 and 4.0) installed on
the fixed disks of their IBM systems. The upgrade is priced atabout one-half of the base DOS
product price. Once the upgrade
is installed, the DOS 5.0 code is

the same as the base DOS 5.0
product.
• The IBM DOS 5.0 base product(worldwide offering) is for U.S.
users who do not have a previous
level of IBM DOS (between 2.1
and 4.0) already installed on the
fixed disks of their IBM systems
and all IBM DOS non-U.S. customers. European countries offer
the IBM DOS 5.0 base product atfull and upgrade prices.

Installation
Installation of both DOS packages is
simple: the user inserts diskette# 1
in the A drive and reboots. The default configuration puts DOS into
the high memory area and loads
SETVER.EXE. (SETVER allows applications designed for a specific version of DOS to run on DOS 5.0.)
When the IBM DOS 5.0 Upgrade isused, the existing AUTOEXEC.BAT
and CONFIG.SYS get merged withthese statements. In addition, the default configuration makes DOS
come up under the DOS Shell.
If you boot your system with the default configuration that is created
when you first install the base package, you will be surprised and delighted to find 616 KB of available
memory.

Memory Management
DOS 5.0 includes two memory management device drivers that are
based on older versions distributedwith DOS LAN Requester and Microsoft® Windows™ 3.0. Because
the device drivers have been improved for DOS 5.0, make sure you
use these new versions instead of
the ones supplied with Microsoft
Windows 3.0 or DOS LAN
Requester.

Personal Systems/Issue 4, 1991

• HIMEM.SYS manages the use ofextended memory according to
the Extended Memory Specification (XMS). This includes thehigh memory area (HMA), which
is where DOS will be loaded.
(HMA is the first 64 KB of extended memory above l MB.)
This driver must be loaded before
loading any other device drivers
that use extended memory (suchas SMARTDRV.SYS,RAMDRIVE.SYS, andEMM386.EXE).
• EMM386.EXE uses extended
memory to emulate expanded
memory only on 80386 andhigher systems. You must have
HIMEM.SYS loaded before thisdriver can be used. (The default
amount is 256 KB, but you willprobably want to increase it.)
EMM386.EXE replaces
XMAEM.EXE andXMA2EMS.EXE.

Upper Memory Block: The upper
memory block (UMB) area is thearea between 640 KB and 1 MB. Although this entire area is reservedfor hardware, expanded memory
pages, and video buffers, once thesystem is fully configured there aresome areas that are unused. DOS 5.0
can use these areas to load either device drivers or terminate-and-stayresident (TSR) programs, thereby
freeing up conventional memory(the first 640 KB of memory). You
must have EMM386.EXE loaded touse this area, and it is used only on
80386 and higher systems.
The DOS device drivers that can beloaded in this area (using the
DEVICEHIGH command) are:•

EGA.SYS•DISPLAY.SYS•

ANSI.SYS•RAMDRIVE.SYS

55•

DRIVER.SYS•

SMARTDRV.SYS•

PRJNTER.SYS

Two of these drivers are new withDOS 5.0:• RAMDRIVE.SYS creates a temporary disk in RAM, or conventional memory. Use IE to create
the disk in extended memory andI A to create it in expanded
memory.
This replaces VDISK.SYS.
• SMARTDRV.SYS creates a disk
cache in extended or expanded
memory. This replaces
IBMCACHE.SYS.
The DOS TSR programs that can beloaded in the UMB area (using the
LOADHIGH command) are:• DOSKEY.COM• MOUSE.COM• DOSSHELL.COM• KEYE.COM• GRAPHICS.COM• NLSFUNC.EXE

To fully utilize the UMB area, load
the largest drivers and/or programs
first, because DOS will use the largest space as the "HIGH" commands
are processed sequentially.
To obtain a memory map, use
MEM IC; to view the memory usage, use MEM/DEBUG; to print,
use MEM /C > LPTl.

• MODE.COM• SHARE.EXE• PRJNT.EXE• APPEND.EXE
The CONFIG.SYS file must havethe following sequence before the
UMB area can be used:

DEVICE=C:\00S\HIMEM.SYS
00S=HIGH,UMB
DEVICE=C:\DOS\EMM386.EXE
NOEMS (or RAM)DEVICEHIGH=mydriver.sys
Place the LOADHIGH statements in
the AUTOEXEC.BAT:LOADHIGH myprog.exe

If you are using a VGA color display in graphics mode, you can use
the area normally reserved for the
monochrome display (B000-B7FF).
If you don't run BASIC programs or
use the DOS 5.0 full-screen editor,
you can use the IBM BASIC ROM
area (F600-FDFF) (except on the
PS/2 Model 57). When using thesewith EMM386.EXE, include parameter (l=B000-B7FF l=F600-FDFF) to
increase your UMB space by 64 KB.

In addition, use your system's reference diskette to consolidate the various adapter BIOS and data areas.
For example, for XGA and TokenRing (16/4), change the token ring

Personal Systems/Issue 4, 1991

adapter addresses from D000 to
C0OO.

DOS Shell
The DOS Shell on IBM DOS 5.0
can perform application context
switching in a suspend/resumemode. The applications must be
loaded within the DOS Shell. These
applications are swapped to disk or
to extended memory.
Some DOS Shell highlights are:
• Active task list
• View of directories on the current
disk• View of several directories at one
time• Ability to rename a directory• Look and feel of OS/2 Presentation Manager and Windows 3.0

Differences between
DOS 5.0 and DOS 4.0
Most of the DOS 5.0 files are compressed (as denoted by an underscore "_" in the file extension) on
the diskettes. In order to use them,

56

they must be expanded using the
new EXPAND.EXE utility.

adapter (EMS 3.2 or 4.0), use thedriver supplied by the manufacturer.

In DOS 4.0, ANSI.SYS has a switch/L, which keeps the number of rows
set by the mode command as you
switch between text and graphics applications. Because of its many incompatibilities with some
applications, this support was eliminated from DOS 5.0.

If your mouse doesn't work properlywith the DOS 5.0 Shell, you may
need the new MOUSE.COM version
7.04, which is supplied with DOS
5.0 but doesn't get installed automatically. Installation information isfound in the Getting Started manual.

VDISK.SYS has been replaced by
RAMDRIVE.SYS, which has thesame function. Any programs thatused VDISK.SYS should be updated
to use RAMDRIVE.SYS.
DOS 5.0 has two BASIC programs:
QBasic and BASICA. In order for
QBasic to run BASICA programs,
the BASICA programs must be
saved in ASCII mode, using thecommand:(SAVE "filename", A).

In BASICA, the default is to save afile in binary mode.
BASICA in DOS 5.0 is larger thanin DOS 4.0, because it will support
PS/2 systems with less BASIC codein the BIOS, such as the PS/2 Model
57. Previous PS/2 models contained
32 KB of BASIC in BIOS. Newer
machines contain only 5 KB, andthat code now resides in theBASICA.COM file.
The expanded memory device
drivers XMA2EMS.SYS andXMAEM.SYS have been replacedby the higher performance
EMM386.EXE. As the name implies, EMM386.EXE only has support for memory on 80386 systems.
If IBM XMA adapter support isneeded for an 80286 system, theXMA2EMS.SYS file can be obtained through IBM DOS 5.0 service. If you have a non-IBM memory

The DOS 5.0 Shell doesn't recognize the .MEU extension of files created by the DOS 4.0 Shell. The
utility MEUTOINI will convert
these files for you. If you are installing the upgrade, it will be run automatically. Changes have been madeto functions of the Shell, and certain
installation switches are no longer
supported. Further information isfound in the Getting Started manual.
In DOS 4.0, SHARE was loaded
automatically to support hardfile partitions of greater than 32 MB. DOS
5.0 has improved partition support,with a savings of 8 KB, and nolonger requires SHARE.

New and Enhanced Utilities
Here are the new utilities in
DOS 5.0:• Doskey provides command line

history and macro capability.
• Unformat complements the newsafe format.
• Undelete has the ability to re-cover deleted files.
• Fe is a second file compare utility

that compares two files of different sizes.
• Setver allows applications tothink there is a different level of
DOS on the system. (For instance, some applications require
DOS 3.3.)
Here are the enhanced utilities in
DOS 5.0:

Personal Systems/Issue 4, 1991

• Dir has sort options, attribute fil-ter, and DIR/SUBDIR file matches• Format has safe format as the de-fault and saves control data.
There is also a quick format
option.
• Attrib allows the manipulation ofsystem and hidden files• Restore has a ID option that willallow users to view the backed-up
file list.

OS/2 Dual Boot
When installing DOS 5.0 on a dualboot system, before leaving the
OS/2 command prompt, you must
point to the DOS directories by typing BOOT /DOS. In addition, during the installation, if you are asked
if you want to replace all occurrences of your files, say "NO" because some DOS and OS/2 files
have the same name. A DOS FAT
partition must be located before an
OS/2 high performance file system(HPFS).

OS/2 Upgrades
When OS/2 2.0 becomes available,
you will be able to upgrade yourDOS 5.0 to OS/2 2.0.

DOS 5.0 and PS/1 TM
To install DOS 5.0 on a PS/1 , the environment must point to the fixed
disk instead of to ROM DOS, sothat you can start your PS/1 fromfixed disk instead of from ROM.
There are certain things you need toknow, so refer to the PS/1 documentation before installing DOS 5.0.
Your ROM Shell will no longer
work.

DOS 5.0 Changing Hardfile
Partition SizeIf you have a fixed disk that islarger than 32 MB and is partitioned
to 32 MB with your current version

57

of IBM DOS, you may repartition
the fixed disk to any size. Install
DOS 5.0 over your current versionof IBM DOS. Although the upgrade
was designed for this, you may also
use the base DOS 5.0 program. If
you are using the upgrade, back up
your current level of DOS with the
backup option of the install. Once
DOS 5.0 is installed, try it out andmake sure that it works to your satisfaction. Then do a complete backup
of all of the disk partitions on yourfixed disk using the BACKUP
command.
Create a boot diskette in the A driveby formatting a blank diskette with
JS. Also on the diskette, copy
FDISK, FORMAT, and RESTORE
from your DOS 5.0 subdirectory.
Copy your favorite editor, too. (Ifyou choose the editor on DOS 5.0,
copy over QBASIC.EXE and
EDIT.COM.) Remove the diskettefrom the A drive. Use FDISK to set
up your new partition (you will be
erasing your fixed disk, so makesure you backed it up). This will instruct you to restart DOS with theboot diskette in the A drive.
Once you have restarted the machine, run FORMAT /S from theboot diskette and format yourhardfile. Then you can reinstall DOS
5.0 using your DOS 5.0 program. After it is installed, do a RESTORE of
your backup diskettes. Use caution
if you've had identical subdirectory
names on different disk partitions.

DOS 5.0 and 7552 Industrial
Gearbox TM
A special parameter with the
HIMEM device driver is required in
the CONFIG.SYS to load DOS
HIGH on the IBM Industrial Computer Model 7552. When you havecompleted the initial DOS 5.0 installation, before you use Ctl-Alt-Del toreboot, press F3 to get out of theinstallation procedure, put the firstDOS 5.0 diskette in the A drive, andedit CONFIG.SYS in the root of C
to include this parameter:

DEVICE= C:\DOS\HIMEM.SYS/MACHINE:15
If you have HIMEM.SYS loaded

without /MACHINE:15, the 7552
Industrial Gearbox will hang when
you try to boot your system.
All other industrial computers will
work fine as installed.

A new feature, commandline help, is accessed byentering help or thecommand name fallowedby/?.

Online Documentation
To help you understand DOS 5.0 better, files with compatibility and howto information are provided. In
addition, there is an important file(on diskette #2 of the 3.5" package
and diskette #3 of the 5.25" package) called the PACKING.LST file.
This file tells you on which diskettes
all of the DOS files are located. (Ifyou are installing to diskette, it will
also tell you which files are on thetarget diskettes.)
README.TXT has the latest online information. It contains additional information on memory,
OS/2, Windows, mouse drivers, anddifferent networks.
APPNOTES.TXT will help you run
existing applications with DOS 5.0.

Personal Systems/Issue 4, 1991

It gives you tips and techniques to
get maximum productivity as
quickly as possible with this latest
version of DOS.
A new feature, command line help,
is accessed by entering help or thecommand name followed by/?.
"Help" lists all the commands andtheir functions. Can't remember thesyntax for the del command? Typedel/?

and not only will you get a brief explanation, but the permissible syntax
functions, as well.
The installation feature has function
keys that give you help or allow you
to return to a previous screen or exit
the program. The help is so complete you may never have to open
the documentation. To start the installation, just put diskette #1 of the
DOS 5.0 or the DOS 5.0 Upgrade inyour computer and start your system(Ctl-Alt-Del).
You will enjoy losing yourself in thelevels of DOS Shell help, and it isequally accessible with the mouse or
keyboard. Put your book away andprepare for an online adventure!
For upward compatibility, BASICA(BASIC interpreter) and EDLIN(line editor) continue to be available.
A second BASIC interpreter program, QBasic, with advanced features and a full-screen editor, EDIT,
are exciting additions to the product.
To find out some of the differences
between QBasic and BASICA, andthe conversion requirements to use
QBasic to run your BASICA programs, look at the "Survival Guide,"which is the first screen after invoking QBasic. Choose "Contents," andthen "Converting BASICA Programs." (DOS 5.0 has a program,
REMLINE.BAS, that helps in the58

conversion.) Working through thesescreens gives you a lot of information that will make you comfortablewith QBasic without ever opening a
book! All documentation for QBasicis online.
Although the full-screen editor ispart of QBasic, you can type "edit"
to start it, without going into QBasicfirst. It is a text-mode editor withblock and line marking, has mouse
support, and full online
documentation.

DOS 5.0 and Network
SupportWith each new version of DOS,
your network must be modified accordingly. The network code needed
to use DOS 5.0 with the IBM PC
LAN program, IBM DOS LAN Requester, or Novell NetWare is included in the IBM DOS 5.0
Upgrade. This is the first time that
DOS is supplying network support
in its initial offering. If you have another type of network, call IBM
Service or your network supplier.

Service
A good service and support structure
is a key priority. Users want to beable to ask questions - quickly andeasily. IBM has broadly expanded
service and support to include both atoll-free number and access to an
Electronic Bulletin Board. The tollfree number is 1 800 237-5511 andthe customer number is DOS 5692.
Corrective Service Diskettes will beavailable at your IBM Authorized
Dealer, through the toll-free number,
IBM branch offices, or the Electronic Bulletin Board (National Support Center, Atlanta, 404 835-6600).
The DOS 5.0 service information
card gives details about the enhanced service.

National Language Support
Ever want to send a letter to someone in Turkey? Your U.S. version of
IBM DOS 5.0 supports Turkish characters as well as a host of others. A
small booklet titled Keyboards andCode Pages is included with DOS
5.0. This booklet has keyboard layouts (when you choose to write with
Turkish characters, your keyboard
layout will change), code page tables, and available accented
characters.

Although the full-screen
editor is part of QBasic,
you can type "edit" tostart it, without going into
QBasic first.

Hardware Support
The following new hardware features are supported in DOS 5.0:
• The new 2.88 MB I-inch highdiskette drives are high-density(2.88 MB, also known as 4 MB)
3.5-inch diskette drives. These all
have media-sensing capability.
• Some models of 1.44 MB and2.88 MB diskette drives have media-sensing capability. With thisfeature, when you format a diskette, the system recognizes thetype of diskette in the drive andformats it accordingly. Previously, the FORMAT command
was used to format a diskette according to the size of the drive
containing the diskette. For example, a 1.44 MB diskette drive formatted a 720 KB disketteincorrectly as 1.44 MB. The de-Personal Systems/Issue 4, 1991

fault in the FORMAT statement
was the size of the drive. This
could cause data errors. With media-sensing, such errors areprevented.
• The 3.5-inch Read/Write Optical
Disks are new IBM products thatallow large amounts of data to be
stored on an optical disk. New
multimedia sound and motion
technology, which requires vast
amounts of data, is one of themany uses for these disks.
• Keyboards that now have DOS
5.0 support include the 122-key
host-connected PS/2 keyboard
and the 106-key Japanesekeyboard.

Extended DOS Support
ACCESS DOS is a supplement to
IBM DOS 5.0 that provides extended keyboard, mouse, and soundaccess for IBM DOS users. It is very
helpful for people with disabilities.
Here are some features:• Sticky keys - allow sequential
rather than simultaneous processing of keystrokes (likeCtl-Alt-Del)• Mouse keys - allow the numeric
keypad to perform like a mouse• Repeat keys - customize how fast
held-down keys repeat• Slow keys - customize the lengthof time a key is pressed before itis processed• Bounce keys - prevent double
characters from being processed• Serial keys - allow control of the
keyboard and mouse through an
input device (not included)• Toggle keys - use beeps to indicate when Caps, Num, and Scroll
Lock keys are activated59This supplement is available free ofcharge through IBM. Call
1 800 IBM-2468.

grade will install to either fixed disk
or diskette.
MS-DOS will install across a LAN.

IBM DOS 5.0 and
MS-DOS® 5.0 Upgrade
What are the differences between
IBM DOS 5.0 and Microsoft's MSDOS Upgrade? Both IBM DOS and
MS-DOS, once installed, have thesame commands and essentially thesame documentation. But IBM has"customized" the generic MS-DOS.
MS-DOS 5.0 is offered only as an
upgrade to a previous DOS system.
IBM offers the choice of the DOS
Upgrade, which is competitively
priced, and the base DOS 5.0, for users who do not already have DOS
installed. The base DOS will also
work on systems that have a previous level of IBM DOS installed.
MS-DOS has been tested on clone
hardware thoroughly; IBM has gonea step further in testing IBM DOS
on IBM hardware.

Install: MS-DOS 5.0 and IBM
DOS 5.0 both offer upgrades to an
existing DOS system. IBM DOS Upgrade is self-booting, installs only
over an existing IBM DOS from 2.1
through 4.0, and will not install todiskettes. In addition, IBM DOS 5.0
Upgrade requires you to have IBM
hardware. If you are a user of IBM
DOS prior to DOS 2.1 or an IBM
DOS user with a diskette-only configuration, you can call l 800 IBM7699 to purchase a copy of the full
package at the Upgrade price. MSDOS does not check for any of thesethings except for the existence of aprior DOS. It does this by running
the install as an application (yoursystem must be running before you
can start the MS-DOS install by typing A:SETUP). MS-DOS 5.0 Up-

Hardware: Although MS-DOS 5.0
Upgrade will install to all systems
and IBM DOS, once installed, isonly warranted on IBM hardware,
the base IBM code is functionallythe same (except for BASICA,
QBasic, and EDIT). QBasic and
EDIT may require an update from
IBM. Please see additional information under "BASIC/Editor." If a
problem is found using IBM DOS
on clone hardware, the user can call
IBM for service and support. If, after analysis, IBM determines that it
is not a problem in the IBM DOS
product, then IBM refers the user tothe appropriate hardware vendor.

Both IBM DOS and
MS-DOS, once installed,have the same commands,
and essentially the same
documentation. But IBM
has "customized" thegeneric MS-DOS.

can be created and RIPL' d with MSDOS diskettes; however, OS/2 LAN
Server's "parameter passing" feature(to allow workstations to use thesame image) does not work.

BASIC/Editor: MS-DOS ships
with only QBasic, and even though
prior versions had GW-BASIC (similar to BASICA), it is no longer
shipped with DOS 5.0. If IBM DOS
5.0 is installed on non-IBM hardware, an updated QBasic is requiredfor QBasic and EDIT (the fullscreen editor) to run properly.
BASICA will not work on non-IBM
hardware. If you do not have
QBASIC.EXE dated 8/16/91 orlater, please call IBM Service. You
can also get this module from yourdealer, your IBM branch office, or
the Electronic Bulletin Board.
Support Unique to IBM:
8514A - Using MS-DOS 5.0 with acolor display and the IBM 8514A
adapter, the install and DOS Shell
come up in monochrome. IBM DOS
works properly in theseenvironments.
CD-ROM SETVER - Users shouldmake sure the following statement is
added to the SETVER table if they
are using IBM DOS 5.0 (MS-DOS
has it included).

SETVER MSCDEX.EXE 4.00
Remote IPL: There are some differences that may affect the user. The"hidden" files IBMBIO.COM andIBMDOS.COM are known as
IO.SYS and MSDOS.SYS in MSDOS 5.0. This difference affects the
remote IPL feature (RIPL). IBM
DOS may be installed by an OS/2
LAN Server for use by DOS RIPL
machines without having to create
separate boot images for each workstation. Because the MS-DOS system file names are different (IO.SYS
and MSDOS.SYS), the boot images

Personal Systems/Issue 4, 1991

SHELL/MOUSE support - For users
of DOS 4.0, there is a conversion
utility that will update the MEU
files to the IBM DOS Shell 5.0 format. In addition, the 5.0 Shell-compatible mouse is included in IBM
DOS 5.0, although this is available
through MS support.
4755 Cryptographic adapter with
EMM386 - IBM DOS 5.0 supports
the use of the 4755 Cryptographic

60

adapter if EMM386 is loaded. MSDOS does not.

the memory management Novell
drivers.

National Language Support - Country support for Greece, Turkey, andIceland are available in IBM DOS
5.0, but not in MS-DOS 5.0.

Drivers for 3COM networks and
LAN MAN networks are included in
MS-DOS. These drivers are alsoavailable on CompuServe in the
MSNETWORKS forum, library one,
supplemental disks. Try searchingfor "supp." Call 3COM for additional information on the 3COM network products.

Corrective Service Diskettes(CSD): IBM has a policy of issuing
CSDs periodically to better serve
customer needs. In the past Microsoft has not provided this.
Uninstall Option: During installation , the IBM DOS 5.0 Upgrade
gives the user the option of creating(or not creating) UNINSTALL diskettes. MS-DOS does not give theuser this option; the user must copy
some of the "old DOS" files onto
diskettes. MS-DOS also copies
many of the "old DOS" files into aseparate directory of the fixed disk,
limiting available fixed disk space.
Bootable Diskettes: MS-DOS 5.0
diskettes are not bootable, but rather,
are run as an application . Thismeans enough memory has to beavailable, with a stable environment,
to ensure smooth installation. Because both IBM DOS 5.0 products
are bootable, this is not a problem
for the IBM products.
The IBM DOS self-booting feature
is valuable for the repartitioning ofhard disk drives and for recoveringfrom computer viruses.

Network Support: IBM DOS 5.0
Upgrade contains full Novell NetWare drivers, including EMS and
XMS support. MS-DOS upgrades
only the base memory driver fromNovell; therefore, the memory you
save with MS-DOS 5.0 is used for
the Novell drivers. With IBM DOS,
you achieve memory savings and get

To use IBM DOS 5.0 with Banyan
Vines 4.0X, on the command line
type SETVER REDIR4.EXE 4.0.
MS-DOS 5.0 already has this statement in the SETVER table. Banyan
Vines 4.10 has DOS 5.0 support andis available.

The End User Bulletin Board for
IBM is Electronic BBS and
NSC/Atlanta, while Microsoft uses
CompuServe. Both Microsoft andIBM have 24-hour/7-day phone numbers to report a problem. The IBM
Support Center number is 1 800 2375511; the MS Automated Support
System number is 1 800 646-5103.
For technician support, IBM has programming services available Monday through Friday for 8 hours per
day for I year(] 800 237-5511) ; Microsoft has Technician support Monday through Friday 8 hours per day
for 90 days, with support after 90
days at $2 per minute (1 900 8969000) or $20 per call (206 6465108).

ABOUT THE AUTHOR

The IBM DOS
self-booting feature isvaluable for the
repartitioning of harddisk drives and forrecovering from computerviruses.
Service: The service philosophiesof IBM and MS differ; each supports the customer a little differently. IBM offers free service forone year, while Microsoft offers it
for three months. IBM Corrective
Service Diskettes are cumulative
fixes available to all customers. Microsoft corrective service is a single
fix to a customer with a problem,
and Microsoft uses CompuServe to
make certain fixes available tocustomers.

Personal Systems/Issue 4, 1991

Midge Portney is the external
compatibility planner for entry
operating systems and extensions.
She has worked in DOS/FORTRAN
development and system software
compatibility testing for DOS at
IBM's Entry Systems Division.
Midge has a B.A. in mathematics
from Antioch College, a B.A. in
computer systems from Florida
Atlantic University, and an M.A . inmathematics education from
Harvard University.

The information about MS-DOS 5.0
Upgrade, IBM DOS 5.0, and IBM
DOS 5.0 Upgrade is based upon information and packages available on June
1 I, 1991, the time these products wereannounced. All references to MS-DOS
5.0 or MS-DOS refer to the MS-DOS
5.0 Upgrade. All references to IBM
DOS 5.0 or IBM DOS refer to bothbase and upgrade products unlessotherwise specified.

61

IBM DOS 5.0
Upgradediskettes. If necessary, the user can
restore the old DOS version fromthe backup diskettes using the Uninstall feature.

Pylee Lennil andClovis L. Tonda
IBM Corporation
Boca Raton, Florida

Restoring the Old DOS

The IBM DOS 5.0 Upgrade allows
DOS users to upgrade their current versions of IBM DOS to IBM
DOS 5.0. The Upgrade is less expensive than the DOS 5.0 Base Installation program and isdesigned for users who alreadyhave IBM DOS installed.

The Upgrade allows users to restore
the old DOS, which was previously
saved using the backup facility. The
program displays the Uninstallmenu. If the Uninstall option is selected, the program requests that thefirst backup diskette is inserted and
DOS 5.0 is removed from the fixed
disk. Then it reboots the system. An
internal procedure restores the old
DOS from the backup diskettes.

The DOS 5.0 Upgrade has several facilities to help the user upgrade froman earlier DOS version. The package:• Allows users to back up the oldversion of DOS onto diskettes before installing DOS 5.0• Allows users to restore the old
DOS from backup diskettes• Upgrades the DOS CONFIG.SYS
and AUTOEXEC.BA T files toconform to the DOS 5.0
CONFIG.SYS and
AUTOEXEC.BAT file standards• Upgrades the DOS 4.0 shell menu
files to DOS 5.0 shell menu fileformat• Allows users to replace all occurrences of their DOS system files• Provides network update files for
PC LAN Program and Novell
networks

Backing Up the Old DOS
The DOS 5.0 Upgrade allows users
to back up DOS versions 2.1
through 5.0 onto diskettes before installing DOS 5.0. When the upgrade
program starts, a backup menu is displayed. If the user chooses to backup the old system, the program copies the old DOS files to the backup

Personal Systems/Issue 4, 1991

It is important to note that users
must go through the Uninstall procedure to uninstall DOS 5.0. This is because the boot record for earlier
versions of DOS is somewhat different, and it is necessary to use the Upgrade to restore the boot record andthe files.

Upgrading CONFIG.SYS
and AUTOEXEC.BATThe Upgrade allows users to upgrade the existing CONFIG.SYS
and AUTOEXEC.BAT files after
copying the DOS 5.0 system files tothe disk. The upgrade involves making the necessary changes to these

62

DEVICE=HIMEM. SYS
Default version for
CONF1G.SYS

and
DOS=HIGH

DEVICE-C:\DOS\SETVER.EXE
DEVICE- C:\DOS\HIMEM.SYS
DOS- HIGHFILES=lO

load DOS into high memoryarea.

Default version for

AUTOEXEC.BAT@ECHO OFF
PROMPT $p$g
PATH- C:\DOS
SET TEMP- C:\DOS
C:\DOS\DOSSHELL.EXE• These commands were replacedby new commands:- DEVICE=XMAEM.SY S
andDEVICE=XMA2EM S.S YS
were replaced by
DEVICE=EMM386.EXE(Note that
DEVICE- XMA2EMS. SYS

Figure 1. Defaults

files to conform to the DOS 5.0
CONFIG.SYS and
AUTOEXEC.BAT standards. Thechanges are necessary because DOS
5.0 has some new commands, andsome existing commands were modified . The program copies the
CONFIG.SYS and
AUTOEXEC.BAT files to the
CONFIG.DAT and
AUTOEXEC.DAT files , respectively, before it upgrades those files
to DOS 5.0 standards. The
CONFIG.SYS and
AUTOEXEC.BAT file modifications are necessary because of thefollowing changes:• These commands were removed
from DOS 5.0:
- IN STALL- IFSFUNC.EXE- IN STALL- FILE SYS.EXE• These commands were added in
DOS 5.0:- DEVICE=SETVER.EXE- DEVICE- SMARTDRV. SYS- DOS- HIGH
- Note that
DEVICE-S ETVER . EXE
provides version changes toprograms;

still is required for 80286 systems with expanded memory
adapter hardware.)- DEVICE- IBMCACHE.SYS
was replaced by
DEVICE=S MARTDRV. SYS- DEVICE- VDI SK. SYS

was replaced by
DEVICE- RAMDRIVE. SYS
If the CONFIG.SYS and
AUTOEXEC.BAT do not exist under the current DOS system, theDOS 5.0 Upgrade creates default
versions for those files. Figure lshows the defaults.
If the CONFIG.SYS file already exists on the root directory , the Upgrade program modifies this file toconform to the DOS 5.0
CONFIG.SYS standards.

Figure 2 shows a sample
CONFIG.SYS file. "OldCONFIG.SYS" shows the file before
DOS 5.0. "New CONFIG.SYS"
shows CONFIG.SYS after the update. Note that the upgrade program
may not be able to upgrade somelines in the file; therefore, thoselines will be commented (the program begins the line with REM).

Old CONFIG.SYS

break-onfiles - 10
device- xmaem.sys
device- xma2ems.sys frame=COOO
device- ibmcache.sy s
install-c:\dos\ifsfunc.exe
device=c:\net\pcnet.sys
device-c:\dosl\vdisk.sys
New CONFIG.SYS

DEVICE=C:\DOS\SETVER.EXE
DEVICE- C:\DOS \ HIMEM.SYS
DOS-HIGH
break- onfiles=lO
DEVICE- C:\DOS\EMM386.EXE frame=COOO
REM device- ibmcache.sys
DEVICE-C:\DOS\SMARTDRV.SYS
REM install - c:\dos\ifsfunc.exe
device=c:\net\pcnet.sys
REM device- c:\dosl\vdisk.sys
DEVICE- C:\DOS\RAMDRIVE.SYS

Figure 2. Comparison of Old and New CONFIG.SYS

Personal Systems/Issue 4, 1991

63

Old AUTOEXEC.BAT

PATH=C:\;C:\D0S1;
ifsfunc.exe
call autouser. bat
prompt=$p$g
New AUTOEXEC.BAT

PATH-C:\DOS;C:\;C:\D0S1
REM ifsfunc.exe
call autouser. bat
prompt- $p$g

should make necessary changes to include these lines based on the support available for the commands
specified in the lines under DOS 5.0.

which may contain one or more submenus. Each submenu is stored in a
separate .MEU file. The utility understands the hierarchy for the shellmenu files and converts those files
into DOSSHELL.INI format.

Upgrading the DOS 4.0
DOS Shell Menu Files

The menu system in DOS 5.0 uses afile called DOSSHELL.INI. This is
an ASCII file that contains the information about menus and submenus
for DOS 5.0. (There is one .INI fileas opposed to various .MEU files.)The update program copies a version
of DOSSHELL.INI to the user's
disk. If the user wants to upgrade
the existing .MEU files, the program

If the user has DOS 4.0 .MEU files,

and if DOS 4.0 is the current DOS
on the fixed disk, the DOS 5.0 Upgrade invokes a utility to convert the.MEU files to .INI format.

SET TEMP=C:\DOS
Note that the path command has
been updated to include the new
DOS path.

Figure 3. Comparison of Old and New
AUTOEXEC.BAT

The user should examine the new
CONFIG.SYS and CONFIG.DAT(the old CONFIG.SYS) files andshould make the necessary changes
on the commented lines, based on
the support available for the commands in those lines, to obtain similar support in DOS 5.0.
Similarly, if an AUTOEXEC.BAT
exists in the root directory, the program modifies this file to conform to
DOS 5.0 AUTOEXEC.BAT
standards.
Figure 3 shows a sample
AUTOEXEC.BAT file before and after upgrading to the DOS 5.0 standard. "Old AUTOEXEC.BAT" shows
the file before DOS 5.0 installation.
"New AUTOEXEC.BAT" shows thefile after the update. Note that the
program may not be able to upgrade
some lines. In this case, the program
will comment those lines (the program begins the line with REM).
The user should examine the new
and old AUTOEXEC.BAT files and

DOS 4.0 uses a collection of .MEU
files supporting menus. These are binary files that form a dependency
tree. The first file is SHELL.MEU,

••

••

••u
••
••
••

,.••
••
••

••••
•••
••
,.••
••••
•

....

••,
••
••
.•

.
••

.

•t ••

•
•
•

•

•••

•

!•
••

••
••

.

••
,
••••

•••

•
••

•••
•

•••

•'••

•:
•.

••

-

••
.Q
••••

.••• ,

•

•• •

••

•

• ••
••
••

••••.
,,
"·
11,

..

•·

..

Personal Systems/Issue 4, 1991"

64

uses a utility to transform the .MEU
files , then append that information
to the existing DOSSHELL.INI. The
existing .MEU files are not deleted.
The DOS 5.0 shell has a few lower
limits when compared to the DOS
4.0 shell. For example:• The maximum number of prompts
in the DOS 5.0 shell is 9; it was
250 in the DOS 4.0 shell.
• The maximum length of help text
is 256 bytes; it was 500 bytes.
• The program item title is 23 characters long; it was 40.

Refer to Getting Started in the DOS
5.0 Upgrade for more details.

Easy Migration
The DOS 5.0 Upgrade facilitates thetransition from earlier DOS versions,starting with version 2.1, to the latest version of DOS: DOS 5.0.
The user may want to back up theexisting system before installing
DOS 5.0. The program provides a facility to back up the system files associated with an earlier version ofDOS. If the user chooses to reinstall
the earlier version of DOS at a later
date, the program knows how toucopy the files from the backup diskettes and replace the existing bootrecord on the fixed disk.
The upgrade program updates existing CONFIG.SYS and
AUTOEXEC.BAT files. If thosefiles do not exist, it brings DOS 5.0
versions of those files with the restof the system.
It then copies the DOS 5.0 systemfiles to the user's machine.
There is one more step: if the user
has .MEU files (for DOS 4.0 shellmenus), those files will be converted
and appended to the .INI file that
DOS 5.0 uses.
The purpose of the upgrade programis to make it easier for a DOS user
to migrate to DOS 5.0.

ABOUT THE AUTHORS
Pylee Lennil is a staff programmer
at IBM Entry Systems Division. He
is presently involved in thedevelopment of ADC. He previously
spent several years in PC DOS
development. Pylee joined IBM in
1983. He received his B.S. inphysics from Kerala University inIndia, and an M.S. in computerengineering from the University ofLowell in Lowell, Massachusetts.
Clovis L. Tonda is an advisory
programmer at IBM Entry Systems
Division, with AIX system design.
He has an M.S. from Southern
Illinois University and a Doctorate
in computer science from Nova
University. Dr. Tonda is also avisiting professor of computerscience at Nova University, Fort
Lauderdale, Florida.

Personal Systems/Issue 4, 1991

65

DOS 5.0
Performance
Improvements
Due 1. Vianney
IBM Corporation
Boca Raton, Florida
DOS 5.0 provides two major improvements over DOS 4.0 that willconsiderably affect the performance of your applications: reduction in memory requirements andenhancement of fundamental system utilities such as expanded
memory manager (EMM386.SVS),
disk caching (SMARTDRV.SVS),
and virtual disk RAMDRIVE(RAMDRIVE.SVS). This article discusses those improvements including empirical data collectedfrom certain industry-standard
benchmarks.

DOS 5.0 achieves its memory reduction goals by:• Reducing the amount of low 640
KB RAM, that is, conventional
memory, consumed by DOS.
• Providing the option of runningparts of DOS from the High Memory Area (HMA) as defined in the
Extended Memory Specification(XMS) 2.0. This is available on
many 286-, 386-, and 486-based
machines that provide at least 64
KB of extended memory• Relocating buffers into the HMA.
The HMA is the first 64 KB ofmemory above the 1 MB boundary that marks the end of conventional memory and the beginningof extended memory.
Physical Size Reduction of
Resident DOS The actual physicalsize of the resident DOS module
was reduced by I ,378 bytes compared to DOS 4.0. The reduction

was achieved through the following
code changes:• Replaced support for buffers in
EMS and hash organization of
buffers with DOS 3.3 LRU algorithm. This means a return to
DOS 3.3 buffer management algorithm, in which buffers are organized as a circular linked list,
maintained in LRU order, and provide a pointer to the last buffer
used. The internal hash organization has also been removed, although the secondary caching
scheme is still supported in DOS
5.0 (for example, BUFFERS=XY).
• Removed FASTOPEN extents
caching. The removal of
FASTSEEK support from the
FASTOPEN.EXE program andthe resident DOS results in a savings of 1 KB of resident code anddata.
• Enabled access to large partitions
without loading share. [n DOS
5.0, you no longer need to have
SHARE loaded for 32 MB andgreater fixed disks.
• Removed IFS. This includes theremoval of the undocumented
IFS, which was added in DOS 4.0.
• Optimized message retriever andother COMMAND.COM code.
The code optimization in
COMMAND.COM code has reduced the amount of resident
memory required by about 1,800
bytes.
• Added reusable COMMAND.COM code. The resident
COMMAND.COM code has been
made reusable. As a result,multiple invocations of
COMMAND.COM share thesame code, creating a savings of 2
KB for each invocation after the
initial COMMAND.COM.
• Built Upper Memory Block(UMB) support into DOS. Pro-

Personal Systems/Issue 4, 1991

grams and device drivers can beloaded high via the device line
DEVICEHIGH= in CONFIG.SYS
and LOADHIGH from commandline or AUTOEXEC.BAT.

DOS Execution in HMA: The second approach used in reducing memory requirements is to run certain
DOS functions in HMA, which
include:• Execution of COMMAND.COM
resident code in the HMA.
COMMAND.COM was made relocatable by separating the codeand data segments, and by
making instructions that are notrelative - jump tables, for example - to become relocatable.
• Internal DOS interface for sharing
HMA with other DOS device
drivers and DOS utilities.

Buffers Relocation in HMA:
The relocation of the DOS kerneland various buffers used by the kernel also contributes significantly tothe reduction of conventional memory. DOS 5.0 moves the following
modules into HMA:
• DOS Kernel and BIOS - When
the DOS kernel and BIOS areloaded into memory , if the HMA
is found, DOS and BIOS are relocated to the HMA and initialized
there. Otherwise, they will be initialized and executed in the conventional memory area.
• DOS Buffers - In DOS 4.0, thenumber of buffers requested by
the line BUFFERS= in the
CONFIG.SYS file is allocated inconventional memory. In DOS
5.0, buffers automatically go into
the HMA space, if available.
• Code Page Buffers - These arebuffers used by DISPLAY.SYS
and its relocation into the HMA
can mean an additional 20 KB

66

Conventional Memory(in Kbytes)

DOS 4.0

DOS 5.0Low

DOS 5.0 HighInterrupt Area

1.0KB

1.0KB

1.0KB

BIOS Data Area

0.3 KB

0.3 KB

0.3 KB

System Data

0.5 KB

0.5 KB

0.5 KBDOS

56.0 KB

54.0 KB

13.0 KB

Program Area

5.8 KB

4.6 KB

2.6 KB

Total

63.6 KB

60.4 KB

14.4 KB

Figure 1. Memory Used by DOS Functions

savings for international users
with two code pages loaded.

programs like Windows 3.0. In
DOS 5.0, HIMEM.SYS implements an internal interface with
DOS that relocates parts of
HIMEM.SYS to the HMA.

• Part of the HIMEM.SYS HIMEM is an extended memory
manager whose main function is
to control and manage the use ofextended memory by such programs as disk caching, RAM
disk, and other extended memory

System Under Test

In summary, Figure 1 shows theEffect of Size Reduction: When asystem is booted and initialized under either DOS 5.0 or 4.0, the Extended BIOS area occupies 1 KB at

8555-061

8580-311

8595-OJ9

Average

Instruction Mix

NC

NC

NC

NC

Instruction Mix - 80286

NC

NC

NC

NC

Instruction Mix - 80386

NC

NC

NC

NC

Integer Add

NC

NC

NC

NC

NC

NC

NC

NC

BIOS Disk Seek - Random

NC

NC

NC

NC

BIOS Disk Seek - Sequential

NC

NC

NC

NC

DOS File Access Total - Smal
and Large Record Size

NC

NC

NC

NC

-1 %

+2%

-2%

NC

NSTL-C

NC

NC

NC

NC

NSTL-Foxpro

+4%

+! %

+8 %

+4%

NSTL-Word

NC

NC

NC

NC

CPU Performance Tests:
PC Labs

PC Week
Total: CPU/sort

1/0 Performance Tests:
PC Labs

PC Week
Disk Speed - Database Test

the high end of the 640 KB boundary, leaving only 639 KB available
to DOS. Using a one line
CONFIG.SYS with FILES=20 and
no AUTOEXEC.BAT file, DOS 4.0
yields 589,152 bytes of conventional
memory to applications, while DOS
5.0 low yields 596,536 bytes and
DOS 5.0 high yields 636,400 bytes,
respectively. "DOS 5.0 low" means
DOS is configured to run in conventional memory (as specified by thestatement DOS=LOW inCONFIG.SYS); "DOS high" means
DOS is configured to run in the
HMA (as specified by the statement
DOS=HIGH in CONFIG.SYS).

Application Tests:

NC = No Change
Figure 2. DOS Low and DOS High Performance Comparison

Personal Systems/Issue 4, 1991

amount of conventional memory
taken by various DOS functions under DOS 5.0 and DOS 4.0.
Performance Comparison Between
DOS Low and DOS High: Given
the complexity in size reduction andrelocation of the kernel to the HMA,a primary concern is whether the implementation of the memory reduction strategy impacts performance ofthe base operating system. To measure the performance impact of DOS
relocation into HMA, a set of benchmarks was run on three PS/2 platforms: 8555-061, 8580-311, and8595-019. The benchmarks include
the PC Labs version 5.6 (see Reference l at the end of the article), PC
Week version 1.1 (see Reference 2),
and a host of simulated application
benchmarks from the NSTL (see Reference 3). The data illustrated in Figure 2 represents the percent of
performance difference between
DOS high and DOS low on eachhardware platform and the averageof all three platforms. A negative(positive) percent value means DOS
high is slower (faster) than DOS low
by that percentage. The result in Figure 2 suggests that there is no performance difference between DOS

67

low and high in most primitive processing and J/O operations. However,certain application benchmarks, suchas the NSTL-Foxpro (see Reference3), might run faster when DOS isloaded in the HMA. In the CPU performance tests, both PC Labs and
PC Week benchmarks show nochange (NC) in performance between DOS low and high. In the J/O
performance tests, the PC Week
benchmark shows its database test
ran 2% faster on the 8580-311 in
DOS 5.0 high, yet 1% and 2%
slower on the 8555-061 and 8595OJ9. On the average, these variations cancel each other out, which
results in insignificant performancechange. In the application benchmarks, the Foxpro benchmark ran
consistently faster in DOS high, resulting an average of 4% performance gain overall .
Performance Comparison Between
DOS 5.0 and DOS 4.0: Using thesame measurement approach just described, the performance of DOS 5.0
low and DOS 4.0 is shown in the
Figure 3. Again, "NC" means theperformance change is not observable, while a negative (positive) percent value means DOS 5.0 is slower(faster) than DOS 4.0 by that percentage. While the processor subsystem shows no reaction to either
DOS, DOS 5.0 certainly improves
the performance of applications considerably through its J/O performance improvement as shown by the
PC Labs benchmark. The PC LabsDOS File Access benchmark ran
25 % faster on the 8555-061 and8580-311 , 9% faster on the 85950}9, and on the average, 20% fasteron DOS 5.0 compared to DOS 4.0.
The Foxpro benchmark seems tobenefit most from DOS 5.0, with thethe average improvement of 9%
over DOS 4.0.

System Under Test

8555-061

8580-311

8595-0J9

Average

Instruction Mix

NC

NC

NC

NC

Instruction Mix - 80286

NC

NC

NC

NC

Instruction Mix - 80386

NC

NC

NC

NC

Integer Add

NC

NC

NC

NC

NC

NC

NC

NC

BIOS Disk Seek - Random

NC

NC

NC

NC

BIOS Disk Seek - Sequential

NC

NC

NC

NC

DOS File Access Total - Smalland Large Record Size

NC

NC

NC

NC

-1%

+2%

-2%

NC

NSTL-C

NC

NC

NC

NC

NSTL-Foxpro

+4%

+!%

+8%

+4%

NSTL-Word

NC

NC

NC

NC

CPU Performance Tests:
PC Labs

PC Week
Total: CPU/sort

1/0 Performance Tests:
PC Labs

PC Week
Disk Speed - Database Test

Application Tests:

NC = No Change
Figure 3. DOS 4.0 and DOS 5.0 Performance Comparison

EMM386.EXE
ENHANCEMENT
EMM386.EXE is an expanded memory emulator that uses extended
memory to simulate expanded memory to meet the requirements of applications that use expanded memory
on 386- and 486-based systems.
DOS 5.0 EMM386 provides a full
LIM 4.0 EMS standard, in compliance with VCPI, fully supports the
Virtual DMA Services specification,and searches for and provides upper
memory blocks (UMBs) via theXMS 2.0 Allocate Upper Memory
Block call. EMM386 must be loaded
from a device line in CONFIG.SYS.
Figure 4 shows the pe1formancegain of various Excel (see Reference3) functions performed under DOS
5.0 and EMM386.EXE compared to

Personal Systems/Issue 4, 1991

DOS 4.0 and XMAEM.SYS. Whileno performance change was observed in transcendental functions ,charting, and array operations, considerable gain was seen in the last
four groups of functions : defined
functions (21 %), scaled insert/delete(45%), scaled cut/paste (29%), andlarge link and recalc functions (43 %).

RAMDRIVE.SYS
The virtual disk, known as
VDISK.SYS in DOS 4.0, is now
called RAMDRIVE.SYS. It is a utility program that uses system memory to emulate a temporary disk
drive. As a result, because the information is read from memory (known
as VDISK or RAMDRIVE) rather
than from a physical disk, the response of your application is very
fast. However, because the informa-

68•
EXCEL 2.1 Functions:

Percent of Performance Gain

Transcendental Functions

NC

Cut/Paste+3 %Charting (line, bar, area, pie, column, etc.)

NClnsert/Delete (rows, columns)+7%

Financial Functions (ddb, dv, ipmt, nper,
npv, rate, etc.)+3%

Array Operations (constant andparameterized arrays)

NC

Database Functions (dmax, dmin,
dcounta, dproduct, dstdev, etc.)+14%

File Operations (open, close, delete, save)+9%

Defined Functions (solving system of
equations)+21 %Scaled Insert/Delete+45%

Scaled Cut/Paste+29%

SMARTDRV.SYS
SMARTDRV is a disk caching program that can be used to significantly reduce the time required toread and write data from your harddisk. SMARTDRV can use either extended memory (default) or expanded memory (optional) for its
disk cache.

Figure 4. Performance of EXCEL Functions

tion is stored temporarily in memory, it will be lost when the system
is turned off. In DOS 5.0,
RAMDRIVE uses XMS calls to allocate and manipulate extended memory. If RAMDRIVE is instructed touse extended memory and an XMS
manager is not present, RAMDRIVE
won ' t install. This makes
RAMDRIVE compatible with thelatest standard for using extended
memory, and removes machinedependent code from RAMDRIVE.
RAMDRIVE now runs with DOS
versions up to 5.x.

from a virtual disk under DOS 4.0.
Figure 5 shows how the DOS file access test in the PC Labs performs under both DOS 5.0 and 4.0. In DOS
5.0, the test was run from the RAMDRIVE created by the device line
RAMDRIVE.SYS, while in DOS
4.0, the test was run from the virtual
disk created by the device line
VDISK.SYS in the CONFIG.SYS
file. The value in the table represents
the percent of performance gain between DOS 5.0 and DOS 4.0. For example, on system 8555-061, basedon the total time of tests involving
small record size (Total - Small
Record Size), the test ran 21 % fasteron DOS 5.0 compared to DOS 4.0.
In the average, across three different

In general, it has been observed that
J/0 operations perform better if they
are running from the ram drive under DOS 5.0 as opposed to running

System Under Test

I 8555-061 I 8580-311 I 8595-oJ9 l Average

PC Labs-DOS File AccessTotal-Small Record Size

I

+21 %

I

+42%

I
I

+26%

+46%

I
I

+29%

+30%

I
I

+29%

Total-Large Record Size

+22%

I

+32%

I

+31 %

I

+39%

+40%

DOS File AccessTotal-Small/ Large Record SizeJ

platforms, the same test ran 26%
faster on DOS 5.0.

Figure 5. Ram Drive Performance Comparison

Personal Systems/Issue 4, 1991

In DOS 5.0, SMARTDRV uses
XMS calls to allocate and manipulate extended memory. As a result, if
you put the cache in expanded memory provided by EMM386.EXE,
your system might not run as fast as
expected because of the overhead required by EMM386.EXE to emulate
expanded memory. There are a few
enhancements added to the DOS 5.0
SMARTDRY:• It can now buffer all disk VO via
its track buffer in conventional
memory to safeguard against bus
master DMA hardware that may
not translate virtual addresses correctly. This double-buffering
mechanism may be enabled or disabled on the installation commandline (/B+ or /B-) or, by default,
the DMA Services Active bit in
the BIOS data area is checked anddouble-buffering done when
DMA Services are active.
• A quick cache-locking mechanism has been introduced to allow
Windows to demand page without
flushing other data from the
SMARTDRV cache. There are
now two cache-locking mechanisms. The older mechanism
locks and unlocks the cachethough IOCTL Writes. In thiscase, SMARTDRV locks tracks
currently in the cache. If any
cache elements are free, they remain unlocked and may change
their contents while the lock is in

69

effect. In the new mechanism,
whenever the cache is locked,
SMARTDRV will not replace any
track currently cached. If any elements of the cache are free when
the cache is locked, they too became locked as soon as they areused.
• Caching strategy has been modified to improve SMARTDRV performance with disk writes. Disk
writes may update cache contents
but never cause new tracks to be
added to the cache.
• SMARTDRV's resident trackbuffer is no longer repositioned
when it falls across a OMA
boundary. DOS detects this condition and breaks the OMA into
pieces without significantly affecting SMARTDRV performance.
Figure 6 shows the performancegain of tests that were running withand without SMARTDRV under
DOS 5.0, on an 8555-061 and an
8580-311 system. The PC Labs
benchmark shows the average gainof 30% for the DOS File Access
Test and 51 % for the DOS Variable
Size File Access test. In the Disktester (see Reference 4) benchmark,typical average gain with SMARTDRY over non-SMARTDRV ranges
from 31 % to 53%. The Disktester
benchmark consists of a series offile operations such as file creation,
sequential read and write, and random read and write performed on
various file size, record size, andnumber of records. The data presented in Figure 6 is the average
result of all tests.

Conclusion
DOS 5.0 provides sharp improvements over DOS 4.0. It requires not

Sytem Under Test

8555-061

8580-311

Average

Total-Small Record Size

+33%

+29%

+31 %

Total-Large Record Size

+10%

+32%

+21 %

Total-Small / Large Record Size

+31 %

+29%

+30%

Total-Small Record Size

+49%

+56%

+53 %

Total-Large Record Size

+40%

+56%

+48%

Total-Small / Large Record Size

+46%

+56%

+51 %

FS=256,RS=512,#RCDS=512

+36%

+26%

+31 %

FS=256,RS=4096,#RCDS=64

+34%

+33%

+33 %

PC Labs Benchmark
DOS File Access Test:

DOS Variable Size File Access

Disktester Benchmark

FS=5 l 2,RS=l024,#RCDS=512

+44%

+47%

+46%

FS=5 l 2,RS=2048,#RCDS=256

+44%

+46%

+45%

FS= I024,RS=2048,#RCDS=512

+53%

+53%

+53 %

FS=l024,RS=8 l 92, #RCDS= 128

+45 %

+50%

+48%

Note: FS = File Size

RS = Record Size

#RCDS = Number of Records

Figure 6. Average Result of All Tests

only less memory but offers morefunctions at better performance. Applications can now take advantage of
HIMEM.SYS for a more robust environment, relocation of the DOS kernel and various buffers to gain moreconventional memory, and high performance utilities for a faster time tosolution.

loading a document, block copy, spellingcheck, text scrolling, text saving, and so forth.
NSTL-Excel Benchmark: Microsoft Excel 2.1based tests that include most basic spreadsheet functions.
[4] Disktester, Version 1.04, Intelligent Devices Corporation, 1989.

ABOUT THE AUTHOR

References:[I] PC Labs Hardware Benchmark, Version
5.6, PC Magazine Labs Benchmark, 11/1 990.
[2] PC Week Labs System Benchmark, Ziff
Communications Co., 1990.
[3] NSTL Benchmarks. A series of application-oriented benchmarks available from the
National Software Testing Laboratories.
NSTL-C Benchmark: A compilation and linkof various C programs for used in a development environment. NSTL-Foxpro Benchmark:A collection of tests based on the Fox pro 1.0 I(Fox Software) involving database creation,
record and file manipulation, and report generation. NSTL-Word Benchmark: Contains
tests involving Microsoft Word 5.0 such as

Personal Systems/Issue 4, 1991

Due Vianney is an advisory
programmer at IBM's Personal
Systems Programming Center in
Boca Raton. He is currently involved
with the peiformance evaluation of
DOS 5.0, Windows and OS/2. Hereceived a B.S. in mathematics fromthe University of Texas at El Paso
and a Ph.D. in computer sciencefrom the University of SouthwesternLouisiana.

70

DOS Memory
Management
Facilities

32MB
Extended
MemoryEMB sThis article describes the different
kinds of memory and how DOS
manages each one. It includes a
description of the DOS 5.0 memory management enhancements.

DOS memory management facilities
allow applications to access systemmemory on a variety of hardware ina well-behaved manner. The basic
DOS memory management functionsare:• Loading applications into memory• Allocating memory blocks to applications during execution• Providing an environment thatallows applications to accessmemory above 640 KB
The type of memory management
support provided by DOS depends
on the system processor and the
DOS version used. Intel®
8086/8088 processors support only
real mode and have a limited address space of I MB. The 80286™
and higher processors support both
real and protected modes and can address up to 16 or 32 MB. In realmode, processors can address only
up to 1 MB, and in protected mode,the processors can address up to 16
or 32 MB. Protected mode provides
large memory space to applications
and is used by operating systems
like OS/2. Because DOS and its applications run under real mode, theiraddress space is restricted to 1 MB.
The actual memory space available
is even less because address space
between 640 KB and 1 MB is re-

32MB

-

-

-

Pylee Lennil
IBM Corporation
Boca Raton, Florida

EMM LogicalPages

1088 KB

1088 KB

High Memory
Area (64 KB)

High Memory
Area (64 KB)
1024 KB

Upper Memory
UMBs( I MB)

1024 KB

ROM BIOS(I MB)

Adapters
EMM Physical
Pages

-

Video Buffers

-

640KB

640 KB

Applications
Base Memory
50 KB

DOS
0

0

Figure 1. System Memory Areas

served for video buffers, adapters,
and ROM BIOS.
System memory is divided into basememory, upper memory, high memory, and extended memory (Figure1). Normal ly, DOS and its applications run in base memory. Accessing
memory above 640 KB requires systems with 80286 or higher processors, special memory management
drivers, and DOS 4.0 or 5.0.

Base Memory Management
Base memory is located between 0
and 640 KB. DOS occupies approximately 50 KB of base memory. The
remaining base memory is available
for applications. When an application is loaded, it receives al] theavailable memory up to 640 KB .

Personal Systems/Issue 4, 1991

The application must release the unused memory. This way, it can subsequently allocate or free memory
blocks as needed during execution
by calling the DOS memory management function calls. The caller mustspecify memory size, and then DOS
returns the segment of the allocatedmemory block. Following are thethree DOS memory management
functions. A detailed description ofthese functions is given in the Disk
Operating System User's Guide andReference (84F9682).
• Function 48H - allocate memory
blocks• Function 49H - free memory
blocks• Function 4AH - resize memory
blocks71

Upper Memory Management
Upper memory is located between
640 KB and 1 MB. Normally thisarea is reserved for video buffers,
adapters, and ROM BIOS. If adapters are not present, the address
spaces they would occupy are free.
Upper memory blocks (UMB) arethese unused address spaces. Because no physical memory exists atthese locations, neither DOS nor applications can access these blocks directly. To make use of these blocks,
you can use an emulator program.
How do emulators work? The emulator simulates extended memory using protected mode page tables. The
emulator gains control every time
DOS or applications access the upper memory block, and it maps theaddress into extended memory.
UMBs can be accessed by loading
Microsoft Extended Memory Specification (XMS) driver (HIMEM.SYS).
It provides functions that request
and release upper memory blocks.
The UMBs can be used as data buffers, or they can be loaded with programs. A detailed description of the
HIMEM.SYS can be found in theMicrosoft Extended Memory Specification (XMS) Version 2.0.

High Memory Management
High memory is a 64 KB block ofmemory located between 1024 KB
and 1088 KB . This memory is
unique because it can be accessed byprograms running in real mode, eventhough it exists over 1 MB . The
high memory area has a unique segment number FFFFh. Using th.is segment, a program can address from
FFFF: 10h to FFFF:FFFFh (64 KB
minus 16 bytes). Note that highmemory does not start at
FFFF:00OOh, because the first 16
bytes are reserved for system use.
High memory can be used as data

buffers or it can be loaded with
programs.
Unlike other memory areas, highmemory has several restrictions. Systems based on 80286 or higher processors provide high memory support.
The entire area must be used as a single segment with a unique segment
number FFFFh. The segment cannot
be shared with other programs. Finally, it can be accessed only if address line A20 is enabled. Highmemory can be accessed using theMicrosoft XMS driver
HIMEM.SYS. HIMEM.SYS allows
programs to access high memory ina well-behaved and machine-independent manner. It provides functions to enable the line A20, as wellas to allocate or free the high memory area. A detailed description of
the HIMEM.SYS driver can befound in the Microsoft XMS
Version 2.0.

Extended Memory
Management
Extended memory starts at I088 KB
and occupies all available memory

Personal Systems/Issue 4, 1991

above 1 MB (Figure 1). This memory area cannot be accessed by programs running in real mode.
Accessing extended memory requires extended or expanded memory drivers running in protect or
virtual 86 mode supported by 80286
and higher processors. DOS 5.0 contains both expanded memory manager EMM386.EXE and theextended memory manager
HIMEM.SYS.

Extended Memory Driver:
Microsoft XMS driver(HIMEM.SYS) provides functions toallocate, lock, free and move extended memory blocks. The allocated extended memory blocks canbe used only for data storage. A detailed description of HIMEM.SYS
can be found in the Microsoft XMS
Version 2.0.
Expanded Memory Driver: The
expanded memory driver,
EMM386.EXE, allows DOS and applications to access extended memory blocks (EMB). The expanded
memory driver creates one or more
16 KB physical pages in upper mem-

72

32MB
Extended Memory
EMM Logical
Pages
Map
LogicalPages toPhysicalPage1088 KB

High Memory
Area (64 KB)
ROM BIOS

1024 KB(I MB)EMM PhysicalPages
Video Buffers
640KB

Applications
50KB

DOS
0

Figure 2. Expanded Memory Logical and Physical Pages

ory or in base memory (Figure 2). It
also divides extended memory into
16 KB logical pages. To access extended memory logical pages, theprogram transfers data into one ofthe physical pages. The expanded
memory driver maps the extended
memory logical page into this physical page. This is like using a physical page as a window to accessextended memory logical pages.
The actual location of the physicalpages may vary depending on theconfiguration of the hardware. To
use expanded memory , you must
load the expanded memory driver using the device= command in
CONFIG.SYS. The driver provides
a set of functions to allocate physical pages and map logical pages into
physical pages. Extended memory

blocks can be used as data buffers or
they can be loaded with programs. A
detailed description of expanded
memory manager functions can befound in Lotus/Intel/Microsoft Expanded Memory Specification
Version 4.0.

DOS 5.0 Memory
Management Enhancements
The major problem facing applications under DOS is the limited memory space. In base memory, DOS
occupies approximately 50 KB . Ifother stay-resident programs or drivers are already loaded, the application may have little memory to run .
DOS 5.0 has implemented the following memory management enhancements that provide additional
memory to applications:

Personal Systems/Issue 4, 1991

• DOS 5.0 kernel can be relocatedto high memory on 80286 or
higher processor-based systems,
leaving only a small kernel stubin the base memory (Figure 3).
This releases approximately 30
KB of memory to applications.

• DOS 5.0 allows loading device
drivers and stay-resident programs into upper memory on
80386 or higher processor-based
systems.
• DOS 5.0 does not require
SHARE.EXE to be loaded for
greater than 32 MB hardfile partition support.
Relocating DOS kernel,
stay-resident programs, or device
drivers requires DOS 5.0 memory
management drivers HIMEM.SYS
and EMM386.EXE. HIMEM.SYS
allocates extended memory, highmemory, and upper memory area.
Therefore, HIMEM.SYS must be
loaded before relocation can be
done. Relocating DOS kernel needs
only HIMEM.SYS, whereas
relocating device drivers and stayresident programs requires both
HIMEM.SYS and EMM386.EXE.
Also, DOS 5.0 provides the configuration commands shown in Figure 4
to relocate DOS drivers and stay-resident programs.
The following command loads DOS
into high memory area. If dos=high
is not specified, DOS will be kept inbase memory.
device - himem . sys
dos-high

The EMM386.EXE simulates expanded memory and also allocates
upper memory blocks. Specifying
the ram option allows emulation of
expanded memory, as well as allocation of upper memory blocks. If noemulation is needed, then the noems
option should be used instead of

73

32MB

Extended
Memory1088 KB

High [
MemoryDOS Kernel

I024KBdevice - himem.sys
device - emm386. exe
no emsdos=high,umb
devicehigh=mydriver.sys
loadhigh-myprog.com(I MB)ROM BIOS
Upper
MemoryThe following command loads DOS
into high memory area, the driver
mydriver.sys, and the stay-resident
program myprog.com into upper
memory area. The noems option prevents EMM386.EXE from emulating
expanded memory.

TSRs/Drivers

Video Buffers
640 KB
Applications

DOS Stub0

To summarize, the DOS memory
management facilities are available
based on the type of processors andthe DOS version used. On 80286 or
higher processor-based systems, anapplication can access memory
above 640 KB by using extended or
expanded memory drivers. DOS 5.0
provides additional memory to thebase memory applications by loading DOS into high memory or drivers and stay-resident programs into
upper memory.

Figure 3. DOS 5.0 Memory Structure

ABOUT THE AUTHOR
ram option. Because EMM386.EXE
calls HIMEM.SYS to allocate extended and upper memory blocks,
HIMEM.SYS must be loaded priorto EMM386.EXE.

The following command emulates
expanded memory and loads thedriver mydriver.sys into upper memory block while keeping DOS inbase memory:device - himem.sys
device = EMM386. exe ram
dos=umb
devicehigh- mydriver .sys

dos=high

Load DOS into high memory area

dos=umb

Load drivers and stay-resident programs into upper memoryarealoadhigh-xxxx.com

Load stay-resident program xxxx.com into upper memory

devicehigh=xxxx.sys Load driver xxxx.sys into upper memory
Figure 4. Configuration Commands

Personal Systems/Issue 4, 1991

Pylee Lennil is a staff programmer
at IBM Entry Systems Division in
Boca Raton, Florida. He is presently
involved in the development of ADC.
Previously, he spent several years in
PC DOS development. Pylee joined
IBM in 1983. He received a B.S. inphysics from Kera/a University inIndia, and an M.S. in computerengineering from the University ofLowell in Lowell, Massachusetts.

74

Disk Caching
Under DOS
Pylee Lennil
IBM Corporation
Boca Raton, Florida
Disk caching is a software
scheme that improves system performance by saving the recently
accessed disk data blocks forlater use. This article presents ageneral overview of disk caching
and how various disk caching
schemes are implemented underDOS.

Applications running under DOS
waste most of their time waiting fordata from disk, especially if the applications perform frequent disk access. This is because accessing datafrom a disk is much slower than accessing the same amount of datafrom memory. To access a specificdisk sector involves physically moving the read/write head to the righttrack and then waiting until the specific sector appears under the head.
These mechanical movements taketime, affecting the performance of
the applications.
The most common technique used
for solving this hardware problem
through software is by creating adisk caching mechanism. What is
disk caching? Disk caching involves
saving blocks of data to and fromthe disk in a memory buffer to reduce the number of disk accesses.
The fewer the disk accesses, thebetter the performance.

Disk Caching
Disk caching can be divided into thefollowing categories:
Write-through caching immediately
writes data blocks to disk. The main
advantage of this method is that it

.,

,,,
.,~,
II,

<:I.\R.!U'",,.

maintains file system integrity. Since
the blocks are not kept in memoryfor delayed writing, the chances oflosing the data by accidental systemshut-off are eliminated. On the other
hand, this method requires frequentdisk access, which impacts system
performance. DOS uses writethrough caching only if specificallyrequested through DOS Extended
Open function call.
Write-back disk caching is based ona delayed disk write. A cache buffer
keeps data blocks to be written to a
specific track on the disk. Several
disk writes to the same track are performed at one time, avoiding repeated writes to the same track. This
is nothing more than flushing thecache buffers periodically to the appropriate track on the disk. The delayed write has an inherent problem.
If the system is turned off before thedata is written to the tracks, the system fails to update the file system information, causing file system
corruption. DOS normally writes thedata blocks to disk only when thefile is closed.

Personal Systems/Issue 4, 1991~,,,

\l, \w .w II>/ trl,

' ' L. ~" 1•,//,, ,,, ,,,,.,

Read-through disk caching reads therequested data blocks into an application buffer. It also keeps a copy ofthe blocks in system cache buffers
for future use. The assumption hereis that the application will most
likely request the same sectors in
subsequent reads. DOS utilizes thismethod during all disk reads bykeeping a copy of the most recently
read disk sectors in a group of system buffers. Read-through caching is
also used by disk caching programs
like IBMCACHE and SMARTDRY.
Read-ahead disk caching involves
reading a few additional sectors immediately following the requested
sector into a cache buffer. These sectors may be beneficial in the case ofa sequential disk access. In DOS,
this method is implemented as lookahead buffers supported by the
BUFFERS=m,n command in
CONFIG.SYS.
These disk caching methods areused in DOS either internal or external to DOS. The internal disk caching schemes are built into DOS as
system buffers, look-ahead buffers,

75

and cluster and disk directory information cache buffers. The externalcaching is enabled by loading caching programs like IBMCACHE,
SMARTDRV, or any other similarcaching program. These programs
are loaded as DOS drivers or stayresident programs.

DOS Internal Disk Caching
DOS internal disk caching is designed based on the workings of the
DOS file allocation table, disk directory, and the general operation of
the disk. The internal disk caching
methods are:
System Buffers: DOS system buffers provide a basic disk cachingmechanism that uses the readthrough caching method. Systembuffers are a group of circular buffers maintained by DOS for caching
the data flowing between the disk
and the application. As shown in
Figure 1, each buffer consists of abuffer header and a 512-byte buffer
data area. Each buffer can hold one
sector. The buffer header contains information such as the link address tothe next buffer, the sector number associated with the buffer, and a flag
indicating if the buffer is free.
How do system buffers work? To
understand buffers, consider the following steps required for accessing a
file:
1. Read the file's path informationfrom the disk directory

2. Read the file's sector location information from the file allocation
table
3. Read the file data sectors from thedisk
During these steps, the sectors readare kept in the system buffers. During subsequent disk read requests,

DOS checks the system buffers to
see if the required sectors are available in the cache. If they are available, further disk reads are avoided,
thereby improving performance. The
number of system buffers is specified by the "m" parameter in the
BUFFERS=m,n command. Once thebuffers are full, buffers holding theleast recently used sectors are freed
to make room for newly read disk
sectors.
System buffers provide better performance during random disk reads.
Specifying a large number of systembuffers may further enhance random
disk reads, but it may degrade theperformance of sequential disk
reads. This is because large buffers
require an extensive search throughthe buffers for sectors that are unlikely to be found under sequential
disk reads. Also, a large number ofbuffers will occupy large portions ofbase memory, leaving less memory
for applications.
Look-ahead Buffers: In DOS, caching the adjacent sectors is done using a group of look-ahead buffers.
These buffers hold a few sectors
ahead of the requested sectors, withthe assumption that these sectors
will be requested during a sequential
file access. The look-ahead
buffers are enabled using the
BUFFERS=m,n command in the
CONFIG.SYS file. Here "n" specifies the number of look-ahead buffers. For instance if n=2, then when
the application requests DOS to read
sector 50, DOS reads sectors 51 and
52 in addition to sector 50, andkeeps these additional sectors in thelook-ahead buffers. Look-ahead buffers provide best performance during
sequential disk reads and provide little or no improvements under random disk reads.

File Allocation and Path
Information Caching: DOS disk
caching is also designed based on
the workings of the DOS disk directory and file allocation table. Performance will be improved if
portions of the file allocation tableor disk directory are kept in main
memory for subsequent use. Thiscaching method is implemented in
FASTOPEN under DOS. How does
FASTOPEN work? FASTOPEN is astay-resident program that caches
the file sector location informationand the file path information of themost recently accessed files. To see
how FASTOPEN works, consider
the following steps DOS performs
during a file access:1. Reads the file' s path informationfrom the disk directory

2. Reads the file' s sector location information from the file allocation
table

1
Buffer Header
Sector Data Areal
Buffer Header
Sector Data Area

1
Buffer Header
Sector Data Areal
Figure 1. DOS System Buffers

Personal Systems/Issue 4, 1991

76

Page Tag Buffers

Page Buffers

Tag - 1~

Tag - 2r------_....

Page - 1(2 to 8 Sectors/Page)

Page - 2....

Figure 2. Page and Page Tag Buffers

During file access, FASTOPEN
keeps both the path and sector locations of files in cache buffers. This
information can be reused for subsequent access of the same files.
This effectively reduces steps 1 and
2, which, in tum, improves performance. FASTOPEN is enabled using
the command FASTOPEN C: (n,m).
Here "n" is the number of file pathbuffers, and "m" is the number ofsector information buffers. If thebuffers are full, then space is createdby deleting the least recently usedfile information from the cache buffers. The "m" and "n" values in the
FASTOPEN command must be
specified based on the way files anddirectories exist on the disk. A large"m" value should be used if the file
path consists of many levels of subdirectories and a large "n" value if
files are highly fragmented.
Performance improvement under
FASTOPEN depends mainly on the
behavior of the application.
FASTOPEN improves performancefor applications accessing fragmented files. It also improves performance for applications that
require repeated file and directory
access.

DOS External Disk Caching
DOS external disk caching is provided by cache programs like
IBMCACHE and SMARTDRV.
These programs can be loaded as
DOS device drivers. They maintaintheir own cache buffers either inbase memory, extended memory, or
expanded memory. During disk access, the program takes control andreads the sectors transferred between
the disk and the application into
cache buffers for future use. Unlike
system buffers, which provide optimal performance under random disk
access, these programs improve performance for both sequential and random disk-access environments.
The cache buffer consists of twoareas as shown in Figure 2. The
large area contains pages and thesmall areas contain page tags . Eachpage has a fixed size that holds two
to eight disk sectors. Each tag identifies a page in the page buffer. The
tag contains information on the sectors held in each page. During disk
I/O, multiple pages are read into thecache buffer, depending on the sizeof the data block requested. Even if
only one sector in a page is requested, the entire page is read into

Personal Systems/Issue 4, 1991

the buffer. This works like the lookahead buffer method. Additional sectors read are the most likely to be
used by sequential reads.
The major advantage of DOS external disk caching programs is thatthey support both read-through andread-ahead caching methods. This
improves the performance of sequential as well as random disk reads. External caching allows users tospecify a large number of buffers capable of loading them into extended
or expanded memory. Because they
are device drivers or resident programs, they can be loaded only ifneeded.

Summary
System buffers improve performance for random disk I/O. Lookahead buffers improve performance
under sequential disk I/O.
FASTOPEN improves performancefor accessing fragmented files, andin the case of repeated access offiles and directory path names. External disk caching programs improve
performance for both sequential andrandom disk I/O.

ABOUT THE AUTHOR
Pylee Lennil is a staff programmer
at IBM Entry Systems Division in
Boca Raton, Florida. He is presently
involved in AIX development. Before
joining the AIX team, he spent
several years in PC DOS
development. Pylee began his careerwith IBM in 1983. He received a
B.S. in physics from Kerala
University in India and an M.S. incomputer engineering from the
University of Lowell in Lowell,
Massachusetts.

77

NetWareClient-ServerInteraction
Paul Turner
Novell Inc.
Provo, Utah
On a NetWare LAN, several software components work together
to enable communication between
the workstation client and the fileserver. The NetWare workstation
shell (NETx.COM) manages theconnection with the server, while
IPX.COM forms the communications link with the network hardware. This article presents abehind-the-scenes look at how
these pieces use NetWare's communications and routing protocols
to establish and maintain the vitalclient-server connection.

The NetWare shell facilitates clientserver communications for DOSbased workstations. In a typicalclient-server interaction, one station(the client) requests services from another station (the server). Throughthe shell, DOS-based applications
can request file services (such as
writing to and reading from files)
from NetWare file servers. At theworkstation, the shell, the user application, and the user together act as
the client requesting file services;
the NetWare file server acts as theserver providing file services.
The shell, then, is the liaison between the client (the user application) and the server. The shell
performs the tasks necessary to request file services from a NetWare
file server: for example, establishinga connection with the file server,

Personal Systems/Issue 4, 1991

maintaining the connection, and terminating the connection.
The NetWare shell is a terminateand-stay-resident (TSR) program
called NETx.COM (where x depends on the version of DOS beingrun) . NETx.COM is loaded into a
NetWare workstation's memory
when the workstation is booted. Before you load the shell, however,
you must load another TSR called!PX.COM.

!PX.COM
Novell's Internetwork Packet Exchange (IPX) protocol serves as thecommunications link with the network interface card (NIC) installedin the workstation. At installation, acustomized version of !PX.COM isgenerated for each workstation bylinking in a driver written specifi-

78

cally for the NIC that resides in thatworkstation. Once !PX.COM isloaded, any workstation program, including the shell, can communicate
on the network through NetWare's
IPX protocol.
Recently, as part of its Open DataLink Interface (ODI) specification,
Novell began distributing a new setof modules that provide greater flexibility than !PX.COM. Under ODI,
an intermediate link support layer(LSL) separates the NIC driver from
IPX and other protocol stacks. This
separation allows NIC drivers to be
independent of IPX, thereby eliminating the need to generate a custom!PX.COM file for each workstation.
The LSL also allows multiple protocol stacks to communicate over thesame NIC simultaneously.
To bring up a workstation using
ODI, the link support layer(LSL.COM) must be loaded first, followed by a NIC driver (suchas TOKEN.COM or NE2000.COM).
Finally, the protocol stacks (IPX,
TCP/IP, and so on) are loaded andbound to a NIC driver through the
LSL.
Together, the ODI NIC driver, theLSL, and the IPX protocol stack provide the same functionality as!PX.COM. All references to"!PX.COM" in this article apply
also to the ODI implementation of
IPX.
In addition to interfacing with the

NIC, !PX.COM performs several
communication-related functions.
For example, it manages the IPX
sockets used with the workstation.
The shell and other applications access !PX.COM to open and close
IPX sockets. When the workstation
receives an IPX packet, !PX.COM
checks which socket the packet is ad-

dressed to and passes the packet tothe program having that socket open.
!PX.COM is also responsible for determining the address of the network
segment to which the workstation is
physically connected. The workstation's network number, along with
its node address, make up the workstation's full internetwork address.
IPX can determine the workstation's
network number in one of two ways.
In the first method, !PX.COM
watches for any routing information
protocol (RIP) broadcasts sent on
the network. Because RIP packets
are not forwarded to other network
segments, IPX knows that this typeof broadcast originated on the segment to which the workstation is directly connected. To determine theworkstation's network number, IPX
simply reads the source network address contained in the IPX header ofa RIP broadcast.

The shell (NETx. COM)
acts as the interjace
between user applications
and NetWare file servers.

IPX uses an alternate method if theshell requests a route to a network
number before IPX can determine
the workstation's network number
from a RIP broadcast. In this case,
IPX broadcasts a Get Local Target
packet, which requests the fastest
route to the destination network number requested by the shell. Upon receiving a response, IPX.COM
checks the source network numberin the IPX header of the response
packet. This source network number

Personal Systems/Issue 4, 1991

(the network number of the routerthat responded to the Get Local Target request) is the workstation's network number.

The NetWare Shell
The shell (NETx.COM) acts as theinterface between user applications
and NetWare file servers. As user applications make requests, the shell
determines whether the requests
should be handled locally by DOS
or sent to a server on the network. If
the shell determines that the request
should be sent to a network server,
the shell formulates a request
packet, hands it to !PX.COM fortransmission, and waits for a
response.
Prior to submitting any requests to aserver, the shell must establish a connection with that server. The shellcan establish a connection to a server in two ways. When the shell isfirst loaded at the workstation, it
logically attaches to the first serverthat responds (usually the servernearest to the workstation). The
LOGIN and ATTACH commandline utilities, when executed, alsoestablish a server connection.
To establish a connection, the workstation and the server must exchange
several packets. One of these packets requests that a connection number be assigned to the shell. Anotherproposes the maximum packet sizethat will be allowed in the interaction between the file server and theshell. Before sending these initial
packets, the shell needs the server' s
address and a route to that address.

Getting a Server's Address
To acquire a server's address, theshell can use the service advertising
protocol (SAP) to broadcast a request for the address of the nearest
server - a Get Nearest Server re-

79

Get Nearest Server Request

ws

FSl

FS3

FS2

AA

BB

Get Nearest Server (Local Broadcast)
Give Nearest Server Response
FS3

ws

FSI

FS2

BB

FS I/Address/! Hop

FS2/Address/l Hop

Figure 1. Getting the Address of the Nearest File Serverquest. AJI routers on the workstation ' s network segment having information about the nearest server
respond to the Get Nearest Server request. Each response contains thenearest server's name, its full internetwork address, and the number ofhops required to reach the server(Figure 1).

A second method the shell uses to
get a server's address is to use the
NetWare core protocol (NCP) to access a file server's bindery. The
bindery is a database within
NetWare file servers that contains information about many network entities, including users, groups, andservers.

When first loaded at a workstation,
the shell issues a Get Nearest Server
request to establish an initial connection to a file server. If the shell loses
its connections with all file servers,
it resorts to the Get Nearest Server
request method to re-establish aserver connection.

Because the shell must already havea server connection before it can access the server's bindery, the shell
can use this method only after it hasestablished an initial connection to a
file server. The LOGIN and
ATTACH utilities use this method,
as does the new "preferred server"

Personal Systems/Issue 4, 1991

shell (version 3.0 l or later). These
programs allow the user to specify a
specific file server name, then usethat name to scan the bindery for theserver's address.

Getting a Route to a ServerOnce the shell has the server's address, it needs a route to get to that
address. The shell uses this route forall subsequent communications withthe server for the duration of theconnection.
The shell submits a Get Local Target request to !PX.COM to obtain aroute. IPX first compares the net-

80

Get Local Target Request

FSl

FS3

ws

FS2

Who has quickest route to AA (Local Broadcast)
Give Local Target Response

FS3

FSl

ws

Node Address/ AA/I Hop/2 Ticks

FS2

Node Address/AA/I Hop/2 Ticks

Figure 2. Requesting the Fastest Route to an Address

work number of the desired serverto the workstation's network number. If these two numbers are thesame, IPX tells the shell to send requests directly to the server (without
going through an intermediaterouter).
If the network number submitted by
the shell and the workstation's network number are not the same, IPX
broadcasts a RIP request for the fastest route to the submitted network
number. Whichever router on theworkstation ' s network segment has
the shortest route to the network responds to the request. More than one
router might respond if several rout-ers have a route equal to the shortest
route. IPX accepts only the firstrouter's response and discards allothers.
IPX then returns to the shell thenode address of the first router that
responded. The shell places the nodeaddress of this router in the MAC
header of a Create Connection request packet. It addresses the IPX
header of the request packet to thefile server to which it wants to connect. With the packet addressed inthis fashion, the router receives thepacket first, checks the IPX destination address, and forwards thepacket to the network number on

Personal Systems/Issue 4, 1991

which the file server resides(Figure 2).

Establishing an Initial
Connection
To establi sh its connection to a fileserver, the shell uses a combinationof the SAP, the RIP, and the NCP.
The sequence followed is slightly
different for the preferred servershell than it is for previous shellversions.
Figure 3 shows the steps taken byshells prior to version 3.01 to connect with a file server. The first column represents the call or packet

81

sent. The second column lists thesource, or sender, of the packet. The
third column lists the addressee ofthe packet. The final column indicates the protocol used for handlingthe packet.
We have already seen how the first
four steps work. In steps 1 and 2,
the shell obtains the address of thenearest server. Step 3 is IPX.COM'srequest for the fastest route to the address that the shell received in step
2. Step 4 is the response by all routers with the shortest route to thatsegment.
Steps 5 through 8 show the packets
exchanged between the shell and theserver to establish the initial connection . Once thi s connection is made,the shell moves to the background(terminates-and-stays-resident) andreturns the DOS prompt to the user.
The user can then execute
LOGIN.EXE to log in to the connected server or to another server.

SourceDestination

ProtocolI. Get Nearest Server

ClientBroadcast

SAP

Call

2. Give Nearest Server

RouterClientSAP

3. Get Local Target

ClientBroadcast

RIP

4. Give Local Target

RouterClientRIP

5. Create Connection

ClientFile Server

NCP
NCP
NCP
NCP

6. Request Processed; Connection # Assigned
7. Propose Packet Size
8. Return Maximum Packet Size

File Server

ClientClientFile Server

File Server

ClientFigure 3. Initial Connection Sequence for the NetWare Shell (Prior to Version 3.01)

For example, if the workstation in
Figure 1 initially connects to FS 1
and the user specified FS3 as the preferred server, the shell will follow asequence similar to that shown in
Figure 4. In step 9, the preferred
server shell uses the bindery methodof acquiring the server's address.

quired. If the preferred server resides on the same network segment
as the workstation, the shell skips
these two steps and sends the Create
Connection request directly to theserver. The shell destroys the connection with the initial server once it
has successfully connected to thepreferred server.

Steps 11 and 12 of this preferred
server sequence are not always re-Call

SourceDestination

ProtocolI. Get Nearest Server

ClientBroadcastSAP

The Preferred Server Shell
The preferred server shell (version
3.01 and above) features several additional functions not offered byolder versions of the shell . As its
name implies, the preferred servershell allows users to specify, either
at the command line, or in the
SHELL.CFO or NET.CFO file, theserver to which they would like toconnect. Whether or not a preferred
server is specified, the preferred server shell goes through the same initialeight steps as the old shells.
During the initial eight steps, theshell might connect to a server otherthan the preferred server. If so, theshell performs additional steps to establish connection with the preferred
server (Figure 4).

2. Give Nearest Server

RouterClientSAP

3. Get Local Target

ClientBroadcast

RIP

4. Give Local Target

RouterClientRIP

5. Create Connection

ClientFSl

6. Request Processed; Connection # Assigned

FSl

Client7. Propose Packet Size

ClientFSI

8. Return Maximum Packet Size

FSl

Client9. Query Bindery for Preferred Server

ClientFSI

I0. Address of Preferred Server

FSl

Client

NCP
NCP
NCP
NCP
NCP
NCP

11. Get Local Target

ClientBroadcast

RIP

12. Give Local Target

FSl's
RouterClientRIP

13. Create Connection

ClientFS3

14. Request Processed; Connection# Assigned

FS3

Client

15. Propose Packet Size

ClientFS3

16. Return Maximum Packet Size

FS3

Client17. Destroy Service Connection

Client

FSI

NCP
NCP
NCP
NCP
NCP

Figure 4. Connection Sequence for the Preferred Server Shell

Personal Systems/Issue 4, 1991

82

Call

SourceDestination

ProtocolI. Query Bindery for Preferred Server

ClientFSl

NCP

2. Address of Preferred Server

FSJ

ClientNCP

3. Get Local Target

ClientBroadcast

RIP

4. Give Local Target

FS l 's
RouterClientRIP

5. Create Connection

ClientFS3

NCP

6. Request Processed; Connection # Assigned

FS3

ClientNCP

7. Propose Packet Size

ClientFS3

NCP

8. Return Maximum Packet Size

FS3

ClientNCP

9. Destroy Service Connection

ClientFSI

NCP

Figure 5. Additional Steps Performed by LOG IN.EXE

Another major difference between
the old shell and the preferred servershell involves the receipt of Give
Nearest Server responses. Older
shells accept the first Give Nearest
Server response they receive and ignore all subsequent responses. Preferred server shell s al so accept thefirst response, but save the next four
Give Nearest Server responses incase a connection cannot be made to
the first server.
Servers respond to Get Nearest Server requests even if they have no freeconnections. Consequently, older
shells fail to establish a connection(steps 5 and 6 of Figure 3) if thefirst Give Nearest Server response received is from a server with no freeconnections. The preferred servershells, on the other hand, can referto the next saved Give Nearest Serv-

Server's
Name

Full
Address

er response if the current attempt toestablish a connection fail s.

LOGIN.EXE
Users can run LOGIN.EXE any timeafter the shell has connected to a
NetWare fi le server. LOGIN submits
the user' s name and password to thefile server for verification. It al so establishes a new server connection if
the user specifies a fi le server namein the LOGIN command.
If the server specified at the com-mand line is not the one the shell isalready connected to, LOGIN fo llows the steps outlined in Figure 5.
Once these steps are completed,
LOGIN verifies the username andpassword. If the server specified at
the command line is located on thesame segment as the workstation,
steps 3 and 4 are not necessary.

Intermediate Packet
Router's
Sequence
Node Address Number

Connection Receive
NumberTime
Out

MaxmumTime
Out

Figure 6. Portion of the Shell's Connection Table

Personal Systems/Issue 4, 1991

ATTACH.EXE uses the same
sequence as that described for
LOGIN.EXE when establishingconnections to a file server.

Connection Management
Communication between any twoworkstations requires a certain
amount of responsibility on bothsides to ensure that no information islost. In the NetWare environment,
NICs maintain error checking at the
bit level. File servers and workstation shells handle at the packet andsession level .
It is a common misconception that
SPX is used for packet-level error
checking between workstations andservers; however, SPX is used only
for peer-to-peer interaction. It is actually the NCP that governs the way
connection control information is exchanged. Every NCP packet a client
submits to a NetWare fi le servermust contain a connection number
and a sequence number. The connection number assigned to the client
when the file server connection is established. The sequence number
identifies each packet so that boththe server and the shell can tell if apacket gets lost.

The Shell's Connection Table
NETx.COM (the shell) can support
up to eight server connections concurrently. NETx.COM maintains aconnection table to track these connections (Figure 6).
Within each entry in thi s table, theshell stores the name and full internetwork address of the server towhich it is connected. If the shell isforwarding packets through an intermediate router to the server, thenode address of that router will be
stored in the Router's Node Address
field . The shell's connection number
and packet sequence number are83

Connection#

Network
Address

Node
Address

SocketNumberSequence
NumberWatchdog
Count

Watchdog
Timer

NIC
NumberIntermediate
Router's Address

Figure 7. A Portion of the NetWare File Server's Connection Table

also kept in the table. The sequencenumber is set to zero when the connection is first established and incremented with each new request sent.
The shell's connection table also
maintains two timeouts. Max TimeOut is the maximum time the shell
will wait for a response from theserver before resending a request
packet. This timeout is based on an
estimate of the time (in ticks)
needed to deliver a packet to theserver. The router provides this time
estimate in its Give Immediate Address response. (If the workstationand the server are on the same segment, this value is set to one tick. )To set its maximum timeout for communications with a server, the shell
multiplies this estimate by 16 andadds 10 ticks to the result.
The Receive Timeout is a dynamic
timeout originally set to four times
the time estimate received in theGive Local Target response plus 10
ticks.
Receive Timeout= 4t + JO
Once initially set, the receive timeout adjusts up or down to adapt tochanging network conditions. If theshell issues a request to a server anddoes not receive a response within
its current receive timeout, the receive timeout is increased by one
and a half times its original value.
New Receive Timeout =1.5 (current Receive Timeout)

It remains at this new value for all
subsequent retries of the current request and on first try of the next request. If the next request requires a
retry, the receive timeout is increased again. The shell continues toincrease the receive timeout until itreaches the maximum timeout.

Each time the shell does not have toissue a retry to a request, it decreases the receive timeout. To determine how much to decrease thereceive timeout, the shell takes thetime to receive a response to the lastrequest (that didn't require a retry),
multiplies that value by two, andadds 10 ticks. The shell sets the newreceive timeout to the average ofthis calculated val ue and the current
receive timeout.
New Receive Timeout=[2(Time to receive response) + JO
+ Current Receive Timeout)/2
The number of times the shell will
resend a request to a server is determined by the IPX Retry Count. If
this count is exceeded, the shell
gives up and presents the user with a"Network error on server xxxxx. Error xxxxx from network. Abort, Retry?" message. All drivers have adefault for this retry count. This default differs from driver to driver but
is generally between 20 and 40. The
SHELL.CFG file's "IPX RETRY
COUNT = xx" option allows the default IPX retry count to be modified;
however, some drivers ignore this en-

Personal Systems/Issue 4, 1991

try in the configuration file andleave the retry count at their default.

The File Server Connection
Table
The file server connection tableshown in part in Figure 7 allows theserver to keep information about
each of the clients it is servicing.
The server uses the address fields
for addressing response packets andfor security purposes. When apacket arrives with a service request,
it contains the connection number assigned to the sender. The servermatches the packet's IPX source address (network, node, socket) withthe address registered for that connection number. If the addresses
don 't match, the server regards therequest as a security breach.
The NIC Number and Intermediate
Router's Address fields are used forsending responses to clients. As a request packet is received, the server
places the number of the NIC the request came in on in the NIC Number field. This number would be A,
B, C, or D for NetWare version
2.15c and earlier, or the NIC's network number for NetWare versions
3.0 and hi gher.
If the packet was forwarded throughone or more routers, the server
stores the node address of the lastrouter in the Intermediate Router'sAddress field. This saves the server
from having to find a route to the client when it is ready to send a response. The server gets the node84

Service Request
Request notreceived by fileserverNo response
from server
within shelJ ' stime-out~-----~

Workstation/

File Server

Second Identical Service Request--

ur,, -· .:10---

File ServerWorkstation

Completed Service Response

Workstation

File Server

Figure 8. Request Lost in Transit to File Server

address of the first router from theIntermediate Router's Address fieldand places it in the MAC header destination address field. It then sends
the packet through the NIC specified
in the NIC Number field. Of course,
it first places both the client's andits own full network address in thedestination and source address fieldsof the IPX header, respectively.

File servers also maintain a 100-byte
reply buffer for each of their connections. If a response to a client is lessthan 100 bytes, the server places a
copy of the response in the buffer
corresponding to that connection.
That way, if the client does not receive the response and resends therequest, the server will not have toreprocess it.

The Sequence Number field is used
for packet-level error checking. The
Watchdog Count and Timer fields
are used by the watchdog process,which is discussed later.

Packet-Level Error Checking
The bit-level error checking provided by network adapters detects
the corruption of individual bits
within a packet. When an adapter
finds that part of a received packet

Personal Systems/Issue 4, 1991

is corrupted, it discards the entire
packet. Because of the driver's simple design, it contains no mechanism
to request that the packet be resent
or to inform the upper-layer processes and applications that an error
occurred. Therefore, the upper-levelsending process (the shell or fileserver) must determine when apacket has not reached its intended
destination.
In the NetWare environment, thispacket-level error checking is the responsibility of the shell. The NCP
permits a workstation shell to submit
only one server request at a time.
Furthermore, the server's response

85

Service Request

File ServerWorkstation

Completed Service Response·X
Workstation

Request notreceived by fileserver~File Server

Second identical Service Request

Workstation

File Server

Completed Service Response

File ServerWorkstation

Figure 9. Response Lost in Transit to Shellmust fit in a single packet - the shellshould never request more than apacket's worth of information. To
guarantee that no packets have been
lost, the shell has only to make sure
it receives a completed response toeach of its requests.

Each workstation request contains asequence number within the NCP
header. The server's response islabeled with the same sequence number. Ultimately, the shell is responsible for getting a completed response
for each service requests it submits.
If the shell does not receive a re-

Personal Systems/Issue 4, 1991

sponse to its most recent request
within the specified receive timeout.
The shell continues to resubmit therequest until it either receives a
response or exceeds its IPX Retry
count.

86

Service Request

No response
from server
within shell ' stime-out

File ServerWorkstation

Second Identical Service Request

File ServerWorkstation

Busy Now but Have Received Your
Request and Will RespondFile ServerWorkstation

Completed Service Response

File ServerWorkstation

Figure 10. File Server is Busy

Three conditions can cause the shellto timeout while waiting for a response from a server. Figure 8 illustrates a case in which the request is
lost in transit to the server. The
shell's timeout eventually expires,upon which the shell resends thesame request. The server receives

the duplicate request, processes it,
and sends back the response.

second, identical request to theserver.

In Figure 9, the request is received
by the server, but the response islost in transit to the workstation.
Once the workstation's timeout
reaches its limit, the shell sends a

When a server receives any request,
it checks the request's sequencenumber to see that it is one greaterthan the sequence number registeredin the server's connection table. If it

Personal Systems/Issue 4, 1991

87

is, the server increments that number
and processes the request as usual.
However, if the two sequence numbers are the same, the server determines that the client, for whateverreason, is resubmitting its lastrequest.
In some cases, the server might havea copy of the last response in its I 00byte response buffer for that connection. When a server sends a response
less than LOO bytes long, it places a
copy in that client's buffer - that is,the buffer coITesponding to that client's connection number. Since alarge percentage of responses are
smaller than 100 bytes, there is agood chance that a server will havea copy of the response when requests are resubmitted by clients.
(fhis type of response increments
the Duplicate Replies Sent counteron the the FCONSOLE StatisticsLAN l/0 Statistics screen.)
For requests larger than 100 bytes,
the server must reprocess the request
before sending the response. (Thistype of response increments the Reexecuted Requests counter in
FCONSOLE.)
The response might still be in transit
to the workstation when the shelltimes out and resubmits the request(that is, the shell receives the completed response after resending therequest). In this case, the server will
send another response, but the shell
will ignore it.
Sometimes the server is too busy torespond within the shell's timeout
period (Figure 10). As usual, theshell resends the request. When theserver receives this second request,
it sends a reply stating that the initial request was received successfully, but the processing is not yet
completed. (This intermediate response increments the Positive Ac-Time(minutes)

0
I

l

3

2
4

5
6
7
8
9
10
11
12

13
14

15

Watchdog packet sent
Watchdog packet sent
Watchdog packet sent
Watchdog packet sent
Watchdog packet sent
Watchdog packet sent
Watchdog packet sent
Watchdog packet sent
Watchdog packet sent
Watchdog packet sent
Watchdog packet sent-> Workstation disconnected

Figure 11. Watchdog Timetable for a Connection that Does Not Respondknowledgments Sent counter within
the FCONSOLE Statistics-LAN I/0
Statistics screen.)
When the shell receives this reply
from the server, it resets its timeout
to zero and waits for the request. If
the shell's timeout expires again, it
sends a third copy of the request justin case the response was lost in transit from the server. This process continues until the shell finally receives
a completed response.

Connection-Level Error
Checking
The connection between a workstation and server can be lost due to a
power failure or a communications
problem. Both the file server and theworkstation shell is equipped to handle this eventuality. At the workstation, the connection is checked eachtime a request is made. If the shell
does not receive a response to a request after it retries a certain numberof times (as dictated by the IPX Retry Count), the shell assumes a connection problem and displays amessage for the user. At this point,
the user can either order the shell toresubmit the request or abort theoperation completely.

Personal Systems/Issue 4, 1991

If the operation is aborted, the shell
removes that connection from its
Connection table. If it has no otherserver connections, the shell attempts to create a new connection
with a server (using the initial connection sequence outlined in Figure3). If this attempt fails, the shell informs the user with the following
message: You are not connected toany file servers. The shell will try toconnect to a file server whenever thecurrent default drive is changed to
an invalid drive. <Current drive is
no longer valid>.

At a NetWare file server, connectionlevel error checking occurs via address verification and periodic
watchdog polling. When a file server receives a request packet for a certain connection, it verifies that the
IPX source address within the request packet matches the address recorded for that connection in its
connection table. If the addresses do
not match, the server sends a response indicating that the connection
number and address do not match.

The Watchdog Process
When a workstation is turned off,
regardless of whether the user issued

88

the LOGOUT command first, the station's connection remains occupied
at the server. To clear these unusedconnections, the server uses thewatchdog process to poll any clientsthe server hasn 't heard from in thelast five minutes. The server tracks
the time for each connection in the
Watchdog Timer field of theserver's connection table. If the shell
being polled is still operational, it
responds to the watchdog query, andthe server resets its timer for thatconnection.
However, if the workstation has
been turned off, or if there is a communications problem on the network, the server will receive no
response from the shell. The watchdog process then resets the connection's Watchdog Timer field to zero,but increments the Watchdog
Counter field by one. The watchdog
process sends another query to theworkstation a minute later. As longas the watchdog continues to hearnothing from the workstation, it
sends a packet every minute until it
has sent a total of 11 polling packets
to that workstation. The server
clears the workstation's connection
if it receives no response to the lastwatchdog packet.

Conclusions

NetWare version
3.x-based servers provide
a setable parameter thatallows administrators tomonitor whenworkstations are logged
out by the watchdog
process.

Figure l I illustrates the timetable
for a connection that does not answer a server's queries. NetWare version 3.x-based servers provide a~etable parameter that allows administrators to monitor when workstations are logged out by thewatchdog process. This option is set
with the following command: SETCONSOLE DISPLAY WATCHDOG LOGOUTS = ON.

A series of protocols governs
NetWare's client-server communications. These protocols can be broken
up by functionality: protocols used
for all communications (the medium
access protocols and IPX), administrative protocols (the RIP and SAP),
protocols concerned with connection
control (the NCP and Watchdog),and, finally, the protocol that defines
the coding of service requests (theNCP).
This article has explained the operation and interoperation of these protocols; however, it makes no attempt
to apply this information to all possible network configurations and environments. It is up to network
administrators to apply this information to their specific networks.

ABOUT THE AUTHORPaul Turner is a consultant with thesystems research department ofNovell's Systems Engineering
Division.
Novell Inc.
P. 0. Box 5900
Provo, Utah 84606

Personal Systems/Issue 4, 1991

89

LANACS
Protocols
Mike Colucci
IBM Corporation
Dallas, Texas
Local Area Network Asynchronous Connection Server(LANACS) is a communications
gateway. It makes available to
LAN users a modem pool of up to
32 asynchronous lines. This is a
description of the LANACS enveloping scheme in the token ring environment. Understanding theframe formats and their enveloping scheme facilitates problem determination when using traces.

In explaining the reasons why

LAN ACS cannot communicate withother NetBIOS software, I normallyuse the following analogy:
I have a PS/2 in Dallas on a LAN
with a LANACS gateway. The
LANACS gateway can dial a mainframe in Atlanta. If the mainframe isin a soft drink plant, and I have a
spigot on my PS/2, why can't I get
the soft drink to flow from the plant
to my spigot using LANACS as agateway?
The answer is that LANACS does
not understand the interface called
Soft Drink Transfer Interface(SDTI). It does understand ACSI
and EBI. With the addition of OS/2
EE ACDI redirection, it understands
ACDI because ACDI is essentiallythe equivalent of EBI. Also,
LANACS Version 2 includes
TCP/IP support, so it understands
the TELNET protocol of TCP/IP.
So, LAN ACS is capable of speaking
EBI, ACDI, ACSI, TCP/IP, andAsync - but not SDTI.

Let's call the languages high-level
frame formats. These high-level
frame formats are enveloped in thelower-level frame formats, which are:
• Media Access Control (MAC)• Logical Link Control (LLC)• NetBIOS

Frame Formats from MAC
Layer to LANACSThe MAC-level frame is the lowestlevel frame. It is what you see if you
trace a token-ring. You might see a
MAC-level abort frame, a MAC
level frame used for LAN management, or a data frame that carries
user data in an LLC frame. A MAClevel frame might also be a free-token frame, but you won't see it in a
Trace and Performance (TAP) tool
trace.
The LLC frame is the next higher
level frame. In the data po1tion of
the LLC frame, you might have NetBIOS, SNA, TCP/IP, and so forth.
So from bottom to top, the MAClevel frame encapsulates the LLC
frame. The LLC frame encapsulates
the NetBIOS frame. The NetBIOS
frame encapsulates the data. The
data comes from LANACS and canconsist of actual ASCII data. But it
can also consist of non-ASCII datathat LANACS can interpret. These
are the interfaces mentioned in mysoft drink analogy.

MAC Frame
As can be seen at the the bottom of
Figure 1, there are several types of
MAC frames. They all start with a
bit pattern called a starting delimiterso the hardware can recognize the beginning of legitimate data. They all
have an ending delimiter which is another particular bit pattern. That's all
there is to the abort frame. The freetoken frame has an access control

Personal Systems/Issue 4, 1991

byte preceeding the ending delimiter. And the MAC and data frames
have a frame status byte following
the ending delimiter.
The MAC and data frames are similar. Between the delimiters they
have bytes for control, addressing,and data checking. The difference isthat the MAC frame has a field for
MAC-level commands and information and the data frame does not.
Instead it has two fields. One is routing information and the other iscalled the LLC Protocol Data Unit
(LPDU).
The important point here is that all
the other fields surrounding the
LPDU are the envelope provided by
MAC-level software. That software,in this case, is on a token ring card.
The protocol is named IEEE 802.5by the IEEE standards organization.
The LPDU itself is the LLC frame
encapsulated in MAC information.

LLC Frame
This frame contains the Service Access Point (SAP).
When an application starts, it opens
an SAP, which might be considereda type of address. When an application connects to another system it
provides both its own SAP (source
SAP) and the SAP of its partner (destination SAP). The communicating
systems must use SAPs known toeach other to communicate. For example, the NetBIOS SAP is F0. An
SNA SAP is 04-. Either one can ridein an LLC frame. A destination has
to have SAP 04 open or the source
can't send it any 04 SAP information. It can't talk to NetBIOS SAP.
The control field in the LLC frame
contains the LLC protocol, which
consists of the commands and responses. The rest of the frame is the90

NETBIOS Frame'_ . - - - - - - - - - - - - - - -v-a-r·,,a-b-le- s~iz-e- - - - - - - - - - - - - - ~ - NETBIOS Header

LANACS Data

•

Xmit/
Dest
SourceHeader 'EFFF'
I
Optional Optional
length NETBIOS Command data 1
data 2 Response Name or Name orCorrelator Number Number
Delimiter

Data

NETBIOS uses F0 SAP
LLC Frame
DSAP

SSAP

1 or 2

0-n

CONT

DATA

Numbers in boxes are thenumber of bytes

MAC Frames
2
Routing
Control

2
Segment
Number2
Segment
Numberl

Source Routing Info

SD

AC

FC

DA

SA

0-18

3- n

RI

L-PDU

FCS

ED

FS

Data Frame

1

1

SD AC

FC

1

2-6
DA

2-6
SA

variable

4

MAC

FCS

1

1

ED FS

MAC Frame

ffi
D

Abort

1

1

1

SD

AC

ED

Free Token

Figure 1. IBM Token-Ring Protocols Used with LANA CS (1 of 2)

Personal Systems/Issue 4, 1991

Abbreviations
AC
Access Control
CONT Control
DA
Destination Address
DSAP Destination SAP
Ending Delimiter
ED
FC
Frame Control
Frame Check Sequence
FCS
Frame StatusFS
MAC Media Access Control
LPDU LLC Protocol Data Unit
LLC Logical Link Level
Source AddressSA
SAP Service Access Point
Starting Delimiter
SD
SSAP Source SAP91

ACSI Protocol
Command

2
EF01
EF02
EF03
EF04
EF05
EF06
EF07
EF08
EF09
EFOA
EFOB
EFOC
EFOD
EFOE
EFOF

Examples0Abbreviations

EBI/ACDI Protocol

ID
L
LL
T

Command

Data

1
80
81
82
83
84
85
86
87
88
89
SA
A1
A2
A3
A4
AS
A6
A7
AS
A9
AB
AC
AD
AE
AF

1
00

Command ID
Sub-vector LengthCommand Vector Length
Sub-vector Type

Examples
0

0

0

0

0

Set Mode
Modem Status
Req Modem Status
Delay
Set Pacing
SetXONSet XOFFSet Xmit Bit Rate

Connection ID Response
Change Parameters
Query Parameters
Connection Parameters
Request Queued
Cancel Queued
Data Only
Reserved
00Command vector can containmultiple sub-vectors which cancontain other sub-vectors. These
vectors are commands and/or
information

0
0

- -

0
0

0
0

0
0
0

0

Sub-vector

Sub-vector

1 1 variable
Va lueL T

1 1 variable
L T Va lu e

0
0
0

03
00
00
FF
FF
00
FF

03
07
07
FF
FF
FF
FF
FF
FF
00
FF
FF
00
00
00
00
00

1

Command Vector

2
LL

LANACS Frame

2
ID

variableSub - Vector Da t avariable
ASCII Data

l

1
Byte
Count

_L
var iable size
Dat a

NETBIOS Framevaria bl e s i ze
NE TBIOS Heade r

LANACS Dato--,

Numbers in fields are the number of bytes

Figure 2. IBM Token-Ring Protocols Used with LANA CS (2 of 2)

Personal Systems/Issue 4, 1991

92

Abbreviations

Commands
End sub-negotiations
No operation
Data MarkBreak MarkInterrupt process
Abort output
Are you there
Erase character
Erase line
Go ahead
Sub-negotiation

ARP

Addr Resolution Prot
cc Command Code
CONT Control
DSAP Destination SAP
IACInterpret as Command
IP
Internet Protocol
LLC Logical Link Control
ON
Option Negotiation
ORG Organization TypeRARP Reverse ARP
SAP Service Access Point
SNAP Sub-NW Addr Prot
SSAP Source SAP

-

240
241
242
243
244
245
246
247
248
249
250

Options
0
0
0

33
255
J

l
-

0 to nData3270 data stream
J

TELNET frames are either command( 1st character is X"FF" -Decimal "255 ")or data (can be 3270 data stream if
TN3270 protocol)--

I_ - - - -- -TCP Frame

◊

1

~

-

l

--

r

0 to nTCP HEADER includes: po rts, sequence number, ac knowledge ment number,control bytes, window, checksum, urgent pointer, opti ons, and padding

l

---

-

-

-- ----··

--- -

-

--

-

DATA

-

--

-

l

-

-

I
= IP
= ARP I= RARPI---

LLC Frame---

ARP or RARP
address data----

AA indicates 5 byte SNAP
address follows CONT field

1

DSAP
AA

I

1

SSAP

DATA
J

--

0800
0806
0835

I
0 to nIP HEADER includes: version, length, type of service, total ID, flags, frag ment
offset, timing, protocol, checks um, source IP address, destination IP address,
options, and paddin g

l

J

--

11 or 2

CONT

AA

J

--

---

SNAP addresses I
Datagram types

.J

I

---

--

IP Frame

◊

ON

'c

5
--

-

---

_I

~

TELNET Frame

9

0

~

0 to n

3

2

ORG

TYPE

DATA

00 00 00

08 00

IP Datagram

Figure 3. TCP/IP TELNET Protocol Used with LANA CS

Personal Sy stems/Issue 4, 1991

93

data. This data field is the NetBIOS
frame encapsulated in LLC information. The LLC protocol is named
IEEE 802.2 and is also software thatis found on the token ring card.

NetBIOS Frame
This frame starts with a field that defines the length of the header. Next
is a 2-byte specific bit pattern that isthe delimiter for the frame. The
NetBIOS command follows. The
command gives and takes all the information it needs from a Network
Control Block (NCB). The NCB varies depending on the commandwithin it. The NetBIOS frame also
contains source and destination information, just as the LLC and MAC
frames. As each level is stripped off,
the remainder has to have an address
to go to until it reaches the application. Finally, following all this information in the NetBIOS header, isthe data field. This data field is the
LANACS data.
Just as a reminder, NetBIOS stands
for Network Basic Input/Output System. The NetBIOS frame encapsulates the LANACS data frame.
NetBIOS software is found in LAN
Support Program. It is also part of
OS/2 EE. It doesn't have a namegiven by IEEE or any other organization because it is an industry defacto
standard.

LANACS Frame
As can be seen from Figure 2,
LANACS frames come in different
forms, commonly called protocols.
Actually, some are programmjng interfaces. (You'll find, although notaccurate, the terms protocol and interface are often used interchangeably. Put simply, interfaces arecommands. Protocols are thesequence in which the commands areused.) Figure 2 depicts both the

ACSI protocol and the EBI protocol.
ACDI uses the EBI protocol.

ACSI: ACSI is a complicated language. It's called a protocol in its
original documentation in an issueof IBM Personal Computer Seminar
Proceedings, Volume 3, #4, October1985 (G320-0323). Each command
generates a series of NetBIOS commands. Sometimes, ACSI information or data is imbedded in acommand, such as the data command EFOB.

also indicates that this is TCP/IP.
The first three bytes of the SNAP address (the organization code field)
have been assigned Os (zeros) by thestandards committee. The next two
bytes (type field) indicate which protocol - IP, ARP, or RARP - is being
used. If it is IP, the type field is hex'0800' (decimal '2048'). If it is
ARP, the type field is hex '0806'(decimal '2054'). And RARP has atype field of hex '8035' (decimal'32821 ').

The ARP Frame: This frame also
EBI: EBI is a language written to
PC interupt X' 14' , which is the vector that points to the async adapter
device driver. When EBI is installed,
the vector is changed to point to a
LAN device driver so COM ports
can be redirected to the LAN. Extra
commands are added to the device
driver. EBI commands generate actions within the workstation or theygenerate NetBIOS packets that contain a command byte along with adata byte. Or it can generate a
NetBIOS packet that contains ASCII
data. This is unlike the ACSI data
packet, in which a command vector
precedes the ASCII data. The EBINetBIOS packets (commands) are
shown in Figure 2.
In-depth information on EBI isfound in the LANACS Installation
and Configuration Guide.

TCP/IP Frames
Again, the protocol layers are encapsulated in each other, as shown in
Figure 3.

The LLC Frame: The TCP/IP LLC
frame is different than the NetBIOS
LLC frame. The DSAP and SSAP
fields contain hex 'AA' (decimal' 170'). That indicates that following
the control field is a five-byte SNAP
address. The control field is normally followed by data. The' AA'

Personal Systems/Issue 4, 1991

has a SNAP indicator of hex'AAAA'. But the end of the frame
contains actual TCP/IP addresses. In
this case, the trace indicated a
TCP/IP address of hex '09 13 8D
05 ' (9.19.141.05, the host address).

The IP Frame: This frame is encapsulated within the LLC frame as thedata field. The IP header contains
various information including
addressing.

The TCP Frame: This frame is encapsulated within the IP frame as thedata field. The TCP header contains
port and control information.
The TELNET Frame: TELNET
commands are identified by hex'FF' (decimal '255') in the first databyte. They are used to negotiate thebind parameters between the two
communicating entities. That is one
type of TELNET frame. The othertype of TELNET frame is data. It
does not contain the hex 'FF' in thefirst byte. It can be straight data or
3270 datastream data. If TN3270,
which is supported by LANACS, isused, the data will be in 3270 datastream format. The TN in TN3270
stands for TELNET, which is only
one of many of a suite of protocols
supported by TCP/IP. But rememberthat it is the only one supported by
LANACS.

94

ACSI
ProtocolComposite Frames

EBI/ACDI
ProtocolCommands

CommandFinally, let' s put them all together inFigure 4 to see how it flows .

Data~mmao~ sOpt;o~(You will note that the SDTI isconspicuously absent.)

Sub-vector Sub-vector

□□

'~
r--

r

'-------

Yector ~ - 1

Sub-vector

ASCII
□
Data

0

3270
Data
Stream
L_

II

I I

~

IP Frame---~---_J_

SNAP Address

I j

C

NETBIOS Frame□

LTCP FrameLANACS Frame

NETBIOS FrameABOUT THE AUTHORTELNET FrameI

LLC Frame I- .)MAC Frames
SourceRout ing

I

I

'

I

Reading'---

I LLC FrameI

Mike Colucci is an Advisory Market
Support Representative in National
Technical Support. He has been the
focal point for I.ANA CS support
since its inception. He has also
supported other asynchronous
products such as Asynchronous
Communications Server (ACS) andRemote NetBIOS Access Facility(RNAF). He has recently added
support for the async ASCII portionof OS/2 EE Communications
Manager to his responsibilities.

If

For more information on LANACS,
including traces, refer to Local Area
Network Connection Server(LANACS) Version 2 Simplifying
the Complex (GG66-3202).
For help in understanding frame
formats, protocols, and NetBIOS
commands, the following documentation is available:

Token-Ring Network Architecture
Reference (SC30-3374)

I ,

Data

Local Area Network Technical
Reference (SC30-3383)
TCP/IP Tutorial and Technical
Overview (GG24-3376)

Control

Abort
Figure 4.

Free Token

Local Area Network Protocols Used with LANA CS

Personal Systems/Issue 4, 1991

IBM Personal Computer Seminar
Proceedings, Vol 3, # 4, October
1985, "IBM Asynchronous Communications Server Protocol"(G320-0323)

95

New Book:
Client-Server
Programmingwith OS/2
Extended Edition• Processes versus threads

This book on client-server computing was written by Robert Orfali and
Dan Harkey of IBM. Through easyto-read, in-depth tutorials and working code, the book shows how tointegrate databases, LANs, andgraphical front-end clients to build
working client-server applications
using OS/2 EE. A Club Med reservation system serves as a grand finalethat brings together GUI clients,
database servers, and LAN
communications.

• GUI tools versus Presentation
Manager programming

In addition to the tutorials, the bookcontains more than 300 pages ofworking code and benchmarks that
demonstrate the many trade-offs inclient-server design, such as:• APPC, NetBIOS, named pipes, or
the LAN server• Static SQL versus dynamic SQL• Remote SQL versus stored
procedures• Transaction servers versus database servers

The software in this book provides a
jumpstart for creating OS/2 clientserver applications in record time.
To create a robust client-server platform, the authors use OS/2 EE's advanced features, including:• Referential integrity• Remote Data Services• Advanced peer-to-peer
communications• Threads

The friendly style of this book appeals to a wide audience, ranging
from novices to PC programmers
and MIS professionals. It should
also be of great interest to LAN andcommunications specialists, databaseadministrators, and anyone interested in SNA, SAA, or OS/2 EE.
The book can also be used as a supplementary text for courses on networks, operating systems, OLTP,
LANs, SQL, database theory, servers, and distributed systems. Finally, this book explains the power of
OS/2 and how it fits with SAA and
CUA.

Authors: Robert Orfali and Dan
HarkeyIBM Mechanicsburg order nunber:G325-0650
Description: /000 pages, $39.95
Publisher: Van Nostrand Reinhold,
New York, New York• Network and database administration utilities

IBM Personal Systems Developer
The IBM Personal Systems Developer is a quarterly publication written primarily for OS/2 application programmers. It features a variety of technical articles, such as programming tips and techniques, product reviews of new
software tools, application development case studies, and interviews with OS/2 industry leaders. IBM employees,
customers, and software vendors write articles for the Developer. The magazine is published as part of IBM's
Developer Assistance Program, which offers a variety of support services for companies that are writing OS/2
applications for resale.
Subscriptions can be ordered be calling I 800 READ-OS2. IBM employees can subscribe throughMechanicsburg's Systems Libra1y Subscription Service (SLSS), order number 0362-000 I.

Personal Systems/Issue 4, 1991

96

Keystroke Savers
Here are a few tips that will savemany keystrokes when you're working in DOS.
The first tip is a little-known featureof DOS that allows you to eliminate
the use of asterisks as wildcard parameters in conjunction with a DOS
command (COPY, DEL, and soforth) . DOS allows you to omit theasterisks so you can type:

DEL .
in place of

DEL*.*For example, to copy all the files on
your C drive root directory to a
floppy disk you can type thecommand:Here are hints and tips from our readers. If you have "little solutions" toshare, send them to us in care of the editor.

COPY C:\. A:
as opposed to

COPY C:\*.* A:

Modifying Your LIBPATH
Statement on the Fly
A real problem for some OS/2 users
is the inability to dynamically modify the OS/2 library search path.
While the PATH and DPATH statements can be modified easily, the
LIBPATH statement is not part ofthe environment space and as suchcannot be modified while OS/2 is
executing.
While this remains a hard-and-fastrule, here's a trick you can use togain a small measure of flexibility inyour library path during execution.

Code your LIBPATH statement with.'as the first two characters on the parameter line. This causes OS/2 tosearch the current subdirectory first
before searching the libraries defined in the rest of the library path.
By manipulating the current directory, you can have some effect upon
the library search path.
Figure 1 is an example of the LIBPATH statement with the current directory defined as the first directory
to search. - Dave Dill, IBM, Dallas

LIBPATH=.;c:\libraryl;c:\library2;d:\library3;
Figure 1. Example LIBPATH Statement

Personal Systems/Issue 4, 1991

The next tip is a way to change froma subdirectory to a directory one
level higher in your directory tree
structure without specifying thedirectory name. For example, tochange from the directory\BATCH\COMMANDS\UTILS to\BA TCH\COMMANDS, you would
normally type:

CD \BATCH\COMMANDS
To achieve the same result, you cansimply type:CD ..
The last tip is a way to use batch
files that will save you from typing
commands that have replaceable parameters. For example, the program
PKZIP (a widely used file compression utility), along with its companion program PKUNZIP allows you
to compress many files into one

97

smaller file for easier portability between DOS machines. After the fileis transferred to the destination machine, it can be decompressed backinto its original form of many separate files. Let's assume you want toback up all the files with the extension .EXE in the directory \UTILS
into one file called UTILS.ZIP. The
command to do this (after making
sure you are in the \UTILS directory) is:

also a replaceable parameter whose
value is dete1mined by the second
parameter of the command. In our
example it is *.EXE.

PKZIP -A UTILS.ZIP * .EXE

ex. UNZIP UTILS.ZIP \TOOLS

where -A tells it to add files to an archive file, UTILS.ZIP is the output
archive filename, and *.EXE is therange of files to include. You may
then transfer the file to the destination machine for decompressing. For
the purposes of this example, let's
assume you put the fi le into the destination machine's C drive root directory and that you want the original
decompressed files in a directory on
the same drive called \TOOLS. The
command to accomplish this is:

The %1 represents the input archive
file name and %2 represents the output directory name.

PKUNZIP -X UTIL.ZIP \TOOLS
where -X tells it to extract files fromthe archive file, UTIL.ZIP is the input archive filename, and \TOOLS
is the output directory name.
Both of these commands are rather
lengthy and cumbersome. Instead,simply create two simple batch files:
The first batch file is called
ZIP.BAT and compresses the files
into an archive file.

PKZIP -A %1 %2
ex. ZIP UTILS.ZIP *.EXE
The % 1 is a replaceable parameter
whose value is determined by the
first parameter after the name of thebatch file ZIP; in the preceding example it is UTILS.ZIP. The %2 is

The second batch file is called UNZIP.BAT and decompresses the archive file back into separate files
with the option of specifying which
directory to put the files into.

PKUNZIP -X %1 %2Make sure that these two batch files
and the programs PKZIP.EXE and
PKUNZIP.EXE are in directories
that can be found in your DOS path
(specified in your
AUTOEXEC.BAT file).
The files shown here are examplesof the use of the % parameter. You
may use the % parameter in yourown batch files that start programs
that have parameters that need to be
input.
These shortcuts can be realtime-savers when used regularly.
- Forrest York, Dallas

say there was an error, it is just an
informational message.
Changes to Home Directories:
Starting with LAN Server version
1.30.1, home directories will nolonger be defined as an alias. Also
the home directories can be locatedon any server at any location on theserver.

Until version 1.30.1 of LAN Server(WR05015), when a home directory
was created it was automatically put
under the IBMLAN directory on thedomain controller. Beginning withversion 1.30.1, when the administrator is defining a home directory fora user, the system asks which server
the home directory will be on andthe path to the directory. If the pathdoes not exist, the directory and path
are created. This can also be done
from the command line. Documentation for this is on the README filefor CSD 5015.
When a home directory was created,
an alias was automatically createdand shared at user request with anaccess profile giving only that user
access. With version 1.30.1, an alias
is not created. The share will be a
dynamic share just as you can dofrom the command line. There is a
non-alias access profile created with
only the user having access.

LAN Solutions
Out of Resources? Lan Server 1.3
will fail to start if resources requested in the IBMLAN.INI file arelarger than those defined in the Communications Manager configuration
file. Lan Server 1.30.1 will allow theserver to start, although the server
will have fewer resources than requested. An error message,
NET3 I 98, will be written to the error log to let you know all requested
resources were not available whenstarted. The error message does not

Personal Systems/Issue 4, 1991

Updating DLR from 1.2 to 1.3
across the Network: There is nopredefined function (as with the
CSD download) that allows you to
download DLR 1.3 to DLR 1.2 machines. The options are to install thecode on each diskette or to install
the code on the server (because it ispacked on the diskettes) and thencopy it to an existing DLR workstation. You could implement this function by performing the following
steps:

98

1. Install DLR 1.3 on one requester.
2. Access a shared driver at theOS/2 1.3 Server from the 1 DLR 1.3
requester.
3. Copy the DOSLAN subdirectory
tree structure to the server from theDLR 1.3 machine.
4. Because the DLR 1.2 at 4098 machines can log on to the OS/2 1.3 domain, you can easily provide accessto the files copied to the server insteps 2 and 3 to the DLR 1.2 at
4098 machines.
5. Copy the DOSLAN files fromthe server (that is, from steps 2 and
3) to a new subdirectory at the DLR
1.2 machines (that is,
C:\DOSLAN13). Do not delete theoriginal DLR 1.2 subdirectory until
DLR 1.3 is working.
6. Edit the DLR 1.2
AUTO EXEC.BAT and change the
PATH to C:\DOSLAN13 (or towherever you copied the files).
7. Edit the
C:\DOSLAN 13\DOSLAN.INI file(after you have copied it) to reflect a
unique machine name.
8. Reboot the DLR 1.2 machine.
DLR 1.3 should then be available.
DOS 5.00 and DLR: If you want to
run DOS 5.00 and DOS LAN Requester, there are different procedures depending on what you
currently have installed.

DOS 3.3 and 4.01 users who have
DLR installed can install the DOS
5.00 Upgrade and then install thefixes provided with the Upgrade on

the IBM Network diskette that is included. DLR must be installed before the upgrade. If you try to install
DLR 1.3 after the DOS 5.00 Upgrade, it will fail, displaying a message that you are out of storage.
New DOS 5.00 users can install
DOS 5.00, then install the DLR
1.30.1 diskettes that are now being
shipped with OS/2 LAN Server
1.30.1.
New DOS 5.00 users who have
DLR 1.30 and CSD 5015 can use
the following procedure if the serveris at CSD WR05015:
1. Install DOS 5.00.
2. Edit CONFIG.SYS and make
FILES=30.
3. Install LAN Support Program
4. Reboot the machine.
5. On the first DLR 1.30 diskette, remove the "read only" from the file
CIP_MAIN.EXE (in the root
directory).

to a diskette:
REDIR40.EXE
NET.COM
NETWORK.MSG
NETWORKl.CMD
NETWORK2.CMD
NETWORK3.CMD
Copy those same files to the
DOSLAN directory on the workstation using the following commands:

attrib *.* -r
copy a:\*.* c:\doslan
attrib *.* +r
attrib doslan.ini -r
10. Start DLR, log on, and run
INSTDLR.BAT (see CSD WR05015
READ.ME) to update the rest of theworkstation DLR files.
NET WHO: If DLR users are
dropped from NET WHO within one
hour of logging on to the DLR, theyneed to add the /NMS:n (where n is
one or more) in their DOSLAN.INI
file. This uses a minimum of 2.7 K(4.4 Kif HIMEM isn't specified).
They must also install fix IC02772,
which is available from the software
support center.

6. Copy CIP_MAIN.EXE from server \IBMLAN\DOSLAN\NET to thisdiskette.

Sharing CDROM: A CDROM canbe successfully shared across the
LAN using OS/2 LAN Server 1.2 orhigher. The administrator must issue
the following at the Server:

7. Make the file CIP_MAIN.EXE"read only" on the diskette.

NET SHARE cdrom=d:\Issue at the OS/2 requester:

8. Install DLR 1.30 on theworkstation.
9. Update base DLR files toWR05015 in the DOSLAN directory. This may be done with the
IBM DOS 5.00 Upgrade, or the user
can copy the following files fromthe server \IBMLAN\DOSLAN\NET

Personal Systems/Issue 4, 1991

NET USED: \\servname\cdrom
The administrator needs to create a
non-alias access control profile forthe path to the CDROM drive andgive R access.
- Monte Hall, IBM, Austin

99

New Products
Hardware
IBM PS/2 Model 70 386(081, 161, A81 and A16)
These new PS/2 system units address awide range of customer needs and enhance the PS/2 family of systems withadditional standard memory and enhanced fixed disks. All of these models
have 4 MB of standard memory and a
32-bit microprocessor with the capabilityof supporting up to 16 MB of high-speed
real memory.
The 80386 processor models 081 (80 million bytes/20MHz), 161 (160 million
bytes/20MHz), A8 l (80 million
bytes/25MHz) and A16 (160 million
bytes/25MHz) enhance ESDI files andsupport the addition of an 80387 optional Math Co-Processor, which offers
significantly improved system performance for a desktop environment. The
Models PS/2 70 386 8570-AS l and A 16
can be upgraded to the 25MHz i486
processor by the installation of the486/25 Power Platform.
These models are appropriate for advanced users who perform numeric-intensive applications requiring floating-point
operations, large processing intensive applications or applications requi1ing highperformance fixed disks. These newmodels of the PS/2 70 386 family maintain compatibility with most existing software products for IBM personal
computers and systems.

Highlights:• 32-bit 80386 (20MHz-25MHz) andlarge capacity 80 MB or 160 MB
fixed disks with integrated controller• 4 MB memory on the system board
and capacity of up to 8 MB highspeed memory on system board• Micro Channel ® architecture withone 16-bit and two 32-bit slot and optional 80387 Math Co-Processor
Letter# 191-079, June 11, I 991

IBM PS/2 Model 55 SX andMemory Upgrade for IBM
PS/2 Model 55 LS
New models of the PS/2 Model 55 SX(8555-041, 081) have additional standard
memory, higher capacity and enhanced
performance fixed disks.
The PS/2 55 SX new models have 4 MB
standard memory, a 32-bit microprocessor with the capability of suppo1ting up
to 16 MB of system memory and a 40mi llion-byte or SO-million-byte fixed
disk drive.
Additional functions of the PS/2 Model
55 SX include: 1.44 MB, 3.5-inch diskette drive; ports (keyboard, pointing device, serial/asynchronous, parallel,VGA); three 1/0 slots and keyboard.
Standard memory for the 32-bit microprocessor PS/2 Model 55 LS (8555-LEO
and LTO) is increased to 4 MB with thecapability of supporting up to 16 MB of
memo1y. The 8555-LEO and 8555-LTO
can also be upgraded with a 40 MB or
80 MB fixed-disk drive.

Highlights:• New PS/2 Models 8555-041 and 081
with fixed disks larger and faster thanprevious Model 55s; 4 MB standard
memory; 80386SX 16MHz processor

1.44MB diskette drive support, Math CoProcessor socket, and three single in-line
memory module (SIMM) sockets (twoavailable for memory expansion). The
PS/2 Model 40 SX is offered in a diskette-only model (8540-040) and 40MB
and 80MB fixed-disk models (8540-043
and 8540-045).
The Model 40 SX supports the IBM Enhanced (101-key) Keyboard, Space Saving (84-key) Keyboard, or the IBM Host
Connected (122-key) Keyboard. The keyboard selection can only be specified in
new equipment orders and cannot be ordered sepru·ately for on-order or installed
equipment.
Also announced are two new 8 MB
memory module options designed to expand system board memory. The IBM
PS/2 8 MB Memory Module Kit-80ns(#1401, 6450129) contains 8 MB of 80
nanosecond memo1y on a single SIMM.
The IBM PS/2 8 MB Memory Module
Kit-70ns (#5116, 6450130) contains 8
MB of high speed, 70 nanosecond memory on a single SIMM. These memory
module kits are supported on PS/2 Models 35 SX, 35 LS, 40 SX, 57 SX, 90 XP
and 95 XP. The PS/2 Models 90 XP and
95 XP can now support up to 64 MB ofmemory on the system board.
Letter# I91-076, June 11, 1991

• Upgrade of PS/2 Models 8555-LEO
and 8555-LTO to 4 MB standard memory; 80386SX 16MHz processor

IBM PS/2 Model 35 SX(8535-040, 043) IBM PS/2
Model 35 LS (8535-24X)

Letter# 191-077, June 11, 1991

The PS/2 Model 35 SX utilizes the80386SX microprocessor operating at
20MHz with zero to two wait states andhas the following integrated functions:parallel port, serial port, pointing device
port, video graphics rurny (VGA 16-bit)
port, keyboard port, 1.44 MB (million
bytes) diskette drive support, Math CoProcessor socket, and three single in-line
memory module (SIMM) sockets (twoavailable for memory expansion). The
PS/2 Model 35 SX is a 3-slot 2-bay system and is offered in diskette-only (040)
and a 40MB fixed-disk model (043). All
models have 2 MB of memory standard
on the system board (expandable to 16
MB). The PS/2 Model 35 LS provides a

IBM PS/2 Model 40 SX(8540-040, 043, 045)
The PS/2 Model 40 SX system unit utilizes the 80386SX microprocessor operating at 20MHz with zero to two waitstates to system memory. The Model 40
SX ships with 2 MB (million bytes) system board memory (expandable to 16
MB on planar), new 3.5-inch DASD options, five slots and four bays, and I6-bit
video graphics rurny (VGA). The
80386SX microprocessor PS/2 Model 40
SX has the following integrated functions: parallel port, serial port, pointing
device port, VGA port, keyboru·d port,

Personal Systems/Issue 4, 1991

100

small footprint and low priced, generalbusiness solution.
The Model 35 LS provides a local area
network (LAN) workstation solution andis available with all the standard featuresof the Model 35 SX, with the following
exception: no DASO devices are installed in this "medialess" system, but a
16/4 Token-Ring adapter with RIPL occupies one of the three adapter slots. The
PS/2 Model 35 SX is fully upgradeable
to the Model 35 SX configurations.
Both the PS/2 Model 35 SX and 35 LS
suppo1t the IBM Enhanced Keyboard( 101/102 keys), Space Saving Keyboard(84/85 keys) or the IBM Host Connected
Keyboard (122 keys). The keyboard selection can only be specified in new
equipment orders and cannot be orderedseparately for on-order or installed
equipment.
The PS/2 Floor Stand is a new option
available to customers who wish to install the system unit in a verticalorientation.
Letter# 191-075, June 11, 1991

IBM Select-a-Keyboard and
IBM PS/2 Host Connected
Keyboard
Select-a-Keyboard allows a customer tospecify one of the PS/2 keyboards in thisannouncement for the initial orders ofeither the PS/2 Models 35 SX and LS,
Model 40 SX or Model 57 SX. Thoseavai lable are the Space Saving Keyboard, the Enhanced Keyboard and the
new Host Connected Keyboard. They
are available in a variety of languages.
The new Host Connected Keyboard willallow users to operate in both PC and
Host modes from a PS/2, when usedwith either the IBM Personal Communications/3270 Version 2.0 or the IBM PC
3270 Emulation Program, Entry Level
Version 2.0 products. This keyboard provides a key arrangement very similar tothat found on the most popular 3270
style keyboard. Key caps are clearlymarked for both 3270 emulation andPS/2 application usage.
Letter# 191-086, June 11, 1991

IBM PS/2 3.5-Inch
Rewritable Optical Drive,
128 MB Rewritable Optical
Cartridge, Optical Drive
Kit A

Optical Drive (#0162, 6450162) in PS/2
Models 60 and 80-041, 071, 111 and
311 with either PS/2 Micro Channel
SCSI adapter installed.

The PS/2 3.5-Inch Rewritable Optical
Drive (#0162, 6450162) is a new technologically advanced SCSI storage device.
This attractively priced optical drive features high performance (4.3 MB per second data transfer rate, 66ms average
seek time) and high capacity ( 127 million bytes) in a compact 3.5-inch halfhigh package. The drive accepts either asingle-sided removable 3.5-inch magnetooptical (MO) cartridge that can be written and read many times, or a 3.5-inch
optical read only memory (O-ROM).
The drive adheres to the ANSI industry
standard Small Computer System Interface (SCSI) X3. l 31- I 986 and can be installed in PS/2 Models 57 SX, 60, 65
SX, 80, 90 XP, 95 XP, 3510 and 3511.
When combined with either of the PS/2
SCSI enclosures (3510-0VO, 351 1-003),
this versatile drive offers optical function
to any PS/2 Micro Channel desktop or
floor-standing system with a PS/2 SCSI
adapter installed.

IBM PS/2 2.3 GB External
SCSI Tape Drive

The IBM PS/2 128 MB Rewritable Optical Cartridge (38F8645 single pack,
38F8646 five pack) is a 3.5-inch MO media, similar in appearance to 3.5-inch
diskette media. This media has a formatted capacity of up to 127 million bytes
and can be written and read many times.
These attributes allow this media to be
used for online/off-line data storage,
backup/restore, software distribution, ora wide variety of data transfer
applications.
O-ROM is 3.5-inch optical read-only
memory with up to I 22 million bytes
typical capacity, similar in appearance to
3.5-inch diskette media. This media canbe used by software or application developers to distribute CD-ROM like applications, such as data bases, encyclopedias
and image books.
The IBM PS/2 Optical Drive Kit A(#1121, 6451126) is specifically designed and required to support the installation of a PS/2 3.5-Inch Rewritable

Personal Systems/Issue 4, 1991

Letter# 191-082, June 11, 1991

The family of PS/2 Small Computer System Interface (SCSI) storage options isenhanced through the introduction of the
IBM PS/2 2.3GB External SCSI Tape
Drive (3532-023). This self-contained external SCSI tape drive has the flexibility
to be attached to any PS/2 Micro Channel system equipped with either a PS/2
Micro Channel SCSI Adapter or a PS/2
Micro Channel SCSI Adapter with
Cache. The 3532 is a high performance,large capacity, tape drive that has an instantaneous data transfer rate of 245 KB
per second and can store up to 2.3 GB ofdata on one 8mm tape cartridge. Device
reliability is enhanced through the use of
a powerful Error Correction Code (ECC)
function.
Also being announced with the IBM
PS/2 2.3GB External SCSI Tape Drive
are two new SCSI cables that are uniqueto this device. The IBM SCSI Controller Cable (#2830, 31 F4 I 87) is required
to attach the 3532 to the PS/2 system
unit (via the external port of the SCSI
adapter). The SCSI Device-to-Device Cable (#3131, 31 F4 I 86) is required to attach the 3532 to another 3532, or toother SCSI devices already present. Ifother SCSI devices are to be added in a"daisy-chain" fashion, consult the appropriate device information for cabling requirements. Either the Sytos Plus® OS/2
(15F7193) or Sytos Plus/IBM DOS(I 5F7 I 94) File Backup Utility is required for operation. These utilities,
when used with the 3532-023, provide ahigh-performance, large capacity, easyto-use tape backup/restore system. Support in the Novell environment isprovided by Cheyenne Software, Inc.
with their ARCserve® program.
Letter# 191-085, June II , 1991

101

,,.

IBM PS/2 2.88 MB
DISKETTE DRIVE
The PS/2 2.88 MB Diskette Drive is a
3.5-inch one-inch high diskette drive thatfeatures media sense capability, and up
to 2.88 MB of formatted capacity whena 3.5-inch 4 MB diskette is installed. In
addition, this drive maintains read/write
compatibility with 720 KB and 1.44 MB
diskette drives. The drive is designed to
be installed in either PS/2 Models 35 SX
and LS , 40 SX, or 57 SX.
Letter# 191-083, June 11, 1991

IBM PS/2 1.44 MB Diskette
Drive, 5.25-Inch External
Diskette Drive Adapter
Cable, and SelectedUpgrade Kits
The PS/2 1.44 MB Diskette Drive(#0030, 6451130) is a new option for the
PS/2 Models 35 SX, LS, 40 SX and 57
SX. This 3.5-inch one-inch high form
factor diskette drive features up to 1.44
MB of formatted capacity, read/write
compatibility with 720 MB formatted
diskettes and media sense capability.
The IBM PS/2 5.25-Inch External Diskette Drive Adapter Cable (#1124,
6451 124) is required to attach a PS/2
5.25-Inch External Diskette Drive to a
PS/2 Model 35 SX, LS or 40 SX. This
cable is installed internally and attaches
the 5.25-inch adapter to the system unit
diskette drive cable.
The IBM PS/2 Upgrade Kit for Diskette
Drives (#5106, 6451127) provides the capability to upgrade a PS/2 Model 35 LS
to accept either a 3.5-inch or 5.25-inch
diskette drive.
The IBM PS/2 Model 35 LS Upgrade
Kit for Hard files (#5107, 6451128) provides the capability to upgrade a PS/2
Model 35 LS to accept either a PS/2 40
MB Fixed Disk Drive (#1073, 6451073)
or 80 MB Fixed Disk Drive (#1074,
6451074).
Letter# 191-084, June 11 , 1991

IBM PS/2 Internal Tape
Backup Program Version
2.0 (DOS compatible)
and IBM PS/2 Internal Tape
Backup Program Version
1.01 (OS/2
compatible)
These backup programs enhance thePS/2 8540, 8550, 8560, 8565, 8570,
8580, 8590 and 8595 by allowing theuser to transfer up to 120 MB of fo1matted data from a disk storage device to aremovable mini-tape cait1idge for later
recall.
For the customer's convenience, theIBM PS/2 Internal Tape Backup Program Version 2.0 (DOS compatible) andthe IBM PS/2 Internal Tape Backup Program Version I.OJ (OS/2 compatible)
are also offered in sepai·ate conveniencekits that include the appropriate program,the IBM PS/2 Internal Tape Backup Unit(#5279) and a formatted mini-tape cartridge in one package. These backup programs, when used with the IBM PS/2
Internal Tape Backup Unit, provide thecustomer with an easy-to-use, easy-to-install and technologically advanced internal tape backup system.
Upgrades from the earlier versions of the
DOS compatible program to the IBM
PS/2 Internal Tape Backup Program Version 2.0 (DOS compatible) or to the
IBM PS/2 Internal Tape Backup Program Version 1.01 (OS/2 compatible)
can be done by ordering the appropriate
upgrade. Customers can upgrade fromearlier versions of the OS/2 compatible
program by ordering the IBM PS/2 Internal Tape Backup Program Version 1.0 I(OS/2 compatible) upgrade.
Letter# 291-278, June 11, 1991

IBM ISDN Interface
Coprocessor
The IBM ISDN Interface Coprocessor
provides attachment to the Integrated
Services Digital Network Basic Rate Interface (ISDN BRI) and, when operatingwith supporting IBM software, provides
the capability of full duplex data transmission by utilizing the two 64 kilobits

Personal Systems/Issue 4, 1991

per second (Kbps) information (B) channels controlled by the 16 Kbps control(D) channel.
The IBM ISDN Interface Coprocessor
and supporting software, when installed
in an AT® BUS PS/2 Model 30 (286),
Model 35, or Model 40, enable ISDN
connectivity not only to other similarly
equipped PS/2 workstations, but also to
Micro Channel Architecture PS/2 workstations with the IBM ISDN Interface
Coprocessor/2 Model 2 installed, IBM
7820 ISDN Terminal Adapters, IBM
3174 ISDN Basic Rate Interface Adapters, and an AS/400 system with the BRI
Adapter feature.
Letter# 191-115, July 9, 1991

IBM PS/2 486/50 Processor
Upgrade Option
The PS/2 486/50 Processor Upgrade Option enhances the PS/2 Model 90 XP
486 and 95 XP 486 family of systems.
The processor upgrade option features
the new Intel 80486 50MHz microprocessor and provides the capability of processor performance upgrade on the PS/2
Model 90 XP 486 and 95 XP 486 systems. This new microprocessor includes
an internal memory cache controller, 8
KB memory cache and an integrated
floating-point processor unit. Additionally, an external 256 KB level two cache
is provided as standard on the processor
complex . The 486/50 Processor Upgrade
Option significantly increases systemprocessor pe1formance in compute-intensive applications while providing investment protection .
Letter# 191-096, June 11, 1991

IBM PS/2 8504
Monochrome Display
The PS/2 8504 is a 12-inch multimodeanalog display. It uses a Flatter Squarer
Tube (FST) for optimal front of screen
performance. Low emissions, front controls, 300-degree swivel with tilt and reduced footprint ai·e leadership design
characteristics. The PS/2 8504 Monochrome Display is suitable for the lowend, low-cost market, where color is not

102

The PS/2 8504 Monochrome Display isengineered to meet the recommendations
for lower field emissions (VLMF).

The IBM PPS IT 2380 and 2381 Printers
are excellent choices for customers needing versatile forms-handling impact printers. The printers also offer a newuser-friend! y operator panel that can beeasily operated by the printer user.

Letter# I 91-080, June 11, 1991

Letter# 191-110, July 9, I 99 I

IBM PS/2 8516 Touch
Display Model 001

IBM Personal Printer Series
II 2390 and 2391 Impact
Printers

exploited, but high clarity in text, graphics and images is required.

The PS/2 8516 Touch Display brings a
new dimension of interactive operation
to the PS/2 product line, and is intended
for new application areas where touch isused for input and interaction. No overlay is required for touch operation and,
therefore, front-of-screen quality is maintained. Touch input resolution is equivalent to the display resolution. The
display supports XGA mode and all
VGA modes and can be operated as a
Personal Systern/2 8515 Color Display.
When attaching to PS/2 systems with
XGA graphics capability, 256 colors at atime may be selected.
Device drivers are supplied with the display that suppo1t the touch operation
with the IBM Disk Operating System(DOS) or OS/2 Standard Edition or OS/2
Extended Edition operating system .

In response to emerging customer requests, the PS/2 85 I 6 Touch Display
meets VLMF (Very Low Magnetic
Field), field emission recommendationsfor Scandinavia.

The IBM Personal Printer Series II (PPSII) 2390 is a narrow-carriage 24-wire impact p1inter; the IBM PPS II 2391 is a
wide-carriage 24-wire impact printer.
Both printers are designed for attachment to IBM Personal Computers, IBMpersonal systems, and selected IBM displays and processors. Both are mediumusage printers, offering low-costownership and versatile paper-handlingwith speeds of up to 200 characters per
second (CPS) in FastDraft mode and up
to 60 CPS in Letter Quality mode.
The IBM Personal Printer Series II 2390
and 2391 are excellent choices for customers needing versatile paper-handling
impact printers or entry-level, high-resolution desktop graphics printers. The
printers also offer a new user-friendly operator panel that can be easily operated
by the printer user.
Letter# 191-129, August 20, 1991

Letter# 191-081, June 11, 1991

IBM PCradio Models 001,
002,003

IBM Personal Printer Series
II Impact Printers (2380
and 2381)

The IBM PCradio is a hand-held rngged
unit that extends host services to the mobile work force via a variety of communication alternatives in a DOS-based unit.
All models provide:The IBM Personal Printer Series II (PPSII) 2380 Printer is a narrow-carriage 9wire impact printer. The IBM PPS II
2381 Printer is a wide-carriage 9-wire impact printer. Both printers are designed
for attachment to IBM Personal Computers, IBM personal systems, and selected
IBM displays and processors. Both are
medium-usage printers. offering low-costownership and versatile paper handlingwith a speed of 320 characters per second (320 CPS) in FastDraft mode.

• A 5-l0MHz 80Cl86 processor withpower management system• Integrated Circuit (IC) memory card
slot
• CGA liquid crystal display• QWERTY keyboard, featuring imbedded numeric keypad• Serial and parallel (via the breakout
box feature,) ports for attaching external devices.
IBM will offer these models of the PCradio, depending on communications requirements (radio, cellular or telephoneline). It will be available on a special-bid
basis, with general availability in thefomth quarter 1991. The PCradio has notbeen approved by the Federal Communications Commission (FCC) . It is not, andmay not be, offered for sale or lease, orsold or leased until the approval of the
FCC has been obtained.
Letter# 191-126, August 13, 1991

Software
IBM System Performance
Monitor/2 Version 1.0
IBM System Performance Monitor/2(SPM/2) Version 1.0 consists of an integrated package of performance monitoring and analyzing facilities executable in
OS/2 SE or EE Version 1.2 or 1.3 environments. SPM/2 enables system administrators to monitor system performance,
analyze performance problems and use
SPM/2 as an aid for pe1formance tuning,load balancing and network growth managing efforts. In addition, SPM/2 enables
application developers to verify pe1formance objectives and fine-tune
applications.

Highlights:• A Data Collection Facility that collects critical OS/2 CPU, disk andmemory utilization data, enabling local or remote systems management• A Monitor Facility that enables realtime pe1formance monitoring• Log and Report Facilities that unveil
details of resource utilization on a dispatched process basis• Memory and Directory Analyzers thatenable in-depth analysis of OS/2 memory management and disk capacity
information.

• 2400 bps internal modem• Battery charger

Personal Systems/Issue 4, 1991

Letter#291-273,June II, 1991

Index to Past Issues of IBM Personal Systems Technical solutions

Issue 3, 1991 (G325-5012)
PS/2 Model I.AO SX Laptop Portable Computer
OS/2 2.0 Considerations
Comparing PC-DOS, OS/2, and AIX PS2 - Part 2
Using Dual Displays with OS/2
Local Area Networks: The New Utility
And You Thought LANs Were Just for the Office!
Remote LAN Management Tools
New Horizons for IBM ' s Shielded Twisted Pair Cabling
Tuning and Self-Tuning Features of OS/2 LAN Server
NetWare Communications and Routing Protocols
Little Solutions for LANs
Issue 2, 1991 (G325-5011)
IBM PS/2 Model 90 XP 486 and Model 95 XP 486
Choosing an I/0 Bus Architecture
The Network Is the Message
Invoking Printer Job Properties
Comparing PC-DOS, OS/2, and AIX PS/2
Programming PM Using the COBOU2 Bindings
Installing and Using the DOS Database Requester
OS/2 LAN Server 1.3 Overview
IBM Windows Connection 2.0
SNA Definitions for 3270 Emulators - Part ll
IBM THINKable
Issue 1, 1991 (G325-5010)
XGA - Raising Video Expectations
Choosing betw. Shielded and Unshielded Wiring for Data Transmission
Compatibility of LAN Servers and Requesters
Running DOS LAN Requester and Novell Netware Concurrently
Breaking the 640 KB DOS Memory Barrier
Understanding an OS/2 CONFJG.SYS File
OS/2 EE I .2 Database Manager Performance
OS/2 EE 1.2 Competitive Performance
An Intelligent Front-End EASEL Application
Enabling Software for National Language Support
SNA Definitions for 3270 Emulators
Diskette Failures Caused by Contamination
Issue 4, 1990 (G325-5009)
First Look at the New IBM PS/I Computer
Using the IBM 4019 LaserPrinter Effectively
Micro Channel Interface Chip Sets
Token Ring Bus Master LAN Adapters
Extension of Wiring Rules for 4-Mbit/s Token Ring Using UTP Lobes
SCSI and DISK.386.SYS
Operating System Platforms: A Business Perspective
Minimum OS/2 1.2 DASO Requirements
User Profile Management
Understanding OS/2 1.2 LAN Server Performance
PM: An Object-Oriented Approach
DOS 4.00 SHARE
A "C" Programming Model for DOS Device Drivers
An Electronic Bulletin Board for PC Users

Issue 3, 1990 (G325-5007)
DOS - A Look under the Hood to See How It Spins
Memory Management in a DOS Environment
FASTOPEN - The DOS Performance Enhancer
DOS 4.00 Compatibility Issues'Out of Environment Space' Errors
A New LAN Requester for DOS Systems
Creating a Dialog Box Dynamically Using WinCreateDlg
An Alternative for the OS/2 START Command
CUA: A Consistent Interface
Issue 2, 1990 (G325-5006)
OS/2 End User Advantages
What's New in OS/2 Standard Edition Version 1.2?
An Application Developer's View of OS/2
Object-Oriented Programming with C and OS/2 PM - ls It Possible?
Design Goals and Implementation of the New HPFS
OS/2 EE I .2 Database Manager - Remote Data Services
OS/2 EE Database Manager Precompiler AP!
UNION, INTERSECT, EXCEPT
Writing a Database Manager COBOL/2 Program
Database Manager Programming with Procedures Language 2/REXXAPPC Performance Tips for OS/2 EE
EASEL OS/2 EE PROFS: Host Code Interface
PS/2 RPG II Application Platform and Toolkit
The IBM Independence Series Products
Issue I, 1990 (G325-5005)
Introduction to Local Area Networks
IEEE 802.3 LAN Considerations
The IBM Token-Ring Network: A New Generation
How to Design and Build a 4-Mbit/s Token-Ring LAN
How to Design and Build a 16-Mbit/s Token-Ring LAN
Making the Cabling Decision
IBM Cabling System Highlights
Communication Strategy for Growth
Issue 4, 1989 (G325-5004)
Requirements for Advanced Bus Architecture
Micro Channel System Configuration Considerations
Features and Benefits
Bus Masters and Applications
Overview of Extended Micro Channel Functions
New Micro Channel Features
SCB - An Architecture for Micro Channel Bus Masters
Design Alternatives with Micro Channel Systems
The IBM PS/2 Micro Channel SCSI Adapters
PS/2 Wizard Adapter
Experience in Bus Master Design
Bus Master Adapters from Independent Option Vendors
Bus Masters and OS/2
Micro Channel Issues in AIX PS/2
Information for Developers
Book Report: "The Winn Rosch Hardware Bible"

When companies connect hundreds and thom,ands of PCs in a building, the trip Ien harmonic currents
add to those of the other non-linear loads creating unexpected electrical problems. (page 4)

Database Manager has extensive data integrityand protection features. (page 8)

CM workstations can access gateways to System/370 architecture hosts,
other hosts supporting LU6.2 protocols, and ASCII hosts. (page 18)

Aligning data structure can make significant performance
improvements to an application. (page 25)

Window panels can be created efficiently withthe dialog box editor. (page 33)

Compiling the application for introduction into the production environment is best
done on the DOS machine after Micro Focus COBOL/2 has been installed. (page 51)

Memory relief with DOS 5.0 can bequite dramatic. (page 54)

The shell (NETx.COM) acts as the interface between user
applications and NetWare file servers. (page 78)

LANA CS frames come in different forms,
commonly called protocols. (page 93)

Here 's a trick you can use to gain a small measure of flexibility
in your library path during execution. (page 96)

G325-5013-00