Unisys: Application Development Solutions
Unisys: Application Development Solutions
You should be very careful to ensure that the use of this information and/or software material complies with the
laws, rules, and regulations of the jurisdictions with respect to which it is used.
The information contained herein is subject to change without notice. Revisions may be issued to advise of such
changes and/or additions.
Notice to U.S. Government End Users: This is commercial computer software or hardware documentation developed
at private expense. Use, reproduction, or disclosure by the Government is subject to the terms of Unisys standard
commercial license for the products, and where applicable, the restricted/limited rights provisions of the contract
data rights clauses.
Unisys and ClearPath are registered trademarks of Unisys Corporation in the United States and other countries.
All other brands and products referenced in this document are acknowledged to be the trademarks or registered
trademarks of their respective holders.
Contents
Section 1. UCS Application Programming Overview
iv 7831 4077–009
Contents
7831 4077–009 v
Contents
vi 7831 4077–009
Contents
7831 4077–009 ix
Contents
x 7831 4077–009
Contents
7831 4077–009 xi
Contents
Index ..................................................................................................... 1
4–1. Using Library Search Chains to Link to Application Groups ................................. 4–4
7831 4077–009 xv
Figures
9–1. FLSS Object Module and HVTIP ZOOM Comparison ............................................. 9–4
5–1. Generic Static Linking Runstream for a TIP Transaction Program .................... 5–15
5–2. Source Listing of the Transaction (QUAL*UCSTST.DPSTIP) ............................... 5–18
5–3. Runstream to Set Up, Compile, and Link COBOL DPS TIP Transaction
Program ....................................................................................................................... 5–21
5–4. Execution of Source Runstream—COBOL DPS TIP Transaction
Program ...................................................................................................................... 5–24
5–5. Source Listing of the Transaction (QUAL*UCSTST.MCBTIP) ............................. 5–30
5–6. Partial Source Listing of MCBPKT-UCOB Routine
(QUAL*UCSTST.MCBPKT-UCOB) ......................................................................... 5–38
5–7. Runstream to Set Up, Compile, and Link—COBOL MCB TIP
Transaction Program ................................................................................................5–41
xx 7831 4077–009
Examples
6–1. Source Code to Create HVCALLS Object Module (HV$CALL) ........................... 6–23
6–2. Source Code to Create HVCALLS Object Module (HV$XFR$CANCL) ............. 6–26
6–3. Generic Static Linking Runstream for an HVTIP ICP ............................................ 6–34
6–4. Generic Static Linking Runstream for an HVTIP Subprogram ........................... 6–38
6–5. Source Listing of the ICP (QUAL*UCSTST.DPSICP) .............................................. 6–43
6–6. Source Listing of the ICP HVCALLS Element
(QUAL*UCSTST.HVCALLSDEF/DPSSUBX) ......................................................... 6–43
6–7. Source Listing of the First Subprogram (QUAL*UCSTST.DPSSUBX)............... 6–44
http://www.support.unisys.com/all/ple/18893924
Note: If you are not logged into the Product Support site, you will be asked to
do so.
• Describes how to set up the required UCS environment. This guide describes
installation and generation requirements for UCS products, supporting products,
and interface products.
• Describes how to get more in-depth information on specific topics.
Scope
Early sections give a general conceptual overview of UCS. Later sections give specific
instructions and guidelines for writing programs and include actual detailed program
examples and the output they produce.
For more detailed information about a specific UCS product, refer to the
documentation for that product.
The UCS Evaluation Overview describes the features of UCS and supporting software
products. This overview includes features of the UCS languages, the Linking System,
and PADS. This overview is for programmers, analysts, managers, or consultants who
are evaluating UCS capabilities and features.
Audience
The primary audience for this guide is the applications programmer or systems analyst
who actually writes, compiles, executes, and debugs programs. The secondary
audience is the site administrator. Site administrators will find information on the
following topics useful:
• Library search chains
• Subsystems
• Planning new and existing applications
• Setting up the environment
Programming managers will generally not require the detail in this document. The UCS
Conceptual Overview is designed for programming managers.
Prerequisites
This guide assumes the reader has at least a basic familiarity with OS 2200 systems
and their job control language. Knowledge of one or more programming languages is
also assumed.
You need not have specific knowledge of UCS to use this guide. This guide is intended
to give enough detailed programming instructions and guidelines concerning UCS so
that a programmer can in many cases use it to create, compile, link, and execute
programs, without necessarily having prior instruction in UCS and without having to
reference other UCS documentation. For more detailed information about a specific
UCS product, refer to the documentation for that product.
Notation Conventions
The following conventions are used in this guide:
• Highlighting (bold copy) represents important lines of programming in examples
and illustrations and user input in a user/system dialog
• Italics represent a variable value
• UPPERCASE letters represent a literal value
• Changes made since the last version of the manual are shown with yellow
highlighting in the online version (and may appear as shading in the printed
version).
How to Use This Guide
Programmers should use Sections 3, 5, 6, and 7 as a model for coding UCS programs.
Sections are organized according to the different execution environments: batch and
demand, TIP, and HVTIP. Examples have been set up to be as realistic as possible.
Complete programs are shown, along with runstreams that set up, compile, link, and
execute them. The actual output from these programs is also illustrated.
To meet this need, Unisys has provided a new foundation of advanced hardware and
software with OS 2200 extended mode systems:
• The hardware architecture for this foundation was introduced with the 1100/90 and
2200 systems and continues today as the 2200 ClearPath systems.
• The software platform that takes advantage of the capabilities of this architecture
consists of
− The extended mode operating system
− The Universal Compiling System (UCS), which consists of the high-level
language compilers and their supporting software
User-Written
CASE Tools
Applications
This new environment does not prohibit use of the existing basic mode environment.
The two environments coexist peacefully, sharing both software and files. Interfaces
are provided from the new software to
• UDS database products and files
• Transaction files
• Transaction handling software
Very little has changed for the applications programmer. Instead, UCS provides
extended capabilities beyond what existed previously. UCS provides an efficient
application development environment, thus increasing programmer productivity and
more effectively meeting the needs of users.
The following table summarizes the benefits provided by the extended mode
hardware and its extended mode software platform. UCS currently provides these
high-level programming languages: UCS COBOL, UCS FORTRAN, and UCS C.
• UCS COBOL
Supports the COBOL 1985 American National Standard with the 1989 Intrinsic
Function Addendum.
• UCS FORTRAN
Supports the FORTRAN 1978 American National Standard. Also has implemented
many extensions of the Fortran 90 standard.
• UCS C
Supports the X3.159-1989 American National Standard and the ISD/IEC 9899-1990
standard. SB5R1 UCS C was the first release to validate against these standards.
Each language makes use of extended mode addressing capabilities, without the
programmer’s intervention. Everything is done automatically. Also, each language
executes a call to the operating system whenever possible, instead of a costly system
interrupt. The number of implemented calls is growing with each release of the
extended mode operating system.
These languages have a broad base of product interfaces from which to choose. The
commands used by these product interfaces have embedded syntax that the UCS
compilers accept without any preprocessing.
Front-End Processors
Compiler
Products Programming
Language Front-End LSS Code
UCS C (UC) Source Processor Generator
Characteristics
Perform front-end processing
002314
These front-end processors are architecture independent. This means their output is
not limited to a particular hardware system in the 2200 ClearPath family. The front-end
processors perform syntax analysis that is dependent on the structures of the
particular high-level language being analyzed. They produce intermediate code, static
flags, tables, and a data dictionary that are independent of the language being
analyzed.
The output of the front-end processor is passed to a back-end processor, the UCS
Language Support System (LSS), for transformation into architecture-specific output:
LSS is another product in the Universal Compiling System. LSS is the part of the
compiler that generates the code. It is a single back-end processor used in common
by all of the front-end processors. It is architecture dependent, meaning that it
generates hardware level instructions that may be limited to one or more particular
hardware systems. The programmer is unaware of the existence of LSS because it is
called internally during compilation.
Intermediate
Output
Dictionary
Source LSS
Front-End Object
Program Text Code Generator
Processor Module
and Optimizer
Static Flags
COBOL UCOB
and Tables
FORTRAN UFTN
C UC
002321A
An object module has properties that are similar to both a basic mode relocatable and
a basic mode absolute element. It contains symbolic references and relative
addresses like a relocatable element, but is directly executable like an absolute
element.
In addition to the front-end processor and LSS, the Linking System Object Module
Output Routines (see 1.4.2) are also involved in the creation of object modules. In
some circumstances, the following products may also be involved:
• The UCS Runtime System (see 1.4.3)
• The Extended Language Message System (see A.3.5)
• S$WORK element created by processing the DMS 2200 subschema source using
the Subschema Data Definition Language (SDDL) processor
Linking System
Characteristics
Unites separately-compiled object modules into a new object module or whole
executing program
Defines secure units of shared code and data (extended mode software
subsystems)
Automates multibanking
Components
Dynamic Linker
The Linking System offers a more flexible method of linking programs and resolving
references for execution. You do not have to prepare UCS programs before
execution with the Collector (@MAP). Instead, the Linking System links separately
compiled UCS object modules into a single program either at load time, dynamically
during execution, or (optionally) before execution in a process similar to collection.
The same program can even use all three types of linking.
The following subsections briefly explore these components and their capabilities.
It is worthwhile for a site to learn the concepts of the Linking System and how it
works, in order to choose the type of linking most suited to the task at hand. Sections
3, 5, and 6 provide sample links for batch/demand, TIP, and HVTIP environments. For
complete information, see the following documents:
• Linking System Programming Guide
• Linking System Programming Reference Manual
• Linking System Subsystems Programming Guide
This means that when the programmer issues a compiler call, three software products
are actually involved in the creation of the object module:
• The front-end processor
• LSS
• The Linking System Object Module Output Routines
The most noticeable added capability is a linking method specifically intended for the
program development phase. Programs do not require a separate linking phase
(formerly referred to as collection). When you execute (@XQT) an object module
produced by a UCS compiler, references within the object module to other object
modules are automatically resolved during execution. This process is performed by
the dynamic linker.
If an error was found in execution, the code was corrected and the process repeated,
as shown in the following figure:
With UCS, there is a short cut that eliminates the collection phase. UCS supports the
“compile-and-try-it” method, thus removing the programmer-invoked collection step
and shortening development time. UCS code can be
1. Written
2. Compiled
3. Executed
The dynamic linker links the program during execution, as shown in the following
figure:
This process is most useful during debugging and program development for the
following reason: After each recompilation, the programmer does not have to
perform a separate linking step before each new test execution.
Programmer-invoked linking (called static linking) still results in the best execution-
time performance because execution is not interrupted while linking occurs. Static
linking is therefore most efficient for production environments. Static linking also
means linking overhead is incurred only once, rather than each time the program is
executed. Furthermore, static linking is required for all transactions, whether they are
in the development or production phase.
This method of linking provides development flexibility. The modules of a program are
brought together only as they are needed.
Static linking can resolve some or all of a program’s external references before
execution:
• It can produce totally resolved object modules. These are efficient for programs
in a production environment because linking does not interrupt execution.
• It can produce partially resolved object modules. These are useful for programs
still in development:
− References to tested, stable object modules can be resolved during static
linking. This improves performance for that part of the program.
− References to untested, unstable object modules can be resolved during
execution. The “collection” step is not required for these parts of the
program.
The LINK Processor is called using the @LINK statement. The LINK Processor has a
simple command language for performing static linking.
In the following figure, the LINK Processor links together the object modules produced
by two separate compilations to produce a standard object module.
Standard object modules are loaded by the Linking System at execution time. Note
that standard object modules may themselves serve as input to other static links; that
is, they may be statically linked to other object modules.
Characteristics
Are partially-resolved object Compiler Executable
@LINK
modules that include their Output Code
main programs
002294
Bound object modules can be used during the development phase to link together
stable object modules. References to object modules still in development are
resolved by the dynamic linker during execution, just as for standard object modules;
however, bound object modules have better performance than standard object
modules.
In the following figure, the LINK Processor links together the object modules produced
by three separate compilations to produce a bound object module. The bound object
module is then executed; references to other object modules are resolved during
execution.
Bound object modules are loaded by the Linking System at execution time. Note that
bound object modules cannot serve as input to other static links.
In the following figure, the LINK Processor links together the object modules produced
by two separate compilations to produce a ZOOM. The ZOOM is then executed.
SSINFO is meant to be used in demand, and is a window into the state of the fixed-
gate subsystems on your system.
Characteristics trancd
UCS Transaction
Provides execution-time interfaces to the Environment
Runtime
operating system System
002293
The UCS Runtime System provides common interfaces and services to all UCS
programs. These include
• Interfaces to the UDS products
• Input/output interfaces
• Data conversion routines
• Built-in math functions
• Service libraries
The UCS Runtime System also performs program initialization and termination.
Previous compilers each had their own run-time system. In UCS, the similar tasks
performed by the multiple run-time systems have been combined into a single run-
time system used by all executing programs.
The MONITOR feature can be dynamically controlled using the explicitly defined
MCFLAG data item.
Monitor
Characteristics
1 dataname-1 PIC
Produces a program execution-time trace 01 dataname-2 PIC
PROCEDURE DIVISIO
label1
Displays entries when: MOVE ALL 'y' T
label2.
paragraph or section name changes ADD dataname2
data item is referenced DIVIDE datana
Dynamically controlled
trancd
Transaction
Environment
Dynamic Linker
@XQT
Programming
Language Static Linking Executable
Compiler Output
Source Process Code
• If static linking is required, the programmer calls the LINK Processor (@LINK) and
supplies simple commands specifying which object modules should be linked and
the type of object module to be produced.
There are three types of object modules produced by static linking:
− Standard object modules (OM)
− Bound object modules (BOM)
− Zero overhead object modules (ZOOM)
Standard object modules and bound object modules are primarily useful during the
program development phase. Standard object modules and bound object modules
use the dynamic linker for
− Bank acquisition and loading at execution time
− Reference resolution if a link fault occurs during execution
ZOOMs are efficient, totally resolved object modules. They provide very fast
execution and are meant for production environments. They are loaded by the
extended mode operating system, not the dynamic linker. All transaction
programs must be ZOOMs.
• During execution, the UCS Runtime System handles common interfaces and
services, such as program initialization and termination, database interfaces,
input/output interfaces, and service library access.
• UCS programs can be tested and debugged using the Programmers Advanced
Debugging System (PADS).
• UCS COBOL, FORTRAN, and C programs can be tested and debugged using the
MONITOR feature.
A site can gradually upgrade programs to UCS because UCS is designed to coexist
with the older, non-UCS environment. Coexistence is accomplished by sharing the
following resources:
• Interface software
• Database files
As the following figure shows, the interface software for UDS, DPS 2200, MCB, and
TIP can be shared by UCS and non-UCS applications. Only one copy of each product is
required on the extended mode hardware in order to support both environments.
Also, the UDS, PCIOS, and transaction processing file control superstructure (FCSS)
database files can be shared by programs from both environments, as long as no
Fieldata exists in the files. The DPS 2200 form files and the forms within them can
also be shared.
Because UCS and non-UCS programs share interface software and database files, a
single user-written application can consist of a mixture of UCS and non-UCS programs.
For example, an inventory control application might consist of
• A non-UCS program that updates a data file of parts in stock
• A UCS program that writes a report showing out of stock items
This capability allows you to upgrade an application to UCS gradually: You can
upgrade some programs in an application to UCS, while other programs in the
application remain non-UCS.
The only restriction for user-written programs is that any one particular program must
be all UCS or all non-UCS at the linking/collection level. Any one particular user-written
program cannot consist of some non-UCS relocatable elements and some UCS object
modules (for example, ACOB relocatables and UCS COBOL object modules).
For more complete details on coexistence of UCS and non-UCS programs and
upgrading non-UCS programs to UCS, refer to Section 8.
Table 1–1 summarizes the benefits provided by the extended mode hardware and its
extended mode software platform:
Benefits Features
This new hardware and software technology serves as a new foundation upon which
users can develop custom-built applications. It provides an efficient application
development environment, thus increasing programmer productivity and more
effectively meeting the needs of users.
User-Written
CASE Tools
Applications
This section provides general information on the mechanics of using all UCS
compilers.
For more detailed information, refer to the appropriate compiler manual, as follows:
• C Compiler Programming Reference Manual Volume 2
• COBOL Compiler Programming Reference Manual Volume 2
• FORTRAN Compiler Programming Reference Manual Volume 2
• where Uxxx represents the appropriate compiler call: UCOB, UFTN, or UC.
Example
@UCOB QUAL*FILE.SOURCE,QUAL*FILE.OM/COMP
In this example
• The UCS COBOL compiler is called.
• The source program found in the element QUAL*FILE.SOURCE is being compiled.
• The object module output from this compilation is placed in the element
QUAL*FILE.OM/COMP.
The version name COMP is used in the element name in this example because the
output of the UCS compilers and the output of the LINK Processor (static linker)
are both object modules. This means that the @LINK output will delete the
compiler’s output if the following conditions are true:
− The output of the compilation and the output of the @LINK are given the same
element name
− The compilation is performed first
Using a version name such as COMP helps clarify whether the object module
element was produced by the compiler or LINK Processor, and thus helps ensure
name conflicts will not occur.
(In this guide, all compilation outputs include the version name COMP to avoid
potential name conflicts.)
The following subsections describe in detail each syntax item in the compiler call.
Conflicts may arise between options specified by these different methods. For
example, the keyword options WIDE and NARROW control the width of compiler
output. A conflict would occur if a keyword option specifies WIDE, but the keyword
options element specifies NARROW. In such a case, the order of precedence is as
follows.
@UCOB,S QUAL*FILE.SOURCE,QUAL*FILE.OM/COMP
These letter options were introduced by previous compilers and have been carried
over to the UCS compilers. Refer to the appropriate UCS compiler manual for the
letter options supported by that compiler.
You specify keyword options in the fifth and following fields on the compiler call
statement, separating different keyword options by commas. For example, the
following compiler call uses three keyword options: SOURCE, NO-REMARK, and
NARROW:
In this example
• The SOURCE keyword option directs the compiler to produce a source listing of
the element QUAL*FILE.SOURCE.
• The NO-REMARK keyword option indicates that no remarks are to be printed in
the listing. (Remarks are informational compiler messages.)
• The NARROW keyword option limits the print width to 79 characters.
• The semicolon (;) is used as a continuation character on compiler calls.
Each keyword option has a related keyword option that has the opposite meaning. For
example
• SOURCE has an opposite called NO-SOURCE that indicates that the source listing
is not to be printed.
• NARROW has an opposite called WIDE that indicates that the listing has a width of
132 characters.
For a complete listing of the keyword options available, refer to the appropriate UCS
compiler manual.
@PRT,S QUAL*FILE.OPTIONS
QUAL*FILE(1).OPTIONS(0)
1 SOURCE
2 NO-REMARK, NARROW
The following example of a UCS COBOL compiler call shows this keyword options
element being specified in the fourth field:
@UCOB QUAL*FILE.SOURCE,QUAL*FILE.OM/COMP,,QUAL*FILE.OPTIONS
Once you set up a keyword options element, it can be used over and over; many
programs created by different programmers can be compiled with the same set of
keyword options. This eliminates the need to specify all the options all the time.
Note that the SOURCE, NO-REMARK, NARROW, and OPTIONS keyword options affect
the format of the compiler listing.
1 IDENTIFICATION DIVISION.
2 PROGRAM-ID. EXAMPLE.
3 ENVIRONMENT DIVISION.
4 CONFIGURATION SECTION.
5 SOURCE-COMPUTER. UNISYS-2200.
6 SPECIAL-NAMES.
7 PRINTER IS PRINTER.
8 DATA DIVISION.
Source 9 COMMON-STORAGE SECTION.
Listing 10 01 COMMON-FIELD-1 PIC X(6) VALUE 'COMMON'.
11 WORKING-STORAGE SECTION.
12 01 WORKING-FIELD-1 PIC X(25)
13 VALUE 'THIS IS A WORKING FIELD'.
14 PROCEDURE DIVISION.
15 START-UP-PARA.
16 DISPLAY 'COMMON-FIELD-1 = ' COMMON-FIELD-1
17 UPON PRINTER.
18 DISPLAY 'WORKING-FIELD-1 = ' WORKING-FIELD-1
19 UPON PRINTER.
20 STOP RUN.
Bank
Sizes SIZES: CODE(EM6): 76 DATA: 138 COMMON: 3
Line
• The level of LSS, the code generator portion of the compiling system
(8R2 in this example)
• The date that the software was created by the development center or generated
by the user site; this appears in parentheses following each of the level numbers.
(In this example, 931119 for UCOB and 931209 for LSS)
The Options Listing displays all compiler keyword options in effect for this
compilation, including the keyword options in effect by default.
For information on these keyword options, see the appropriate compiler manual.
Designation Definition
EM0 Generic code executable on any extended mode hardware system has been
produced.
EM2 Code specifically designed for execution on an 1100/90, 2200/600, or
2200/400 system has been produced.
EM4 Code specifically designed for execution on a 2200/100 or 2200/200 system
has been produced.
EM6 Code specifically designed for execution on a 2200/XPA system (2200/900
and 2200/500 and all ClearPath systems) has been produced. This code
executes only on a 2200/XPA or ClearPath system.
You can use another keyword option, EXTENDED/n, to specify the class of hardware
for which your program’s compiled code is to be generated; see the appropriate
compiler manual for a description of this keyword option. Note the following when
using this keyword option:
• When executing on the class of system for which it was designed, EM2 and EM4
code may be more efficient than the EM0 generic code.
• When not executing on the class of system for which it was designed, EM2 and
EM4 code may be less efficient than the EM0 generic code, or it may not work at
all.
• EM6 code executes only on 2200/XPA systems (2200/900, 2200/500, and all
ClearPath systems). This code will not execute successfully on the 1100/90,
2200/600, 2200/400, 2200/200, or 2200/100.
In this example
• Code targeted for a 2200 ClearPath system has been generated (EM6).
• The code bank size is 76 words.
• The data bank size is 138 words.
• The common block bank size is 3 words.
Two simple UCS COBOL examples are used throughout 3.1. Except where noted,
everything discussed regarding these examples also applies to UCS FORTRAN and
UCS C.
Example 1: COBOLEX
The first example shows one UCS COBOL program called COBOLEX. This program
performs data manipulations and displays the data before and after updating.
COBOLEX
IDENTIFICATION DIVISION.
PROGRAM-ID. COBOLEX INITIAL.
.
.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DATANAME1 PIC X(8) VALUE ALL 'x'.
01 DATANAME2 PIC 9(5) VALUE 6.
01 DATANAME3 PIC 9(5) VALUE 12.
PROCEDURE DIVISION.
DISPLAYs ....
data manipulation
DISPLAYs ...
STOP RUN
OS 2200 OS 2200
Sort/Merge Sort/Merge
2200 POSIX.1
• UCS COBOL, UCS FORTRAN, and UCS C provide the capability to execute FURPUR
operations from within a program using a new interface, Program-Callable
FURPUR (PCFP).
• UCS COBOL and UCS C support an extended mode version of selected SYSLIB
functions using SLIB.
• UCS C provides the 2200 POSIX.1 interface.
• All UCS languages provide direct high-level language access to most of the
Executive requests (ER).
• UCS COBOL, UCS FORTRAN, and UCS C can be used to write contingency
handlers.
These interfaces provide great flexibility and the means to utilize the most appropriate
high-level language and interface to meet user application needs. Note that UCS
programs written in a language without access to a specific product can gain access
by calling a subroutine coded in a UCS language with the necessary access.
@UCOB . . . .
or
UCS @UFTN . . . . UCS
Source or Compiled
Program @UC . . . . Object Module
qual*ucstst.source qual*ucstst.om/comp
002323
Notice that you can designate procedure files (using the @USE names COB$PF,
FTN$PF, and UC$PF) for UCS COBOL, FORTRAN, and C to satisfy their COPY or
INCLUDE statements. Each compiler by default searches the system procedure file
SYS$LIB$*PROC$ as a last resort for procs that satisfy COPY or INCLUDE statements.
For more information on this feature, see the reference manual for the appropriate
language.
To make the compilation process easier, the UCS compilers support a standardized
compiler call used across all languages. Examples follow.
Example 1: COBOLEX
In the example using the source program COBOLEX, the compiler call statement is as
follows:
@UCOB QUAL*UCSTST.COBOLEX,.COBOLEX/COMP,,,NO-OPTIONS
@UCOB QUAL*UCSTST.MAIN,.MAIN/COMP,,,NO-OPTIONS
@UCOB QUAL*UCSTST.SUB1,.SUB1/COMP,,,SUBPROGRAM,NO-OPTIONS
@UCOB QUAL*UCSTST.SUB2,.SUB2/COMP,,,SUBPROGRAM,NO-OPTIONS
The preceding example shows how to specify that a UCS COBOL compilation is a
subprogram. Each of the languages identifies whether a compilation is a main
program or subprogram/subroutine in a different way:
• UCS COBOL
− If not explicitly specified, the compilation is a main program by default. It may
be called by another UCS object module or executed with @XQT.
− A subprogram is created if the PROCEDURE DIVISION statement includes a
USING clause. It may be called by another UCS object module but not
executed with @XQT.
− Alternatively, you can produce a subprogram by specifying the SUBPROGRAM
keyword option on the UCS COBOL compiler call. The subprogram may be
called by another UCS object module but not executed with @XQT.
• UCS FORTRAN
− If not explicitly specified, the compilation is a main program by default.
− You produce a subprogram by coding a SUBROUTINE statement or a
FUNCTION statement in the UCS FORTRAN program.
• UCS C
− Any program containing a function named "main" is a main program.
− All other programs are subprograms.
The linking phase of batch and demand programming provides maximum flexibility to
the applications programmer. UCS programs can be executed in any of the following
ways:
• Directly after compilation, with no separate linking phase
This method resolves all references using dynamic linking only.
The following subsections show examples of each of these linking methods. In all
cases, the methods reflect the development phase of application programming. See
3.5.3 for information regarding production-oriented linking.
In this method, the dynamic linker component of the Linking System performs the
linking (reference resolution) during execution. Execution is interrupted as the
dynamic linker locates and loads object modules as they are called.
Note that this process is most effective for program development only; programmer
invoked linking (static linking) still provides the most efficient execution time
performance for the production environment (see 3.5.3). Examples of the dynamic
linking only method follow.
Example 1: COBOLEX
The following is an example of the source statements used to compile and execute
the program COBOLEX, using dynamic linking only. Note that execution immediately
follows compilation.
@UCOB QUAL*UCSTST.COBOLEX,.COBOLEX/COMP,,,NO-OPTIONS
@XQT QUAL*UCSTST.COBOLEX/COMP
Note that the object module chosen may not be the one wanted.
The following example shows this occurring. File QUAL*UCSTST contains the
following object modules:
• SUB1SUB2/OM
Produced by previous static linking. Contains duplicate definitions of SUB1 and SUB2.
Either SUB1SUB2/OM or the compiler outputs, SUB1 and SUB2, could be chosen at
execution time to satisfy the calls to SUB1 and SUB2. In the following example,
SUB1SUB2/OM is chosen. User input is in bold.
@XQT QUAL*UCSTST.MAIN/COMP
*WARNING(LINK 244)* More than one definition of entry point SUB1 exists
in
file QUAL*UCSTST(1).The definition in element
QUAL*UCSTST(1).SUB1SUB2/OM
will be used to satisfy references; the others will be ignored.
THIS IS THE SUB1 PROGRAM
Example 2, which follows, shows one way to avoid this problem: by creating a new
file and copying the object modules to this file. Note that this is only one method
among many for avoiding this problem.
The source runstream ensures there will be no duplicate entry points in the file or files
searched by the dynamic linker by
• Cataloging a new file
• Copying the object modules to be used to this file
This ensures there are no duplicate external entry points. Execution takes place from
this new file.
The first call to each of the subprograms causes a link fault to occur. The operating
system invokes the Linking System to locate and load the requested subprogram.
Explanation
1. These statements compile the main program and subprograms.
2. This statement deletes the latest cycle of the named file. Assuming this file has
only one cycle, this statement ensures that the @CAT,P statement will be
successful and not cause an error.
3. This statement creates the new file, from which execution is to take place.
4. These statements copy the object modules into the execution file.
5. This statement executes the main program. During execution, the dynamic linker
will resolve references to the subprograms.
LSC Tracing
If you precede the @XQT in the preceding Example 2 with the following statements,
you will get LSC trace output from the dynamic linker. This shows the process the
linker uses to resolve references and find entry points:
This method allows you to get the benefits of both linking methods:
• You can statically link all stable routines together; execution-time performance for
these parts of the program is thus improved compared to dynamic linking.
• At the same time, you can skip the extra linking phase for all routines still in
development. Such routines are dynamically located and loaded at execution time.
In this subsection, the main program (MAIN) and two subprograms (SUB1 and SUB2)
are used to demonstrate two different examples of this dual type of linking.
Example 1
In this example
• The two subprograms are the stable routines; they are linked together to produce
a standard object module.
Note that standard object modules produced by static linking can in turn be input to
another static link.
Explanation
1. This statement calls the Linking System LINK Processor. The output object
module produced by static linking is placed in the element
QUAL*UCSTST.SUB1SUB2/OM.
2. These commands supply the compiler-generated object modules used as input by
the static link process. There is an INCLUDE command for each object module
that is to be statically linked. Because this static link produces a standard object
module, the main program may or may not be supplied by an INCLUDE command.
In this case, it is not.
3. This command resolves external references, including those to the UCS Runtime
System library.
4. This command serves two purposes:
• It implicitly causes extensive bank merging, thus producing an efficient object
module.
• It specifies the type of object module to be produced. In this example, a
standard object module (OM) is to be produced.
5. This command deletes all entry point definitions except the starting addresses for
the two programs. This greatly decreases the size of the object module produced.
The EXCEPT clause of the DELETE command should contain all external entry points
that can be called. Any not listed are deleted. SUB1 and SUB2 are the only external
entry points in this example.
The starting entry point of a main program is always called START$. Because there is
no main program in this static link, there is no START$.
6. This statement ends the static link.
7. These statements prevent problems with duplicate definitions.
8. This statement executes the main program, now located in the execution file. The
subprograms, now contained in the single statically linked object module, are
located using dynamic linking.
Example 2
In this next example
• The main program (MAIN) and one of the subprograms (SUB1) are the stable
routines.
• They are statically linked together to produce a special type of object module
called a bound object module. A bound object module must always include the
main program. This allows bound object modules to be loaded faster than
standard object modules.
Note that bound object modules cannot be used as input to another static link.
• The other subprogram (SUB2), still in development, is dynamically located and
loaded during execution, just as for standard object modules.
• The object module produced by the static link (MAINSUB1/BOM) and the
subprogram object module produced by the compiler (SUB2/COMP) are copied to
a new file. This is to avoid problems with duplicate definitions, that is, to ensure
that the subprogram dynamically linked at execution time is the compiler-
produced object module and not the object module from the previous linking
example (SUB1SUB2/OM). Both contain the external entry point SUB2.
@LINK ,QUAL*UCSTST.MAINSUB1/BOM
(1) INCLUDE QUAL*UCSTST.MAIN/COMP
(1) INCLUDE QUAL*UCSTST.SUB1/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
(2) PROCESS FOR EXTENDED BOUND OM
(3) DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@DELETE,C QUAL*EXECUTE.
@CAT,P QUAL*EXECUTE.
@COPY,A QUAL*UCSTST.MAINSUB1/BOM,QUAL*EXECUTE.
@COPY,A QUAL*UCSTST.SUB2/COMP,QUAL*EXECUTE.
@XQT QUAL*EXECUTE.MAINSUB1/BOM
Explanation
This static link differs from the static link of a standard object module in the following
commands:
1. You must supply the main program (MAIN/COMP) with one of these INCLUDE
commands because a bound object module is being produced.
2. The PROCESS command specifies that the type of output is a bound object
module (BOUND OM).
3. In this example, the entry point of the main program, START$, is the only external
entry point not deleted.
This static link will receive the following warning because the main program contains a
call to SUB2, whose object module is not found in any of the files searched by this
static link. This warning is expected and does not indicate a problem. The call to
SUB2 will be resolved at execution time by dynamic linking.
*WARNING(LINK 108)*The definition for name SUB2 (referenced by object
module QUAL*UCSTST(1).MAIN/COMP) could not be found in the files that
were searched.
Example 1: COBOLEX
The following example shows how to statically link the stand-alone program COBOLEX
as a ZOOM and then execute it.
@LINK,S ,QUAL*UCSTST.COBOLEX
INCLUDE QUAL*UCSTST.COBOLEX/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@XQT QUAL*UCSTST.COBOLEX
The following example shows how to statically link a main program and two
subprograms as a ZOOM and then execute it.
@LINK ,QUAL*UCSTST.MAINSUB1SUB2/ZOOM
(1) INCLUDE QUAL*UCSTST.MAIN/COMP
(1) INCLUDE QUAL*UCSTST.SUB1/COMP
(1) INCLUDE QUAL*UCSTST.SUB2/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
(2) PROCESS FOR EXTENDED ZOOM
(3) DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@XQT QUAL*UCSTST.MAINSUB1SUB2/ZOOM
Explanation
This static link differs from the static link of a standard object module in the following
commands:
1. You must supply the main program and all subprograms with one of these
INCLUDE commands because a ZOOM is being produced. With ZOOMs, dynamic
linking cannot be used.
2. The PROCESS command specifies that the type of output is a ZOOM.
3. In this example, the entry point of the main program, START$, is the only external
entry point not deleted.
A site may wish to define its own set of files (its own library search chain) that the
Linking System searches to resolve references before searching the default library
search chains in SYS$*DATA$.SSDEF$. Such a library search chain is called a user-
defined library search chain. User-defined library search chains are created using the
Subsystem Definition Processor (@SSDP). The Subsystem Definition Processor
produces an element named SSDEF$ that is a special subtype (SSD) of an absolute
element. Every library search chain must reside in an element named SSDEF$.
These user-defined library search chains are typically defined and managed by the site
administrator. For details on how library search chains are defined and managed and
how references are resolved, refer to the Linking System Programming Reference
Manual.
If you are going to use user-defined library search chains during dynamic or static
linking, you must identify the file containing the library search chains. Do this by giving
the file an @USE name of LINK$PF before
where qual*libsearchain. is the name of the file containing the user-defined library
search chain’s SSDEF$ element. Examples follow.
Dynamic Linking
In the following example, user-defined library search chains located in
QUAL*LIBSEARCHAIN.SSDEF$ are used during dynamic linking:
@UCOB QUAL*UCSTST.COBOLEX,.COBOLEX/COMP,,,NO-OPTIONS
@USE LINK$PF,qual*libsearchain.
@XQT QUAL*UCSTST.COBOLEX/COMP
Static Linking
In the following example, user-defined library search chains located in
QUAL*LIBSEARCHAIN.SSDEF$ are used during static linking:
@UCOB QUAL*UCSTST.COBOLEX,.COBOLEX/COMP,,,NO-OPTIONS
@USE LINK$PF,qual*libsearchain.
@LINK,S ,QUAL*UCSTST.COBOLEX
INCLUDE QUAL*UCSTST.COBOLEX/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@XQT QUAL*UCSTST.COBOLEX
Dynamic Linking
During dynamic linking, the file containing the object module being executed is also
searched to resolve references. This file is known as HOME$. It is always searched
first, before the library search chains identified by LINK$PF and the default library
search chains in SYS$*DATA$.SSDEF$. In summary, references are resolved during
dynamic linking using the following search order:
1. HOME$-the file in which execution begins
2. User-defined library search chains residing in a LINK$PF element
3. Default library search chains residing in SYS$*DATA$.SSDEF$
Static Linking
In static linking, the USING clause on the RESOLVE command determines the order in
which references are resolved. The USING clause may contain a list that includes any
or all of the following:
• File names
File names indicate specific files that the programmer wishes to have searched to
resolve references. A file name must end with a period.
The order in which these items are listed in the USING clause is the order in which
they are searched. This means once LCN is encountered, the composite SSDEF$
library search chain is searched.
@USE LINK$PF,qual*libsearchain.
@LINK ,QUAL*UCSTST.ZOOM
INCLUDE QUAL*UCSTST.X/COMP
INCLUDE QUAL*UCSTST.Y/COMP
INCLUDE QUAL*UCSTST.Z/COMP
RESOLVE ALL REFERENCES
USING LOCAL_DEFS, QUAL*FILEA., QUAL*FILEB., LCN
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
In this example, the RESOLVE command specifies that references are resolved using
the following search order:
1. All object modules supplied by INCLUDE commands (as specified by LOCAL_DEFS)
2. Object modules in file QUAL*FILEA.
3. Object modules in file QUAL*FILEB.
4. The composite library search chain (as specified by LCN) created by merging
a. The library search chains in LINK$PF
b. The default library search chains in SYS$*DATA$.SSDEF$
Example 3–1 shows the output listing produced by these static link commands. Items
identified by numbers in parentheses are explained following the listing. User input is
in bold.
For more information on @LINK output, refer to the Linking System Programming
Reference Manual.
@LINK,S ,QUAL*UCSTST.COBOLEX
LINK 5R2 (940112 1230:40) 1994 Jan 28 Fri 1353:45 (1)
1 INCLUDE QUAL*UCSTST.COBOLEX/COMP (2)
2 RESOLVE ALL REFERENCES USING LIBCODENAME (2)
3 PROCESS FOR EXTENDED ZOOM (2)
5 Bank(s) merged resulting in bank EM$$CODE . (3)
1 Bank(s) merged resulting in bank EM$$CODE_$A . (3)
1 Bank(s) merged resulting in bank EM$$DATA . (3)
1 Bank(s) merged resulting in bank EM$$LINK_VECTOR . (3)
3 Bank(s) merged resulting in bank EM$$LINK_VECTOR_$A . (3)
1 Bank(s) merged resulting in bank EM$$LINK_VECTOR_$B . (3)
4 DELETE ALL DEFINITIONS EXCEPT START$ (2)
834 Definition(s) deleted after resolution. (4)
5 bank parts:
1 QUAL*UCSTST(1).COBOLEX/COMP 1994 Jan 28 1353:23
Name: COBOLEX$1 000001000 - 000001231
2 SYS$LIB$*EMOMRTS(856).RTS-GCLSINT 1993 Dec 23 1138:55
Name: RTS-GCLSINT 000001232 - 000002230
3 SYS$LIB$*PADS(97).PADS$EMRTS 1994 Jan 7 1438:18
Name: PADS$CODE 000002231 - 000004410
4 SYS$LIB$*LINKOMLIB(227).LS$RES-NAME 1993 OCT 4 1808:11
Name: LS$RES-NAME$01 000004411 - 000004416
5 SYS$LIB$*LINKOMLIB(227).LS$INTERCEPT 1993 Dec 17 1417:57
Name: LS$INTERCEPT$01 000004417 - 000005641
1 bank part:
1 SYS$LIB$*RSA(22).RSAC-UCSEMOM 1993 Nov 23 2240:37
Name: I_BANK 000001000 - 000001053
1 bank part:
1 QUAL*UCSTST(1).COBOLEX/COMP 1994 Jan 28 1353:23
Name: COBOLEX$0 000000000 - 000000474
1 bank part:
1 SYS$LIB$*RSA(22).RSAC-UCSEMOM 1993 Nov 23 2240:37
Name: DBNK 000050000 - 000050005
1 bank part:
1 SYS$LIB$*EMOMRTS(856).URTS$TABLES 1993 Dec 23 1139:04
Name: URTS$TABLES$17 000000000 - 000000007 (16)
3 bank parts:
1 SYS$LIB$*EMOMRTS(856).RTS-GCLSINT 1993 Dec 23 1138:55
Name: LV$GCLSINT 000000000 - 000000013
2 SYS$LIB$PADS(97).PADS$EMRTS 1994 Jan 7 1438:18
Name: PADS$LV 000000014 - 000000213
3 SYS$LIB$*LINKOMLIB(227).LS$INTERCEPT 1993 Dec 17 1417:57
Name: LS$INTERCEPT$04 000000214 - 000000343
1 bank part:
1 SYS$LIB$*RSA(22).RSAC-UCSEMOM 1993 Nov 23 2240:37
Name: RSAC-UCSEMOM$17 000000000 - 000000003
Explanation
1. This is the LINK Processor call line. It identifies
• The level of the Linking System software
• In parentheses, the date and time this Linking System software was generated
• The date and time that this static link took place (not in parentheses)
2. These are an echo of the static linking commands input from the source
runstream.
3. As a result of the PROCESS command, banks were merged in order to produce a
more production-efficient ZOOM. These statements identify the results of this
automatic bank merging. The names of the new banks that were created are
shown (for example, EM$$CODE). Later in this @LINK output, each of these new
banks is described, showing which input banks were merged together during the
formation of the new output bank.
4. This line provides the number of entry points that were deleted as a result of the
DELETE ALL DEFINITIONS command. The DELETE command decreases the size of
the ZOOM produced by the static link.
5. These statements identify the bank groups created by this static link. A bank
group is a collection of one or more related banks that are grouped together for
efficient loading at execution time. An entire bank group is loaded as a single unit.
This static link produced two bank groups:
• EM$$GROUP
Contains the executable code and data. It represents the COBOLEX program.
• SDD$$GROUP
Is a special bank group not used during error-free execution of the COBOLEX
program. It is a symbolic debugging dictionary. It provides information that
allows PADS to reference data and code statements in the user program,
using symbolic names. It is only used when PADS is invoked.
6. EM$$CODE is the first bank created by the automatic bank merging. The
specification "Bank_type" indicates it is a code bank. It was created by merging
the five banks (now referred to as "bank parts") listed on the lines following the
"Addr Range."
The first line for these bank parts specifies the input object module containing the
original bank; the second line specifies the bank name. The following lines are for the
code bank of the user program COBOLEX:
QUAL*UCSTST(1).COBOLEX/COMP
Name: COBOLEX$1
This is a UCS Runtime System code bank used as the interface to the Linking System
from the generated code and the UCS Runtime System.
SYS$LIB$*EMOMRTS(856).RTS-GCLSINT
Name: RTS-GCLSINT
The following lines are for the PADS code bank. SYS$LIB$*PADS(97).PADS$EMRTS
provides interfaces to the PADS common banks and the PADS extended mode
contingency handler.
SYS$LIB$*PADS(97).PADS$EMRTS
Name: PADS$CODE
7. EM$$CODE_$A is the second bank created by the automatic bank merging. The
specification "Bank_type" indicates it is a code bank. It was created by merging
one bank, which is shown here as the bank part:
SYS$LIB$*RSA(22).RSAC-UCSEMOM
Name: I_BANK
This is the entry point virtual address information for the RDMS application group
software defined by ACTIVE$APP in the library search chains.
8. EM$$DATA is the third bank created by the automatic bank merging. The
specification "Bank_type" indicates it is a data bank. It was created by merging
one bank, which is shown here as the bank part:
QUAL*UCSTST(1).COBOLEX/COMP
Name: COBOLEX$0
This is a UCS Runtime System data bank. It contains the UCS Runtime System tables,
I/O buffers and packets, entry point definitions, and the storage management reserve.
This is a UCS Runtime System data bank. It is a dummy bank used to satisfy
SS_CGY_REF in URTS$TABLES, when the user does not supply a contingency routine
for a chameleon subsystem to access its unshared data. If chameleon subsystems
are not being used, this bank is not used.
12. EM$$LINK_VECTOR is the seventh bank created by the automatic bank merging.
The specification "Bank_type" indicates it is a Link_vector bank. This is a special bank
that contains link vectors. A link vector is a structure used to link references to their
definitions. (For more information, see the Linking System Programming Reference
Manual.)
EM$$LINK_VECTOR contains one bank that is shown here as a bank part. The
following lines are for the link vector bank for the UCS Runtime System bank
URTS$TABLES.
SYS$LIB$*EMOMRTS(856).URTS$TABLES
Name: URTS$TABLES$17
13. EM$$LINK_VECTOR_$A is the eighth bank and the second link vector bank. It was
created by merging 3 banks, that are now called bank parts.
The following lines are for the link vector bank part for the UCS Runtime System
contingency processing routine.
SYS$LIB$*EMOMRTS(856).RTS-GCLSINT
Name: LV$GCLSINT
The following lines are for the link vector bank part for PADS.
SYS$LIB$*PADS(97).PADS$EMRTS
Name: PADS$LV
The following lines are for the link vector bank part for the Linking System.
SYS$LIB$*LINKOMLIB(227).LS$INTERCEPT
Name: LS$INTERCEPT$04
14. EM$$LINK_VECTOR_$B is the ninth bank and the third link vector bank.
The following lines are for the link vector bank for RDMS.
SYS$LIB$RSA(22).RSAC-UCSEMOM
Name: RSAC-UCSEMOM$17
17. This is the sign-off line for the LINK Processor. It identifies
• The number of lines of @LINK commands entered by the user (LINES : 4)
• The number of errors that occurred in this @LINK session (ERRORS : 0)
• The number of warnings that were issued in this @LINK session (WARNINGS : 0)
• The number of external references not resolved during the @LINK session
(XREFS : 0)
External references not resolved by static linking must be resolved by the dynamic
linker during execution. In the case of a ZOOM, the number of external references
should always be zero.
COBOLEX
IDENTIFICATION DIVISION.
PROGRAM-ID. COBOLEX INITIAL.
.
.
.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DATANAME1 PIC X(8) VALUE ALL 'x'.
01 DATANAME2 PIC 9(5) VALUE 6.
01 DATANAME3 PIC 9(5) VALUE 12.
PROCEDURE DIVISION.
DISPLAYs ....
data manipulation
DISPLAYs ...
STOP RUN.
IDENTIFICATION DIVISION.
******************************************************************
* *
* EXAMPLE OF A SIMPLE COBOL PROGRAM *
* *
******************************************************************
PROGRAM-ID. COBOLEX INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DATANAME1 PIC X(8) VALUE ALL 'x'.
01 DATANAME2 PIC 9(5) VALUE 6.
01 DATANAME3 PIC 9(5) VALUE 12.
PROCEDURE DIVISION.
******************************************************
*** DISPLAY OF INITIAL VALUES ***
******************************************************
START-PARA.
DISPLAY '*** INITIAL DATA VALUES ***' UPON PRINTER.
DISPLAY ' DATANAME1 = ' DATANAME1 UPON PRINTER.
DISPLAY ' DATANAME2 = ' DATANAME2 UPON PRINTER.
DISPLAY ' DATANAME3 = ' DATANAME3 UPON PRINTER.
*********************************************************
*** MANIPULATION OF THE DATA ***
*********************************************************
DATAMANIPULATION.
DISPLAY '*** DATA MANIPULATION BEING DONE ***' UPON PRINTER.
ADD DATANAME2 TO DATANAME3.
MOVE 'aaaa' TO DATANAME1 (3:4).
******************************************************
*** DISPLAY OF FINAL VALUES ***
******************************************************
ENDPARA.
DISPLAY '*** FINAL DATA VALUES ***' UPON PRINTER.
DISPLAY ' DATANAME1 = ' DATANAME1 UPON PRINTER.
DISPLAY ' DATANAME2 = ' DATANAME2 UPON PRINTER.
DISPLAY ' DATANAME3 = ' DATANAME3 UPON PRINTER.
STOP RUN.
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION *********************
@ . ***
@ . ***
@ . *** THIS EXAMPLE SHOWS THE COMPILATION OF A SIMPLE COBOL
@ . *** PROGRAM - COBOLEX, ITS LINKING USING TWO METHODS, AND
@ . *** THE MATCHING EXECUTIONS
@ . ***
@ . *** COMPILE OF COBOL PROGRAM 'COBOLEX'
@ . ***
@UCOB QUAL*UCSTST.COBOLEX,.COBOLEX/COMP,,,NO-OPTIONS
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . *** METHOD 1: TOTALLY DYNAMIC LINKING
@ . *** EXECUTION OF THE COBOL PROGRAM 'COBOLEX1' USING
@ . *** DYNAMIC LINKING
@ . ***
@XQT QUAL*UCSTST.COBOLEX/COMP
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . *** METHOD 2: STATIC LINKING TO PRODUCE A ZERO OVERHEAD
@ . *** OBJECT MODULE
@ . ***
@LINK,S ,QUAL*UCSTST.COBOLEX
INCLUDE QUAL*UCSTST.COBOLEX/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ******* EXECUTION *******
@ . ***
@ . *** EXECUTION OF COBOL PROGRAM 'COBOLEX'
@ . ***
@XQT QUAL*UCSTST.COBOLEX
@ . ***
@ . ***
@ . ** EXAMPLE IS COMPLETE
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION *********************
@ . ***
@ . ***
@ . *** THIS EXAMPLE SHOWS THE COMPILATION OF A SIMPLE COBOL
@ . *** PROGRAM - COBOLEX, ITS LINKING USING TWO METHODS, AND
@ . *** THE MATCHING EXECUTIONS
@ . ***
@ . *** COMPILE OF COBOL PROGRAM 'COBOLEX'
@ . ***
@UCOB QUAL*UCSTST.COBOLEX,.COBOLEX/COMP,,,NO-OPTIONS
UCOB- 6R2(931119) LSS- 8R2(931209) 940128 13:53:15
SIZES: CODE(EM6): 154 DATA: 317
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . *** METHOD 1: TOTALLY DYNAMIC LINKING
@ . *** EXECUTION OF THE COBOL PROGRAM 'COBOLEX1' USING
@ . *** DYNAMIC LINKING
@ . ***
@XQT QUAL*UCSTST.COBOLEX/COMP
DATANAME1 = xxxxxxxx
DATANAME2 = 00006
DATANAME3 = 00012
DATANAME1 = xxaaaaxx
DATANAME2 = 00006
DATANAME3 = 00018
@ . **
@ . ***
@ . ****************************************************************
@ . ***
@ . *** METHOD 2: STATIC LINKING TO PRODUCE A ZERO OVERHEAD
@ . *** OBJECT MODULE
@ . ***
@LINK,S ,QUAL*UCSTST.COBOLEX
LINK 5R2 (940112 1230:40) 1994 Jan 28 Fri 1353:45
1 INCLUDE QUAL*UCSTST.COBOLEX/COMP
2 RESOLVE ALL REFERENCES USING LIBCODENAME
3 PROCESS FOR EXTENDED ZOOM
5 Bank(s) merged resulting in bank EM$$CODE .
1 Bank(s) merged resulting in bank EM$$CODE_$A .
1 Bank(s) merged resulting in bank EM$$DATA .
1 Bank(s) merged resulting in bank EM$$LINK_VECTOR .
3 Bank(s) merged resulting in bank EM$$LINK_VECTOR_$A .
1 Bank(s) merged resulting in bank EM$$LINK_VECTOR_$B .
4 DELETE ALL DEFINITIONS EXCEPT START$
834 Definition(s) deleted after resolution .
5 bank parts:
1 QUAL*UCSTST(1).COBOLEX/COMP 1994 Jan 28 1353:23
Name: COBOLEX$1 000001000 - 000001231
2 SYS$LIB$*EMOMRTS(856).RTS-GCLSINT 1993 Dec 23 1138:55
Name: RTS-GCLSINT 000001232 - 000002230
3 SYS$LIB$*PADS(97).PADS$EMRTS 1994 Jan 7 1438:18
Name: PADS$CODE 000002231 - 000004410
4 SYS$LIB$*LINKOMLIB(227).LS$RES-NAME 1993 OCT 4 1808:11
Name: LS$RES-NAME$01 000004411 - 000004416
5 SYS$LIB$*LINKOMLIB(227).LS$INTERCEPT 1993 Dec 17 1417:57
Name: LS$INTERCEPT$01 000004417 - 000005641
1 bank part:
1 SYS$LIB$*RSA(22).RSAC-UCSEMOM 1993 Nov 23 2240:37
Name: I_BANK 000001000 - 000001053
3 Name: EM$$DATA (new bank)
Bank_type = Data; LBN = 02
1 bank part:
1 SYS$LIB$*RSA(22).RSAC-UCSEMOM 1993 Nov 23 2240:37
Name: DBNK 000050000 - 000050005
1 bank part:
1 SYS$LIB$*EMOMRTS(856).URTS$TABLES 1993 Dec 23 1139:04
Name: URTS$TABLES$17 000000000 - 000000007
3 bank parts:
1 SYS$LIB$*EMOMRTS(856).RTS-GCLSINT 1993 Dec 23 1138:55
Name: LV$GCLSINT 000000000 - 000000013
2 SYS$LIB$PADS(97).PADS$EMRTS 1994 Jan 7 1438:18
Name: PADS$LV 000000014 - 000000213
3 SYS$LIB$*LINKOMLIB(227).LS$INTERCEPT 1993 Dec 17 1417:57
Name: LS$INTERCEPT$04 000000214 - 000000343
1 bank part:
@ . ***
@ . ***
@ . *** ******* EXECUTION *******
@ . ***
@ . *** EXECUTION OF COBOL PROGRAM 'COBOLEX'
@ . ***
@XQT QUAL*UCSTST.COBOLEX
DATANAME1 = xxxxxxxx
DATANAME2 = 00006
DATANAME3 = 00012
DATANAME1 = xxaaaaxx
DATANAME2 = 00006
DATANAME3 = 00018
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SIMPLE COBOL MAIN PROGRAM *
* *
******************************************************************
******************************************************************
PROGRAM-ID. MAIN.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
******************************************************
*** DISPLAY OF MAIN PROGRAM ***
******************************************************
START-PARA.
DISPLAY 'THIS IS THE MAIN PROGRAM' UPON PRINTER.
CALL 'SUB1'.
DISPLAY 'RETURN FROM SUBPROGRAM SUB1' UPON PRINTER.
CALL 'SUB2'.
DISPLAY 'RETURN FROM SUBPROGRAM SUB2' UPON PRINTER.
DISPLAY 'END OF THE MAIN PROGRAM' UPON PRINTER.
STOP RUN.
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SIMPLE COBOL SUB1 PROGRAM *
* *
******************************************************************
******************************************************************
PROGRAM-ID. SUB1.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
******************************************************
*** DISPLAY OF SUB1 PROGRAM ***
******************************************************
START-PARA.
DISPLAY 'THIS IS THE SUB1 PROGRAM' UPON PRINTER.
EXIT PROGRAM.
Example 3-7 shows the complete source listing of the second subprogram, SUB2. In
this example, this program resides in element QUAL*UCSTST.SUB2. Noteworthy lines
are bolded.
IDENTIFICATION DIVISION.
***********************************************************
***********************************************************
* *
* EXAMPLE OF A SIMPLE COBOL SUB2 PROGRAM *
* *
***********************************************************
***********************************************************
PROGRAM-ID. SUB2.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
******************************************************
*** DISPLAY OF SUB2 PROGRAM ***
******************************************************
START-PARA.
DISPLAY 'THIS IS THE SUB2 PROGRAM' UPON PRINTER.
EXIT PROGRAM.
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION *********************
@ . ***
@ . ***
@ . *** THIS EXAMPLE SHOWS THE COMPILATION OF THREE COBOL PROGRAMS -
@ . *** ONE MAIN PROGRAM 'MAIN' AND TWO SUBPROGRAMS 'SUB1' AND 'SUB2',
@ . *** THE LINKING USING FOUR CASES, AND THE MATCHING EXECUTIONS.
@ . ***
@ . ***
@ . ***
@ . *** COMPILE OF COBOL MAIN PROGRAM 'MAIN'
@ . ***
@UCOB QUAL*UCSTST.MAIN,.MAIN/COMP,,,NO-OPTIONS
@ . ***
@ . ***
@ . *** COMPILE OF COBOL SUBPROGRAM 'SUB1'
@ . ***
@UCOB QUAL*UCSTST.SUB1,.SUB1/COMP,,,SUBPROGRAM,NO-OPTIONS
@ . ***
@ . ***
@ . *** COMPILE OF COBOL SUBPROGRAM 'SUB2'
@ . ***
@UCOB QUAL*UCSTST.SUB2,.SUB2/COMP,,,SUBPROGRAM,NO-OPTIONS
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . *** CASE 1: TOTALLY DYNAMIC LINKING
@ . *** EXECUTION OF THE COBOL MAIN PROGRAM 'MAIN' USING
@ . *** DYNAMIC LINKING TO LOCATE AND LOAD THE SUBPROGRAMS.
@ . ***
@ . ***
@ . *** ******* COPY *******
@ . ***
@ . *** COPY THE OBJECT MODULES THAT WILL BE DYNAMIC LINKED
@ . *** TO A NEW FILE TO ENSURE THAT THE COMPILER-PRODUCED
@ . *** OBJECT MODULES ARE USED BY THE DYNAMIC LINKER AND NOT
@ . *** STATIC LINKER OUTPUTS WITH THE SAME ENTRY POINTS.
@ . ***
@DELETE,C QUAL*EXECUTE.
@CAT,P QUAL*EXECUTE.
@COPY,A QUAL*UCSTST.MAIN/COMP,QUAL*EXECUTE.
@COPY,A QUAL*UCSTST.SUB1/COMP,QUAL*EXECUTE.
@COPY,A QUAL*UCSTST.SUB2/COMP,QUAL*EXECUTE.
@PRT,T QUAL*EXECUTE.
@ . ***
@ . ***
@ . *** ******* EXECUTION *******
@ . ***
@XQT QUAL*EXECUTE.MAIN/COMP
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . *** CASE 2: STATIC LINKING TO PRODUCE A STANDARD OBJECT MODULE
@ . *** INCLUDING BOTH SUBPROGRAMS BUT NOT THE MAIN PROGRAM
@ . ***
@LINK ,QUAL*UCSTST.SUB1SUB2/OM
INCLUDE QUAL*UCSTST.SUB1/COMP
INCLUDE QUAL*UCSTST.SUB2/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED OM
DELETE ALL DEFINITIONS EXCEPT SUB1, SUB2
@EOF
@ . ***
@ . ***
@ . *** ******* COPY *******
@ . ***
@ . *** COPY THE OBJECT MODULES THAT WILL BE DYNAMIC LINKED
@ . *** TO A NEW FILE TO ENSURE THAT THE COMPILER-PRODUCED
@ . *** OBJECT MODULES ARE USED BY THE DYNAMIC LINKER AND NOT
@ . *** STATIC LINKER OUTPUTS WITH THE SAME ENTRY POINTS.
@ . ***
@DELETE,C QUAL*EXECUTE.
@CAT,P QUAL*EXECUTE.
@COPY,A QUAL*UCSTST.MAIN/COMP,QUAL*EXECUTE.
@COPY,A QUAL*UCSTST.SUB1SUB2/OM,QUAL*EXECUTE.
@PRT,T QUAL*EXECUTE.
@ . ***
@ . ***
@ . *** ******* EXECUTION *******
@ . ***
@ . *** EXECUTION OF COBOL OM 'MAIN/COMP'
@ . ***
@XQT QUAL*EXECUTE.MAIN/COMP
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . *** CASE 3: STATIC LINKING TO PRODUCE A BOUND OBJECT MODULE
@ . *** INCLUDING THE MAIN PROGRAM AND ONE SUBPROGRAM
@ . ***
@LINK ,QUAL*UCSTST.MAINSUB1/BOM
INCLUDE QUAL*UCSTST.MAIN/COMP
INCLUDE QUAL*UCSTST.SUB1/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED BOUND OM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ******* COPY *******
@ . ***
@ . *** COPY THE OBJECT MODULES THAT WILL BE DYNAMIC LINKED
@ . *** TO A NEW FILE TO ENSURE THAT THE COMPILER-PRODUCED
@ . *** OBJECT MODULES ARE USED BY THE DYNAMIC LINKER AND NOT STATIC
@ . *** LINKER OUTPUTS WITH THE SAME ENTRY POINTS.
@ . ***
@DELETE,C QUAL*EXECUTE.
@CAT,P QUAL*EXECUTE.
@COPY,A QUAL*UCSTST.MAINSUB1/BOM,QUAL*EXECUTE.
@COPY,A QUAL*UCSTST.SUB2/COMP,QUAL*EXECUTE.
@PRT,T QUAL*EXECUTE.
@ . ***
@ . ***
@ . *** ******* EXECUTION *******
@ . ***
@ . *** EXECUTION OF COBOL BOM 'MAINSUB1/BOM'
@ . ***
@XQT QUAL*EXECUTE.MAINSUB1/BOM
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . *** CASE 4: STATIC LINKING TO PRODUCE A ZERO OVERHEAD OBJECT
@ . *** MODULE INCLUDING THE MAIN PROGRAM AND BOTH
@ . *** SUBPROGRAMS
@ . ***
@LINK ,QUAL*UCSTST.MAINSUB1SUB2/ZOOM
INCLUDE QUAL*UCSTST.MAIN/COMP
INCLUDE QUAL*UCSTST.SUB1/COMP
INCLUDE QUAL*UCSTST.SUB2/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ******* EXECUTION *******
@ . ***
@ . *** EXECUTION OF COBOL ZOOM 'MAINSUB1SUB2/ZOOM'
@ . ***
@XQT QUAL*UCSTST.MAINSUB1SUB2/ZOOM
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** THIS EXAMPLE SHOWS THE COMPILATION OF THREE COBOL PROGRAMS -
@ . *** ONE MAIN PROGRAM 'MAIN' AND TWO SUBPROGRAMS 'SUB1' AND 'SUB2',
@ . *** THE LINKING USING FOUR CASES, AND THE MATCHING EXECUTIONS
@ . ***
@ . ***
@ . *** COMPILE OF COBOL MAIN PROGRAM 'MAIN'
@ . ***
@UCOB QUAL*UCSTST.MAIN,.MAIN/COMP,,,NO-OPTIONS
UCOB- 6R2(931119) LSS- 8R2(931209) 940128 14:09:16
SIZES: CODE(EM6): 92 DATA: 179
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** COMPILE OF COBOL SUBPROGRAM 'SUB1'
@ . ***
@UCOB QUAL*UCSTST.SUB1,.SUB1/COMP,,,SUBPROGRAM,NO-OPTIONS
UCOB- 6R2(931119) LSS- 8R2(931209) 940128 14:09:22
SIZES: CODE(EM6): 50 DATA: 89
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** COMPILE OF COBOL SUBPROGRAM 'SUB2'
@ . ***
@UCOB QUAL*UCSTST.SUB2,.SUB2/COMP,,,SUBPROGRAM,NO-OPTIONS
UCOB- 6R2(931119) LSS- 8R2(931209) 940128 14:09:27
SIZES: CODE(EM6): 50 DATA: 89
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . *** CASE 1: TOTALLY DYNAMIC LINKING
@ . *** EXECUTION OF THE COBOL MAIN PROGRAM 'MAIN' USING
@ . *** DYNAMIC LINKING TO LOCATE AND LOAD THE SUBPROGRAMS
@ . ***
@ . ***
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . ***
@ . ***
@ . ****************************************************************
@ . ***
@ . *** CASE 4: STATIC LINKING TO PRODUCE A ZERO OVERHEAD OBJECT
@ . *** MODULE INCLUDING THE MAIN PROGRAM AND BOTH
@ . *** SUBPROGRAMS
@ . ***
@LINK ,QUAL*UCSTST.MAINSUB1SUB2/ZOOM
LINK 5R2 (940112 1230:40) 1994 Jan 28 Fri 1411:11
END LINK , LINES : 6 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** ******* EXECUTION *******
@ . ***
@ . *** EXECUTION OF COBOL ZOOM 'MAINSUB1SUB2/ZOOM'
@ . ***
@XQT QUAL*UCSTST.MAINSUB1SUB2/ZOOM
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
The UDS suite of database products is totally supported in UCS programming. These
products include the following:
• DMS 2200
This is the hierarchical and network architectural database system, based on a record
and set structure.
DMS 2200 is supported only for UCS COBOL and UCS FORTRAN.
• RDMS 2200
This is the relational database system, based on tables composed of rows and
columns that support parent-child relationships.
RDMS 2200 databases can be accessed through all UCS languages.
• SFS 2200
This is the conventional shared file system, based on sequential and multi-indexed file
structures.
SFS 2200 databases can also be accessed through all UCS languages.
Table 3–2 is a summary of the UDS interfaces supported by the UCS host languages.
The UCS interfaces to UDS databases are designed to be compatible with older UDS
interfaces. UCS and non-UCS programs can share the same
• UDS software
• Database files
Both UCS and non-UCS programs also support the same functional capabilities. In
other words, UCS programs and non-UCS programs with the same data manipulation
language (DML) command syntax can access the same database files using the same
UDS software, simultaneously. As far as compatibility is concerned, very little has
changed for the applications programmer.
In order to describe how UCS programs access these UDS data models, the following
subsections show three very simple databases, one for each of the data models:
• DMS 2200
• RDMS 2200
• SFS 2200
For each database model, a subsection describes each of the following processes:
• Creating the database
• Loading information into the database
• Accessing information from the database
The following subsections describe the steps involved in creating and accessing a
DMS 2200 database using UCS. They discuss
• DMS 2200 schemas
• DMS 2200 subschemas
• DML application programs
The coding of a DMS 2200 schema to be used by UCS programs must comply with the
following conditions:
• The schema cannot contain any Fieldata data items or records. Fieldata is not
supported by any UCS compiler. Schemas that contain no Fieldata can be shared
by both UCS and non-UCS programs.
Therefore, most existing schemas built for non-UCS programs can be shared with UCS
programs. This means you do not need to recode or reprocess schemas.
• The schema cannot contain any of the following new UCS COBOL USAGE clauses:
− BINARY-1
− BINARY
These USAGE clauses are not supported by the schema processor (@DDL),
unless the syntax SOURCE IS UCS appears in the schema definition (available
in DMS level 17R1 and later).
• All area names, record names, data item names, set names and database names
must be unique. For example, a schema cannot contain a record and an area with
the same name. Also, these names must be unique within the COBOL program.
Refer to the DMS DDL Administration, Operations, and Programming Guide for more
information on DMS 2200 schemas.
The schema used in the example for this section uses the following record and set
diagram:
EMPNUMBER
A direct record type that is keyed off the individual’s unique employee number.
INDIVIDUAL
An indexed sequential record type that is keyed off the individual’s name;
duplicates are allowed.
JOBINFO
A calc record type that is keyed off job titles; no duplicates are allowed.
DEPARTMENT
A calc record type that is keyed off department numbers; no duplicates are
allowed.
UCS programs require their own subschemas, with a new HOST LANGUAGE value for
both UCS COBOL and UCS FORTRAN. For UCS COBOL, the following clause is
required:
HOST LANGUAGE IS UCS COBOL
The following figure compares subschema source code of UCS COBOL and UCS
FORTRAN.
• The T option is not permitted on the SDDL processor call. This option converts
USAGE clauses to Fieldata or ASCII, depending upon the current values of the
clauses.
When a UCS subschema is processed, the SDDL processor produces three output
elements:
• S$PROC
This is a symbolic element containing information describing records and data items.
It is used by the UCS compilers while they process an INVOKE statement. The record
and data item layouts are copied from S$PROC into the program during compilation.
• S$WORK
When a subschema contains a HOST LANGUAGE clause for a UCS language, S$WORK
is generated as an object module. You statically or dynamically link S$WORK to the
program (as described later in this subsection).
Note: The F option is no longer required on the SDDL processor call when the Host
Language is UCS COBOL (as of DMS level 16R1). The SDDL processor automatically
converts ASCII COBOL item PICTURE and USAGE clauses (in S$PROC) to those
acceptable to the UCS COBOL compiler.
The following example shows the SDDL processor call for the UCS COBOL example
subschema:
@UDS$$SVN*DMRMT$.SDDL,DN
QUAL*UCSTST.PERSONSUB,UDS$$SVN*SCHFILE.PERSONSUB
The HOST LANGUAGE IS UCS FORTRAN clause requires no special SDDL processor
call options. The following example shows the SDDL processor call in this case:
@UDS$$SVN*DMRMT$.SDDL,DN
QUAL*UCSTST.PERSONSUB,UDS$$SVN*SCHFILE.PERSONSUB
Refer to the DMS SDDL Administration, Operations, and Programming Guide for
more information on DMS 2200 subschemas.
IDENTIFICATION DIVISION
SCHEMA NAME IS PERSONNEL IN FILE SCHFILE
DATA DIVISION
DATA NAME SECTION.
01 CALC-AREA-NAME USAGE IS AREA-NAME
01 EMPNO-AREA-NAME USAGE IS AREA-NAME
01 EMPNO-AREA-KEY USAGE IS AREA-KEY
AREA SECTION.
AREA LOOKS INCLUDE QUICK-BEFORE-LOOKS AFTER-LOOKS
AREA NAME IS DEPTAREA
AREA CODE IS 1
MODE IS DATA
ALLOCATE 12 PAGES
PAGES ARE 448 WORDS
CALC USES 1 CHAINS LINKED PRIOR
AREA NAME IS JOBAREA
AREA CODE IS 2
MODE IS DATA
ALLOCATE 10 PAGES 2 OVERFLOW AT END
PAGES ARE 448 WORDS
CALC USES 1 CHAINS LINKED PRIOR
AREA NAME IS EMPNOAREA
AREA CODE IS 3
MODE IS DATA
ALLOCATE 1000 PAGES
PAGES ARE 448 WORDS
AREA NAME IS INDAREA
AREA CODE IS 4
MODE IS DATA
ALLOCATE 1000 PAGES
PAGES ARE 1792 WORDS
AREA NAME IS INDINDEX
AREA CODE IS 5
MODE IS INDEX
ALLOCATE 10 PAGES
PAGES ARE 112 WORDS
RECORD SECTION.
RECORD DEPARTMENT
CODE IS 101
LOCATION MODE IS CALC DMSCALC
IN CALC-AREA-NAME
USING DEPT-NO
DUPLICATES ARE NOT ALLOWED
WITHIN DEPTAREA
MODE IS ASCII
05 DEPT-NO PIC X(4)
05 DEPT-NAME PIC X(24)
05 DEPT-DESCRIPTION PIC X(55)
RECORD JOBINFO
CODE IS 102
LOCATION MODE IS CALC DMSCALC
IN CALC-AREA-NAME
USING JOB-TITLE
DUPLICATES ARE NOT ALLOWED
WITHIN JOBAREA
MODE IS ASCII
05 JOB-TITLE PIC X(20)
05 JOB-DESCRIPTION PIC X(50)
05 JOB-SALARY PIC X(5)
RECORD EMPNUMBER
CODE IS 103
LOCATION MODE IS DIRECT EMPNO-AREA-KEY, EMPNO-AREA-NAME
WITHIN EMPNOAREA
MODE IS ASCII
05 EMP-NUMBER PIC X(5)
RECORD INDIVIDUAL
CODE IS 104
LOCATION MODE IS INDEX SEQUENTIAL
USING ASCENDING KEY IND-LAST-NAME, IND-FIRST-NAME
INDEX AREA IS INDINDEX
LINKS ARE NEXT AND PRIOR
DUPLICATES ARE NOT ALLOWED
WITHIN INDAREA
MODE IS ASCII
05 IND-LAST-NAME PIC X(20)
05 IND-FIRST-NAME PIC X(12)
SET SECTION.
SET DEPT-IND
CODE IS 201
MODE IS CHAIN
ORDER IS SORTED
OWNER IS DEPARTMENT
MEMBER IS INDIVIDUAL AUTOMATIC
LINKED TO OWNER
ASCENDING KEY IS IND-LAST-NAME, IND-FIRST-NAME
DUPLICATES ARE LAST
SET OCCURRENCE SELECTION IS THRU CURRENT OF SET
SET JOB-IND
CODE IS 202
MODE IS CHAIN
ORDER IS SORTED
OWNER IS JOBINFO
MEMBER IS INDIVIDUAL AUTOMATIC
LINKED TO OWNER
ASCENDING KEY IS IND-LAST-NAME, IND-FIRST-NAME
DUPLICATES ARE LAST
SET OCCURRENCE SELECTION IS THRU CURRENT OF SET
SET EMPNO-IND
CODE IS 203
MODE IS CHAIN
ORDER IS NEXT
OWNER IS EMPNUMBER
MEMBER IS INDIVIDUAL AUTOMATIC
SET OCCURRENCE SELECTION IS THRU CURRENT OF SET
IDENTIFICATION DIVISION
SUBSCHEMA NAME IS PERSONSUB IN FILE SCHFILE
OF SCHEMA PERSONNEL
HOST LANGUAGE IS UCS COBOL
DATA DIVISION
DATA NAME SECTION.
DATA NAMES ARE ALL
AREA SECTION.
AREAS ARE ALL
RECORD SECTION.
RECORDS ARE ALL
SET SECTION.
SETS ARE ALL
@ . ***
@ . *** ******** START OF THE DMS DATABASE DEFINITION SECTION **********
@ . ***
@ . ***
@ . *** CATALOG: THE FILE THAT WILL HOLD THE SCHEMA AND SUBSCHEMA
@ . *** THE DATABASE STORAGE AREA FILES
@ . ***
@CAT,P UDS$$SVN*SCHFILE.,F///5000
@CAT,P UDS$$SVN*DEPTAREA.,F/3//3
@CAT,P UDS$$SVN*JOBAREA.,F/3//3
@CAT,P UDS$$SVN*EMPNOAREA.,F/250//250
@CAT,P UDS$$SVN*INDAREA.,F/1000//1000
@CAT,P UDS$$SVN*INDINDEX.,F/1//1
@ . ***
@ . ***
@ . *** USE THE DDL PROCESSOR TO PRODUCE ABSOLUTE SCHEMA TABLES AND
@ . *** TO PLACE INFORMATION ABOUT THE SCHEMA IN THE REPOSITORY DATABASE
@ . ***
@ASG,A UDS$$SVN*SCHFILE.
@USE SCHFILE.,UDS$$SVN*SCHFILE.
@UDS$$SVN*DMRMT$.DDL,DN QUAL*UCSTST.PERSONNEL,UDS$$SVN*SCHFILE.PERSONNEL
@ . ***
@ . ***
@ . *** USE THE SDDL PROCESSOR TO PRODUCE SUBSCHEMA TABLES AND TO PLACE
@ . *** INFORMATION ABOUT THE SUBSCHEMA IN THE REPOSITORY DATABASE
@ . ***
@ . *** COBOL: NOTE THAT THE F-OPTION IS NO LONGER REQUIRED ON THE SDDL
@ . *** CALL FOR UCS COBOL SUBSCHEMAS.
@ . ***
@ . ***
@ . *** THE SDDL PROCESSOR CREATES A PROC THAT CONTAINS THE DATA DIVISION
@ . *** ENTRIES FOR THE DATABASE DATA NAMES AND THE DATABASE RECORDS THAT
@ . *** WILL BE COPIED INTO THE USER PROGRAM BY THE UCS COMPILER. AS
@ . *** PART OF THE SDDL PROCESS THIS PROC IS AUTOMATICALLY PDP'ED.
@ . ***
@UDS$$SVN*DMRMT$.SDDL,DN QUAL*UCSTST.PERSONSUB,UDS$$SVN*SCHFILE.PERSONSUB
@ . ***
@ . ***
@ . *** USE THE INFORMATION PLACED IN THE REPOSITORY DATABASE BY THE DDL
@ . ***
@ . *** ******** START OF THE DMS DATABASE DEFINITION SECTION **********
@ . ***
@ . ***
@ . *** CATALOG: THE FILE THAT WILL HOLD THE SCHEMA AND SUBSCHEMA
@ . *** THE DATABASE STORAGE AREA FILES
@ . ***
@CAT,P UDS$$SVN*SCHFILE.,F///5000
I:002333 CAT complete.
@CAT,P UDS$$SVN*DEPTAREA.,F/3//3
I:002333 CAT complete.
@CAT,P UDS$$SVN*JOBAREA.,F/3//3
I:002333 CAT complete.
@CAT,P UDS$$SVN*EMPNOAREA.,F/250//250
I:002333 CAT complete.
@CAT,P UDS$$SVN*INDAREA.,F/1000//1000
I:002333 CAT complete.
@CAT,P UDS$$SVN*INDINDEX.,F/1//1
I:002333 CAT complete.
@ . ***
@ . ***
@ . *** USE THE DDL PROCESSOR TO PRODUCE ABSOLUTE SCHEMA TABLES AND
@ . *** TO PLACE INFORMATION ABOUT THE SCHEMA IN THE REPOSITORY DATABASE
@ . ***
@ASG,A UDS$$SVN*SCHFILE.
I:002333 ASG complete.
@USE SCHFILE.,UDS$$SVN*SCHFILE.
I:002333 USE complete.
@UDS$$SVN*DMRMT$.DDL,DN QUAL*UCSTST.PERSONNEL,UDS$$SVN*SCHFILE.PERSONNEL
DDL PROCESSOR LEVEL :
DMS 1100 BUILD ID
CC/ER: 00:00:02.746
@ . ***
@ . ***
@ . *** USE THE SDDL PROCESSOR TO PRODUCE SUBSCHEMA TABLES AND TO PLACE
@ . *** INFORMATION ABOUT THE SUBSCHEMA IN THE REPOSITORY DATABASE
@ . ***
@ . *** COBOL: NOTE THAT THE F-OPTION IS NO LONGER REQUIRED ON THE SDDL
@ . *** CALL FOR UCS COBOL SUBSCHEMAS.
@ . ***
@ . ***
@ . *** THE SDDL PROCESSOR CREATES A PROC THAT CONTAINS THE DATA DIVISION
@ . *** ENTRIES FOR THE DATABASE DATA NAMES AND THE DATABASE RECORDS THAT
@ . *** WILL BE COPIED INTO THE USER PROGRAM BY THE UCS COMPILER. AS
@ . *** PART OF THE SDDL PROCESS THIS PROC IS AUTOMATICALLY PDP'ED.
@ . ***
@UDS$$SVN*DMRMT$.SDDL,DN QUAL*UCSTST.PERSONSUB,UDS$$SVN*SCHFILE.PERSONSUB
SDDL PROCESSOR LEVEL :
DMS 1100 BUILD ID
CC/ER: 00:00:04.670
@PDP,CN DSF$.X$PROC/PERSONSUB,PDP$$$SO$$$.S$PROC/PERSONSUB
PDP 13R1J (931108 0108:39) 1994 Jan 28 Fri 1417:06
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 22 Entry Points: 2 Time: 1.164 Storage: 7070/0/7070/0106210
@FREE,A PDP$$$SO$$$.
I:002333 FREE complete.
@ . ***
@ . ***
@ . *** USE THE INFORMATION PLACED IN THE REPOSITORY DATABASE BY THE DDL
@ . *** AND SDDL PROCESSORS TO CREATE SCHEMA AND SUBSCHEMA INFORMATION
@ . *** IN THE REPOSITORY AND PRODUCE THEIR FILE DESCRIPTION TABLES (FDTs).
@ . ***
@UDS$$SVN*UREP$ABS.DD,ES ,,APPSVN
UREP 3R2 (11/04/93 10:17:39) 01/28/94 14:17:08
1 PROCESS SCHEMA PERSONNEL INSTALL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA SCHEMA VERSION ABS for SCHEMA
PERSONNEL was SUCCESSFUL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA DEPTAREA VERSION ' ' for SCHEMA
PERSONNEL was SUCCESSFUL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA JOBAREA VERSION ' ' for SCHEMA
PERSONNEL was SUCCESSFUL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA EMPNOAREA VERSION ' ' for SCHEMA
A UCS DML program must identify a subschema that contains a HOST LANGUAGE IS
UCS clause in the INVOKE statement.
The syntax for DML commands in UCS programs is identical to the syntax supported
for non-UCS programs.
The following figure summarizes a simple UCS DML program described in the
following subsections. The program
1. Reads an employee number
2. Accesses information about that individual from the DMS 2200 database
3. Displays the data
IDENTIFICATION DIVISION.
PROGRAM-ID. DISPLAYIND.
.
.
DATA DIVISION.
SUBSCHEMA SECTION.
INVOKE .....
.
.
WORKING-STORAGE SECTION.
01 EMPLOYEE-NUMBER ....
PROCEDURE DIVISION.
ACCEPT EMPLOYEE-NUMBER
IMPART
OPEN .... RETRIEVAL
FETCHs ....
DISPLAYs .....
DEPART
STOP RUN.
Refer to the DMS CDML Operations and Programming Reference Manual for more
information on coding UCS COBOL DML programs. Refer to the DMS FDML
Operations and Programming Reference Manual for more information on coding UCS
FORTRAN DML programs.
The ASCII COBOL DML (ADML) and FORTRAN DML (FDML) preprocessors required for
non-UCS programs are not needed and no longer exist in UCS.
1) The compiler first looks for a file with the @USE name of the subschema
file name.
2) If it does not find such a file, the compiler tries to assign the subschema
file, using the run’s project-id as the subschema file’s qualifier.
2. When compiling a UCS COBOL program containing DML statements, you must
specify the COMPAT keyword option on the compiler call (only if including COMP-1
or COMP-2 items in the subschema). The COMPAT keyword option causes the
compiler to interpret these as if they were the correct COBOL 85 format.
No special keyword options are required for compilation of UCS FORTRAN DML
programs.
3. The UCS compilers access the object subschema and the S$PROC symbolic
element from the subschema file while parsing the DML syntax.
4. The output of the compiler is an object module that includes the D$WORK
information.
The following statements show how to compile the UCS COBOL DML program
illustrated in this section.
@ASG,A UDS$$SVN*SCHFILE.
@USE SCHFILE,UDS$$SVN*SCHFILE.
@UCOB,S QUAL*UCSTST.DISPLAYIND,QUAL*UCSTST.DISPLAYIND/COMP,,,;
NO-OPTIONS, NO-REMARK
The system automatically sets up application group library search chains for each of
the 64 application groups during installation of the Linking System. These library
search chains mean the applications programmer does not have to do either of the
following:
• Build a user-defined library search chain for linking
• Explicitly supply (INCLUDE) the object module containing the DMS 2200 interface
during static linking
The following generic format shows how to specify use of the appropriate application
group library search chain:
@USE LINK$PF,SYS$LIB$*APP$n
If you want to link a UCS program containing DML statements to the system software
in application group 7, use the following statement:
@USE LINK$PF.,SYS$LIB$*APP$7.
In this case, all references to DMS 2200 software would be resolved using
UDS$$SVN*D$MR.
Dynamic Linking
For dynamic linking, you can use one of the following ways to ensure that the Linking
System can locate S$WORK:
• Copy the S$WORK object module to the program file from which the UCS
compiler-generated object module is executed. This is the file represented by
HOME$. (This method is used in the dynamic linking example shown in
“Dynamically Linking a UCS DML Program” which follows.)
• Set up a user-defined library search chain that searches both
− The file containing S$WORK
− The files containing the system software for the appropriate application group
Then specify an @USE LINK$PF statement to identify this library search chain.
You must include the files containing the system software for the appropriate
application group in the user-defined library search chain because only one @USE
LINK$PF statement is allowed. If you specify a LINK$PF that represents a
user-defined library search chain, it cannot also represent the application group library
search chain built by the system.
Static Linking
For static linking, you can use one of the following ways to ensure that the Linking
System can locate S$WORK:
• Explicitly supply (INCLUDE) the S$WORK object module from the subschema file.
(This method is used in the static linking example shown in "Statically Linking a
UCS DML Program," which follows.)
• Specify the file containing S$WORK in the USING clause of the RESOLVE
command.
• Set up a user-defined library search chain that searches both
− The file containing S$WORK
− The files containing the system software for the appropriate application group
Then specify an @USE LINK$PF statement to identify this library search chain.
2. Before executing the program, specify use of the application group library search
chain by using the @USE LINK$PF statement.
3. Now the UCS compiler-produced object module is ready for execution.
The following example shows how to compile and execute a UCS DML program, using
dynamic linking.
@ASG,A UDS$$SVN*SCHFILE.
@USE SCHFILE,UDS$$SVN*SCHFILE.
@UCOB QUAL*UCSTST.LOADDMSDB,QUAL*UCSTST.LOADDMSDB/COMP,,, ;
NO-OPTIONS
@COPY,A UDS$$SVN*SCHFILE.S$WORK/PERSONSUB,QUAL*UCSTST.
@USE LINK$PF,SYS$LIB$*APP$7.
@XQT QUAL*UCSTST.LOADDMSDB/COMP
The output of this static link can be a standard object module, a bound object module,
or a zero overhead object module.
The following example shows how to statically link a UCS program containing DML
statements, producing a zero overhead object module:
Explanation:
1. This statement ensures that the program is statically linked using the DMS 2200
software located in the desired application group. (It ensures that the library
search chain for the correct application group is used.) In this example, this
program is to execute in application group 7.
2. This statement calls the Linking System LINK Processor. The zero overhead object
module (ZOOM) to be produced is named QUAL*UCSTST.DISPLAYIND.
3. This command identifies the compiler-generated object module containing the
UCS DML program.
4. This command identifies the object module generated by SDDL that contains the
subschema’s S$WORK element.
5. This command resolves external references, including those to the UCS Runtime
System library.
6. This command merges banks and produces a zero overhead object module.
7. This command deletes all definitions except the program’s starting address,
START$. This decreases the size of the ZOOM.
8. This statement ends static linking.
IDENTIFICATION DIVISION.
PROGRAM-ID. DISPLAYIND INITIAL.
******************************************************************
******************************************************************
* *
* SIMPLE BATCH COBOL DML PROGRAM - DISPLAYIND *
* *
* reads the input data *
* imparts to the PERSONNEL database *
* retrieves the requested information from the database *
* displays this on the printer *
* departs from the PERSONNEL database *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
SUBSCHEMA SECTION.
INVOKE SUBSCHEMA PERSONSUB IN FILE SCHFILE
OF SCHEMA PERSONNEL
COPYING RECORDS INTO WORKING
COPYING DATA-NAMES INTO WORKING
RUN-UNIT-ID DSPIND
DMCA IS WORKING
ERROR DMS-GENERAL-ERROR-PARA.
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 INVALID-EMPLOYEE-NUMBER PIC X(40)
VALUE 'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER '.
************************************************************
* VARIABLE TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
01 EMPLOYEE-NUMBER.
@ . ***
@ . *** ******** START OF THE EXAMPLE SECTION *************************
@ . ***
@ . ***
@ . *** COMPILE OF THE INITIAL LOAD PROGRAM AND THE DML RETRIEVAL PROGRAM
@ . ***
@ . ***
@ . *** ASSIGN THE FILE CONTAINING SUBSCHEMA PROCESSING OUTPUT AND
@ . *** PUT A USE NAME ON IT.
@ . ***
@ASG,A UDS$$SVN*SCHFILE.
@USE SCHFILE,UDS$$SVN*SCHFILE.
@ . ***
@ . *** INITIAL LOAD PROGRAM COMPILE
@ . ***
@UCOB QUAL*UCSTST.LOADDMSDB,QUAL*UCSTST.LOADDMSDB/COMP,,, ;
NO-OPTIONS
@ . ***
@ . ***
@ . *** RETRIEVAL PROGRAM COMPILE
@ . ***
@UCOB QUAL*UCSTST.DISPLAYIND,QUAL*UCSTST.DISPLAYIND/COMP,,,;
NO-OPTIONS
@ . ***
@ . ***
@ . *** EXECUTION OF THE INITIAL LOAD PROGRAM USING DYNAMIC LINKING
@ . ***
@ . *** THE SUBSCHEMA ABSOLUTE IS COPIED TO QUAL*UCSTST. (HOME$)
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@COPY,A UDS$$SVN*SCHFILE.S$WORK/PERSONSUB,QUAL*UCSTST.
@USE LINK$PF,SYS$LIB$*APP$7.
@XQT QUAL*UCSTST.LOADDMSDB/COMP
@ . ***
@ . ***
@ . *** STATIC LINK OF THE RETRIEVAL PROGRAM
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
@LINK ,QUAL*UCSTST.DISPLAYIND
INCLUDE QUAL*UCSTST.DISPLAYIND/COMP
INCLUDE UDS$$SVN*SCHFILE.S$WORK/PERSONSUB
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** EXECUTION OF THE RETRIEVAL PROGRAM
@ . ***
@XQT QUAL*UCSTST.DISPLAYIND
10211
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
@ . ***
@ . *** ******** START OF THE EXAMPLE SECTION *************************
@ . ***
@ . ***
@ . *** COMPILE OF THE INITIAL LOAD PROGRAM AND THE DML RETRIEVAL PROGRAM
@ . ***
@ . ***
@ . *** ASSIGN THE FILE CONTAINING SUBSCHEMA PROCESSING OUTPUT AND
@ . *** PUT A USE NAME ON IT.
@ . ***
@ASG,A UDS$$SVN*SCHFILE.
W:120533 filename not unique.
W:120133 file is already assigned.
@USE SCHFILE,UDS$$SVN*SCHFILE.
I:002333 USE complete.
@ . *** INITIAL LOAD PROGRAM COMPILE
@ . ***
@UCOB QUAL*UCSTST.LOADDMSDB,QUAL*UCSTST.LOADDMSDB/COMP,,, ;
NO-OPTIONS
UCOB- 6R2 (931119) LSS- 8R2 (931209) 940128 14:22:02
SIZES: CODE(EM6): 1701 DATA: 2098
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 6 REMARKS(CLARIFICATION)
@ . ***
@ . ***
@ . *** RETRIEVAL PROGRAM COMPILE
@ . ***
@UCOB QUAL*UCSTST.DISPLAYIND,QUAL*UCSTST.DISPLAYIND/COMP,,,;
NO-OPTIONS
UCOB- 6R2 (931119) LSS- 8R2 (931209) 940128 14:22:19
SIZES: CODE(EM6): 465 DATA: 1231
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 6 REMARKS(CLARIFICATION)
@ . ***
@ . ***
@ . *** EXECUTION OF THE INITIAL LOAD PROGRAM USING DYNAMIC LINKING
@ . ***
@ . *** THE SUBSCHEMA ABSOLUTE IS COPIED TO QUAL*UCSTST. (HOME$)
IMPARTED
*******************
DATABASE VALIDATION
****
@ . ***
@ . ***
@ . *** STATIC LINK OF THE RETRIEVAL PROGRAM
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.DISPLAYIND
LINK 5R2 (940112 1230:40) 1994 Jan 28 Fri 1423:18
END LINK , LINES : 5 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** EXECUTION OF THE RETRIEVAL PROGRAM
@ . ***
@XQT QUAL*UCSTST.DISPLAYIND
INDIVIDUAL DATA
The following subsections describe the steps involved in creating and accessing an
RDMS 2200 database using UCS. They discuss
• Table definitions
• SQL application programs
The implementation of both embedded SQL and module SQL as implemented by UCS
and RDMS 2200 conform to the following standards:
• ANSI Systems—Database Language—Embedded SQL (ANSI number: X3.168-1988
(Revised)).
• ANSI Systems—Database Language—SQL (ANSI number: X3.135.1-1989 (Revised))
• Federal Information Processing Standards Publication 127-2 (FIPS 127-2)
• ANSI Systems—Database Language—Embedded SQL (ANSI number: X3.135-1992
(entry-level)).
RDMS 2200 tables are kept in storage areas. You define storage areas by using the
Unisys Repository Manager (UREP).
Once you have defined the storage areas for the tables, you can define the tables
themselves using one of the following ways:
• By using the IPF SQL Interface
• By coding an SQL program
• By using the MAPPER Relational Interface (MRI)
When you define a table, UREP makes an entry in the Unisys repository that
symbolically describes the table’s characteristics (for example, table names and
column names).
Coding an RDMS 2200 table definition has no special constraints in UCS. Existing table
definitions being used by non-UCS SQL programs can be used without change by UCS
interpreted SQL, embedded SQL, and module language SQL programs.
Refer to the RDMS Administration Guide for more information on RDMS 2200 storage
areas and tables.
The following figure shows the tables that are used in the RDMS 2200 example for
this section.
INDIVIDUALR
is a table whose primary key is the individual’s employee number (INDR-EMP-
NUMBER). The table also has a secondary index consisting of the individual’s
name (indr-last-name, indr-first-name).
SCHOOL
is a table whose a primary key is the school’s unique number (SCH-NUMBER).
CHILD
is a table whose primary key is the individual’s employee number (CHILD-EMP-
NUMBER) and the sequential number of the child in the family (CHILD-NUMBER).
The table also has a secondary index consisting of the child’s name (child-last-
name, child-first-name). The child’s school number (child-school-number) is a
foreign key to the SCHOOL table. The child’s employee number (CHILD-EMP-
NUMBER) is a foreign key to the INDIVIDUALR table. To keep the programs
simple, this example assumes that no individual will have more than three children.
>DESCRIPTION<
THIS IS AN OPTIONAL DESCRIPTION SECTION, WHICH DESCRIBES
THE FORMAT OF THE DATA IN THIS FILE.
COLUMNS FIELD NAME RDMS FORMAT
======= ========== ===========
1-5 INDR_EMP_NUMBER CHARACTER (5) NOT NULL primary key
7-26 INDR_LAST_NAME CHARACTER (20) NOT NULL
28-39 INDR_FIRST_NAME CHARACTER (12) NOT NULL
41-46 INDR_BIRTH_DATE CHARACTER (6) NOT NULL
48-57 INDR-SPOUSE_LAST_NAME CHARACTER (20) NULLS ALLOWED
59-70 INDR-SPOUSE_FIRST_NAME CHARACTER (12) NULLS ALLOWED
>END DESCRIPTION<
10211 FIELDING STEVEN 480719 FIELDING KATHY
10215 HELLER JENNIFER 590529 * *
10223 RALSTON KAREN 580910 EASTMAN JOHN
24101 ANDERSON MARY 520803 ANDERSON FRED
26503 MILLER RALPH 470317 * *
26504 BLAKE JOHN 650714 * *
26510 CARR GEORGE 561123 CARR SUSAN
32009 KAISER JAKE 531008 WRIGHT ANGEL
Example 3–18. Source Listing of the Load Data for INDIVIDUALR Table
(QUAL*INDLOAD)
Example 3–19 is the source listing of the load data for the SCHOOL table. For this
example, the SCHOOL load data resides in the file QUAL*SCHLOAD.
.>DESCRIPTION<
THIS IS AN OPTIONAL DESCRIPTION SECTION, WHICH DESCRIBES
THE FORMAT OF THE DATA IN THIS FILE.
>END DESCRIPTION<
1349 WOODBURY SENIOR HIGH 09 12
1361 EAGAN MIDDLE SCHOOL 06 08
2188 WESTERLY ELEMENTARY 01 05
3703 GLENVIEW ELEMENTARY 01 05
Example 3–19. Source Listing of the Load Data for SCHOOL Table
(QUAL*SCHLOAD)
Example 3–20 is the source listing of the load data for the CHILD table. For this
example, the CHILD load data resides in the file QUAL*CHILDLOAD.
>DESCRIPTION<
THIS IS AN OPTIONAL DESCRIPTION SECTION, WHICH DESCRIBES
THE FORMAT OF THE DATA IN THIS FILE.
>END DESCRIPTION<
10211 01 FIELDING STEVEN JR 680108 * *
10211 02 FIELDING DANIEL 710708 * *
10211 03 FIELDING JANE 760411 1349 3.500
10215 01 HELLER VANESSA 851002 * *
10223 01 EASTMAN JAMES 880912 * *
24101 01 ANDERSON SEAN 800611 3703 2.850
24101 02 ANDERSON MICHELLE 800611 3703 4.000
32009 01 KAISER JASON 780213 1361 3.500
32009 02 KAISER SHARON 830228 2188 3.250
Example 3–20. Source Listing of the Load Data for CHILD Table
(QUAL*CHILDLOAD)
Example 3–21. Runstream to Define Storage Areas and Tables and Load Tables
Example 3–21. Runstream to Define Storage Areas and Tables and Load Tables
LOAD FACTOR 50
INTO TABLE FAMILY.CHILD
FORMAT CHILD_EMP_NUMBER(1:5),
CHILD_NUMBER(7:8),
CHILD_LAST_NAME(10:29),
CHILD_FIRST_NAME(31:42),
CHILD_BIRTH_DATE(44:49),
CHILD_SCHOOL_NUMBER(51:54) NULLIF((51:51) = '*'),
CHILD_GRADE_AVERAGE(56:60) NULLIF((56:56) = '*');
@ . ***
@ . ***
@ . ***
@ . *** ******** END OF THE RDMS DATABASE DEFINITION SECTION *************
@ . ***
Example 3–21. Runstream to Define Storage Areas and Tables and Load Tables
Thread committed after reading line 22 of the input file at time 14:29:25
21 LOAD FACTOR 50
22 INTO TABLE FAMILY.CHILD
23 FORMAT CHILD_EMP_NUMBER(1:5),
24 CHILD_NUMBER(7:8),
25 CHILD_LAST_NAME(10:29),
26 CHILD_FIRST_NAME(31:42),
27 CHILD_BIRTH_DATE(44:49),
28 CHILD_SCHOOL_NUMBER(51:54) NULLIF((51:51) = '*'),
29 CHILD_GRADE_AVERAGE(56:60) NULLIF((56:56) = '*') ;
Thread committed after reading line 24 of the input file at time 14:29:29
• Module SQL
This interface is supported by UCS FORTRAN.
The embedded and module language SQL implemented by UCS and RDMS 2200
conform to the following standards:
• ANSI Systems—Database Language—Embedded SQL (ANSI number: X3.168-1988
(Revised)).
• ANSI Systems—Database Language—SQL (ANSI number: X3.135.1-1989 (Revised)).
• ANSI Systems—Database Language—Embedded SQL (ANSI number: X3.135-1992
(entry-level)).
• Federal Information Processing Standards Publication 127-2 (FIPS 127-2).
The embedded SQL (ESQL) interface provides syntax parsing and optimization during
compilation. The UCS compiler works with the RDMS 2200 software and the Unisys
Repository Manager (UREP) to verify command syntax. These capabilities provide
significantly faster execution than the SQL interpreter interface.
You envelop each embedded SQL command in an ESQL command packet. In UCS
COBOL, the command packet starts with the SQL prefix EXEC SQL and ends with the
SQL terminator END-EXEC. In UCS C, the command packet starts with EXEC SQL and
ends with a semi-colon (;). This command packet is required by the SQL standard. It
makes ESQL commands easily identifiable to the UCS COBOL and UCS C compilers.
The following example shows the format of this command packet, followed by an
example of its use with the USE DEFAULT QUALIFIER command.
UCS COBOL
Syntax
EXEC SQL sql-command END-EXEC.
Example
EXEC SQL
USE DEFAULT QUALIFIER FAMILY
END-EXEC.
Several embedded UCS COBOL SQL commands can be used without these packet
delimiters, as long as they are stand-alone commands. In other words, to be used
without packet delimiters, these commands
• Must end with a period
• Must not be part of a larger command structure
During compilation, these commands affect commands that physically follow them in
the source input. When you use these commands, you must consider their physical
location in relation to the commands they affect.
In the following example, the USE DEFAULT QUALIFIER command is in effect for the
DECLARE CURSOR command that physically follows it in the source code.
.
.
.
BEGIN THREAD
EXEC SQL USE DEFAULT QUALIFIER FAMILY END-EXEC.
EXEC SQL DECLARE CURSOR... END-EXEC.
.
.
.
STOP RUN.
In the following example, the USE DEFAULT QUALIFIER command has no effect on the
DECLARE CURSOR command, because it does not physically precede DECLARE
CURSOR in the source code.
.
.
.
BEGIN THREAD
PERFORM DEFAULT-QUAL-PARA.
EXEC SQL DECLARE CURSOR ... END-EXEC.
.
.
.
STOP RUN.
.
.
.
DEFAULT-QUAL-PARA.
EXEC SQL USE DEFAULT QUALIFIER FAMILY END-EXEC.
When you use these commands in embedded SQL, carefully consider their physical
coding order.
COBOL variables used in embedded SQL commands can be coded in any section of
the Data Division, in accordance with COBOL coding conventions. The only exception
to this rule is a special group item, RDMCA. RDMCA must be located in a new
section, the Declare Section. The rule for the location of the Declare Section is that
the Declare Sections may be located in any section within the Data Division and there
can be multiple Declare Sections. They cannot be nested and cannot overlap.
These statements must start in area B of the COBOL source line. The following is an
example showing the format of this section.
RDMCA and another new variable, SQLSTATE, are used to return embedded SQL
command statuses for all commands except GETERROR. They must be coded exactly
as shown in Example 3-23, so that they can be found by embedded SQL processing.
Unlike RDMCA, the SQLSTATE variable is not required to be in the Declare Section of
the COBOL program.
Example 3–23 is an example of the definition of the variables for a FETCH command
and the general error buffers:
• SQLSTATE and RDMCA are the embedded SQL error buffers. The variable names
must be SQLSTATE, RDMCA, ERROR-STATUS, and AUX-INFO. Their declarations
must be as shown in the example.
• In this example, ERROR-TEXT is the buffer used by the GETERROR command for
returning error message text.
• In this example, all COBOL variables used by embedded SQL commands are
located in the Working-Storage Section.
WORKING-STORAGE SECTION.
.
.
.
***********************************************
* RELATIONAL DATABASE INFORMATION FOR A FETCH
***********************************************
01 INDR-LAST-NAME PIC X(20).
01 INDR-FIRST-NAME PIC X(12).
***********************************************
* ESQL STATEMENT STATUS
***********************************************
01 SQLSTATE PIC X(5).
***********************************************
* RELATIONAL COMMAND ERROR BUFFERS
***********************************************
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 RDMCA.
05 ERROR-STATUS PIC 9(4).
05 AUX-INFO PIC S9(9) USAGE BINARY.
EXEC SQL END DECLARE SECTION END-EXEC.
***********************************************
* GETERROR BUFFERS
***********************************************
01 ERROR-TEXT.
05 ERR PIC X(132) OCCURS 5 TIMES.
***********************************************
* INDEX FOR GETERROR DISPLAYS
***********************************************
01 ERR-INDEX PIC 9.
***********************************************
* ALLERROR INDICATOR *
***********************************************
01 xx PIC 9 VALUE 0.
88 ALLERR VALUE 1.
Example 3–23. Coding RDMCA and SQLSTATE Variables for UCS COBOL
The global command WHENEVER is in effect from the point at which it is encountered
in the source program.
The following is an example of a global command to catch all errors except the NOT
FOUND condition. The NOT FOUND condition (SQLSTATE = “02000”) can be detected
by explicitly coding a check, or by coding a different form of this global error-detecting
command.
SQL-ERROR-PROCESSING.
EXEC SQL
WHENEVER SQLERROR GO TO RDMS-ERROR-PARA
END-EXEC.
If you use global error checking, you should code a new WHENEVER command in the
global error-handling paragraph, before any embedded SQL commands. This
WHENEVER command prevents the possibility of entering an infinite loop, if
embedded SQL commands in this paragraph cause errors.
RDMS-ERROR-PARA.
EXEC SQL WHENEVER SQLERROR CONTINUE END-EXEC.
DISPLAY '***SQLSTATE = ' SQLSTATE UPON PRT.
DISPLAY '***RDMCA AUX-INFO = ' AUX-INFO UPON PRT.
DISPLAY '***ERROR STATUS = ' ERROR-STATUS UPON PRT.
PERFORM UNTIL ALLERR
INITIALIZE ERROR-TEXT
EXEC SQL
GETERROR INTO :ERR(1), :ERR(2),:ERR(3),:ERR(4),:ERR(5)
END-EXEC
PERFORM VARYING ERR-INDEX FROM 1 BY 1 UNTIL ERR-INDEX = 6
DISPLAY ERR (ERR-INDEX) UPON PRINTER
IF ERR(ERR-INDEX = SPACE SET ALLERR TO TRUE END-IF
END-PERFORM
END-PERFORM.
END-THREAD.
STOP RUN.
UCS C
Syntax
EXEC SQL sql-command;
Example
EXEC SQL
USE DEFAULT QUALIFIER FAMILY;
During compilation, these commands affect commands that physically follow them in
the source input. When you use these commands, you must consider their physical
location in relation to the commands they affect.
In the following example, the USE DEFAULT QUALIFIER command is in effect for the
DECLARE CURSOR command that physically follows it in the source code.
.
.
.
EXEC SQL BEGIN THREAD ...;
EXEC SQL USE DEFAULT QUALIFIER FAMILY;
EXEC SQL DECLARE CURSOR...;
.
.
.
return(0);
In the following example, the USE DEFAULT QUALIFIER command has no effect on the
DECLARE CURSOR command because it does not physically precede DECLARE
CURSOR in the source code.
.
.
.
EXEC SQL BEGIN THREAD...;
default_qual();
EXEC SQL DECLARE CURSOR...;
.
.
.
return(0);
.
.
.
void default_qual(void)
{
EXEC SQL USE DEFAULT QUALIFIER FAMILY;
return;
}
When you use these commands in embedded SQL, carefully consider their physical
coding order.
C variables used in embedded SQL commands should be coded within the SQL
Declare Section. The Declare Section always starts with the statement:
SQLSTATE is used to return embedded SQL command statuses for all commands
except GETERROR. It must be coded exactly as shown in the following example, so
that it can be found by embedded SQL processing.
The following is an example of the variable for a FETCH command and general error
buffers:
• SQLSTATE is the embedded SQL error buffer. Its variable name must be
SQLSTATE. Its declaration must be shown as in the example.
• NO_FIND_STATUS is defined with the value returned if the FETCH finds no
row/record occurrence that satisfies the selection criteria. This value is "02000".
/* *****************************************
* ESQL STATEMENT STATUS
***************************************** */
char SQLSTATE[6];
#define NO_FIND_STATUS "02000"
/* *****************************************
* RELATIONAL DATABASE INFORMATION
***************************************** */
EXEC SQL BEGIN DECLARE SECTION;
char employee_number[6];
char indr_last_name[21];
char indr_first_name[13];
EXEC SQL END DECLARE SECTION;
The global command WHENEVER is in effect from the point at which it is encountered
in the source program.
The following is an example of a global command to catch all errors except the NOT
FOUND condition. The NOT FOUND condition (SQLSTATE = "02000") can be detected
by explicitly coding a check, or by coding a different form of this global error-detecting
command.
If you use global error checking, you should code a new WHENEVER command in the
global error-handling function. This WHENEVER command prevents the possibility of
entering an infinite loop if embedded SQL commands in this function cause errors.
void handle_sqlerror(void)
{
char msg[133];
EXEC SQL WHENEVER SQLERROR CONTINUE;
printf("***SQLSTATE = %p\n", SQLSTATE);
printf("GETERROR returned the following text for
SQLSTATE:\n\n");
do
{
EXEC SQL GETERROR INTO :msg;
printf("%s/n",msg);
}
while(msg[0] != '/0');
EXEC SQL END THREAD;
}
Syntax parsing or optimizing does not occur each time the EXECUTE command is
processed. All EXECUTE commands use the PREPARE statement until the next
THREAD CONTROL command is executed or a ROLLBACK occurs.
You can use the PREPARE and EXECUTE commands on the following commands:
DELETE
INSERT
LOCATE
LOCK
SET STATISTICS
UNLOCK
UPDATE
USE DEFAULT
You can also use PREPARE and EXECUTE commands on query specifications used
with the ALLOCATE CURSOR command.
For a dynamic SELECT, the OPEN CURSOR command performs the function of the
EXECUTE command. The EXECUTE command is not used.
COMMIT, ROLLBACK, and END THREAD can be prepared and executed from an
implicit thread only.
EXECUTE IMMEDIATE
You should use the EXECUTE IMMEDIATE command when coding a dynamic ESQL
command that the program will use only once. The EXECUTE IMMEDIATE command
parses, optimizes, and executes an SQL statement at runtime.
The following ESQL commands can be used with the EXECUTE IMMEDIATE statement:
DEBUG
DELETE
INSERT
LOCATE
LOCK
SET STATISTICS
UNLOCK
UPDATE
USE DEFAULT
For more information on coding RDMS 2200 embedded SQL programs, refer to the
following documents:
• COBOL Compiler Programming Reference Manual Volume 2
• RDMS SQL Programming Reference Manual
The module SQL interface provides better execution time than the interpreter
interface.
When you use the module SQL language interface, UCS FORTRAN and accesses
RDMS indirectly by calling procedures generated by the SQL Module Preprocessor.
An SQL module implementation consists of at least two program units that you must
develop:
• The module language source program
• The UCS FORTRAN host application program
The module language defines modules and procedures. Only one module is permitted
per host application program. An optional set of cursor declarations and a set of
procedures make up the module. A procedure consists of a procedure name, a list of
parameter declarations, and a single SQL statement. The SQLSTATE parameter must
be included in the parameter list. The following is an example of a FORTRAN module
language program.
MODULE SQLPROCS
LANGUAGE FORTRAN
AUTHORIZATION FAMILY
--
-- ***********************************************************************
-- This module defines the cursor and procedure definitions
-- called by FORTRAN host application program
-- ***********************************************************************
--
-- Individual's children cursor definition
--
DECLARE CHILDDATA CURSOR
SELECT CHILD_LAST_NAME, CHILD_FIRST_NAME
FROM CHILD
WHERE CHILD.CHILD_EMP_NUMBER = :EMPLOYEE_NUMBER
--
-- Procedure to begin thread with UDS
--
PROCEDURE BEGINTHREAD
(SQLSTATE);
BEGIN THREAD FDSPDATA FOR APPSVN RETRIEVE;
--
-- Procedure to perform singleton select
--
PROCEDURE SINGLESELECTIND
(SQLSTATE,
:EMPLOYEE_NUMBER CHAR(5),
:IDR_LAST_NAME CHAR(20),
:INDR_FIRST_NAME CHAR(12));
SELECT INDR_LAST_NAME, INDR_FIRST_NAME
INTO :INDR_LAST_NAME, :INDR_FIRST_NAME
FROM INDIVIDUALR
WHERE INDIVIDUALR.INDR_EMP_NUMBER = :EMPLOYEE_NUMBER;
--
-- Procedure to open the individual's children cursor
--
PROCEDURE OPENCHILDCURSOR
(SQLSTATE,
:EMPLOYEE_NUMBER CHAR(5));
OPEN CHILDDATA;
--
-- Procedure to fetch the children of an individual using the CHILDDATA
-- cursor
--
PROCEDURE FETCHCHILD
(SQLSTATE,
:CHILD_LAST_NAME CHAR(20),
:CHILD_FIRST_NAME CHAR(12));
FETCH NEXT CHILDDATA INTO :INDR_LAST_NAME, :INDR_FIRST_NAME;
--
-- Procedure to end thread with UDS
--
PROCEDURE ENDTHREAD
(SQLSTATE);
END THREAD;
--
-- Procedure to call GETERROR to obtain message description for
-- SQLSTATE status
--
PROCEDURE GETERRORTEXT
(SQLSTATE,
:MSG1 CHAR(132),
:MSG2 CHAR(132),
:MSG3 CHAR(132),
:MSG4 CHAR(132),
:MSG5 CHAR(132));
GETERROR INTO :MSG1, :MSG2, :MSG3, :MSG4, :MSG5;
To execute an SQL statement, the host application program calls the module
procedure associated with a particular SQL statement in the same way it calls any
other subroutine or subprogram. The name of the subprogram or subroutine is the
module procedure name.
The following is a sample of part of a UCS FORTRAN host program using the
preceding FORTRAN module language program.
PROGRAM HOST_SQL
IMPLICIT NONE
CHARACTER INDR_LAST_NAME*20
CHARACTER INDR_FIRST_NAME*12
CHARACTER CHILD_LAST_NAME*20
CHARACTER CHILD_FIRST_NAME*12
CHARACTER SQLSTATE*5
CHARACTER GOOD_STATUS*5
PARAMETER (GOOD_STATUS = '00000')
CHARACTER NO_FIND_STATUS*5
PARAMETER (NO_FIND_STATUS = '02000')
.
.
.
CALL BEGINTHREAD(SQLSTATE)
IF (SQLSTATE.NE.GOOD_STATUS) THEN
CALL HANDLE_BAD_SQLSTATE_STATUS(SQLSTATE)
END IF
CALL SINGLESELECTIND
& (SQLSTATE,EMPLOYEE_NUMBER,INDR_LAST_NAME,INDR_FIRST_NAME)
IF (SQLSTATE.EQ.NO_FIND_STATUS) THEN
PRINT*,'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER ',
& EMPLOYEE_NUMBER
CALL ENDTHREAD(SQLSTATE)
IF (SQLSTATE.NE.GOOD_STATUS) THEN
CALL HANDLE_BAD_SQLSTATE_STATUS(SQLSTATE)
END IF
PRINT *,'PROGRAM HAS COMPLETED'
STOP
.
.
.
The SMLP interprets the module source language and generates a COBOL
subprogram element that must be compiled using the UCS COBOL compiler. The
COBOL subprogram combines with the host application program to manipulate the
RDMS database.
The following describes the steps involved in setting up an application that uses the
module SQL language to access an RDMS database and how the subprogram and host
program work together.
1. You develop a FORTRAN host application program and module language source
program as follows:
• The host application program contains the calls to the module language source
procedures to execute SQL statements.
• The module language source program defines procedures that contain the
SQL statements that the host program executes.
2. You call the SMLP preprocessor to convert the module language source program
to a new source element that consists of COBOL subprograms.
3. Use the UCS COBOL compiler to compile the COBOL subprograms. This step can
be performed either automatically by the SMLP preprocessor or manually by the
user. The UCS COBOL compiler processes embedded SQL statements by
interfacing with RDMS. The compilation produces an object module for each
COBOL subprogram.
4. You call the UCS FORTRAN compiler to compile the host application program.
5. You either dynamically or statically link and execute the program.
Table/View
Definitions
@LINK
002324
The coding format for COBOL and FORTRAN is the same for UCS and non-UCS
programs.
The following shows the generic syntax of SQL interpreter commands for each
language, followed by an example of a USE DEFAULT QUALIFIER command.
UCS COBOL
Syntax
ENTER MASM 'ACOB$RDMR' USING sql-command, error-status, auxiliary-info
[,program-variable-1] ... .
Example
ENTER MASM 'ACOB$RDMR' USING 'USE DEFAULT QUALIFIER FAMILY ;',
error-status, auxiliary-info.
UCS FORTRAN
Syntax
CALL F$RDMR (sql_command, error_status, auxiliary_info
& [,program_variable_1] ... )
Example
CALL F$RDMR ('USE DEFAULT QUALIFIER FAMILY ;', error_status,
& auxiliary_info)
UCS C
Syntax
rsa(sql_command, error_status, &auxiliary_info [,&program_variable_1] ... )
Example
rsa("use default qualifier family ;", error_status, &auxiliary_info)
ENTER MASM 'ACOB$RDMR' USING 'FETCH NEXT INDRDATA INTO $P1, $P2 ;',
error-status, auxiliary-info,
INDR-LAST-NAME, INDR-FIRST-NAME.
Refer to the following Error documents for more information on coding RDMS 2200
SQL programs using the interpreter interface:
• The programming reference manual for the appropriate UCS language (for UCS
COBOL, FORTRAN, and C) is Volume 2
• RDMS SQL Programming Reference Manual
RSA$PARAM Usage
The RSA$PARAM feature was integrated for UCS COBOL and UCS C as of SB4R6.
Table 3–3. UCS Data Types Allowed for RDMS Column Definitions
RDMS 2200
Column UCS COBOL Data UCS FORTRAN UCS C Data
Definition Definition Data Definition Definition
usage disp-2
usage binary
S1 (36)
usage binary-1
usage binary
S9(4)usage comp-5
S1 (18)
usage binary-1
BLOB (n) usage is sql type is blob (n) sql type is blob(n)
The following statement is a sample UCS COBOL compiler call used to compile an
embedded SQL program that uses application group 7:
@UCOB QUAL*UCSTST.DISPLAYFAM/ESQL,QUAL*UCSTST.DSPFAMESQL/COMP,,, ;
NO-OPTIONS,APPLICATION/APPSVN
The following figure represents the process used to compile an embedded SQL
program.
1. The embedded SQL commands are passed to RDMS 2200 for parsing.
2. RDMS 2200 accesses the table and view definitions in the RDT$FILE belonging to
the application group specified in the APPLICATION/application-name keyword
option.
Specifying the C option on the SMLP call line disables the automatic COBOL
compilation. You must then compile the generated COBOL subprogram element using
the APPLICATION/application-name and MODULE compiler keyword options.
@SMPL,C QUAL*UCSTST.DISPLAYFAM/MSQL-FMOD,QUAL*UCSTST.FMOD
@UCOB,S QUAL*UCSTST.FMOD/COB,QUAL*UCSTST.,,,NO-OPTIONS,NARROW;
APPLICATION/APPSVN,MODULE
@UFTN QUAL*UCSTST.DISPLAYFAM/MSQL-FHOST,QUAL*UCSTST.FHOST,,,NO-OPTIONS
The following figure represents the process used to preprocess and compile the
module language source program and to compile the host application program.
Table/View
Definitions
UCS FORTRAN
Host UCS FORTRAN
@UFTN Host
Program Source
OM 002325
The following statement is a sample UCS COBOL compiler call used to compile a
program using the SQL interpreter interface.
@UCOB QUAL*UCSTST.DISPLAYFAM/SQL,QUAL*UCSTST.DSPFAMSQL/COMP,,, ;
NO-OPTIONS
The following figure represents the process used to compile a program using the SQL
interpreter interface. Notice that only the compiler is used. This is because all RDMS
2200 command syntax is parsed at execution time.
causes the Linking System to resolve references using the RDMS 2200 software for a
particular application group.
The system automatically sets up application group library search chains for each of
the 64 application groups during installation of the Linking System. These library
search chains mean the applications programmer does not have to do either of the
following:
• Build a user-defined library search chain for linking
• Explicitly supply (INCLUDE) the object module containing the RDMS 2200 interface
during static linking
The following generic format shows how to specify use of the appropriate application
group library search chain:
@USE LINK$PF,SYS$LIB$*APP$n
If you want to link a UCS program containing RDMS 2200 interpreted SQL statements
to the system software in application group 7, use the following statement:
@USE LINK$PF.,SYS$LIB$*APP$7.
In this case, all references to RDMS 2200 software would be resolved using
UDS$$SVN*RSA.
Embedded SQL programs and module SQL programs are compiled for a specific
application group. The default is application UDSSRC or application group 3 (APP$3).
Use of the APPLICATION/appname keyword option on the compilation can target it for
any application group you wish. You also should use the @USE
LINK$PF,SYS$LIB$*APP$n. statement specifying the file for the same application
group when either dynamically linking or static linking these programs. If you wish to
change the application that your compiled ESQL/Module-SQL object modules link to,
you must follow the static linking procedure in "Portable Embedded and Module
Language SQL Programs" later in this subsection.
@USE LINK$PF,SYS$LIB$*APP$7.
@XQT QUAL*UCSTST.DSPFAMSQL/COMP
The following example shows how to statically link a UCS program containing RDMS
2200 statements, producing a zero overhead object module (a ZOOM):
Explanation
1. This statement ensures that the program is statically linked using the RDMS 2200
software located in the desired application group. (It ensures that the library
search chain for the correct application group is used.) In this example, this
program is to execute in application group 7. Any embedded SQL or module SQL
programs input to this static link must also have been compiled for this application
group.
2. This statement calls the Linking System LINK Processor. The ZOOM to be
produced is named QUAL*UCSTST.DSPFAMESQL.
3. This command identifies the compiler-generated object module containing the
UCS RDMS 2200 program. For the module SQL interface, this is the UCS
FORTRAN compiler-created object from the host application program.
4. This command resolves external references, including those to the UCS Runtime
System library.
If you are statically linking a module SQL program, you must identify the file where the
output of the UCS COBOL back-to-back compilations exists on the RESOLVE
command. This file name must be specified prior to LIBCODENAME or LCN.
5. This command merges banks and produces a ZOOM.
6. This command deletes all definitions except the program’s starting address,
START$. This decreases the size of the ZOOM.
7. This statement ends static linking.
When the schema definitions are equivalent, the portable embedded and module
language SQL programs feature provides the capability to
• Port from one application group and execute on another OS 2200 system in the
same application group
• Execute on a different application group on the same OS 2200 system or another
OS 2200 system
The porting of UCS ESQL and MSQL programs is handled by relinking these programs
to the new application group on the target OS 2200 system. This is accomplished by
making the following two changes to the static link runstreams for the programs:
1. Identify the new library search chain for the new application group on the target
OS 2200 system prior to the static link. To do so, use the following statement.
@USE LINK$PF,SYS$LIB$*APP$n
The static link must be performed on the target OS 2200 system. Here is the previous
RDMS static link example adjusted to target a different application group than the
code was compiled for:
@USE LINK$PF,SYS$LIB$*APP$8.
@LINK ,QUAL*UCSTST.DSPFAMESQL
INCLUDE QUAL*UCSTST.DSPFAMESQL/COMP
CHANGE LCN FOR RSA$APP$NAME,RSA$RUNTIME TO APP$8
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
You get static linker warnings like the following if you did not have any embedded or
module SQL object modules in your program:
*WARNING (LINK 603)* No REFERENCES found for RSA$RUNTIME.
*WARNING (LINK 603)* No REFERENCES found for RSA$APP$NAME.
*WARNING (LINK 605)* CHANGE statement cannot be performed.
Getting these warnings means that you probably had only interpreted SQL programs
included in this static link, or perhaps you misspelled the RSA$xxx entry point names.
For information on how to port the table definitions (RDTs) and database data, refer to
the Relational Database Server for ClearPath OS 2200 Administration Guide.
All programs have the same functional capabilities; all are compiled using the UCS
compilers. However, for variety, this example shows use of different linking methods
for the four programs:
• The embedded SQL programs and module SQL program use static linking to
produce zero overhead object modules.
• The program using the SQL interpreter interface uses dynamic linking.
The following example summarizes the simple UCS RDMS 2200 program used in the
example. The program
1. Reads an employee number
2. Accesses information about that individual from the RDMS 2200 database
3. Displays the data
3.2.2.12. DISPLAYFAM
IDENTIFICATION DIVISION.
PROGRAM-ID. DISPLAYFAM.
.
.
DATA DIVISION.
WORKING-STORAGE SECTION.
table definitions
.
.
.
01 EMPLOYEE-NUMBER ....
PROCEDURE DIVISION.
ACCEPT EMPLOYEE-NUMBER
BEGIN THREAD
USE DEFAULT QUALIFIER
SINGLETON SELECT
DISPLAYS .....
DECLARE CURSOR
OPEN CURSOR
FETCHs ....
DISPLAYs .....
END THREAD
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. DSPFAMESQL.
******************************************************************
******************************************************************
* *
* SIMPLE BATCH COBOL RDMS EMBEDDED SQL PROGRAM - DSPFAMESQL *
* *
* reads the input data *
* begins thread with UDS *
* retrieves the requested information from the database *
* displays this information on the printer *
* ends thread with UDS *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 INVALID-EMPLOYEE-NUMBER PIC X(40)
VALUE 'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER
************************************************************
* VARIABLE TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
01 EMPLOYEE-NUMBER PIC X(5).
************************************************************
* RDMS WORK AREA SIZE
************************************************************
01 WORK-AREA-SIZE PIC 1(36) USAGE BINARY-1 VALUE 2000.
************************************************************
* UDS THREAD STATUS FLAG
************************************************************
01 THREAD-FLAG PIC 9(1) VALUE 0.
************************************************************
* RELATIONAL DATABASE INFORMATION
************************************************************
01 INDR-LAST-NAME PIC X(20).
01 INDR-FIRST-NAME PIC X(12).
01 CHILD-LAST-NAME PIC X(20).
01 CHILD-FIRST-NAME PIC X(12).
************************************************************
* ESQL STATEMENT STATUS
************************************************************
01 SQLSTATE PIC X(5).
************************************************************
* RELATIONAL COMMAND ERROR BUFFERS
************************************************************
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 RDMCA.
05 ERROR-STATUS PIC 9(4).
05 AUX-INFO PIC S9(9) USAGE BINARY.
EXEC SQL END DECLARE SECTION END-EXEC.
************************************************************
* GETERROR BUFFERS
************************************************************
01 ERROR-TEXT.
05 ERR PIC X(132) OCCURS 5 TIMES.
************************************************************
* INDEX FOR GETERROR DISPLAYS
************************************************************
01 ERR-INDEX PIC 9.
************************************************************
* ALLERR INDICATOR
************************************************************
01 XX PIC 9 VALUE 0.
88 VALUE 1.
*
PROCEDURE DIVISION.
************************************************************
* PROGRAM FLOW
************************************************************
MAIN-PROGRAM-FLOW.
DISPLAY 'ENTER EMPLOYEE NUMBER' UPON PRINTER.
ACCEPT EMPLOYEE-NUMBER.
************************************************************
* RSA WORK AREA SIZE
************************************************************
CALL 'RSA$INIT' USING WORK-AREA-SIZE.
************************************************************
* GENERAL ERROR PROCESSING FOR A NEGATIVE SQL ERROR
************************************************************
EXEC SQL
WHENEVER SQLERROR GO TO RDMS-ERROR-PARA
END-EXEC.
PERFORM BEGIN-THREAD-TO-UDS.
PERFORM SINGLETON-SELECT-INDRDATA.
IF SQLSTATE = "02000"
DISPLAY INVALID-EMPLOYEE-NUMBER, EMPLOYEE-NUMBER
UPON PRINTER
PERFORM END-THREAD-TO-UDS
PERFORM TERMINATION-PARA
ELSE CONTINUE
END-IF.
PERFORM DISPLAY-INDIVIDUAL-DATA.
PERFORM SETUP-CHILDDATA-CURSOR.
PERFORM FETCH-FROM-CHILDDATA-CURSOR
WITH TEST AFTER UNTIL SQLSTATE = "02000"
PERFORM END-THREAD-TO-UDS
PERFORM TERMINATION-PARA.
************************************************************
* INITIALIZE WITH THE DATABASE SYSTEM
* SET DEFAULT QUALIFIER ON ALL TABLES IN THIS THREAD
************************************************************
BEGIN-THREAD-TO-UDS.
BEGIN THREAD DSPDATA FOR APPSVN RETRIEVE.
MOVE 1 TO THREAD-FLAG.
EXEC SQL
USE DEFAULT QUALIFIER FAMILY
END-EXEC.
************************************************************
* SINGLETON SELECT OF THE INDIVIDUAL'S DATA
************************************************************
SINGLETON-SELECT-INDRDATA.
EXEC SQL
SELECT INDR_LAST_NAME, INDR_FIRST_NAME
INTO :INDR-LAST-NAME, :INDR-FIRST-NAME
FROM INDIVIDUALR
WHERE INDIVIDUALR.INDR_EMP_NUMBER = :EMPLOYEE-NUMBER
END-EXEC.
************************************************************
* DISPLAY THE INDIVIDUAL'S INFORMATION TO THE PRINTER
************************************************************
DISPLAY-INDIVIDUAL-DATA.
DISPLAY 'INDIVIDUAL DATA' UPON PRINTER.
DISPLAY ' EMPLOYEE NUMBER IS ' EMPLOYEE-NUMBER UPON PRINTER.
DISPLAY ' LAST NAME: ' INDR-LAST-NAME UPON PRINTER.
DISPLAY ' FIRST NAME: ' INDR-FIRST-NAME UPON PRINTER.
************************************************************
* DEFINE CURSOR TO BE USED FOR DATA RETRIEVAL
* OPEN CURSOR
************************************************************
SETUP-CHILDDATA-CURSOR.
EXEC SQL
DECLARE CHILDDATA CURSOR
SELECT CHILD_LAST_NAME, CHILD_FIRST_NAME
FROM CHILD
WHERE CHILD.CHILD_EMP_NUMBER = :EMPLOYEE-NUMBER
END-EXEC.
EXEC SQL
OPEN CHILDDATA
END-EXEC.
************************************************************
* RETRIEVE DATA FROM THE CURSOR
************************************************************
FETCH-FROM-CHILDDATA-CURSOR.
EXEC SQL
FETCH NEXT CHILDDATA INTO
:CHILD-LAST-NAME, :CHILD-FIRST-NAME
END-EXEC.
IF SQLSTATE NOT = "02000"
DISPLAY ' CHILD NAME: ' CHILD-FIRST-NAME, ' ',
CHILD-LAST-NAME UPON PRINTER
ELSE CONTINUE
END-IF.
************************************************************
* TERMINATE WITH THE DATABASE SYSTEM
************************************************************
END-THREAD-TO-UDS.
END THREAD.
MOVE 0 TO THREAD-FLAG.
************************************************************
* TERMINATE PROGRAM
************************************************************
TERMINATION-PARA.
*
DISPLAY 'PROGRAM HAS COMPLETED' UPON PRINTER.
STOP RUN.
************************************************************
* RETURN AN ERROR MESSAGE ON THE PRINTER IF A
* DATABASE ERROR OCCURS
************************************************************
RDMS-ERROR-PARA.
EXEC SQL WHENEVER SQLERROR CONTINUE END-EXEC.
DISPLAY ***SQLSTATE = ' SQLSTATE UPON PRINTER.
DISPLAY '***RDMCA AUX-INFO = ' AUX-INFO UPON PRINTER.
DISPLAY '***ERROR STATUS = ' ERROR-STATUS UPON PRINTER.
PERFORM UNTIL ALLERR
INITIALIZE ERROR-TEXT
EXEC SQL
GETERROR INTO :ERR(1), :ERR(2), :ERR(3), :ERR(4), :ERR(5)
END-EXEC
PERFORM VARYING ERR-INDEX FROM 1 BY 1 UNTIL ERR-INDEX = 6
DISPLAY ERR (ERR-INDEX) UPON PRINTER
IF ERR(ERR-INDEX) = SPACE SET ALLERR TO TRUE END-IF
END-PERFORM
END-PERFORM.
END-THREAD.
STOP RUN.
PERFORM END-THREAD-TO-UDS.
PERFORM TERMINATION-PARA.
Example 3–25 shows the source listing of a runstream used to compile, link, and
execute the example program DSPFAMESQL. Noteworthy lines are bolded.
Example 3–25. Runstream to Compile, Link, and Execute COBOL Embedded SQL
Program
INDIVIDUAL DATA
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
/* ***************************************************************
* *
* SIMPLE BATCH C RDMS EMBEDDED SQL PROGRAM - CDSPFAMESQL *
* *
* reads the input data *
* begins thread with UDS *
* retrieves the requested information from the database *
* displays this information on the printer *
* ends thread with UDS *
* *
*************************************************************** */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <rsa.h>
/* ************************************************************
* ESQL STATEMENT STATUS
************************************************************ */
char SQLSTATE[6];
#define NO_FIND_STATUS "02000"
/* ************************************************************
* RDMS WORK AREA SIZE
************************************************************ */
int work_area_size = 2000;
/* ************************************************************
* UDS THREAD STATUS FLAG
************************************************************ */
int thread_flag = 0;
/* ************************************************************
* RELATIONAL DATABASE INFORMATION
************************************************************ */
EXEC SQL BEGIN DECLARE SECTION;
char employee_number[6];
char indr_last_name[21];
char indr_first_name[13];
char child_last_name[21];
char child_first_name[13];
EXEC SQL END DECLARE SECTION;
int main(void)
{
/* ************************************************************
* READ EMPLOYEE NUMBER
************************************************************ */
printf ("Enter employee number:");
fflush(stdout);
scanf ("%5s",&employee_number);
/* ************************************************************
* RSA WORK AREA SIZE
************************************************************ */
rsa_init (&work_area_size);
/* ************************************************************
* GENERAL ERROR PROCESSING FOR A NEGATIVE SQL ERROR
************************************************************ */
EXEC SQL WHENEVER SQLERROR GO TO: HANDLE_SQL_ERROR;
/* ************************************************************
* INITIALIZE WITH THE DATABASE SYSTEM
* SET DEFAULT QUALIFIER ON ALL TABLES IN THIS THREAD
************************************************************ */
EXEC SQL BEGIN THREAD CDSPDATA FOR APPSVN RETRIEVE;
thread_flag = 1;
EXEC SQL USE DEFAULT QUALIFIER FAMILY;
/* ************************************************************
* SINGLETON SELECT OF THE INDIVIDUAL'S DATA
************************************************************ */
EXEC SQL
SELECT INDR_LAST_NAME, INDR_FIRST_NAME
INTO :indr_last_name, :indr_first_name
FROM INDIVIDUALR
WHERE INDIVIDUALR.INDR_EMP_NUMBER = :employee_number;
if (strcmp(SQLSTATE,NO_FIND_STATUS) == 0)
{ printf("NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER: %s\n",
employee_number);
printf("PROGRAM HAS COMPLETED");
EXEC SQL END THREAD;
thread_flag = 0;
return(0);
}
else
{ printf("INDIVIDUAL DATA \n");
printf(" EMPLOYEE NUMBER IS %s\n",employee_number);
printf(" LAST NAME: %s\n",indr_last_name);
printf(" FIRST NAME: %s\n",indr_first_name);
}
/* ************************************************************
* DEFINE CURSOR TO BE USED FOR DATA RETRIEVAL
* OPEN CURSOR
************************************************************ */
EXEC SQL
DECLARE CHILDDATA CURSOR
SELECT CHILD_LAST_NAME, CHILD_FIRST_NAME
FROM CHILD
WHERE CHILD.CHILD_EMP_NUMBER = :employee_number;
EXEC SQL OPEN CHILDDATA;
/* ************************************************************
* RETRIEVE DATA FROM THE CURSOR
************************************************************ */
while(1)
{ EXEC SQL
FETCH NEXT CHILDDATA INTO :child_last_name, :child_first_name;
if (strcmp(SQLSTATE, NO_FIND_STATUS) != 0)
printf(" CHILD NAME: %s %s\n",
child_first_name, child_last_name);
else break;
}
/* ************************************************************
* TERMINATE WITH THE DATABASE SYSTEM
************************************************************ */
EXEC SQL END THREAD;
thread_flag = 0;
/* ************************************************************
* TERMINATE PROGRAM
************************************************************ */
printf("PROGRAM HAS COMPLETED\n");
return(0);
/* ************************************************************
* RETURN AN ERROR MESSAGE ON THE PRINTER IF A
* DATABASE ERROR OCCURS
************************************************************ */
HANDLE_SQL_ERROR:
handle_sqlerror();
return(0);
}
void handle_sqlerror(void)
{
char msg[133];
EXEC SQL WHENEVER SQLERROR CONTINUE;
printf("***SQLSTATE = %p\n", SQLSTATE);
printf("GETERROR returned the following text for SQLSTATE:\n\n");
do
{
EXEC SQL GETERROR INTO :msg;
printf("%s\n",msg);
}
while(msg[0] != '\0');
EXEC SQL END THREAD;
thread_flag = 0;
}
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION ******************
@ . ***
@ . *** UC COMPILE OF THE EMBEDDED SQL PROGRAM
@ . ***
@UC QUAL*UCSTST.DISPLAYFAM/ESQL-C,QUAL*UCSTST.CDSPFAMESQL/COMP,,, ;
NO-OPTIONS,APPLICATION/APPSVN
@ . ***
@ . ***
@ . *** STATIC LINK OF THE EMBEDDED SQL PROGRAM TO PRODUCE A ZOOM
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
@LINK ,QUAL*UCSTST.CDSPFAMESQL
INCLUDE QUAL*UCSTST.CDSPFAMESQL/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** EXECUTION OF THE EMBEDDED SQL PROGRAM
@ . ***
@XQT QUAL*UCSTST.CDSPFAMESQL
10211
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION ******************
@ . ***
@ . *** UC COMPILE OF THE EMBEDDED SQL PROGRAM
@ . ***
@UC QUAL*UCSTST.DISPLAYFAM/ESQL-C,QUAL*UCSTST.CDSPFAMESQL/COMP,,, ;
NO-OPTIONS,APPLICATION/APPSVN
UC- 4R2(931119) LSS- 8R2(931209) 940209 10:51:27
SIZES: CODE(EM6): 657 DATA: 1071
END UC- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 1 WARNING(LEVEL)
@ . ***
@ . ***
@ . *** STATIC LINK OF THE EMBEDDED SQL PROGRAM TO PRODUCE A ZOOM
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.CDSPFAMESQL
LINK 5R2 (940112 1230:40) 1994 Feb 09 Wed 1052:03
END LINK , LINES : 4 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** EXECUTION OF THE EMBEDDED SQL PROGRAM
@ . ***
@XQT QUAL*UCSTST.CDSPFAMESQL
Enter employee number:
INDIVIDUAL DATA
EMPLOYEE NUMBER IS 10211
LAST NAME: FIELDING
FIRST NAME: STEVEN
CHILD NAME: STEVEN JR FIELDING
CHILD NAME: DANIEL FIELDING
CHILD NAME: JANE FIELDING
PROGRAM HAS COMPLETED
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
This program defines the cursor and procedure definitions called by the FORTRAN
host language application program DISPLAYFAM/MSQL-FHOST. In this example, this
program resides in element QUAL*UCSTST.DISPLAYFAM/MSQL-FMOD. Noteworthy
lines are bolded.
MODULE SQLPROCS
LANGUAGE FORTRAN
AUTHORIZATION FAMILY
--
-- *******************************************************************
-- This module defines the cursor and procedure definitions called
-- by the FORTRAN host application program
-- *******************************************************************
--
-- Individual's children cursor definition
--
DECLARE CHILDDATA CURSOR
SELECT CHILD_LAST_NAME, CHILD_FIRST_NAME
FROM CHILD
WHERE CHILD.CHILD_EMP_NUMBER = :EMPLOYEE_NUMBER
--
-- Procedure to begin thread with UDS
--
PROCEDURE BEGINTHREAD
(SQLSTATE);
BEGIN THREAD FDSPDATA FOR APPSVN RETRIEVE;
--
-- Procedure to fetch the requested individual
--
PROCEDURE SINGLESELECTIND
(SQLSTATE,
:EMPLOYEE_NUMBER CHAR(5),
:INDR_LAST_NAME CHAR(20),
:INDR_FIRST_NAME CHAR(12));
SELECT INDR_LAST_NAME, INDR_FIRST_NAME
INTO :INDR_LAST_NAME, :INDR_FIRST_NAME
FROM INDIVIDUALR
WHERE INDIVIDUALR.INDR_EMP_NUMBER = :EMPLOYEE_NUMBER;
--
-- Procedure to open the individual's children cursor
--
PROCEDURE OPENCHILDCURSOR
(SQLSTATE,
:EMPLOYEE_NUMBER CHAR(5));
OPEN CHILDDATA;
--
-- Procedure to fetch the children of an individual using the
-- CHILDDATA cursor
--
PROCEDURE FETCHCHILD
(SQLSTATE,
:CHILD_LAST_NAME CHAR(20),
:CHILD_FIRST_NAME CHAR(12));
FETCH NEXT CHILDDATA INTO :CHILD_LAST_NAME, :CHILD_FIRST_NAME;
--
-- Procedure to end thread with UDS
--
PROCEDURE ENDTHREAD
(SQLSTATE);
END THREAD;
--
-- Procedure to call GETERROR to obtain message description for
-- SQLSTATE status
--
PROCEDURE GETERRORTEXT
(SQLSTATE,
:MSG1 CHAR(132),
:MSG2 CHAR(132),
:MSG3 CHAR(132),
:MSG4 CHAR(132),
:MSG5 CHAR(132));
GETERROR INTO :MSG1, :MSG2, :MSG3, :MSG4, :MSG5;
PROGRAM HOST_SQL
IMPLICIT NONE
C *******************************************************************
C *******************************************************************
C *
C * SIMPLE BATCH FORTRAN RDMS MODULE SQL PROGRAM - DSPFAMMSQL
C *
C * reads the input data
C * calls the module program to begin the thread with UDS
C * calls the module program to retrieve the requested information
C * from the database
C * prints this information on the printer
C * calls the module program to begin the thread with UDS
C *
C *******************************************************************
C *******************************************************************
C *
C *
C * Variable to hold employee number input
C *
CHARACTER EMPLOYEE_NUMBER*5
C *
C * UDS thread status flag
C *
INTEGER THREAD_FLAG
C *
C * Relational database information
C *
CHARACTER INDR_LAST_NAME*20
CHARACTER INDR_FIRST_NAME*12
CHARACTER CHILD_LAST_NAME*20
CHARACTER CHILD_FIRST_NAME*12
C *
C * ESQL statement status
C *
CHARACTER SQLSTATE*5
Example 3–31. Source Listing of the FORTRAN Host Language Application Program
CHARACTER GOOD_STATUS*5
PARAMETER (GOOD_STATUS = '00000')
CHARACTER NO_FIND_STATUS*5
PARAMETER (NO_FIND_STATUS = '02000')
C *
C * Initialize UDS thread status flag
C *
DATA THREAD_FLAG/0/
C *
C *******************************************************************
C *
C * Input employee number
C *
PRINT *,'ENTER EMPLOYEE NUMBER'
READ *,EMPLOYEE_NUMBER
C *
C * Initialize with the database system
C *
CALL BEGINTHREAD(SQLSTATE)
IF (SQLSTATE .NE. GOOD_STATUS) THEN
CALL HANDLE_BAD_SQLSTATE_STATUS(SQLSTATE)
END IF
THREAD_FLAG = 1
C *
C * Retrieve individual data
C *
CALL SINGLESELECTIND
& (SQLSTATE,EMPLOYEE_NUMBER,INDR_LAST_NAME,INDR_FIRST_NAME)
IF (SQLSTATE .EQ. NO_FIND_STATUS) THEN
PRINT *,'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER ',
& EMPLOYEE_NUMBER
CALL ENDTHREAD(SQLSTATE)
IF (SQLSTATE .NE. GOOD_STATUS) THEN
CALL HANDLE_BAD_SQLSTATE_STATUS(SQLSTATE)
END IF
THREAD_FLAG = 0
PRINT *,'PROGRAM HAS COMPLETED '
STOP
ELSE IF (SQLSTATE .NE. GOOD_STATUS) THEN
CALL HANDLE_BAD_SQLSTATE_STATUS(SQLSTATE)
ELSE
PRINT*, 'INDIVIDUAL DATA'
PRINT*, ' EMPLOYEE NUMBER IS ', EMPLOYEE_NUMBER
PRINT*, ' LAST NAME: ', INDR_LAST_NAME
PRINT*, ' FIRST NAME: ', INDR_FIRST_NAME
END IF
Example 3–31. Source Listing of the FORTRAN Host Language Application Program
C *
C * Open cursor to be used for data retrieval(CHILDDATA)
C *
CALL OPENCHILDCURSOR(SQLSTATE,EMPLOYEE_NUMBER)
IF (SQLSTATE .NE. GOOD_STATUS) THEN
CALL HANDLE_BAD_SQLSTATE_STATUS(SQLSTATE)
END IF
C *
C * Retrieve data from the cursor
C *
100 CALL FETCHCHILD(SQLSTATE,CHILD_LAST_NAME,CHILD_FIRST_NAME)
IF (SQLSTATE .EQ. GOOD_STATUS) THEN
PRINT *, ' CHILD NAME: ',
& CHILD_FIRST_NAME, ' ',
& CHILD_LAST_NAME
GOTO 100
ELSE IF (SQLSTATE .NE. NO_FIND_STATUS) THEN
CALL HANDLE_BAD_SQLSTATE_STATUS(SQLSTATE)
END IF
C *
C * Terminate with the database system
C *
CALL ENDTHREAD(SQLSTATE)
IF (SQLSTATE .NE. GOOD_STATUS) THEN
CALL HANDLE_BAD_SQLSTATE_STATUS(SQLSTATE)
END IF
THREAD_FLAG = 0
STOP
C ******************************************************************
SUBROUTINE HANDLE_BAD_SQLSTATE_STATUS(SQLSTATE)
C *******************************************************************
C * ESQL STATEMENT STATUS
C *******************************************************************
CHARACTER SQLSTATE*5
C *******************************************************************
C * GETERROR BUFFERS
C *******************************************************************
CHARACTER SQL_ERR_MSG(5)*132
C *******************************************************************
C * INDEX FOR GETERROR PRINTS
C *******************************************************************
INTEGER I
C *
C * Returns an error message on the printer if a database error occurs
C *
Example 3–31. Source Listing of the FORTRAN Host Language Application Program
200 DO 300 I = 1, 5
SQL_ERR_MSG(I) = ' '
300 CONTINUE
CALL GETERRORTEXT(SQLSTATE,
& SQL_ERR_MSG(1),
& SQL_ERR_MSG(2),
& SQL_ERR_MSG(3),
& SQL_ERR_MSG(4),
& SQL_ERR_MSG(5))
DO 400 I = 1, 5
IF (SQL_ERR_MSG(I) .NE. ' ') THEN
PRINT *, SQL_ERR_MSG(I)
IF (I .EQ. 5) GO TO 200
END IF
400 CONTINUE
C *
C * Terminate with the database system
C *
CALL ENDTHREAD(SQLSTATE)
THREAD_FLAG = 0
STOP
END
Example 3–31. Source Listing of the FORTRAN Host Language Application Program
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION ******************
@ . ***
@ . *** UFTN MODULE SQL PROGRAM PREPROCESSING
@ . ***
@SMLP,C QUAL*UCSTST.DISPLAYFAM/MSQL-FMOD,QUAL*UCSTST.FMOD
@ . ***
@ . ***
@ . *** UCOB COMPILE OF THE EMBEDDED SQL PROGRAM
@ . ***
@UCOB,S QUAL*UCSTST.FMOD/COB,QUAL*UCSTST.,,,NO-OPTIONS,NARROW, ;
APPLICATION/APPSVN,MODULE
@ . ***
@ . ***
@ . *** UFTN COMPILE OF THE MODULE SQL HOST PROGRAM
@ . ***
@UFTN QUAL*UCSTST.DISPLAYFAM/MSQL-FHOST,QUAL*UCSTST.FHOST,,,NO-OPTIONS
@ . ***
@ . ***
@ . *** STATIC LINK OF THE MODULE SQL PROGRAM TO PRODUCE A ZOOM
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
@LINK ,QUAL*UCSTST.DSPFAMMSQL
INCLUDE QUAL*UCSTST.FHOST
RESOLVE ALL REFERENCES USING QUAL*UCSTST.,LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** EXECUTION OF THE MODULE SQL PROGRAM
@ . ***
@XQT QUAL*UCSTST.DSPFAMMSQL
'10211'
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION ******************
@ . ***
@ . *** UFTN MODULE SQL PROGRAM PREPROCESSING
@ . ***
@SMLP,C QUAL*UCSTST.DISPLAYFAM/MSQL-FMOD,QUAL*UCSTST.FMOD
SMLP 8R2 02/10/94 22:34:31
***** 163 line COBOL program produced ****
END SMLP 0 ERRORS 0 WARNINGS
@ . ***
@ . ***
@ . *** UCOB COMPILE OF THE EMBEDDED SQL PROGRAM
@ . ***
@UCOB,S QUAL*UCSTST.FMOD/COB,QUAL*UCSTST.,,,NO-OPTIONS,NARROW, ;
APPLICATION/APPSVN,MODULE
UCOB- 6R2(931119) LSS- 8R2(931209) 940210 22:34:31
1 * This source was generated by the 2200 SQL Module Language Processor.
2 * Edit at your own risk.
3
4
5 IDENTIFICATION DIVISION.
6 PROGRAM-ID. BEGINTHREAD.
7 ENVIRONMENT DIVISION.
8 CONFIGURATION SECTION.
9 SOURCE-COMPUTER. UNISYS-2200.
10 OBJECT-COMPUTER. UNISYS-2200.
11 DATA DIVISION.
12 FILE SECTION.
13 WORKING-STORAGE SECTION.
14 LINKAGE SECTION.
15 EXEC SQL BEGIN DECLARE SECTION END-EXEC.
16 01 SQLSTATE PIC X(5).
17 EXEC SQL END DECLARE SECTION END-EXEC.
18 PROCEDURE DIVISION USING SQLSTATE.
19 P0.
20 EXEC SQL
21 USE DEFAULT QUALIFIER FAMILY
22 END-EXEC.
23 EXEC SQL
*WARNING 7002: The application name on your BEGIN THREAD will be ignored.
The application name specified on the keyword APPLICATION option
will be used for the runtime execution of this command.
v
24 21 BEGIN THREAD FDSPDATA FOR APPSVN RETRIEVE
25 END-EXEC.
26 END PROGRAM BEGINTHREAD.
27
** OBJECT MODULE FMOD/COB GENERATED
SIZES: CODE(EM6): 70 DATA: 108
@LINK ,QUAL*UCSTST.DSPFAMMSQL
LINK 5R2 (940112 1230:40) 1994 Feb 10 Thu 2234:45
END LINK , LINES : 4 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** EXECUTION OF THE MODULE SQL PROGRAM
@ . ***
@XQT QUAL*UCSTST.DSPFAMMSQL
ENTER EMPLOYEE NUMBER
INDIVIDUAL DATA
EMPLOYEE NUMBER IS 10211
LAST NAME: FIELDING
FIRST NAME: STEVEN
CHILD NAME: STEVEN JR FIELDING
CHILD NAME: DANIEL FIELDING
CHILD NAME: JANE FIELDING
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
IDENTIFICATION DIVISION.
PROGRAM-ID. DSPFAMISQL.
DATE-COMPILED.
******************************************************************
******************************************************************
* *
* SIMPLE BATCH COBOL RDMS NONEMBEDDED SQL PROGRAM - DSPFAMISQL *
* *
* reads the input data *
* begins thread with UDS *
* retrieves the requested information from the database *
* displays this information on the printer *
* ends thread with UDS *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 INVALID-EMPLOYEE-NUMBER PIC X(40)
VALUE 'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER '.
************************************************************
* VARIABLE TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
01 EMPLOYEE-NUMBER PIC X(5).
************************************************************
* RELATIONAL DATABASE INFORMATION
************************************************************
01 INDR-LAST-NAME PIC X(20).
01 INDR-FIRST-NAME PIC X(12).
PROCEDURE DIVISION.
************************************************************
* PROGRAM FLOW
************************************************************
MAIN-PROGRAM-FLOW.
DISPLAY 'ENTER EMPLOYEE NUMBER' UPON PRINTER.
ACCEPT EMPLOYEE-NUMBER.
PERFORM BEGIN-THREAD-TO-UDS.
IF ERROR-STATUS = ZERO
MOVE 1 TO THREAD-FLAG.
PERFORM SET-DEFAULT-QUALIFIER.
IF ERROR-STATUS = ZERO
PERFORM SINGLETON-SELECT-INDRDATA.
IF ERROR-STATUS = 6001
DISPLAY INVALID-EMPLOYEE-NUMBER, EMPLOYEE-NUMBER
UPON PRINTER
PERFORM END-THREAD-TO-UDS
PERFORM TERMINATION-PARA.
IF ERROR-STATUS = ZERO
PERFORM DISPLAY-INDIVIDUAL-DATA
PERFORM DEFINE-CHILDDATA-CURSOR.
IF ERROR-STATUS = ZERO
PERFORM OPEN-CHILDDATA-CURSOR.
IF ERROR-STATUS = ZERO
PERFORM FETCH-FROM-CHILDDATA-CURSOR
WITH TEST AFTER UNTIL ERROR-STATUS NOT = ZERO.
IF ERROR-STATUS NOT = 6001 AND ERROR-STATUS NOT = ZERO
PERFORM RDMS-ERROR-PARA.
PERFORM END-THREAD-TO-UDS.
PERFORM TERMINATION-PARA.
************************************************************
* INITIALIZE WITH THE DATABASE SYSTEM
************************************************************
BEGIN-THREAD-TO-UDS.
ENTER MASM 'ACOB$RDMR' USING
'BEGIN THREAD DSPDATA FOR APPSVN RETRIEVE ;'
ERROR-STATUS, AUX-INFO.
************************************************************
* SET DEFAULT QUALIFIER ON ALL TABLES IN THIS THREAD
************************************************************
SET-DEFAULT-QUALIFIER.
ENTER MASM 'ACOB$RDMR' USING
'USE DEFAULT QUALIFIER FAMILY ;'
ERROR-STATUS, AUX-INFO.
************************************************************
* SINGLETON SELECT OF THE INDIVIDUAL'S DATA
************************************************************
SINGLETON-SELECT-INDRDATA.
MOVE SPACES TO RCOM-AREA.
MOVE 'SELECT ' TO R-LINE (1).
MOVE ' INDR_LAST_NAME, INDR_FIRST_NAME ' TO R-LINE (2).
MOVE ' INTO $P1, $P2 ' TO R-LINE (3).
MOVE ' FROM INDIVIDUALR ' TO R-LINE (4).
MOVE ' WHERE INDIVIDUALR.INDR_EMP_NUMBER ' TO R-LINE (5).
MOVE ' = $P3 ; ' TO R-LINE (6).
ENTER MASM 'ACOB$RDMR' USING RCOM-AREA,
ERROR-STATUS, AUX-INFO,
INDR-LAST-NAME, INDR-FIRST-NAME, EMPLOYEE-NUMBER.
************************************************************
* DISPLAY THE INDIVIDUAL'S INFORMATION TO THE PRINTER
************************************************************
DISPLAY-INDIVIDUAL-DATA.
DISPLAY 'INDIVIDUAL DATA' UPON PRINTER.
DISPLAY ' EMPLOYEE NUMBER IS ' EMPLOYEE-NUMBER UPON PRINTER.
DISPLAY ' LAST NAME: ' INDR-LAST-NAME UPON PRINTER.
DISPLAY ' FIRST NAME: ' INDR-FIRST-NAME UPON PRINTER.
************************************************************
* DEFINE CURSOR TO BE USED FOR DATA RETRIEVAL
************************************************************
DEFINE-CHILDDATA-CURSOR.
MOVE SPACES TO RCOM-AREA.
MOVE 'DECLARE CHILDDATA CURSOR ' TO R-LINE (1).
MOVE ' SELECT ' TO R-LINE (2).
MOVE ' CHILD_LAST_NAME, CHILD_FIRST_NAME ' TO R-LINE (3).
MOVE ' FROM CHILD ' TO R-LINE (4).
MOVE ' WHERE CHILD.CHILD_EMP_NUMBER ' TO R-LINE (5).
MOVE ' = $P1 ; ' TO R-LINE (6).
ENTER MASM 'ACOB$RDMR' USING RCOM-AREA,
ERROR-STATUS, AUX-INFO, EMPLOYEE-NUMBER.
************************************************************
* OPEN CURSOR
************************************************************
OPEN-CHILDDATA-CURSOR.
ENTER MASM 'ACOB$RDMR' USING
'OPEN CHILDDATA USING $P1 ;'
ERROR-STATUS, AUX-INFO, EMPLOYEE-NUMBER.
************************************************************
* RETRIEVE DATA FROM THE CURSOR
************************************************************
FETCH-FROM-CHILDDATA-CURSOR.
ENTER MASM 'ACOB$RDMR' USING
'FETCH NEXT CHILDDATA INTO $P1, $P2, ;'
ERROR-STATUS, AUX-INFO,
CHILD-LAST-NAME, CHILD-FIRST-NAME.
IF ERROR-STATUS = ZERO
DISPLAY ' CHILD NAME: ' CHILD-FIRST-NAME, ' ',
CHILD-LAST-NAME UPON PRINTER
END-IF.
************************************************************
* TERMINATE WITH THE DATABASE SYSTEM
************************************************************
END-THREAD-TO-UDS.
ENTER MASM 'ACOB$RDMR' USING
'END THREAD ;'
ERROR-STATUS, AUX-INFO.
MOVE 0 TO THREAD-FLAG.
************************************************************
* TERMINATE PROGRAM
************************************************************
TERMINATION-PARA.
DISPLAY 'PROGRAM HAS COMPLETED' UPON PRINTER.
STOP RUN.
*
************************************************************
* RETURN AN ERROR MESSAGE ON THE PRINTER IF A
* DATABASE ERROR OCCURS
************************************************************
RDMS-ERROR-PARA.
DISPLAY 'ERROR STATUS = ' ERROR-STATUS UPON PRINTER.
DISPLAY 'AUXILIARY INFORMATION = ' AUX-INFO UPON PRINTER.
MOVE 'GETERROR INTO $P1, $P2, $P3, $P4, $P5 ;' TO RCOM-AREA.
PERFORM UNTIL ALLERR
INITIALIZE ERROR-TEXT
ENTER MASM 'ACOB$RDMR' USING RCOM-AREA,
ERROR-STATUS, AUX-INFO, ERR (1), ERR (2), ERR (3),
ERR (4), ERR (5)
PERFORM VARYING ERR-INDEX FROM 1 BY 1 UNTIL ERR-INDEX = 6
DISPLAY ERR (ERR-INDEX) UPON PRINTER
IF ERR(ERR-INDEX) = SPACE SET ALLERR TO TRUE END-IF
END-PERFORM
END-PERFORM.
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION *********************
@ . ***
@ . ***
@ . *** UCOB COMPILATION OF THE INTERPRETER SQL PROGRAM
@ . ***
@UCOB QUAL*UCSTST.DISPLAYFAM/ISQL,QUAL*UCSTST.DSPFAMISQL/COMP,,, ;
NO-OPTIONS
@ . ***
@ . ***
@ . *** EXECUTION OF THE INTERPRETIVE SQL PROGRAM USING DYNAMIC LINKING
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
@XQT QUAL*UCSTST.DSPFAMISQL/COMP
10211
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
Example 3–35. Runstream to Compile, Link, and Execute COBOL Interpreter SQL
Program
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION *********************
@ . ***
@ . ***
@ . *** UCOB COMPILATION OF THE INTERPRETER SQL PROGRAM
@ . ***
@UCOB QUAL*UCSTST.DISPLAYFAM/ISQL,QUAL*UCSTST.DSPFAMISQL/COMP,,, ;
NO-OPTIONS
UCOB- 6R2 (931119) LSS- 8R2 (931209) 940128 15:12:04
SIZES: CODE(EM6): 520 DATA: 1404
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** EXECUTION OF THE INTERPRETIVE SQL PROGRAM USING DYNAMIC LINKING
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@XQT QUAL*UCSTST.DSPFAMISQL/COMP
INDIVIDUAL DATA
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
SFS 2200 provides access to both of the following types of UCS COBOL files:
• Relative files
A UCS COBOL relative file is an SFS 2200 direct system data format (DSDF) file.
• Indexed files
A UCS COBOL indexed file is an SFS 2200 multi-indexed sequential access method
(MSAM) file.
SFS 2200 also provides support for direct SDF files for UCS FORTRAN and UCS C. In
UCS C, direct sequential data files are called binary files. Table 3-4 shows the SFS
2200 file access methods (file organization methods) supported for the UCS
languages.
The SFS 2200 example in the following subsections uses an indexed (MSAM) COBOL
file that contains information about an individual’s participation in company-organized
sports:
• It is assumed that no individual will participate in more than three sports.
• The SPT-ACTIVE-COUNT field identifies the number of company sports the
individual currently plays.
• The individual’s employee number (SPT-EMP-NUMBER) uniquely identifies each
record occurrence.
• A second index exists on the last name of the individual (the last name is stored in
data item SPT-IND-LAST-NAME).
2. Define the UDS storage areas that map to the SFS 2200 files, using UREP.
• There must be one storage area per SFS 2200 file.
• The DATA-FORMAT attribute for the storage area must have a value of one of
the following:
− DSDF (direct system data format)
− MSAM (multi-indexed sequential access method file)
• The QUALIFIER attribute must be the same as the name of the SCHEMA for
this file.
3. After you define the storage areas, create the file description tables (FDT) required
by UDS by using the PROCESS STORAGE-AREA...INSTALL command.
The following runstream defines and processes the storage area for the SFS 2200 file,
SPORTS.
@UDS$$SVN*UREP$ABS.DD ,,APPSVN
CREATE SCHEMA LEISURE.
CREATE STORAGE-AREA SPORTS FOR SCHEMA LEISURE.
ADD FILE-TYPE IS EXEC.
ADD DATA-FORMAT IS MSAM.
ADD QUALIFIER IS LEISURE.
ADD DOMAIN IS UDS.
ADD RECOVERED IS TRUE.
ADD AUDITED IS TRUE.
ADD PAGE-SIZE IS 896.
ADD MAXIMUM-PAGES IS 10.
PROCESS STORAGE-AREA ALL FOR SCHEMA LEISURE INSTALL.
PROCESS STORAGE-AREA ALL FOR SCHEMA LEISURE REPORT.
EXIT.
UCS COBOL and UCS FORTRAN SFS 2200 files require no further processing for
program use. In fact, the same COBOL and FORTRAN SFS 2200 files can be used by
both UCS and non-UCS programs, as long as they contain no Fieldata characters.
UCS C SFS 2200 (binary) files require one more step in their setup, however. The
additional step is required because C does not have language syntax for specifying an
SFS 2200 file. You must create an external file description for C SFS 2200 files, using
the Define File Processor (DFP), a stand-alone preprocessor. You create this external
file description as a define-file-block omnibus element in a program file. The following
runstream creates this omnibus element in a file called UDS$$SVN*DFP$.
Explanation
1. This statement catalogs a file to hold the define-file-block omnibus element
created by DFP. The file in this example might be used to hold all of the define-
file-block omnibus elements for application group 7.
2. This statement places the @USE name of DFP$ on the file into which DFP is to
place its output. This @USE name is required by the Define File Processor.
3. This statement calls the Define File Processor. The LE options specify that:
• A define-file-block omnibus element containing the description of the external
data file is to be built.
• A listing is to be produced.
The first field on the processor call identifies the SFS 2200 data file for which
this block is being built.
The second field identifies the file name (which must be DFP$) and element
name (which must be the same as the name of the data file) where the define-
file-block omnibus element is to be placed.
4. This input parameter identifies this file as an SFS 2200 (shared) file.
5. This statement terminates the runstream.
During execution of a UCS C SFS 2200 program, whenever the program opens an SFS
2200 file, the UCS Runtime System reads the define-file-block. This means that prior
to execution of a UCS C SFS 2200 program, you must do the following:
1. Assign the program file containing the define-file-block omnibus element to the
run.
2. Give the file an @USE name of DFP$.
This process is necessary so that when an SFS 2200 file is opened, the UCS Runtime
System knows where to locate the define-file-block omnibus element.
Remember that a define-file-block is not required by UCS COBOL and UCS FORTRAN
programs.
For more information on SFS 2200 programming, refer to the SFS Administration and
Support Reference Manual.
For more information on using DFP, refer to the DFP Administration and
Programming Reference Manual.
Source Listing of Runstream to Define the SFS 2200 File and Storage Area
Example 3–37 shows the source listing of a runstream used to define the SFS 2200 file
and storage area. Noteworthy lines are bolded.
@ . ***
@ . *** ******** START OF THE SFS DATABASE DEFINITION SECTION ************
@ . ***
@ . ***
@ . *** CATALOG THE DATABASE STORAGE AREA FILES.
@ . ***
@CAT,P LEISURE*SPORTS.,F/5//5
@ . ***
@ . ***
@ . *** USE THE UNISYS REPOSITORY TO DEFINE THE SFS STORAGE AREAS
@ . ***
@UDS$$SVN*UREP$ABS.DD ,,APPSVN
CREATE SCHEMA LEISURE.
CREATE STORAGE-AREA SPORTS FOR SCHEMA LEISURE.
ADD FILE-TYPE IS EXEC.
ADD DATA-FORMAT IS MSAM.
ADD QUALIFIER IS LEISURE.
ADD DOMAIN IS UDS.
ADD RECOVERED IS TRUE.
ADD AUDITED IS TRUE.
ADD PAGE-SIZE IS 896.
ADD MAXIMUM-PAGES IS 10.
PROCESS STORAGE-AREA ALL FOR SCHEMA LEISURE INSTALL.
PROCESS STORAGE-AREA ALL FOR SCHEMA LEISURE REPORT.
EXIT.
@ . ***
@ . ***
@ . ***
@ . *** ******** END OF THE SFS DATABASE DEFINITION SECTION *************
@ . ***
Example 3–37. Runstream to Define the SFS 2200 File and Storage Area
@ . ***
@ . *** ******** START OF THE SFS DATABASE DEFINITION SECTION ************
@ . ***
@ . ***
@ . *** CATALOG THE DATABASE STORAGE AREA FILES.
@ . ***
@CAT,P LEISURE*SPORTS.,F/5//5
I:002333 CAT complete.
@ . ***
@ . ***
@ . *** USE THE UNISYS REPOSITORY TO DEFINE THE SFS STORAGE AREAS
@ . ***
@UDS$$SVN*UREP$ABS.DD ,,APPSVN
UREP 3R1 (11/04/93 10:17:39) 01/28/94 14:47:25
*REMARK* DSD4023 The INSTALL for STORAGE-AREA SPORTS VERSION ' ' for SCHEMA
LEISURE was SUCCESSFUL.
*REMARK* DSD4036 Your PROCESS STORAGE-AREA ALL command was successful.
@ . ***
@ . ***
@ . ***
@ . *** ******** END OF THE SFS DATABASE DEFINITION SECTION *************
@ . ***
(For UCS C, this is accomplished instead by use of the Define File Processor; refer to
"SFS 2200 Files and Storage Areas.")
UCS COBOL
UCS COBOL identifies SFS 2200 files by using the A-SHARED-FILE syntax in the
SELECT clause. The following SELECT clauses show the syntax for identifying a
relative (DSDF) file and an indexed (MSAM) file for COBOL:
UCS FORTRAN
UCS FORTRAN identifies SFS 2200 files by the RFORM setting in the OPEN statement.
A value of LS, MS, ES, FS, US, or VS identifies the file as an SFS 2200 file. (The "S"
stands for shared.)
@UCOB . . . .
or
@UCOB . . . . ,,,COMPAT
UCS SFS or UCS SFS
Source @UFTN . . . . Object
Program or Module
@UC . . . .
qual*progfile.source
qual*progfile.om/comp
002326
Only UCS COBOL might require a special keyword option. If the program uses the
ASCII COBOL usage clauses in the file definitions, you must use the COMPAT keyword
option to ensure an error-free compilation.
The system automatically sets up application group library search chains for each of
the 64 application groups during installation of the Linking System. These library
search chains mean the applications programmer does not have to do either of the
following:
• Build a user-defined library search chain for linking
• Explicitly supply (INCLUDE) the object module containing the SFS 2200 interface
during static linking
The following generic format shows how to specify use of the appropriate application
group library search chain:
@USE LINK$PF,SYS$LIB$*APP$n
If you want to link a UCS program that accesses an SFS 2200 database to the system
software in application group 7, use the following statement:
@USE LINK$PF.,SYS$LIB$*APP$7.
In this case, all references to SFS 2200 software would be resolved using
UDS$$SVN*SFS.
Before SB4, you had to use the Relational Syntax Analyzer (RSA) and the BEGIN
THREAD/END THREAD commands in an SFS 2200 program in order for the program to
execute in an alternate application group. In SB4, SFS 2200 directly supports alternate
application groups and their system-defined application group library search chains.
RSA and the BEGIN THREAD/END THREAD commands are no longer necessary.
• If either of the following are true, you must before execution specify an @USE
name that identifies the SFS 2200 file (by its external name) to the executing
program:
− The qualifier on the file does not match the qualifier that you are running
under.
− The external file name specified by the program is different from the OS 2200
Exec file name.
Explanation
1. This statement compiles the program.
2. This statement allows use of the correct application group library search chains.
3. In this example, the file name specified by the program is different from the
OS 2200 Exec file name. The OS 2200 Exec file name is LEISURE*SPORTS.
However, in this case the executing COBOL program uses the file name
SFSSPORTS, specified in the following statement:
SELECT SPORTS ASSIGN TO A-SHARED-FILE SFSSPORTS
The output of the static link can be a standard object module, a bound object module,
or a ZOOM.
The following example shows how to statically link a UCS program that accesses an
SFS 2200 database, producing a ZOOM:
Explanation
1. This statement ensures that the program is statically linked using the SFS 2200
software in the desired application group. (It ensures that the library search chain
for the correct application group is used.) In this example, this program is to
execute in application group 7.
2. This statement calls the Linking System LINK Processor. The ZOOM to be
produced is named QUAL*UCSTST.DISPLAYSPT.
3. This command identifies the compiler-generated object module containing the
UCS program that accesses the SFS 2200 database.
4. This command resolves external references, including those to the UCS Runtime
System library.
5. This command merges banks and produces a ZOOM.
6. This command deletes all definitions except the program’s starting address,
START$. This decreases the size of the ZOOM.
7. This statement ends static linking.
For example, assume a program contains the following COBOL SELECT statement:
SELECT SPORTS ASSIGN TO A-SHARED-FILE SFSSPORTS
Assuming the file’s OS 2200 Exec file name is LEISURE*SPORTS, the following @USE
statement would be used in this case:
@USE SFSSPORTS,LEISURE*SPORTS.
Complete Example
The following execution runstream would be used for a UCS COBOL program with the
following characteristics:
• Object module name of QUAL*UCSTST.LOADSFSDB/COMP
• OS 2200 Exec file name of LEISURE*SPORTS
• A-SHARED-FILE name of SFSSPORTS
• Storage-area DOMAIN attribute of USER
@ASG,A LEISURE*SPORTS.
@USE SFSSPORTS,LEISURE*SPORTS.
@XQT QUAL*UCSTST.LOADSFSDB/COMP
The following example summarizes the retrieval program used in the example. The
program
1. Accepts an employee number as input
2. Accesses information about that individual’s sports activities from the SFS 2200
database
3. Displays the data
IDENTIFICATION DIVISION.
PROGRAM-ID. DSPSPORTS.
.
.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT file-name
ASSIGN TO A-SHARED-FILE ....
.
.
FILE SECTION.
FD file-name
file definition ....
WORKING-STORAGE SECTION.
01 EMPLOYEE-NUMBER ....
.
.
PROCEDURE DIVISION.
ACCEPT EMPLOYEE-NUMBER
OPEN FILE
READ FILE
DISPLAYs .....
CLOSE FILE
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. DSPSPORTS.
******************************************************************
******************************************************************
* *
* SIMPLE BATCH COBOL SFS PROGRAM - DISPLAYSPT *
* *
* reads the input data *
* opens the SPORTS SFS database file *
* retrieves the requested information from the database *
* displays this on the printer *
* closes the SPORTS SFS database file *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SPORTS
ASSIGN TO A-SHARED-FILE SFSSPORTS
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
RECORD KEY IS SPT-EMP-NUMBER
ALTERNATE RECORD KEY IS SPT-IND-LAST-NAME WITH DUPLICATES.
DATA DIVISION.
FILE SECTION.
FD SPORTS.
01 SPORTS-DATA.
05 SPT-EMP-NUMBER PIC X(5).
MAIN-PROGRAM-FLOW.
DISPLAY 'ENTER EMPLOYEE NUMBER' UPON PRINTER.
ACCEPT EMPLOYEE-NUMBER.
PERFORM OPEN-SFS-FILE-SPORTS.
PERFORM RETRIEVE-SPORTS-RECORD.
PERFORM DISPLAY-INDIVIDUAL-DATA.
IF SPT-ACTIVE-COUNT = 0
DISPLAY ' THIS EMPLOYEE DOES NOT PARTICIPATE IN ANY',
' COMPANY-SPONSORED SPORTS.' UPON PRINTER
ELSE DISPLAY ' COMPANY SPORTS PARTICIPATION: '
UPON PRINTER
PERFORM DISPLAY-SPORTS-DATA
VARYING I FROM 1 BY 1 UNTIL I > SPT-ACTIVE-COUNT
END-IF.
PERFORM CLOSE-SFS-FILE-SPORTS.
PERFORM TERMINATION-PARA.
************************************************************
* OPEN SFS DATABASE FILE - SPORTS
************************************************************
OPEN-SFS-FILE-SPORTS.
OPEN INPUT SPORTS.
************************************************************
* RETRIEVE THE INDIVIDUAL'S SPORTS RECORD FROM THE
* DATABASE
************************************************************
RETRIEVE-SPORTS-RECORD.
************************************************************
* DISPLAY THE INDIVIDUAL'S SPORTS DATA
************************************************************
DISPLAY-SPORTS-DATA.
DISPLAY ' ', SPT-NAME (I), ' ', SPT-LEAGUE-TYPE (I)
UPON PRINTER.
************************************************************
* CLOSE SFS DATABASE FILE - SPORTS
************************************************************
CLOSE-SFS-FILE-SPORTS.
CLOSE SPORTS.
************************************************************
* TERMINATE PROGRAM.
************************************************************
TERMINATION-PARA.
DISPLAY 'PROGRAM HAS COMPLETED' UPON PRINTER.
STOP RUN.
*
************************************************************
* DISPLAY OF BAD INPUT KEY
************************************************************
BAD-KEY.
DISPLAY INVALID-EMPLOYEE-NUMBER, EMPLOYEE-NUMBER
UPON PRINTER.
CLOSE SPORTS.
STOP RUN.
*******************
DATABASE VALIDATION
*******************
****
@ . ***
@ . ***
@ . *** STATIC LINK OF THE RETRIEVAL PROGRAM
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.DISPLAYSPT
SPORTS DATA
GOLF ADVANCED
VOLLEYBALL INTERMEDIATE
@ . ***
@ . ***
@ . ***EXAMPLE IS COMPLETE
This type of program requires use of BEGIN THREAD and END THREAD commands, no
matter which of the data models are used. The other UDS commands (for example,
the DMS 2200 IMPART and DEPART commands and the SFS 2200 OPEN and CLOSE
commands) must follow the BEGIN THREAD command and precede the END THREAD
command. Specifying the BEGIN THREAD and END THREAD commands is known as
using explicit thread control. Programs that access multiple database models require
explicit thread control.
The following subsections show an example of a program that uses the three
database models discussed earlier. This is possible because the databases all contain
data about a group of individuals, each one of whom is uniquely identified in each
database by the same employee number.
This example is a COBOL program that is a combination of the DMS 2200, RDMS 2200,
and SFS 2200 programs shown previously (see 3.2.1, 3.2.2, and 3.2.3). The program is
1. Compiled using UCS COBOL
2. Executed first using dynamic linking
3. Executed again using static linking (a ZOOM is produced)
IDENTIFICATION DIVISION.
PROGRAM-ID. DISPLAYALL.
.
.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT file-name
ASSIGN TO A-SHARED-FILE ....
.
.
DATA DIVISION.
SUBSCHEMA SECTION.
INVOKE .....
.
.
FILE SECTION.
FD file-name
file definition ....
WORKING-STORAGE SECTION.
table definitions ...
.
.
01 EMPLOYEE-NUMBER ....
.
PROCEDURE DIVISION.
ACCEPT EMPLOYEE-NUMBER
BEGIN THREAD
OPEN FILE
IMPART
OPEN DMS areas .... RETRIEVAL
FETCHs ....
DISPLAYs .....
READ FILE
DISPLAYs .....
DEFINE CURSOR
OPEN CURSOR
FETCHs ....
DISPLAYs .....
DEPART
CLOSE FILE
END THREAD
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. DISPLAYALL INITIAL.
******************************************************************
******************************************************************
* *
* SIMPLE BATCH COBOL DMS/SFS/RDMS PROGRAM - DISPLAYALL *
* *
* reads the input data *
* begins thread with UDS *
* opens the SPORTS SFS database file *
* imparts to the PERSONNEL database *
* retrieves the requested information from the DMS database *
* retrieves the requested information from the SFS database *
* retrieves the requested information from the RDMS database *
* displays the data on the printer *
* departs from the PERSONNEL database *
* closes the SPORTS SFS database file *
* ends thread with UDS *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SPORTS
ASSIGN TO A-SHARED-FILE SFSSPORTS
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
RECORD KEY IS SPT-EMP-NUMBER
ALTERNATE RECORD KEY IS SPT-IND-LAST-NAME WITH DUPLICATES.
DATA DIVISION.
SUBSCHEMA SECTION.
INVOKE SUBSCHEMA PERSONSUB IN FILE SCHFILE
OF SCHEMA PERSONNEL
COPYING RECORDS INTO WORKING
COPYING DATA-NAMES INTO WORKING
RUN-UNIT-ID DSPIND
DMCA IS WORKING
ERROR DMS-GENERAL-ERROR-PARA.
FILE SECTION.
FD SPORTS.
01 SPORTS-DATA.
05 SPT-EMP-NUMBER PIC X(5).
05 SPT-IND-LAST-NAME PIC X(20).
05 SPT-IND-FIRST-NAME PIC X(12).
05 SPT-ACTIVE-COUNT PIC 9.
05 SPT-SPORT OCCURS 3 TIMES.
10 SPT-NAME PIC X(10).
10 SPT-LEAGUE-TYPE PIC X(12).
10 SPT-DUES PIC 9(2).
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 INVALID-EMPLOYEE-NUMBER PIC X(40)
VALUE 'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER '.
************************************************************
* VARIABLE TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
01 EMPLOYEE-NUMBER.
05 EMP-PAGE PIC 9(3).
05 EMP-RECORD PIC 9(2).
************************************************************
* RDMS WORK AREA SIZE
************************************************************
01 WORK-AREA-SIZE PIC 1(36) USAGE BINARY-1 VALUE 2000.
************************************************************
* UDS THREAD STATUS FLAG
************************************************************
01 THREAD-FLAG PIC 9(1) VALUE 0.
************************************************************
* RELATIONAL DATABASE INFORMATION
************************************************************
01 CHILD-LAST-NAME PIC X(20).
01 CHILD-FIRST-NAME PIC X(12).
************************************************************
* ESQL STATEMENT STATUS
************************************************************
END-EXEC.
IF SQLSTATE NOT = "02000"
ADD 1 TO CHILD-COUNT
IF CHILD-COUNT = 1
DISPLAY ' EMPLOYEE''S CHILDREN: ' UPON PRINTER
END-IF
DISPLAY ' CHILD NAME: ' CHILD-FIRST-NAME, ' ',
CHILD-LAST-NAME UPON PRINTER
ELSE CONTINUE
END-IF.
************************************************************
* TERMINATE WITH THE DATABASE SYSTEMS
************************************************************
DMS-DEPART-PARA.
DEPART.
SFS-FILE-CLOSE-PARA.
CLOSE SPORTS.
UDS-END-THREAD-PARA.
END THREAD.
MOVE 0 TO THREAD-FLAG.
************************************************************
* TERMINATE PROGRAM
************************************************************
TERMINATION-PARA.
DISPLAY 'PROGRAM HAS COMPLETED' UPON PRINTER.
STOP RUN.
*
*
************************************************************
* DMS - CHECK FOR A '0013' ERROR,
* IF THIS ERROR OCCURRED THE
* INVALID-EMPLOYEE-NUMBER MESSAGE IS PRINTED
* ELSE THE ERROR MESSAGE IS RETURNED TO THE PRINTER
* FOR DEBUGGING.
************************************************************
DMS-GENERAL-ERROR-PARA.
IF ERROR-NUM = '0013'
DISPLAY INVALID-EMPLOYEE-NUMBER, EMPLOYEE-NUMBER
UPON PRINTER
ELSE DISPLAY 'DMS-GENERAL-ERROR-PARA.' UPON PRINTER
DISPLAY 'AREA = ' ERROR-AREA UPON PRINTER
DISPLAY 'RECORD = ' ERROR-RECORD UPON PRINTER
DISPLAY 'SET = ' ERROR-SET UPON PRINTER
DISPLAY 'ROLLBACK = ' RB-ERROR-CODE UPON PRINTER
DISPLAY 'FUNCTION = ' ERROR-FUNCTION UPON PRINTER
DISPLAY 'ERR NUM = ' ERROR-NUM UPON PRINTER
END-IF.
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION ******************
@ . ***
@ . ***
@ . *** UCOB COMPILE OF THE MULTIPLE DATA MODEL (DMS, SFS, ESQL) PROGRAM
@ . ***
@ . *** ASSIGN THE FILE CONTAINING SUBSCHEMA PROCESSING OUTPUT AND
@ . *** PUT A USE NAME ON IT.
@ . ***
@ASG,A UDS$$SVN*SCHFILE.
I:002333 ASG complete.
@USE SCHFILE.,UDS$$SVN*SCHFILE.
I:002333 USE complete.
@ . ***
@UCOB QUAL*UCSTST.DISPLAYALL,QUAL*UCSTST.DISPLAYALL/COMP,,, ;
NO-OPTIONS,COMPAT,APPLICATION/APPSVN
UCOB- 6R2 (931119) LSS- 8R2 (931209) 940128 15:30:53
SIZES: CODE(EM6): 1043 DATA: 2218
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 1 WARNING (LEVEL)
6 REMARKS(CLARIFICATION)
@ . ***
@ . ***
@ . *** EXECUTION OF THIS PROGRAM USING DYNAMIC LINKING
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@USE SFSSPORTS,LEISURE*SPORTS.
I:002333 USE complete.
@XQT QUAL*UCSTST.DISPLAYALL/COMP
INDIVIDUAL DATA
GOLF ADVANCED
VOLLEYBALL INTERMEDIATE
EMPLOYEE'S CHILDREN:
INDIVIDUAL DATA
GOLF ADVANCED
VOLLEYBALL INTERMEDIATE
EMPLOYEE'S CHILDREN:
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
DPS 2200 provides three methods for creating and editing forms (screens):
• The FORMGEN processor (FORMGN)
The FORMGEN processor provides an interactive method for defining forms. It
includes learning aids and extensive online help screens.
UCS COBOL, UCS FORTRAN, and UCS C support DPS 2200 in all programming
environments (batch, demand, TIP, and HVTIP).
DPS 2200 provides the same programming interface for both UCS and non-UCS
programs. The same copy of DPS 2200 software can simultaneously be used by UCS
and non-UCS programs.
Furthermore, UCS supports all methods for defining forms. The same DPS 2200 forms
from the same forms file can simultaneously be used by both UCS and non-UCS
programs.
Example 3–45 shows a listing of the form used in the examples. This listing was
produced by selecting the FORMGEN "print form" option.
---------------------------------------
Notice that when DPS 2200 generates a form for COBOL using SB4 or later software,
it now generates only one 01 level, instead of generating multiple 01 levels as in the
past. The following are now generated as 02 levels:
• The form header area (SCREEN-DSPLYIND-50-HEADER)
The form header area serves the following purposes:
− DPS 2200 uses it to check the validity of the calls to open, send, or read the
form.
− It contains fields that the program can test or set.
Notice that when DPS 2200 generates working storage for COBOL using SB5R2 or
later software, if UCS COBOL source is requested, the COBOL '85 and UCS COBOL
data definitions are used. This eliminates the need for the COMPAT keyword option
on the UCS COBOL compiler call for DPS 2200.
Example 3–46 shows an abbreviated listing of the Working Storage generated by the
FORMGEN processor. Noteworthy lines are bolded.
SCREEN-DSPLYIND-50 PROC.
/
*
* THIS PROCEDURE DEFINES THE FOLLOWING FORM:
* ******************************************
*
* NAME : DSPLYIND
* NUMBER : 50
*
* GENERATED BY : XXX
* GENERATED AT : 29 JUL 90 17:26:53
* LAST UPDATED AT : FORM NOT YET UPDATED
*
01 SCREEN-DSPLYIND-50.
*
02 SCREEN-DSPLYIND-50-HEADER.
*
05 FILLER PIC X(2) VALUE SPACES.
05 FILLER PIC 9(5) BINARY VALUE ZERO.
05 FILLER PIC X(4) VALUE SPACES.
05 S50-FILLER PIC X(8) VALUE '$DPS$SWS'.
05 S50-NUMBER PIC 9(4) VALUE 50.
05 S50-NAME PIC X(8) VALUE 'DSPLYIND'.
05 S50-CHECK-NUMBER PIC 9(10) BINARY VALUE 149411.
.
. (additional source statements)
*
02 SCREEN-DSPLYIND-50-FCA.
.
. (additional source statements)
.
*
05 S50-CHILDREN-ON-STAT PIC 9(2) BINARY VALUE 0.
05 S50-CHILDREN-ON-TYPE PIC 9(2) BINARY VALUE 4.
05 S50-CHILDREN-ON-YCO PIC 9(2) BINARY VALUE 20.
05 S50-CHILDREN-ON-XCO PIC 9(2) BINARY VALUE 4.
05 S50-CHILDREN-ON-CHAR PIC 9(5) BINARY VALUE ZERO.
05 S50-CHILDREN-ON-FID PIC 9(5) BINARY VALUE 17.
05 S50-CHILDREN-ON-VAL PIC X(1) VALUE 'V'.
05 S50-CHILDREN-ON-DYN PIC X(1) VALUE 'O'.
.
. (additional source statements)
.
*
02 SCREEN-DSPLYIND-50-DATA.
*
05 S50-EMP-NUMBER PIC X(5) VALUE SPACES.
05 FILLER PIC X(3).
*
05 S50-IND-FIRST-NAME PIC X(12) VALUE SPACES.
*
05 S50-IND-LAST-NAME PIC X(20) VALUE SPACES.
*
05 S50-DEPT-NAME PIC X(24) VALUE SPACES.
*
05 S50-DEPT-NO PIC X(4) VALUE SPACES.
*
05 S50-DEPT-DESCRIPTION PIC X(56) VALUE SPACES.
*
05 S50-JOB-TITLE PIC X(20) VALUE SPACES.
*
05 S50-JOB-SALARY PIC X(5) VALUE SPACES.
*
15 S50-CHILD-FIRST-NAME
PIC X(12).
*
15 S50-CHILD-LAST-NAME
PIC X(20).
END
#pragma eject
/*
THIS STRUCTURE DEFINES THE FOLLOWING FORM:
******************************************
NAME : DSPLYIND
NUMBER : 50
GENERATED BY : 2HOLLY
GENERATED AT : 21 MAY 91 21:54:34
LAST UPDATED AT : FORM NOT YET UPDATED
*/
struct tag_screen_dsplyind_50 {
struct {
union {
struct {
.
. (additional source statements)
.
unsigned char s50_children_on_stat ;
unsigned char s50_children_on_type ;
unsigned char s50_children_on_yco ;
unsigned char s50_children_on_xco ;
unsigned short s50_children_on_char ;
unsigned short s50_children_on_fid ;
unsigned char s50_children_on_val ;
unsigned char s50_children_on_dyn ;
unsigned char s50_children_on_back ;
unsigned char s50_children_on_fore ;
unsigned char s50_children_on_int ;
unsigned char s50_children_on_high ;
unsigned char s50_children_on_font ;
struct {
} s50_child_index_fca[3] ;
} screen_dsplyind_50_fca_def ;
struct {
} screen_dsplyind_50_fca_redef[23] ;
} screen_dsplyind_50_fca ;
struct {
struct {
} s50_sport_index_data[3] ;
struct {
} s50_child_index_data[3] ;
} screen_dsplyind_50_data ;
} screen_dsplyind_50 = {
0, 2, 3, 19, 0, 1, 'V',
'D', 'E', 'W', 'N', 'N', 'N', 'N',
0, 2, 3, 36, 0, 2, 'V',
'D', 'E', 'W', 'N', 'N', 'N', 'N',
0, 2, 3, 49, 0, 3, 'V',
'D', 'E', 'W', 'N', 'N', 'N', 'N',
0, 2, 7, 20, 0, 4, 'V',
'D', 'E', 'W', 'N', 'N', 'N', 'N',
0, 2, 7, 56, 0, 5, 'V',
'D', 'E', 'W', 'N', 'N', 'N', 'N',
0, 2, 8, 20, 0, 6, 'V',
'D', 'E', 'W', 'N', 'N', 'N', 'N',
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
} ;
UCS COBOL
CALL 'function-name' USING DPS-STATUS, arg2, arg3, ...
UCS FORTRAN
CALL function-name (DS$STA, arg2, arg3, ...)
UCS C
function_name (&dps_status, arg2,arg3...);
For more information on DPS 2200 coding, refer to the DPS 2200 Run-Time
Programming Reference Manual
DPS 2200 system procs are placed in the system proc file, SYS$LIB$*PROC$.
Therefore, no special @USE COB$PF or @USE FTN$PF statement is required when
compiling UCS COBOL or UCS FORTRAN programs using DPS 2200. The compiler
always searches the system proc file (if necessary). The UCS C procs are added to the
system proc file, SYS$LIB*PROC$ when a mode C installation is used for
SYS$LIB$*DPS.
The DPS 2200 form procs are supplied by COPY, INCLUDE, or #include statements in
the program. You can ensure that the form procs are located by using an @USE
COB$PF, @USE FTN$PF, or @USE C$PF statement. (For information on how the
compiler searches for COPY, INCLUDE, or #include procs, see Volume 2 of the
appropriate programming reference manual.)
The following figure illustrates compilation of a UCS COBOL, UCS FORTRAN, or UCS C
program using DPS 2200 functions.
Explanation
1. The Procedure Definition Processor (PDP) takes an element of symbolic procs
(defining DPS 2200 screens) and prepares it for use by the compiler. UCS C forms
do not require use of the PDP.
2. This statement compiles the UCS COBOL program that uses DPS 2200 functions.
In this example, the file containing the form procs is the same as the file
containing the program, so the procs are successfully located. SB5R2 or later
software that supports UCS is being used, therefore compatibility keyword
options are not required.
• EMCBEP$$DPS
This object module supplies the BDI entry into the DPS 2200 configuration common
bank.
The standard DPS 2200 installation file is SYS$LIB$*DPS. When you use the DPS 2200
software located in this file, the system default library search chains located in
SYS$*DATA$.SSDEF$ include a search of SYS$LIB$*DPS; therefore, references
requiring UCS/INTERFACE and EMCBEP$$DPS are resolved using this file.
You might want to link to alternate DPS 2200 software located in a different file (for
example, DPS 2200 software belonging to a particular application group). In this case,
you should do one of the following to ensure that these object modules are available:
• Build a user-defined library search chain that uses the desired version of DPS 2200
to resolve references
The system-defined library search chains built for application groups do not serve this
purpose: They do not contain a file for resolving the DPS 2200 references. See 4.5 for
instructions on how to build a new library search chain that includes a search of both
of the following:
− A file for resolving references to DPS 2200
− Any files already included in the application group library search chains
provided by Unisys
However, if DPS 2200 resides in a different file, you must do one of the following.
The following runstream shows the first method: use of a user-defined library search
chain, as described in 4.5. The library search chain is defined in
SYS$LIB$*APP$7DPS.SSDEF$.
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
@EOF
@UCOB QUAL*UCSTST.DPSDSPLY,.DPSDSPLY/COMP,,,NO-OPTIONS
@USE LINK$PF,SYS$LIB$*APP$7DPS.
@XQT QUAL*UCSTST.DPSDSPLY
However, if DPS 2200 resides in a different file, then you must do one of the following:
• Use INCLUDE commands to explicitly supply the object modules UCS/INTERFACE
and EMCBEP$$DPS (this method is used in the example that follows).
• Specify use of a user-defined library search chain that identifies the file where
UCS/INTERFACE and EMCBEP$$DPS reside, by using an @USE LINK$PF statement
(see 4.5).
The following example shows how to statically link a UCS program containing DPS
2200 functions, using the first method just described. This example produces a zero
overhead object module:
Explanation
1. This statement calls the Linking System LINK Processor. The ZOOM to be
produced is named QUAL*UCSTST.DPSDSPLY.
2. This command identifies the compiler-generated object module containing the
UCS DPS 2200 program.
3. This command identifies the two object modules required for using DPS 2200. In
the examples in this guide, the DPS 2200 file for application group 7 is APP7*DPS.
Therefore, in the examples in this guide, this command appears as
INCLUDE APP7*DPS.UCS/INTERFACE,.EMCBEP$$DPS
4. This command resolves external references, including those to the UCS Runtime
System library.
5. This command merges banks and produces a ZOOM.
6. This command deletes all definitions except the program’s starting address,
START$. This decreases the size of the ZOOM.
7. This statement ends static linking.
The following figure summarizes the simple UCS DPS 2200 program used in the
example. The program
1. Reads an individual employee number.
2. Retrieves the form to be displayed from the form file.
3. Moves the employee number to the form.
4. Displays the form on the terminal screen.
DPSDSPLY
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSDSPLY.
.
.
DATA DIVISION.
WORKING-STORAGE SECTION.
form definition
.
.
.
01 EMPLOYEE-NUMBER ....
PROCEDURE DIVISION.
CALL 'D$INIT1' ...
CALL 'D$GETIN' ...
CALL 'D$GETFL' ...
MOVE GET-FIELD-TEXT TO EMPLOYEE-NUMBER
CALL 'D$OPEN' ...
MOVE EMPLOYEE-NUMBER TO form definition
CALL 'D$SEND' ...
CALL 'D$TERM' ...
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSDSPLY.
******************************************************************
******************************************************************
* *
* SIMPLE DPS COBOL PROGRAM - DPSDSPLY *
* *
* initializes with DPS *
* reads the input employee number *
* opens the DPS form *
* moves the employee number to the form *
* displays the DPS form *
* terminates with DPS *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 ERR-MISSING-INPUT PIC X(78)
VALUE 'NO EMPLOYEE NUMBER WAS SPECIFIED.'.
01 INVALID-EMPLOYEE-NUMBER.
02 TEXT-1 PIC X(40)
VALUE 'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER '.
02 ERR-EMPLOYEE-NO PIC X(10).
************************************************************
* VARIABLE TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
01 EMPLOYEE-NUMBER PIC X(5).
************************************************************
* DPS PROCEDURES
************************************************************
COPY DPSSTATUSCOB.
COPY INFO-BUFFER.
COPY GETFIELD.
COPY SENDERROR.
COPY SCREEN-DSPLYIND-50.
PROCEDURE DIVISION.
************************************************************
* DEMAND INITIALIZATION WITH DPS
************************************************************
DPS-INITIALIZATION.
CALL 'D$INIT1' USING DPS-STATUS, INFO-BUFFER.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
************************************************************
* FREE FORMAT READ OF THE EMPLOYEE NUMBER
* RETURNS THE EMPLOYEE NUMBER
* GETFIELD-TYPE = 1 - TESTS FOR NO INPUT
* GETFIELD-LENGTH = 5 - TESTS THE FIELD LENGTH
************************************************************
DPS-GET-INPUT.
CALL 'D$GETIN' USING DPS-STATUS.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
DPS-FREE-FORMAT-READ.
CALL 'D$GETFL' USING DPS-STATUS, GET-FIELD.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
MOVE GETFIELD-TEXT TO EMPLOYEE-NUMBER.
IF GETFIELD-TYPE = 1
MOVE ERR-MISSING-INPUT TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM TERMINATION-PARA
ELSE IF GETFIELD-LENGTH NOT EQUAL 5
MOVE GETFIELD-TEXT TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM TERMINATION-PARA
ELSE CONTINUE
END-IF
END-IF.
************************************************************
* OPENS THE SCREEN TO BE SENT TO THE USER
************************************************************
DPS-OPEN-OUTPUT-SCREEN.
CALL 'D$OPEN' USING DPS-STATUS, SCREEN-DSPLYIND-50.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
************************************************************
* TRANSFERS THE EMPLOYEE NUMBER TO THE FORM DEFINITION
************************************************************
MOVE-EMPLOYEE-NUMBER.
MOVE EMPLOYEE-NUMBER TO S50-EMP-NUMBER.
************************************************************
* SENDS THE SCREEN TO THE USER
************************************************************
DPS-SEND-OUTPUT-SCREEN.
CALL 'D$SEND' USING DPS-STATUS, SCREEN-DSPLYIND-50.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
************************************************************
* TERMINATION OF THE PROGRAM
************************************************************
TERMINATION-PARA.
CALL 'D$TERM' USING DPS-STATUS.
STOP RUN.
*
*
************************************************************
* RETURNS AN ERROR MESSAGE TO THE USER IF THE INPUT
* MESSAGE WAS IN ERROR AND TERMINATES WITH THE
* TRANSACTION PROCESSING SYSTEM
************************************************************
INVALID-INPUT-PARA.
CALL 'D$SENDERR' USING DPS-STATUS, ERROR-MESSAGE,
ERROR-COORDINATES.
*
*
************************************************************
* ONLY EXECUTED WHEN A DPS ERROR OCCURS
* THE OUTPUT OF D$DUMP SHOULD BE INCLUDED WITH UCF
* DOCUMENTATION IF THIS PARAGRAPH WAS EXECUTED DUE TO
* TO A DPS INTERNAL ERROR.
************************************************************
DPS-GENERAL-ERROR-PARA.
CALL 'D$DUMP'.
CALL 'D$ERRMSG' USING DPS-STATUS.
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
@EOF
@ . ***
@ . ***
@ . *** UCOB COMPILE OF A SIMPLE DPS COBOL PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
@UCOB QUAL*UCSTST.DPSDSPLY,.DPSDSPLY/COMP,,,NO-OPTIONS
@ . ***
@ . ***
@ . *** SETUP IS COMPLETE
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
PDP 13R1J (931108 0108:39) 1994 Feb 03 Thu 2141:41
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 708 Entry Points: 1 Time: 2.615 Storage:7070/0/7070/0106210
@ . ***
@ . ***
@ . *** UCOB COMPILE OF A SIMPLE DPS COBOL PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
I:002333 USE complete.
@UCOB QUAL*UCSTST.DPSDSPLY,.DPSDSPLY/COMP,,,NO-OPTIONS
UCOB- 6R2 (931119) LSS- 8R2 (931209) 940203 21:41:44
SIZES: CODE(EM6): 218 DATA: 428
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** SETUP IS COMPLETE
@use link$pf,sys$lib$*ap$7dps.
I:002333 USE complete.
@xqt qual*ucstst.dpsdsply/comp
10211
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
@EOF
@ . ***
@ . ***
@ . *** UCOB COMPILE OF A SIMPLE DPS COBOL PROGRAM
@ . ***
@USE COB$PF, APP7*DPS.
@UCOB QUAL*UCSTST.DPSDSPLY,.DPSDSPLY/COMP,,,NO-OPTIONS
@ . ***
@ . ***
@ . *** STATIC LINK OF THIS PROGRAM TO PRODUCE A ZOOM
@ . ***
@LINK ,QUAL*UCSTST.DPSDSPLY
INCLUDE QUAL*UCSTST.DPSDSPLY/COMP
INCLUDE APP7*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** SETUP IS COMPLETE
Example 3–51. Source Listing of Runstream to Compile and Static Link— COBOL
DPS Program
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
PDP 13R1J (931108 0108:39) 1994 Feb 03 Thu 2152:04
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 708 Entry Points: 1 Time: 2.583 Storage:7070/0/7070/0106210
@ . ***
@ . ***
@ . *** UCOB COMPILE OF A SIMPLE DPS COBOL PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
I:002333 USE complete.
@UCOB QUAL*UCSTST.DPSDSPLY,.DPSDSPLY/COMP,,,NO-OPTIONS
UCOB- 6R2 (931119) LSS- 8R2 (931209) 940203 21:52:07
SIZES: CODE(EM6): 218 DATA: 428
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** STATIC LINK OF THIS PROGRAM TO PRODUCE A ZOOM
@ . ***
@LINK ,QUAL*UCSTST.DPSDSPLY
LINK 5R2 (940112 1230:40) 1994 Feb 03 Thu 2152:25
END LINK , LINES : 5 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** SETUP IS COMPLETE
@xqt qual*ucstst.dpsdsply
10211
The following example summarizes the simple UCS DPS 2200 program used in the
example. The program
• Reads an individual’s employee number.
• Retrieves the form to be displayed.
• Moves the employee number to the form.
• Displays the form on the terminal screen.
CDPSDSPLY
.
.
.
#include "form definition"
.
.
.
char employee_number[5];
.
.
.
d-init1... ;
d-getin... ;
d-getfl... ;
d-open... ;
strncpy getfield_text to form definition
d-send... ;
d-term... ;
return(0);
/* ***************************************************************
* *
* SIMPLE DPS C PROGRAM - CDPSDSPLY *
* *
* initializes with DPS *
* reads the input employee number *
* opens the DPS form *
* moves the employee number to the form *
* displays the DPS form *
* terminates with DPS *
* *
*************************************************************** */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <dpsfunc-def.h>
#include <dps-stat-def.h>
#include <info-buf-def.h>
#include <get-fld-def.h>
#include <senderr-def.h>
#include "screen-50.h"
/* ************************************************************
* VARIABLE TO HOLD EMPLOYEE NUMBER INPUT *
************************************************************ */
char employee_number[5];
char err_employee_number[41];
int main(void)
{
/* ************************************************************
* DEMAND INITIALIZATION WITH DPS *
************************************************************ */
d_init1(&dps_status, &info_buffer);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
/* ************************************************************
* FREE FORMAT READ OF THE EMPLOYEE NUMBER *
* RETURNS THE EMPLOYEE NUMBER *
* GETFIELD-TYPE = 1 - TESTS FOR NO INPUT *
* GETFIELD-LENGTH = 5 - TESTS THE FIELD LENGTH *
************************************************************ */
d_getin(&dps_status);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
d_getfl(&dps_status, &get_field);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
if(get_field.u_1.s_1.getfield_type == 1)
{ strcpy(error_message.error_text,
"NO EMPLOYEE NUMBER WAS SPECIFIED");
d_senderr(&dps_status, &error_message, &error_coordinates);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
d_term(&dps_status);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
return(0);
}
else { if(get_field.u_1.s_1.getfield_length != 5)
{ strncpy(err_employee_number,
get_field.getfield_text, sizeof(err_employee_number));
err_employee_number[40] = '\0';
sprintf(error_message.error_text,
"NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER %s",
err_employee_number);
d_senderr(&dps_status, &error_message, &error_coordinates);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
d_term(&dps_status);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
return(0);
}
}
/* ************************************************************
* OPENS THE SCREEN TO BE SENT TO THE USER *
************************************************************ */
d_open(&dps_status, &screen_dsplyind_50);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
/* ************************************************************
* TRANSFERS THE EMPLOYEE NUMBER TO THE FORM DEFINITION *
************************************************************ */
strncpy(screen_dsplyind_50.screen_dsplyind_50_data.s50_emp_number,
get_field.getfield_text, sizeof(employee_number));
/* ************************************************************
* SENDS THE SCREEN TO THE USER *
************************************************************ */
d_send(&dps_status, &screen_dsplyind_50);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
/* ************************************************************
* TERMINATION OF THE PROGRAM *
************************************************************ */
d_term(&dps_status);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
return(0);
}
/* ************************************************************
* ONLY EXECUTED WHEN A DPS ERROR OCCURS *
* THE OUTPUT OF D$DUMP SHOULD BE INCLUDED WITH UCF *
* DOCUMENTATION IF THIS PARAGRAPH WAS EXECUTED DUE TO *
* TO A DPS INTERNAL ERROR. *
************************************************************ */
void error_exit(void)
{
d_dump();
d_errmsg(&dps_status);
d_term(&dps_status);
exit(1);
}
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** UC COMPILE OF A SIMPLE DPS C PROGRAM
@ . ***
@USE C$PF,APP7*DPS.
@UC QUAL*UCSTST.CDPSDSPLY,QUAL*UCSTST.CDPSDSPLY/COMP,,,NO-OPTIONS
@ . ***
@ . ***
@ . *** STATIC LINK OF THIS PROGRAM TO PRODUCE A ZOOM
@ . ***
@LINK ,QUAL*UCSTST.CDPSDSPLY
INCLUDE QUAL*UCSTST.CDPSDSPLY/COMP
INCLUDE APP7*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** SETUP IS COMPLETE
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** UC COMPILE OF A SIMPLE DPS C PROGRAM
@ . ***
@USE C$PF,APP7*DPS.
I:002333 USE complete.
@UC QUAL*UCSTST.CDPSDSPLY,QUAL*UCSTST.CDPSDSPLY/COMP,,,NO-OPTIONS
UC- 4R2(931119) LSS- 8R2(931209) 940209 10:32:05
SIZES: CODE(EM6): 377 DATA: 387
END UC- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** STATIC LINK OF THIS PROGRAM TO PRODUCE A ZOOM
@ . ***
@LINK ,QUAL*UCSTST.CDPSDSPLY
LINK 5R2 (940112 1230:40) 1994 Feb 09 Wed 1032:36
END LINK , LINES : 5 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** SETUP IS COMPLETE
@xqt qual*ucstst.cdpsdsply
10211
When using DPS 2200 with any of the UDS database interfaces, it is recommended
that you code the DPS 2200 initialization command (D$INIT, D$INIT1) before coding the
UDS initialization commands (BEGIN THREAD, IMPART). At the end of the program,
termination with the UDS database interfaces (DEPART, END THREAD) must precede
termination with DPS 2200 (D$TERM, D$CLOSE).
This is the way code must be written for transactions; therefore, it is a good idea to
code using this method for demand mode DPS 2200 programs.
The following subsections show an example of a DPS 2200 program that accesses all
three UDS database models:
• DMS 2200
• RDMS 2200
• SFS 2200
To produce this example, DPS 2200 code has been added to the multiple-database-
model program found in 3.2.4. For this example, static linking is used to produce a
zero overhead object module.
The following figure summarizes the UCS program used in the example. The program
1. Reads an individual’s employee number
2. Retrieves the form to be displayed from the form file
3. Moves the employee number to the form
4. Accesses information about the individual from the DMS 2200, RDMS 2200, and
SFS 2200 databases
5. Moves this information to the form
6. Displays the form on the terminal screen
DPSDSPLYALL
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSDSPLYALL INITIAL.
.
.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT file-name
ASSIGN TO A-SHARED-FILE ....
.
.
DATA DIVISION.
SUBSCHEMA SECTION.
INVOKE .....
.
.
FILE SECTION.
FD file-name
file definition ....
WORKING-STORAGE SECTION.
table definitions ...
form definition
.
.
01 EMPLOYEE-NUMBER ....
.
PROCEDURE DIVISION.
CALL 'D$INIT1' ...
CALL 'D$GETIN' ...
CALL 'D$GETFL' ...
MOVE GET-FIELD-TEXT TO EMPLOYEE-NUMBER
CALL 'D$OPEN' ...
MOVE EMPLOYEE-NUMBER TO form
BEGIN THREAD
OPEN FILE
IMPART
OPEN DMS areas .... RETRIEVAL
FETCHs ....
MOVE DMS data TO form
READ FILE
MOVE SFS data TO form
DEFINE CURSOR
OPEN CURSOR
FETCHs ....
MOVE RDMS data TO form
DEPART
CLOSE FILE
END THREAD
CALL 'D$SEND' ...
CALL 'D$TERM' ...
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSDSPLYALL INITIAL.
******************************************************************
******************************************************************
* *
* SIMPLE BATCH COBOL DPS/DMS/SFS/RDMS PROGRAM - DPSDSPLYALL *
* *
* initializes with DPS *
* reads the input data *
* opens the DPS form *
* moves the employee number to the form *
* begins thread with UDS *
* opens the SPORTS SFS database file *
* imparts to the PERSONNEL database *
* retrieves the requested information from the DMS database *
* moves the DMS information to the form *
* retrieves the requested information from the SFS database *
* moves the SFS information to the form *
* retrieves the requested information from the RDMS database *
* moves the RDMS information to the form *
* departs from the PERSONNEL database *
* closes the SPORTS SFS database file *
* ends thread with UDS *
* displays the DPS form *
* terminates with DPS *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SPORTS
ASSIGN TO A-SHARED-FILE SFSSPORTS
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
FILE SECTION.
FD SPORTS.
01 SPORTS-DATA.
05 SPT-EMP-NUMBER PIC X(5).
05 SPT-IND-LAST-NAME PIC X(20).
05 SPT-IND-FIRST-NAME PIC X(12).
05 SPT-ACTIVE-COUNT PIC 9.
05 SPT-SPORT OCCURS 3 TIMES.
10 SPT-NAME PIC X(10).
10 SPT-LEAGUE-TYPE PIC X(12).
10 SPT-DUES PIC 9(2).
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 ERR-MISSING-INPUT PIC X(78)
VALUE 'NO EMPLOYEE NUMBER WAS SPECIFIED.'.
01 INVALID-EMPLOYEE-NUMBER.
02 TEXT-1 PIC X(40)
VALUE 'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER '.
02 ERR-EMPLOYEE-NO PIC X(10).
************************************************************
* NO SPORTS MESSAGE
************************************************************
01 NO-SPORTS PIC X(78)
VALUE '*** NO COMPANY-SPONSORED SPORTS PARTICIPATION
************************************************************
* DPS PROCEDURES
************************************************************
COPY DPSSTATUSCOB.
COPY INFO-BUFFER.
COPY GETFIELD.
COPY SENDERROR.
COPY SCREEN-DSPLYIND-50.
************************************************************
************************************************************
* INDEX VARIABLE
************************************************************
01 I PIC 9(1).
*
PROCEDURE DIVISION.
************************************************************
* DEMAND INITIALIZATION WITH DPS
************************************************************
DPS-INITIALIZATION.
CALL 'D$INIT1' USING DPS-STATUS, INFO-BUFFER.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
************************************************************
* FREE FORMAT READ OF THE EMPLOYEE NUMBER
* RETURNS THE EMPLOYEE NUMBER
* GETFIELD-TYPE = 1 - TESTS FOR NO INPUT
* GETFIELD-LENGTH = 5 - TESTS THE FIELD LENGTH
************************************************************
DPS-GET-INPUT.
CALL 'D$GETIN' USING DPS-STATUS.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
DPS-FREE-FORMAT-READ.
CALL 'D$GETFL' USING DPS-STATUS, GET-FIELD.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
MOVE GETFIELD-TEXT TO EMPLOYEE-NUMBER.
IF GETFIELD-TYPE = 1
MOVE ERR-MISSING-INPUT TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
ELSE IF GETFIELD-LENGTH NOT EQUAL 5
MOVE GETFIELD-TEXT TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
ELSE CONTINUE
END-IF
END-IF.
************************************************************
* EMPLOYEE NUMBER VALIDATION
************************************************************
VALID-EMPLOYEE-NUMBER.
IF EMP-PAGE <= 99 OR EMP-RECORD <= 0
MOVE GETFIELD-TEXT TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
END-IF.
************************************************************
* OPENS THE SCREEN TO BE SENT TO THE USER
************************************************************
DPS-OPEN-OUTPUT-SCREEN.
CALL 'D$OPEN' USING DPS-STATUS, SCREEN-DSPLYIND-50.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
************************************************************
* TRANSFERS THE EMPLOYEE NUMBER TO THE FORM DEFINITION
************************************************************
MOVE-EMPLOYEE-NUMBER.
MOVE EMPLOYEE-NUMBER TO S50-EMP-NUMBER.
************************************************************
* RDMS - SETS UP RDMS WORK AREA
* SETS UP RDMS GENERAL ERROR HANDLING
************************************************************
RDMS-SETUP.
CALL 'RSA$INIT' USING WORK-AREA-SIZE.
EXEC SQL
WHENEVER SQLERROR GO TO RDMS-ERROR-PARA
END-EXEC.
************************************************************
* INITIALIZE WITH THE DATABASE SYSTEMS
************************************************************
CONNECT-TO-DATABASES.
BEGIN THREAD DSPDATA FOR APPSVN RETRIEVE.
MOVE 1 TO THREAD-FLAG.
OPEN INPUT SPORTS.
IMPART.
OPEN ALL USAGE-MODE IS RETRIEVAL.
************************************************************
* DMS - RETRIEVE THE INDIVIDUAL INFORMATION
* MOVE THE INDIVIDUAL INFORMATION TO THE DPS FORM
************************************************************
DMS-RETRIEVE-INDIVIDUAL-DATA.
STOP RUN.
*
*
************************************************************
* DMS - CHECK FOR A '0013' ERROR,
* IF THIS ERROR OCCURRED THE
* INVALID-EMPLOYEE-NUMBER MESSAGE IS PRINTED
* ELSE THE ERROR MESSAGE IS RETURNED TO THE PRINTER
* FOR DEBUGGING.
************************************************************
DMS-GENERAL-ERROR-PARA.
IF ERROR-NUM = '0013'
MOVE EMPLOYEE-NUMBER TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
ELSE DISPLAY 'DMS-GENERAL-ERROR-PARA.' UPON PRINTER
DISPLAY 'AREA = ' ERROR-AREA UPON PRINTER
DISPLAY 'RECORD = ' ERROR-RECORD UPON PRINTER
DISPLAY 'SET = ' ERROR-SET UPON PRINTER
DISPLAY 'ROLLBACK = ' RB-ERROR-CODE UPON PRINTER
DISPLAY 'FUNCTION = ' ERROR-FUNCTION UPON PRINTER
DISPLAY 'ERR NUM = ' ERROR-NUM UPON PRINTER
END-IF.
IF IMPART-DEPART EQUAL TO 1 PERFORM DMS-DEPART-PARA.
PERFORM SFS-FILE-CLOSE-PARA.
PERFORM UDS-END-THREAD-PARA.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
*
************************************************************
* SFS - DISPLAY OF BAD INPUT KEY
************************************************************
BAD-KEY.
MOVE EMP-NUMBER TO ERR-EMPLOYEE-NO.
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE.
PERFORM INVALID-INPUT-PARA.
PERFORM DMS-DEPART-PARA.
PERFORM SFS-FILE-CLOSE-PARA.
PERFORM UDS-END-THREAD-PARA.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
*
************************************************************
* RDMS - RETURN AN ERROR MESSAGE TO THE PRINTER FILE IF A
* DATABASE ERROR OCCURS
************************************************************
RDMS-ERROR-PARA.
EXEC SQL WHENEVER SQLERROR CONTINUE END-EXEC.
@ . ***
@ . ***
@ . *** STATIC LINK OF THIS PROGRAM TO PRODUCE A ZOOM
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
@LINK ,QUAL*UCSTST.DPSDSPLYALL
INCLUDE QUAL*UCSTST.DPSDSPLYALL/COMP
INCLUDE UDS$$SVN*SCHFILE.S$WORK/PERSONSUB
INCLUDE APP7*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION *********************
@ . ***
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
PDP 13R1J (931108 0108:39) 1994 Feb 03 Thu 2209:23
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 708 Entry Points: 1 Time: 2.743 Storage: 7070/0/7070/0106210
@ . ***
@ . ***
@ . *** UCOB COMPILE OF THE MULTIPLE DATA MODEL (DMS, SFS, ESQL) PROGRAM
@ . *** THAT USES DPS FOR TERMINAL OUTPUT
@ . ***
@ . *** ASSIGN THE FILE CONTAINING SUBSCHEMA PROCESSING OUTPUT AND
@ . *** PUT A USE NAME ON IT.
@ . ***
@ASG,A UDS$$SVN*SCHFILE.
W:120133 file is already assigned.
@USE SCHFILE.,UDS$$SVN*SCHFILE.
I:002333 USE complete.
@USE COB$PF,APP7*DPS.
I:002333 USE complete.
@ . ***
@UCOB QUAL*UCSTST.DPSDSPLYALL,QUAL*UCSTST.DPSDSPLYALL/COMP,,, ;
NO-OPTIONS,COMPAT,APPLICATION/APPSVN
UCOB- 6R2 (931119) LSS- 8R2 (931209) 940203 22:09:25
SIZES: CODE(EM6): 1906 DATA: 1626
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 6 REMARKS(CLARIFICATION)
@ . ***
@ . ***
@ . *** STATIC LINK OF THIS PROGRAM TO PRODUCE A ZOOM
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.DPSDSPLYALL
LINK 5R2 (940112 1230:40) 1994 Feb 03 Thu 2209:52
END LINK , LINES : 6 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** EXAMPLE IS COMPLETE
@use sfssports,leisure*sports.
I:0023333 USE complete.
@xqt qual*ucstst.dpsdsplyall
10211
In addition to creating and storing databases definitions, you can use UREP directly
from your UCS COBOL, UCS FORTRAN, and UCS C programs to perform the following
functions:
• Insert code into your UCS source program with the INVOKE or #pragma command.
These INVOKE commands cause UREP to generate file descriptions, data
declarations, RDMS table and view data declarations, and DPS 2200 form
definitions from definitions that you previously created and stored in UREP. UREP
places the generated code in the source program at the point of the INVOKE or
#pragma command.
In Table 3–5, all of the structures were available in the SB4 release except INVOKE
SOURCE, which was available in SB5.
Unisys Repository
Structure UCS C UCS FORTRAN
For more information on using UREP with UCS COBOL programs, refer to the
appropriate UCS programming reference manual, Volume 2.
− UCS FORTRAN
CALL RSA$INIT [(work-area-size)]
− UCS C
rsa_init ([work-area-size]);
− UCS COBOL
PIC 1(36) USAGE BINARY-1
− UCS FORTRAN
INTEGER
− UCS C
int
To determine the size of the work area, code a DEBUG DUMP SIZES command
immediately after the program's END THREAD command.
The following represents the syntax for an embedded SQL DEBUG DUMP SIZES
command in UCS COBOL:
The following represents the syntax for a UCS COBOL interpreter SQL DEBUG
DUMP SIZES command:
Execute the program and check the output of the DEBUG DUMP SIZES. It will
have the following format:
RSA Dbank Size is 13970 words.
Use the value listed previously in the call to RSA$INIT. Also remember to remove
the DEBUG DUMP SIZES command from the program. Note that this process also
is valid for TIP and HVTIP programs.
For more information on how to code UCS programs for performance, refer to the
programming reference manual for the appropriate UCS language (for UCS COBOL,
FORTRAN, and C, this information is in Volume 2.
For more information on these keyword options and other ways to compile UCS
programs for performance, refer to the programming reference manual for the
appropriate UCS language (for UCS COBOL, FORTRAN, and C).
• Do not include PADS code in production programs. You can prevent inclusion of
PADS code by using a static linking RESOLVE command that lists the file
SYS$LIB$*EMOMRTS in the USING clause, before it lists LIBCODENAME (LCN). By
specifying this file in the USING clause, C$NPADS is included in the program
instead of PADS. C$NPADS is a PADS stub.
The following shows the required RESOLVE command:
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS., LIBCODENAME
Note that interactive PADS debugging cannot be done on a program linked in this
manner. PADS postmortem debugging is still available using a DIAG$ file.
Programs that use DPS may not run with this max size if it calls the basic mode MCB.
So, for DPS you might want to keep your URTS$TABLES upper limit to 0577777 or
less. This would be a size of 0577777 - 060000 + 1, or 0520000 words. (Check the
DPS documentation to see if this is necessary.) To get your URTS$TABLES at an initial
limit of 0577777, put the following static linker statement in your static link source,
after all INCLUDE statements and RESOLVE statements:
SET SIZE = 0520000 FOR URTS$TABLES
(Do not set the size of URTS$TABLES in HVTIP links, as HVTIP memory management
is done differently.)
Once the URTS$TABLES bank is expanded to its maximum limit and all space within it
has been allocated, a new bank will be allocated if more space is needed. Note that
there may be several URTS space allocations done for something such as opening a
file. If one or more buffers is obtained for opening a given file, and then a new
URTS$TABLES bank is acquired and another buffer needs to be allocated to finish
opening the file, an error will occur. This is because all the buffers needed for a
specific use such as handling of a given file must be in the same bank.
In order to keep this error from happening you must use a keyword option on the
compilation of the main program for your executable program. The keyword is
URTS$TABLES, and you give it a size which is a reserve for “same-bank” space
allocations within the URTS$TABLES bank. This reserve is used when a
URTS$TABLES allocation is done and must be in the same bank as another allocation
and the “normal” space in the bank is used up. The initial reserve is treated as an
octal number, so do not use the digits 8 or 9 in the reserve value. Here is a main
program compilation with the recommended URTS$TABLES “same-bank” reserve of
050000 words:
@UCOB COBMAIN2,,,,URTS$TABLES/50000 . Reserve 050000 words
You probably should not use this option if your program is not running out of
URTS$TABLES space since putting in a “same-bank” reserve virtually guarantees that
your program will acquire another URTS$TABLES bank at runtime. You also may not
want to use this mechanism if your program uses a product that requires that
URTS$TABLES not grow past some limit such as 0577777, since the URTS runtime will
expand URTS$TABLES to 0777777 and use that space before it will acquire another
bank.
If the heap data bank space is tight, and you wish to minimize its size, you should
consider the following:
• Closing PCIOS files when you are finished using them. This releases the space
that they were using.
• Using extended mode SORT (EM SORT). This moves the major portion of space
used by SORT processing to a separate bank so that it is no longer located in the
heap data bank. The EM SORT is also much faster than the older basic mode
SORT.
• Use the "CALL RSA$INIT" routine to initially allocate all RDMS space so that it is
allocated as contiguous space.
You can do this most easily by setting the size of URTS$TABLES to a selected
maximum size according to the previous general “URTS$TABLES Operation”
discussion. However, the following older more difficult method is still valid, though
not recommended due to its complexity.
The following example shows the HELPER output for the DPS 2200 software in file
APP7*DPS that was used in the examples in this section. Noteworthy lines are
bolded.
@APP7*DPS.HELPER
HELPER 5R1 DPS5R1 DPS Helper Utility Processor 1990 Aug 02 Thu 1109:54
RES 2102,478400,28,$$TERMFILE$$,EXECFILE,NREC,AUDIT=0
THE SIZE OF THE TERMINAL FILE MUST BE 7475 TRACKS
RES 2105,200,112,$$PASSFILE$$,EXECFILE,NREC,AUDIT=0
THE SIZE OF THE PASSWORD FILE MUST BE 13 TRACKS
RES 2103,5001,2016,$$PAGEFILE$$,EXECFILE,NREC,AUDIT=0
THE SIZE OF THE PAGING FILE MUST BE 5627 TRACKS
RES 2108,126000,28,ALT$SCRNFILE,ALT$SCRNFILE,NREC,AUDIT=0
THE SIZE OF THIS FORM LIBRARY MUST BE 1969 TRACKS
RES 2109,126000,28,FORMS,FORMS,NREC,AUDIT=0
THE SIZE OF THIS FORM LIBRARY MUST BE 1969 TRACKS
2. Below this are four lines of output. The third and fourth lines apply to static
linking:
• If D$DEF routines are used in the program, refer to the fourth line.
• Otherwise, refer to the third line.
3. Take the size shown on the appropriate line and use it in a static linking SET SIZE
command, as follows:
SET SIZE = SIZE + dps-helper-size FOR URTS$TABLES
For this example, assuming the program does not use D$DEF routines, the following
command would be used:
SET SIZE = SIZE + 10048 FOR URTS$TABLES
This section discusses topics relating to the use of application groups with the
Universal Compiling System.
Such application groups can share the services of some system software products,
such as the following:
• The Executive system
• Compilers
• The Linking System
• Interactive Processing Facility (IPF 1100)
Access to application group files is controlled within the application group. This allows
you to isolate sensitive data by placing it in its own application group.
For more information on application groups, see the Universal Database Control
Configuration Guide.
• SEARCH command
Specifies the files or other library search chains represented by the library search
chain name in the preceding DEFINE LSC command. These are the files and other
library search chains searched for a unit of software when that library search chain
is used.
4. Together, the library search chains in the file SYS$LIB$*APP$n. and the element
SYS$*DATA$.SSDEF$ ensure the program or transaction is linked to the system
software in the correct application group.
SYS$LIB$*APP$1.
LSCs for
Linking to
Application
Group 1
SYS$*DATA$.SSDEF$
SYS$LIB$*APP$2.
LSCs That Program or
LSCs for Define Which Transaction
Program or @USE LINK$PF., Linking to Products Are Linked to a
Transaction SYS$LIB$*APP$n. Application in Which Particular
Group 2 Application Application
Groups Group
SYS$LIB$*APP$64.
LSCs for
Linking to
Application
Group 64
Note: DPS 2200 is the only application-group-dependent product that does not use
this process. Therefore, you must handle library search chains for DPS 2200
yourself. Refer to 4.5 for information on this process.
The following subsections briefly describe how to use the appropriate library search
chain to link programs and transactions to a particular application group so the
interface software for MCB, DPS 2200, and the UDS suite of software are all from the
same application group.
For optional information on how the system sets up these library search chains for
your use, see 4.6.
Note that all examples in this manual that use application-group-dependent software
products use the library search chains described in this section.
Before executing a UDS program that uses dynamic linking, you must specify use of a
library search chain that accesses the desired application group. This ensures that the
system uses the UDS interface software appropriate for that application group.
Specify use of the library search chain using the following statement:
@USE LINK$PF,SYS$LIB$*APP$n.
where qual*file.om is the user program to be dynamically linked and executed, using
the software in application group 7. Note that if any of the programs use embedded
or module SQL, those programs must have been compiled for this application group
with an APPLICATION/appname keyword option. ESQL programs are targeted for a
specific application group at compilation time. See the discussion on "Portable
Embedded and Module Language SQL Programs" in 3.2.2.10.
Before statically linking a program or transaction that uses UDS, MCB, or both, you
must specify use of a library search chain that accesses the desired application group.
This ensures that the system uses the UDS and/or MCB interface software
appropriate for that application group. Specify use of the library search chain using
the following statement:
@USE LINK$PF,SYS$LIB$*APP$n.
As an example, a static link to application group 7 would use the following runstream:
@USE LINK$PF,SYS$LIB$*APP$7.
@LINK,S ,qual*file.zoom
.
. (@LINK commands)
.
@EOF
where qual*file.zoom is the user program to be produced by static linking, using the
software in application group 7. Again, note that if any of the programs use
embedded or module SQL, those programs must have been compiled for this
application group with an APPLICATION/appname keyword option.
Example
As an example, assume the following:
• A site wishes to include DPS 2200 in its library search chain for application group
7.
• This copy of DPS 2200 resides in the file APP7*DPS.
Explanation
1. Creates a file to contain the new library search chains for DPS$LIB, for application
group 7.
2. Calls SSDP, which defines the library search chains. The library search chains will
reside in the element SYS$LIB$*APP$7DPS.SSDEF$. The I option writes a source
copy of the input commands to the file specified in the @SSDP statement.
3. Redefines DPS$LIB to represent the DPS 2200 software residing in file APP7*DPS.
(The system initially defined DPS$LIB when you installed DPS 2200 in
SYS$LIB$*DPS.)
4. Defines application group 7 as the active application group, that is, the one to be
linked to when these library search chains are used.
5. Begins SSDP processing.
Output
The preceding runstream produces the following output:
*REMARK(CLAR) 2190: Item 2 of the FaE names LSC APP$7 which has not been
defined.
END SSDP. 1 Clarification remark(s).
This message is expected because SSDP does not check SYS$*DATA$.SSDEF$ to see
if the library search chain APP$n (APP$7 in this example) is defined.
When you statically link a program or transaction that uses DPS 2200 library search
chains in this way, the following @LINK command is not required in the static link:
INCLUDE APP7*DPS.UCS/INTERFACE,.EMCEBEP$$DPS
For complete information on defining and using library search chains, see the Linking
System Programming Reference Manual.
Other library search chains represent the file into which an application-group-
dependent software product is installed. For example
• The library search chain MCB$APP1 represents the file containing the version of
MCB installed into application group 1.
• The library search chain DMS$APP7 represents the file containing the version of
DMS 2200 installed into application group 7.
As MCB, DMS 2200, RDMS 2200, or SFS 2200 is installed into an application group, the
system updates the library search chain for that application group so that it includes
the library search chain that represents the file into which that version of the product
has been installed.
For example, when DMS 2200 is installed into application group 7, the system updates
the library search chain for application group 7 (APP$7) so that it includes the library
search chain that represents the file into which that version of DMS 2200 has been
installed (DMS$APP7). In this way, the library search chain for the application group
will represent all of the files containing products installed into that application group.
Note: DPS 2200 is the only application-group-dependent product that does not
update these library search chains; therefore, you must do so yourself. Refer to 4.5
for information on this process.
Explanation
1. DMS 2200 and RDMS 2200 have been installed in application group 1. (RSA
represents RDMS 2200.)
2. None of the application-group-dependent products have been installed in
application group 2.
3. DMS 2200, RDMS 2200, SFS 2200, and MCB have been installed in application
group 3.
4. DMS 2200, RDMS 2200, SFS 2200, and MCB have been installed in application
group 7.
The application group whose library search chain name is included in the library search
chain for ACTIVE$APP becomes the active application group (the one linked to). For
example, if ACTIVE$APP includes the library search chain name for application group 7
(APP$7), application group 7 is the active application group.
Explanation
1. UCS$EMUSER is a library search chain name attached by the compiler to all
references to user programs unknown to the compiler (including references to
application group software). The system places the following in the library search
chain for UCS$EMUSER:
• $LOCAL
$LOCAL is a system-defined default library search chain representing the file
containing the main program.
• ACTIVE$APP
ACTIVE$APP represents the active application group because it is in the library
search chain for UCS$EMUSER.
Each application group has an associated file containing the library search chain for
that application group. The names of these files all have the following format:
SYS$LIB$*APP$n
where n represents the application group number. The element name is always
SSDEF$.
As an example, the following table shows the file.element name containing the library
search chains for application groups 1, 3, and 7, along with the definition of the library
search chains for each one.
Application
Group File.Element Name Library Search Chain
Example 4–3 describes how these library search chains work, using application group
7 as an example.
Explanation
1. This command defines the library search chain for ACTIVE$APP (which represents
the active application group).
2. This command specifies that the library search chain representing application
group 7 is used for the active application group (in other words, it defines
application group 7 as the active application group).
The files that contain the library search chains for the application groups are described
in 4.6.2.
Thus, the program or transaction is linked to the system software in application group
7. Again, note that if any of the programs use embedded or module SQL, those
programs must have been compiled for this application group with an
APPLICATION/appname keyword option. Doing an @USE of LINK$PF is not sufficient
to change the targeted application group for ESQL programs.
This section discusses topics relating to application programming using standard TIP
transactions.
All examples in Section 5 show UCS COBOL and UCS C transactions. Unless
otherwise indicated, the same techniques also apply to UCS FORTRAN TIP
transactions.
This subsection covers the following topics about creating TIP ZOOMs:
• Coding, compiling, and establishing the TIP environment for standard TIP
transaction programs
• Linking for functional testing
The information in this subsection is a foundation for understanding later subsections.
One central example is used throughout this subsection. It is expanded upon as new
topics are discussed. Figure 5–1 illustrates the TIP transaction sequence for this
example.
In this example
1. The transaction code xxxTRX followed by an employee number represents the
transaction input.
2. xxxTIP is scheduled and execution begins.
3. xxxTIP does the following:
a. Reads the employee number input.
b. Validates the employee number.
c. Moves the employee number to the output message.
d. Sends the output message to the terminal that initiated the transaction
execution.
e. Terminates the transaction execution.
In the actual examples, the string xxx is replaced with either "DPS" or "MCB,"
depending upon which function calls are being used in the example. The examples
describe any differences that exist between using DPS 2200 functions or MCB
functions.
Examples in Section 5 show UCS COBOL and UCS C transactions. Except where
noted, everything discussed regarding these examples also applies to UCS FORTRAN.
Table 5–1 shows the interfaces supported for these host languages.
DPS 2200 supports transactions written in UCS COBOL, UCS FORTRAN, and UCS C.
The code used to call DPS 2200 is the same in UCS programming as it was in non-UCS
programming. The same DPS 2200 software and forms files can be used in both
environments simultaneously.
UCS DPS 2200 TIP transactions can use either COMPOOL or MCB message buffering,
depending on
• The VALTAB STATUS (STA) keyword setting
• The availability of the MCB software
• The designation of MCB message buffering in the CMS 1100 configuration
If all of the following are true, DPS 2200 uses MCB message buffering:
• STA,J is specified in the VALTAB entry.
• MCB software is available.
• MCB message buffering is designated in CMS 1100.
If no J is specified on the STA keyword, then DPS 2200 uses COMPOOL message
buffering.
For more information on DPS 2200 coding, refer to the DPS 2200 Run-Time
Programming Reference Manual.
UCS COBOL, UCS FORTRAN, and UCS C all support calls to MCB functions. MCB
functions can be directly called from all UCS TIP transactions.
UCS COBOL
CALL 'MCB$ENT'USING mcb-packet, mcb-status,
msg-buffer, multi-dest-list.
UCS FORTRAN
CALL MCB$ENT(mcb_packet, mcb_status, msg_buffer, multi_dest_list)
UCS C
mcb_ent(&mcb_packet, &mcb_status, &msg_buffer, &multi_dest_list);
Notice that these calls to MCB differ from their non-UCS counterparts. They include
two additional optional parameters:
• msg-buffer, msg_buffer, MSG_BUFFER
Identifies the storage area into which messages are read, and from which
messages are sent by the transaction. For UCS COBOL, this parameter eliminates
the need for the ASCII COBOL CLOCTE call (which sets up this buffer's address).
• multi-dest-list, multi_dest_list, MULTI_DEST_LIST
Provides a simple method for identifying a multiple-destination list of position
identifiers (PID). For UCS COBOL, this parameter eliminates the need for the ASCII
COBOL CLOCTE call (which sets up the buffer's address).
To aid the UCS programmer in coding these, the MCB release tape includes precoded
sample UCS COBOL and UCS FORTRAN procedures for these buffers. The two
elements containing these procedures are found in the MCB installation file. They are
also found in the Unisys-supplied system procedure file SYS$LIB$*PROC$. They have
the following names:
For UCS C, the following #include statement provides the definitions for the MCB
information. This element is found in the C include file.
#include <mcb.h>
For more information on MCB coding, refer to the MCB Programming Reference
Manual.
Primitive coding has not changed in UCS, except for the function names for the UCS
COBOL version.
CCONET CONECT
CDISCN DISCON
CCMMIT COMMIT
CRLBAK ROLLBACK
CFCSS FCSS
CUOPND UOPAND
CUOPGT UOPGET
CUOPTR UOPTOR
CTMABS TIMABS
CTMDEL TIMDEL
CTMREL TIMREL
CTMUPA TIMUPA
CTMUPR TIMUPR
UCS COBOL still supports the previous name of each of these calls in transactions;
however, when you code new UCS transactions or upgrade existing transactions to
UCS, it is recommended that you use the new name.
New TIP primitive procedures for UCS COBOL and UCS FORTRAN that require no
special keyword options are available as of SB4. The new procedure names are
USYSDF and UCMPDF. They can be found in TIP$*TIPLIB$.
For UCS C, the following #include statement provides the definitions for the TIP
primitives. This element is found in the C include file.
#include <tip.h>
In the TIP environment, the COBOL INITIAL clause automatically initializes all data
defined with the VALUE clause, every time the transaction program containing the
INITIAL clause is called.
The following example shows the VALTAB entry for the example transaction program
DPSTIP:
904 NAM,DPSTIP ACT,DPSTRX PRG,3 STF,0 STA,J QPR,1 OPT,TV
904 REC,Z AUD,7 PRT,PR
The following example shows the VALTAB entry for the example transaction program
MCBTIP:
924 NAM,MCBTIP ACT,MCBTRX PRG,3 STF,0 STA,J QPR,1 OPT,TV
924 REC,Z AUD,7 PRT,PR
STF,0
Sets the Standard File number to denote the use of SUPUR files and the SUPUR
utility. UCS transactions cannot use the online files. SUPUR files must be used
instead. SUPUR files offer better performance and online update capability than
the standard TIP online files.
STA,J
Denotes that MCB message buffering will be used if the Communication
Management System (CMS 1100) is configured for MCB message buffering and
the MCB software is available.
QPR,1
Specifies the location in the input queuing tree structure where input requests are
to be queued for this transaction program.
REC,Z
Denotes that this is a recoverable step.
AUD,7
Identifies the audit trail number (application group number).
PRT,PR
Identifies the transaction printer queue.
OPT,TV
Allows the TIPDIAG$ file to be created for diagnostics upon termination.
(TIPTRACE must also be set to ON in the FLAGBOX to receive a TIPDIAG$ file.)
The use of the options ROPL allows MCB to use a reduced output path length
(ROPL) for nonrecoverable output messages.
The DPS 2200 standard TIP transaction (DPSTIP) and the MCB standard TIP transaction
(MCBTIP) used in the examples in this section both use the same SUPUR file. The
SUPUR file is TIP file number 810, which is associated with Executive file
QUAL*TIPSUPUR.
For detailed information on how to set up and handle SUPUR files, refer to the
Transaction Processing Administration and Operations Reference Manual.
Figure 5–2. Compilation of a UCS Transaction Program Using DPS 2200 Functions
MCB MCB
Proc or Proc
SYS$LIB$*PROC$. qual*ucstst.
MCB
@UCOB . . . . Interface
UCS MCB or
Transaction @UCOB . . . . ,,,COMPAT
Source or
Code @UFTN . . . .
or UCS MCB
qual*ucstst.MCBTIP @UC . . . . Object
Module
qual*ucstst.MCBTIP/COMP
002327
All TIP transaction programs must be statically linked TIP ZOOMs. The following
subsections show how to create TIP ZOOMs with static linking.
Example 5–1. Generic Static Linking Runstream for a TIP Transaction Program
Explanation
1. This statement ensures that the transaction program is statically linked using the
system software located in the desired application group. (It ensures that the
library search chain for the correct application group is used.)
Replace n in "SYS$LIB$*APP$n" with the desired application group number. As an
example, use the following statement for application group number 7:
@USE LINK$PF.,SYS$LIB$*APP$7
This statement thus identifies the desired MCB interface software and the UDS
interface software; therefore, you do not need to use static linking INCLUDE
commands specifying the specific MCB and UDS product files. The desired files
are indicated by the library search chain.
For a complete discussion of how these library search chains are created and
used, see Section 4.
2. This statement calls the Linking System LINK Processor. The output TIP ZOOM to
be created is named QUAL*FILE.TIPPRG.
3. This command supplies the compiler-generated object module for the transaction
program as input to static linking.
4. This command supplies the appropriate interface object modules for transaction
programs that use DPS 2200. (The SYS$LIB$*APP$n application group library
search chains supplied by Unisys do not supply DPS 2200 interface information.)
A site may update the application group library search chains supplied by Unisys
so that they include the DPS 2200 interface information for that application group.
Then this INCLUDE command is not necessary (see 4.5).
5. This command resolves external references, including those to the UCS Runtime
System library.
@USE LINK$PF,SYS$LIB$*APP$7DPS.
@LINK ,QUAL*UCSTST.DPSTIP
INCLUDE QUAL*UCSTST.DPSTIP/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSTIP INITIAL.
******************************************************************
******************************************************************
* *
* SIMPLE DPS COBOL TRANSACTION PROGRAM - DPSTIP *
* *
* initializes with DPS *
* reads the input employee number *
* opens the DPS form *
* moves the employee number to the form *
* displays the DPS form *
* terminates with DPS *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 ERR-MISSING-INPUT PIC X(78)
VALUE 'NO EMPLOYEE NUMBER WAS SPECIFIED.'.
01 INVALID-EMPLOYEE-NUMBER.
02 TEXT-1 PIC X(40)
VALUE 'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER '.
02 ERR-EMPLOYEE-NO PIC X(10).
************************************************************
* VARIABLE TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
01 EMPLOYEE-NUMBER PIC X(5).
************************************************************
* DPS PROCEDURES
************************************************************
COPY DPSSTATUSCOB.
COPY INFO-BUFFER.
COPY GETFIELD.
COPY SENDERROR.
SCREEN-DSPLYIND-50.
PROCEDURE DIVISION.
************************************************************
* TIP INITIALIZATION WITH DPS
************************************************************
DPS-INITIALIZATION.
CALL INIT'USING DPS-STATUS, INFO-BUFFER.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
************************************************************
* FREE FORMAT READ OF THE TRANSACTION CODE
************************************************************
DPS-FREE-FORMAT-READ1.
CALL 'D$GETFL'USING DPS-STATUS, GET-FIELD.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
************************************************************
* FREE FORMAT READ OF THE EMPLOYEE NUMBER
* RETURNS THE EMPLOYEE NUMBER
* GETFIELD-TYPE = 1 - TESTS FOR NO INPUT
* GETFIELD-LENGTH = 5 - TESTS THE FIELD LENGTH
************************************************************
DPS-FREE-FORMAT-READ2.
CALL 'D$GETFL'USING DPS-STATUS, GET-FIELD.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
MOVE GETFIELD-TEXT TO EMPLOYEE-NUMBER.
IF GETFIELD-TYPE = 1
MOVE ERR-MISSING-INPUT TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM TERMINATION-PARA
ELSE IF GETFIELD-LENGTH NOT EQUAL 5 OR
GETFIELD-TYPE NOT EQUAL 3
MOVE GETFIELD-TEXT TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM TERMINATION-PARA
ELSE CONTINUE
END-IF
END-IF.
************************************************************
* OPENS THE FORM TO BE SENT AS THE OUTPUT MESSAGE
************************************************************
DPS-OPEN-OUTPUT-SCREEN.
CALL 'D$OPEN'USING DPS-STATUS, SCREEN-DSPLYIND-50.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
************************************************************
* TRANSFERS THE EMPLOYEE NUMBER TO THE FORM DEFINITION
************************************************************
MOVE-EMPLOYEE-NUMBER.
MOVE EMPLOYEE-NUMBER TO S50-EMP-NUMBER.
************************************************************
* SENDS THE FORM AS THE OUTPUT MESSAGE
************************************************************
DPS-SEND-OUTPUT-SCREEN.
CALL 'D$SEND'USING DPS-STATUS, SCREEN-DSPLYIND-50.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM TERMINATION-PARA.
************************************************************
* TIP TERMINATION WITH DPS
* TERMINATION OF THE PROGRAM
************************************************************
TERMINATION-PARA.
CALL 'D$TERM'USING DPS-STATUS.
STOP RUN.
*
*
************************************************************
* RETURNS AN ERROR MESSAGE IF THE INPUT MESSAGE WAS IN ERROR
************************************************************
INVALID-INPUT-PARA.
CALL 'D$SENDERR'USING DPS-STATUS, ERROR-MESSAGE,
ERROR-COORDINATES.
*
*
************************************************************
* ONLY EXECUTED WHEN A DPS ERROR OCCURS
************************************************************
DPS-GENERAL-ERROR-PARA.
CALL 'D$DUMP'.
CALL 'D$ERRMSG'USING DPS-STATUS.
@ . ***
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
@EOF
@ . ***
@ . ***
@ . *** UCOB COMPILE OF A STANDARD TIP DPS COBOL TRANSACTION PROGRAM
@ . ***
@USE COB$PF,APP7*DPS
@UCOB QUAL*UCSTST.DPSTIP,.DPSTIP/COMP,,,NO-OPTIONS
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'DPSTIP'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, A SPECIAL
@ . *** SEARCH CHAIN FOUND IN SYS$LIB$*APP$7DPS.SSDEF$ IS SPECIFIED
@ . *** USING AN "@USE LINK$PF" COMMAND. THIS SEARCH CHAIN IDENTIFIES
@ . *** THE DPS SYSTEM FILE FOR APPLICATION GROUP 7 AND SETS
@ . *** ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7DPS.
@LINK ,QUAL*UCSTST.DPSTIP
INCLUDE QUAL*UCSTST.DPSTIP/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
Example 5–3. Runstream to Set Up, Compile, and Link COBOL DPS TIP Transaction
Program
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@EOF
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON BTLOADING
ON STICKING
@EOF
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*TIPSUPUR.,FIX
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
LFD 810
Example 5–3. Runstream to Set Up, Compile, and Link COBOL DPS TIP Transaction
Program
@EOF
@ . ***
@ . ***
@ . *** USES THE SUPUR UTILITY TO CREATE A SUPUR PROGRAM FILE,
@ . *** COPYS THE TRANSACTION PROGRAM INTO THE SUPUR PROGRAM FILE,
@ . *** AND PLACES THE SUPUR PROGRAM FILE ONLINE.
@ . ***
@TIP$*TIPRUN$.SUPUR,P
CREATE 810 MAIN
COPY ONLY DPSTIP FROM QUAL*UCSTST TO 810
ONLINE 810
LIST ALL FROM 810
EXIT
@ . ***
@ . ***
@ . *** EXAMPLE SETUP IS COMPLETE
Example 5–3. Runstream to Set Up, Compile, and Link COBOL DPS TIP
Transaction
@ . ***
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
PDP 13R1J (931108 0108:39) 1994 Feb 16 Wed 1439:22
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 708 Entry Points: 1 Time: 3.766 Storage: 7070/0/7070/0106210
@ . ***
@ . ***
@ . *** UCOB COMPILE OF A STANDARD TIP DPS COBOL TRANSACTION PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
I:002333 USE complete.
@UCOB QUAL*UCSTST.DPSTIP,.DPSTIP/COMP,,,NO-OPTIONS
UCOB- 6R2(940210) LSS- 8R2 (940209) 940216 14:39:32
SIZES: CODE(EM6): 928 DATA: 96
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'DPSTIP'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, A SPECIAL
@ . *** SEARCH CHAIN FOUND IN SYS$LIB$*APP$7DPS.SSDEF$ IS SPECIFIED
@ . *** USING AN "@USE LINK$PF" COMMAND. THIS SEARCH CHAIN IDENTIFIES
@ . *** THE DPS SYSTEM FILE FOR APPLICATION GROUP 7 AND SETS
@ . *** ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7DPS.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.DPSTIP
LINK 5R2 (940207 1635:57) 1994 Feb 16 Wed 1440:24
END LINK , LINES : 4 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
VTBUTL 44R2#0000001 940216 1440:57
*VALCHG M
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 44R2#0000001 940216 1440:58
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
TPINIT 44R2#0000001 940216 1440:58
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 44R2#0000001 940216 1440:58
ON BTLOADING
ON STICKING
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
I:002333 CAT complete.
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 44R2 02/16/94 14:40:59 FS-LEVEL FS 003
TREG QUAL*TIPSUPUR.,FIX
TP REGISTER STARTED 14:40:59 16 FEB 94
TP REGISTER FINISHED 14:40:59 16 FEB 94
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
>DPSTRX 10211
IDENTIFICATION DIVISION.
PROGRAM-ID. MCBTIP INITIAL.
******************************************************************
******************************************************************
* *
* SIMPLE MCB COBOL TRANSACTION PROGRAM - MCBTIP *
* *
* initializes with MCB *
* reads the input employee number *
* moves the employee number to the output message *
* sends the output message *
* terminates with MCB *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER
SYMBOLIC CHARACTERS EXT IS 4.
******************************************************************
DATA DIVISION.
WORKING-STORAGE SECTION.
************************************************************
* WORK AREA BUFFERS
************************************************************
01 IN-TEXT PIC X(60) VALUE SPACES.
01 TRAN-CODE PIC X(6) VALUE SPACES.
************************************************************
* BUFFER TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
01 EMPLOYEE-TEXT VALUE SPACES.
02 EMPLOYEE-NUMBER PIC X(5).
02 FILLER PIC X(55).
************************************************************
* UNSTRING COUNTER
************************************************************
01 EMP-COUNT PIC 99 VALUE ZERO.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
* Line 1
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '7'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 FILLER PIC X(33)
VALUE '******** INDIVIDUAL DATA ********'.
* Line 3
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '"!'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 FILLER PIC X(17) VALUE 'EMPLOYEE NUMBER: '.
02 OUT-EMP-NUMBER PIC X(10) VALUE SPACES.
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '"='.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 FILLER PIC X(6) VALUE 'NAME: '.
02 OUT-IND-FIRST-NAME PIC X(12) VALUE SPACES.
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '"P'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 OUT-IND-LAST-NAME PIC X(20) VALUE SPACES.
* Line 6
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '%$'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 FILLER PIC X(30)
VALUE '*** DEPARTMENT INFORMATION ***'.
* Line 7
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '&-'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 FILLER PIC X(6) VALUE 'NAME: '.
02 OUT-DEPT-NAME PIC X(24) VALUE SPACES.
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '&O'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 FILLER PIC X(8) VALUE 'NUMBER: '.
02 OUT-DEPT-NO PIC X(4) VALUE SPACES.
* Line 8
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
* Line 17
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '03'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 OUT-SPT-NAME2 PIC X(10) VALUE SPACES.
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '0>'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 OUT-SPT-LEAGUE-TYPE2 PIC X(13) VALUE SPACES.
* Line 18
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '13'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 OUT-SPT-NAME3 PIC X(10) VALUE SPACES.
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '1>'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 OUT-SPT-LEAGUE-TYPE3 PIC X(13) VALUE SPACES.
* Line 20
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '3$'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 OUT-CHILDREN PIC X(16) VALUE '*** CHILDREN ***'.
* Line 21
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '43'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 OUT-CHILD-FIRST-NAME1 PIC X(12) VALUE SPACES.
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '4@'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 OUT-CHILD-LAST-NAME1 PIC X(20) VALUE SPACES.
* Line 22
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
02 FILLER PIC X(2) VALUE '53'.
02 FILLER PIC 1(9) BINARY-1 VALUE 15.
02 OUT-CHILD-FIRST-NAME2 PIC X(12) VALUE SPACES.
02 FILLER PIC 1(9) BINARY-1 VALUE 27.
02 FILLER PIC 1(9) BINARY-1 VALUE 11.
************************************************************
* TRANSFERS THE EMPLOYEE NUMBER TO THE OUTPUT MESSAGE
************************************************************
MOVE-EMPLOYEE-NUMBER.
MOVE EMPLOYEE-NUMBER TO OUT-EMP-NUMBER.
************************************************************
* SENDS THE OUTPUT MESSAGE
************************************************************
MCB-SEND-MESSAGE.
MOVE 0 TO P-MCB-STATUS.
MOVE P-SENDD TO P-FUNC.
MOVE 0 TO P-ID.
MOVE 769 TO P-LENGTH.
MOVE 1 TO P-START.
MOVE 4 TO P-AUX.
MOVE 0 TO P-FLAGS.
MOVE 1 TO P-BIT0.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS, OUTPUT-MSG.
IF P-STATBIT NOT EQUAL ZERO GO TO MCB-ERROR-EXIT.
************************************************************
* TIP TERMINATION WITH MCB
* PROGRAM TERMINATION
************************************************************
TERMINATION-PARA.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 0 TO P-FLAGS.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
IF P-STATBIT NOT EQUAL ZERO GO TO MCB-ERROR-EXIT.
STOP RUN.
*
*
************************************************************
* RETURNS AN ERROR MESSAGE IF THE INPUT MESSAGE WAS IN ERROR
************************************************************
INVALID-INPUT-PARA.
MOVE 0 TO P-MCB-STATUS.
MOVE P-SENDD TO P-FUNC.
MOVE 0 TO P-ID.
MOVE 85 TO P-LENGTH.
MOVE 1 TO P-START.
MOVE 4 TO P-AUX.
MOVE 0 TO P-FLAGS.
MOVE 1 TO P-BIT0.
CALL 'MCB$ENT'USING P-MCB-PACKET, P-MCB-STATUS,
ERROR-MESSAGE.
IF P-STATBIT NOT EQUAL ZERO GO TO MCB-ERROR-EXIT.
*
*
************************************************************
* ONLY EXECUTED WHEN A MCB ERROR OCCURS
************************************************************
MCB-ERROR-EXIT.
DISPLAY '********* MCB ERROR *********'UPON PRINTER.
DISPLAY 'ERROR STATUS BIT = 'P-STATBIT UPON PRINTER.
DISPLAY 'ERROR CODE = 'P-ERRCODE UPON PRINTER.
DISPLAY 'ERROR CODE Q3 = 'P-ERRCODEQ3 UPON PRINTER.
DISPLAY 'ERROR CODE Q4 = 'P-ERRCODEQ4 UPON PRINTER.
MOVE 0 to P-ID.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
STOP RUN.
MCBPKT-UCOB PROC
/
*
* Sample MCB procedure for use in UCOB transactions
*
************************************************
** TRANSACTION CODE BUFFER **
************************************************
01 P-TRXCODE PIC X(6).
************************************************
** INPUT BUFFER **
** This buffer will hold a 24 X 80 screen. **
** The maximum size is PIC X(262143). **
************************************************
01 P-INMSG PIC X(1920).
**************************************************
** BUFFER ADDRESS **
**************************************************
01 P-MSG-LENGTH PIC 9(10) BINARY.
01 P-SAVEPID PIC 1(18) BINARY-1.
01 P-TRXBUFF PIC X(1920) VALUE SPACES.
**************************************************
** MCB ERROR STATUS RETURN **
**************************************************
01 P-MCB-STATUS.
02 P-STATBIT PIC S9(5) BINARY.
02 P-ERRCODE PIC 9(5) BINARY.
02 P-ERRCODEQ REDEFINES P-ERRCODE.
04 P-ERRCODEQ3 PIC 1(9) BINARY-1.
04 P-ERRCODEQ4 PIC 1(9) BINARY-1.
/
*************************************************
** FUNCTION CODES FOR INTERFACES TO THE MCB **
*************************************************
* TRINIT VALUE 2. initialize
* TERM VALUE 10. terminate
@ . ***
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** UCOB COMPILE OF A STANDARD TIP MCB COBOL TRANSACTION PROGRAM
@ . ***
@UCOB QUAL*UCSTST.MCBTIP,.MCBTIP/COMP,,,NO-OPTIONS
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'MCBTIP'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, THE APPLICATION
@ . *** GROUP SEVEN SEARCH CHAIN FOUND IN SYS$LIB$*APP$7.SSDEF$ IS
@ . *** SPECIFIED USING AN "@USE LINK$PF" COMMAND.
@ . *** THiS SEARCH CHAIN SETS ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
@LINK ,QUAL*UCSTST.MCBTIP
INCLUDE QUAL*UCSTST.MCBTIP/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
*VALCHG M
924 NAM,MCBTIP ACT,MCBTRX PRG,3 STF,0 QPR,1 STA,J OPT,TV
924 REC,Z AUD,7 PRT,PR
@EOF
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF BTLOADING
OFF STICKING
ON RECOVERY
Example 5–7. Runstream to Set Up, Compile, and Link—COBOL MCB TIP
Transaction Program
OFF SCHEDULE
@EOF
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON BTLOADING
ON STICKING
@EOF
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*TIPSUPUR.,FIX
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
LFD 810
@EOF
@ . ***
@ . ***
@ . *** USES THE SUPUR UTILITY TO CREATE A SUPUR PROGRAM FILE,
@ . *** COPYS THE TRANSACTION PROGRAM INTO THE SUPUR PROGRAM FILE,
@ . *** AND PLACES THE SUPUR PROGRAM FILE ONLINE.
@ . ***
@TIP$*TIPRUN$.SUPUR,P
CREATE 810 MAIN
COPY ONLY MCBTIP FROM QUAL*UCSTST TO 810
ONLINE 810
LIST ALL FROM 810
Example 5–7. Runstream to Set Up, Compile, and Link—COBOL MCB TIP
Transaction Program
EXIT
@ . ***
@ . ***
@ . *** EXAMPLE SETUP IS COMPLETE
Example 5–7. Runstream to Set Up, Compile, and Link—COBOL MCB TIP
Transaction Program
@ . ***
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** UCOB COMPILE OF A STANDARD TIP MCB COBOL TRANSACTION PROGRAM
@ . ***
@UCOB QUAL*UCSTST.MCBTIP,.MCBTIP/COMP,,,NO-OPTIONS
UCOB- 6R2(940210) LSS- 8R2 (940209) 940216 15:28:24
SIZES: CODE(EM6): 1027 DATA: 431
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'MCBTIP'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, THE APPLICATION
@ . *** GROUP SEVEN SEARCH CHAIN FOUND IN SYS$LIB$*APP$7.SSDEF$ IS
@ . *** SPECIFIED USING AN "@USE LINK$PF" COMMAND.
@ . *** THIS SEARCH CHAIN SETS ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.MCBTIP
LINK 5R2 (940207 1635:57) 1994 Feb 16 Wed 1528:57
END LINK , LINES : 4 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
VTBUTL 44R2#0000001 940216 1529:20
*VALCHG M
KEYWORDS FOR VALTAB FIELDS
LONG FORM SHORT FORM FIELD DESCRIPTION
--------- ---------- -----------------
(FIRST FIELD ON EACH CARD) PROGRAM NUMBER
NAME NAM PROGRAM NAME
ACTION ACT TRANSACTION CODE
RUNTIME RUN MAXIMUM RUN TIME
PRIORITY PRI PROGRAM PRIORITY
INDICATORS IND VALTAB INDICATORS
PRGTYPE PRG PROGRAM TYPE
OPTIONS OPT PROGRAM OPTIONS
STFILE STF STANDARD FILE NO.
COPIES COP MAXIMUM COPIES
STATUS STA PROGRAM STATUS
PRTDEVICE PRT PRINT QUEUE DEVICE
LEVEL LEV SWITCHING LEVEL
PCTBLOCKS PCT NUMBER PCT BLOCKS
WAITQ WAI WAIT-Q LENGTH
DBKSIZ DBK D-BANK SIZE
AUDIT AUD AUDIT TRAIL NUMBER
RECOVERY REC RECOVERY OPTIONS
MASK MAS ACCESS MASK
QPRIORITY QPR QUEUING PRIORITY
TCASIZ TCA TCA BANK SIZE
ON RECOVERY
OFF SCHEDULE
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
TPINIT 44R2#0000001 940216 1529:21
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 44R2#0000001 940216 1529:22
ON BTLOADING
ON STICKING
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
I:002333 CAT complete.
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 44R2 02/16/94 15:29:22 FS-LEVEL FS 003
TREG QUAL*TIPSUPUR.,FIX
TP REGISTER STARTED 15:29:22 16 FEB 94
TP REGISTER FINISHED 15:29:22 16 FEB 94
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 15:29:22 16 FEB 94
TP RESERVE FINISHED 15:29:22 16 FEB 94
LFD 810
PLACEMENT 0
LEG STATUS AVL-UP
END FREIPS
@ . ***
@ . ***
@ . *** USES THE SUPUR UTILITY TO CREATE A SUPUR PROGRAM FILE,
@ . *** COPYS THE TRANSACTION PROGRAM INTO THE SUPUR PROGRAM FILE,
@ . *** AND PLACES THE SUPUR PROGRAM FILE ONLINE.
@ . ***
@TIP$*TIPRUN$.SUPUR,P
SUPUR Processor Level 44R2#0000001 Date-Time: 94-02-16 1529:23
CREATE 810 MAIN
Processing completed successfully for CREATE
COPY ONLY MCBTIP FROM QUAL*UCSTST TO 810
Program MCBTIP copied to TIP file 810 in ZOOM fast-load format.
Processing completed successfully for COPY
ONLINE 810
Online installed 1 LCP records in VALTAB for programs in file 810.
Processing completed successfully for ONLINE
>MCBTRX 10211
UCS TIP transactions support the interface to the UDS database models in the
following ways:
• UCS COBOL and UCS FORTRAN support the interface to DMS 2200 databases in
TIP.
• UCS COBOL, UCS FORTRAN, and UCS C all provide access to RDMS 2200
databases in TIP. UCS COBOL and UCS C support both the embedded SQL and
the interpreter SQL interfaces. UCS FORTRAN supports both module language
SQL and the interpreter SQL interfaces.
• UCS COBOL, UCS FORTRAN, and UCS C all provide access to SFS 2200 databases
in TIP.
For each database interface, there are requirements that are unique to the standard
TIP environment. The following pages discuss these requirements.
Table 5–2 is a summary of the UDS interfaces supported by the UCS host languages in
TIP transactions.
The UCS interfaces to UDS databases are designed to be compatible with older UDS
interfaces. UCS and non-UCS programs can share the same
• UDS software
• Database files
Both UCS and non-UCS programs also support the same functional capabilities. In
other words, UCS programs and non-UCS programs with the same data manipulation
language command syntax can access the same database files using the same UDS
software, simultaneously. As far as compatibility is concerned, very little has changed
for the applications programmer.
To describe how UCS TIP transaction programs access these UDS data models, the
following subsections show three very simple databases, one for each of the data
models:
• DMS 2200
• RDMS 2200
• SFS 2200
For each database model, a subsection describes each of the following processes:
• Creating the database
• Loading information into the database
• Accessing information from the database
The following subsections describe the steps involved in creating and accessing a
DMS 2200 database using UCS TIP transaction programs. They discuss
• DMS 2200 schemas
The coding of a DMS 2200 schema to be used by UCS TIP transaction programs must
comply with the following conditions:
• The schema cannot contain any Fieldata data items or records.
Fieldata is not supported by any UCS compiler. Schemas that do not contain
Fieldata can be shared by both UCS and non-UCS programs.
Therefore, most existing schemas built for non-UCS programs can be shared with
UCS programs. This means you do not need to recode or reprocess schemas.
• The schema cannot contain any of the following new UCS COBOL USAGE clauses
unless the schema contains the syntax SOURCE IS UCS (DMS level 17R1):
− BINARY-1
− BINARY
These USAGE clauses are currently not supported by the schema processor
(@DDL) unless SOURCE IS UCS appears in the schema (available in DMS level 17R1
and later).
• All area names, record names, data item names, set names, and database data
names must be unique. For example, a schema cannot contain a record and an
area with the same name. Also, these names must be unique within the COBOL
program.
Refer to the DMS DDL Administration, Operations, and Programming Guide for more
information on DMS 2200 schemas.
The schema used in the example for this section uses the following record and set
diagram.
INDIVIDUAL
An indexed sequential record type that is keyed off the individual's name;
duplicates are allowed.
JOBINFO
A calc record type that is keyed off job titles; no duplicates are allowed.
DEPARTMENT
A calc record type that is keyed off department numbers; no duplicates are
allowed.
UCS programs require their own subschemas, with a new HOST LANGUAGE value for
both UCS COBOL and UCS FORTRAN. For UCS COBOL, the following clause is
required:
HOST LANGUAGE IS UCS COBOL
− USAGE COMP-4
− USAGE DISP-1
If the SDDL processor finds any Fieldata data definitions in the schema or the
subschema when any UCS subschema is processed, it produces no output and
prints a fatal error message.
• The T option is not permitted on the SDDL processor call. This option converts
USAGE clauses to Fieldata or ASCII, depending upon the current values of the
clauses.
When a UCS subschema is processed, the SDDL processor produces three output
elements:
Note that if the subschema being processed includes the clause HOST LANGUAGE IS
UCS COBOL, the SDDL processor call no longer (as of DMS level 16R1) requires the F
option. The following table shows the equivalent USAGE clauses in ASCII COBOL and
UCS COBOL.
The following example shows the SDDL processor call for the UCS COBOL example
subschema:
@UDS$$SVN*DMRMT$.SDDL,DN QUAL*UCSTST.PERSONSUBTIP,UDS$$SVN*SCHFILEXEC.PERSONSUBTIP
@UDS$$SVN*DMRMT$.SDDL,DN QUAL*UCSTST.PERSONSUBTIP,UDS$$SVN*SCHFILEXEC.PERSONSUBTIP
Refer to the DMS SDDL Administration, Operations, and Programming Guide for
more information on DMS 2200 subschemas.
Note: Using TIP file control eliminates much Exec input/output overhead and
eliminates the need for file assignments. Therefore, it is recommended that DMS
2200 databases that will be accessed by TIP transactions be set up using TIP
schema, subschema, and storage area files. This requires setting up a TIP file for
each underlying Exec file.
Schema File
If the schema file is a TIP file, the Data Definition Language (DDL) syntax must identify
the schema as residing in a TIP file. This is accomplished by using the following clause
in the SCHEMA NAME statement:
IN TIP FILE uds-tip-file-code
For more information on coding a DMS 2200 schema that uses TIP areas, refer to the
DMS DDL Administration, Operations, and Programming Guide.
Furthermore, the area code for each area definition in the schema must be the same
as the UDS-TIP file number of the TIP file for that area.
For more information on setting up TIP files that will hold DMS 2200 storage areas,
refer to the Repository for ClearPath OS 2200 Administration Guide.
Subschema File
If the subschema file is a TIP file, the Subschema Data Definition Language (SDDL)
syntax must identify the subschema as residing in a TIP file. This is accomplished by
using the following clause in the SUBSCHEMA NAME statement:
IN TIP FILE uds-tip-file-code
For more information on coding a DMS 2200 subschema that uses TIP areas, refer to
the DMS SDDL Administration, Operations, and Programming Guide.
IDENTIFICATION DIVISION
SCHEMA NAME IS PERSONNELTIP IN TIP FILE 70
DATA DIVISION
DATA NAME SECTION.
01 CALC-AREA-NAME USAGE IS AREA-NAME
01 EMPNO-AREA-NAME USAGE IS AREA-NAME
01 EMPNO-AREA-KEY USAGE IS AREA-KEY
AREA SECTION.
AREA LOOKS INCLUDE QUICK-BEFORE-LOOKS AFTER-LOOKS
AREA NAME IS DEPTAREATIP
AREA CODE IS 71
MODE IS DATA
AREA MAPS TO TIP
ALLOCATE 12 PAGES
PAGES ARE 448 WORDS
CALC USES 1 CHAINS LINKED PRIOR
AREA NAME IS JOBAREATIP
AREA CODE IS 72
MODE IS DATA
AREA MAPS TO TIP
ALLOCATE 10 PAGES 2 OVERFLOW AT END
PAGES ARE 448 WORDS
CALC USES 1 CHAINS LINKED PRIOR
AREA NAME IS EMPNOAREATIP
AREA CODE IS 73
MODE IS DATA
AREA MAPS TO TIP
ALLOCATE 1000 PAGES
PAGES ARE 448 WORDS
AREA NAME IS INDAREATIP
AREA CODE IS 74
MODE IS DATA
AREA MAPS TO TIP
ALLOCATE 1000 PAGES
PAGES ARE 1792 WORDS
AREA NAME IS INDINDEXTIP
AREA CODE IS 75
MODE IS INDEX
AREA MAPS TO TIP
ALLOCATE 10 PAGES
PAGES ARE 112 WORDS
RECORD SECTION.
RECORD DEPARTMENT
CODE IS 101
LOCATION MODE IS CALC DMSCALC
IN CALC-AREA-NAME
USING DEPT-NO
DUPLICATES ARE NOT ALLOWED
WITHIN DEPTAREA
MODE IS ASCII
05 DEPT-NO PIC X(4)
05 DEPT-NAME PIC X(24)
05 DEPT-DESCRIPTION PIC X(55)
RECORD JOBINFO
CODE IS 102
LOCATION MODE IS CALC DMSCALC
IN CALC-AREA-NAME
USING JOB-TITLE
DUPLICATES ARE NOT ALLOWED
WITHIN JOBAREA
MODE IS ASCII
05 JOB-TITLE PIC X(20)
05 JOB-DESCRIPTION PIC X(50)
05 JOB-SALARY PIC X(5)
RECORD EMPNUMBER
CODE IS 103
LOCATION MODE IS DIRECT EMPNO-AREA-KEY, EMPNO-AREA-NAME
WITHIN EMPNOAREA
MODE IS ASCII
05 EMP-NUMBER PIC X(5)
RECORD INDIVIDUAL
CODE IS 104
LOCATION MODE IS INDEX SEQUENTIAL
USING ASCENDING KEY IND-LAST-NAME, IND-FIRST-NAME
INDEX AREA IS INDINDEX
LINKS ARE NEXT AND PRIOR
DUPLICATES ARE NOT ALLOWED
WITHIN INDAREA
MODE IS ASCII
05 IND-LAST-NAME PIC X(20)
05 IND-FIRST-NAME PIC X(12)
SET SECTION.
SET DEPT-IND
CODE IS 201
MODE IS CHAIN
ORDER IS SORTED
OWNER IS DEPARTMENT
MEMBER IS INDIVIDUAL AUTOMATIC
LINKED TO OWNER
IDENTIFICATION DIVISION
SUBSCHEMA NAME IS PERSONSUBTIP IN TIP FILE 70
OF SCHEMA PERSONNELTIP
HOST LANGUAGE IS UCS COBOL
DATA DIVISION
DATA NAME SECTION.
DATA NAMES ARE ALL
AREA SECTION.
AREAS ARE ALL
RECORD SECTION.
RECORDS ARE ALL
SET SECTION.
SETS ARE ALL
@ . ***
@ . *** ******** START OF THE DMS DATABASE DEFINITION SECTION **********
@ . ***
@ . ***
@ . *** CATALOG: SETS UP AN EXEC FILE TO HOLD THE OUTPUT OF THE DDL
@ . *** PROCESSING OF THE SCHEMA AND THE SDDL PROCESSING OF
@ . *** THE SUBSCHEMA.
@ . ***
@ . *** THE OUTPUT OF THESE PROCESSORS MUST BE PLACED IN AN EXEC
@ . *** FILE. THEY CANNOT WRITE TO A TIP FILE. LATER ANOTHER
@ . *** PORTION OF THIS RUNSTREAM WILL COPY THE DDL AND THE SDDL
@ . *** PROCESSOR OUTPUT THAT WILL BE USED DURING TRANSACTION
@ . *** EXECUTION TO THE APPROPRIATE TIP FILE.
@ . ***
@CAT,P UDS$$SVN*SCHFILEXEC.,F///1000
@ . ***
@ . ***
@ . *** CATALOG: CATALOGS THE SCHEMA, SUBSCHEMA, AND DATABASE STORAGE
@ . *** AREA EXEC FILES THAT WILL CORRESPOND TO THE TIP FILES.
@ . ***
@ . *** TIP FILES ARE NOT AWARE OF EXEC QUALIFIERS, THEREFORE
@ . *** THE EXEC-filename MUST ESTABLISH UNIQUENESS WITHOUT
@ . *** THE QUALIFIER.
@ . ***
@CAT,P UDS$$SVN*SCHFILETIP.,F/1000//1000
@CAT,P UDS$$SVN*DEPTAREATIP.,F/3//3
@CAT,P UDS$$SVN*JOBAREATIP.,F/3//3
@CAT,P UDS$$SVN*EMPNOAREATIP.,F/250//250
@CAT,P UDS$$SVN*INDAREATIP.,F/1000//1000
@CAT,P UDS$$SVN*INDINDEXTIP.,F/1//1
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE SCHEMA, SUBSCHEMA, AND DATABASE STORAGE
@ . *** AREA FILES.
@ . ***
@ . *** 2. RESERVE THE SCHEMA, SUBSCHEMA, AND DATABASE STORAGE
@ . *** AREA FILES.
@ . ***
@ . ***
@ . *** USE THE INFORMATION PLACED IN THE REPOSITORY DATABASE BY THE DDL
@ . *** AND SDDL PROCESSORS TO CREATE SCHEMA AND SUBSCHEMA INFORMATION
@ . *** IN THE REPOSITORY AND PRODUCE THEIR FILE DESCRIPTION TABLES (FDTs)
@ . ***
@UDS$$SVN*UREP$ABS.DD,ES ,,APPSVN
PROCESS SCHEMA PERSONNELTIP INSTALL.
PROCESS SUBSCHEMA PERSONSUBTIP FOR SCHEMA PERSONNELTIP INSTALL.
EXIT.
@ . ***
@ . ***
@ . *** ******** END OF THE DMS DATABASE DEFINITION SECTION ***********
@ . ***
@ . *** ******** START OF THE DMS DATABASE DEFINITION SECTION **********
@ . ***
@ . ***
@ . *** CATALOG: SETS UP AN EXEC FILE TO HOLD THE OUTPUT OF THE DDL
@ . *** PROCESSING OF THE SCHEMA AND THE SDDL PROCESSING OF
@ . *** THE SUBSCHEMA.
@ . ***
@ . *** THE OUTPUT OF THESE PROCESSORS MUST BE PLACED IN AN EXEC
@ . *** FILE. THEY CANNOT WRITE TO A TIP FILE. LATER ANOTHER
@ . *** PORTION OF THIS RUNSTREAM WILL COPY THE DDL AND THE SDDL
@ . *** PROCESSOR OUTPUT THAT WILL BE USED DURING TRANSACTION
@ . *** EXECUTION TO THE APPROPRIATE TIP FILE.
@ . ***
@CAT,P UDS$$SVN*SCHFILEXEC.,F///1000
I:002333 CAT complete.
@ . ***
@ . ***
@ . *** CATALOG: CATALOGS THE SCHEMA, SUBSCHEMA, AND DATABASE STORAGE
@ . *** AREA EXEC FILES THAT WILL CORRESPOND TO THE TIP FILES.
@ . ***
@ . *** TIP FILES ARE NOT AWARE OF EXEC QUALIFIERS, THEREFORE
@ . *** THE EXEC-FILENAME MUST ESTABLISH UNIQUENESS WITHOUT
@ . *** THE QUALIFIER.
@ . ***
@CAT,P UDS$$SVN*SCHFILETIP.,F/1000//1000
I:002333 CAT complete.
@CAT,P UDS$$SVN*DEPTAREATIP.,F/3//3
I:002333 CAT complete.
@CAT,P UDS$$SVN*JOBAREATIP.,F/3//3
I:002333 CAT complete.
@CAT,P UDS$$SVN*EMPNOAREATIP.,F/250//250
:002333 CAT complete.
@CAT,P UDS$$SVN*INDAREATIP.,F/1000//1000
I:002333 CAT complete.
@CAT,P UDS$$SVN*INDINDEXTIP.,F/1//1
I:002333 CAT complete.
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE SCHEMA, SUBSCHEMA, AND DATABASE STORAGE
@ . *** AREA FILES.
@ . ***
@ . *** 2. RESERVE THE SCHEMA, SUBSCHEMA, AND DATABASE STORAGE
@ . *** AREA FILES.
@ . ***
@ . *** 3. LIST THESE TIP FILES IN ORDER TO CONFIRM THEIR SETUP.
@ . ***
@ . *** THE UDS-TIP FILE NUMBERS ARE BACKWARDS FROM THE TIP FILE NUMBERS.
@ . *** THE FOLLOWING EQUATION COORDINATES THE TWO NUMBERS.
@ . ***
@ . ***
@ . *** UDS-TIP-FILE-NUMBER = TPFMAX + 1 - TIP-FILE-NUMBER
@ . ***
@ . *** EXAMPLE: CALCULATING THE UDS-TIP FILE NUMBER FOR
@ . *** UDS$$SVN*SCHFILETIP.
@ . ***
@ . *** GIVEN: TPFMAX = 2200 (EXEC CONFIGURATION TAG)
@ . *** ASSIGNED TIP-FILE-NUMBER = 2131
@ . ***
@ . *** 2200 + 1 - 2131
@ . ***
@ . *** UDS-TIP-FILE-NUMBER FOR UDS$$SVN*SCHFILETIP = 70
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 44R2 02/17/94 12:17:07 FS-LEVEL FS 003
TREG UDS$$SVN*SCHFILETIP.,FIX
TP REGISTER STARTED 12:17:07 17 FEB 94
TP REGISTER FINISHED 12:17:08 17 FEB 94
TREG UDS$$SVN*DEPTAREATIP.,FIX
TP REGISTER STARTED 12:17:08 17 FEB 94
TP REGISTER FINISHED 12:17:08 17 FEB 94
TREG UDS$$SVN*JOBAREATIP.,FIX
TP REGISTER STARTED 12:17:08 17 FEB 94
TP REGISTER FINISHED 12:17:08 17 FEB 94
TREG UDS$$SVN*EMPNOAREATIP.,FIX
TP REGISTER STARTED 12:17:08 17 FEB 94
TP REGISTER FINISHED 12:17:08 17 FEB 94
TREG UDS$$SVN*INDAREATIP.,FIX
TP REGISTER STARTED 12:17:08 17 FEB 94
TP REGISTER FINISHED 12:17:09 17 FEB 94
TREG UDS$$SVN*INDINDEXTIP.,FIX
TP REGISTER STARTED 12:17:09 17 FEB 94
TP REGISTER FINISHED 12:17:09 17 FEB 94
RES,G 70,64000,28,,SCHFILETIP,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 12:17:09 17 FEB 94
DMS AREA 71
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 12 SIZE: 448 APPLICATION GROUP: 0
FILE NAME DEPTAREATIP
PLACEMENT 0
LEG STATUS AVL-UP
DMS AREA 72
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 12 SIZE: 448 APPLICATION GROUP: 0
FILE NAME JOBAREATIP
PLACEMENT 0
LEG STATUS AVL-UP
DMS AREA 73
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 1000 SIZE: 448 APPLICATION GROUP: 0
FILE NAME EMPNOAREATIP
PLACEMENT 0
LEG STATUS AVL-UP
DMS AREA 74
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 1000 SIZE: 1792 APPLICATION GROUP: 0
FILE NAME INDAREATIP
PLACEMENT 0
LEG STATUS AVL-UP
DMS AREA 75
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 16 SIZE: 112 APPLICATION GROUP: 0
FILE NAME INDINDEXTIP
PLACEMENT 0
LEG STATUS AVL-UP
END FREIPS
@ . ***
@ . ***
@ . *** USE THE DDL PROCESSOR TO PRODUCE ABSOLUTE SCHEMA TABLES AND
@ . *** TO PLACE INFORMATION ABOUT THE SCHEMA IN THE REPOSITORY DATABASE.
@ . *** LATER THE OUTPUT OF THE DDL PROCESSOR WILL BE COPIED TO THE
@ . *** APPROPRIATE TIP FILE.
@ . *** THE DDL PROCESSOR CANNOT WRITE TO A TIP FILE.
@ . ***
@ASG,A UDS$$SVN*SCHFILEXEC.
I:002333 ASG complete.
@USE SCHFILEXEC,UDS$$SVN*SCHFILEXEC.
I:002333 USE complete.
@UDS$$SVN*DMRMT$.DDL,DN QUAL*UCSTST.PERSONNELTIP,SCHFILEXEC.PERSONNELTIP
DDL PROCESSOR LEVEL : 13R3 02-17-94 12:17:10
DMS 1100 BUILD ID 13R3
CC/ER: 00:00:01.501
@ . ***
@ . ***
@ . *** USE THE SDDL PROCESSOR TO PRODUCE SUBSCHEMA TABLES AND TO PLACE
@ . *** INFORMATION ABOUT THE SUBSCHEMA IN THE REPOSITORY DATABASE
@ . ***
@ . ***
@ . *** THE SDDL PROCESSOR CREATES A PROC THAT CONTAINS THE DATA DIVISION
@ . *** ENTRIES FOR THE DATABASE DATA NAMES AND THE DATABASE RECORDS THAT
@ . *** WILL BE COPIED INTO THE USER PROGRAM BY THE UCS COMPILER. AS
@ . *** PART OF THE SDDL PROCESS THIS PROC IS AUTOMATICALLY PDP'ED.
@ . ***
@ . *** NOTICE THAT THE OUTPUT OF THE SDDL PROCESSOR IS WRITTEN TO AN EXEC
@ . *** FILE. LATER THIS OUTPUT WILL BE COPIED TO THE APPROPRIATE TIP
@ . *** FILE. THE SDDL PROCESSOR CANNOT WRITE TO A TIP FILE.
@ . ***
@UDS$$SVN*DMRMT$.SDDL,DL QUAL*UCSTST.PERSONSUBTIP,SCHFILEXEC.PERSONSUBTIP
SDDL PROCESSOR LEVEL :
DMS 1100 BUILD ID
1 IDENTIFICATION DIVISION
2 SUBSCHEMA NAME IS PERSONSUBTIP IN TIP FILE 70
3 OF SCHEMA PERSONNELTIP
4 HOST LANGUAGE IS UCS COBOL
5 DATA DIVISION
6 DATA NAME SECTION.
7 DATA NAMES ARE ALL
8 AREA SECTION.
9 AREAS ARE ALL
10 RECORD SECTION.
11 RECORDS ARE ALL
12 SET SECTION.
13 SETS ARE ALL
END SDDL 0 WARNING 0 FATAL 0 SYNTAX
CC/ER: 00:00:06.441
@PDP,CN DSF$.X$PROC/PERSONSUBTIP,PDP$$$SO$$$.S$PROC/PERSONSUBTIP
PDP 13R1J (931108 0108:39) 1994 Feb 17 Thu 1217:14
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 22 Entry Points: 2 Time: 1.196 Storage: 7070/0/7070/0106210
@FREE,A PDP$$$SO$$$.
I:002333 FREE complete.
@ . ***
@ . ***
@ . *** COPIES THE SCHEMA AND SUBSCHEMA AFTER THE DDL AND SDDL PROCESSORS
@ . *** HAVE CREATED ABSOLUTES FROM THEIR EXEC FILE TO THE TIP FILE WHERE
@ . *** THEY ARE REQUIRED FOR TRANSACTION PROGRAMS.
@ . ***
@ . *** THE 'TPFREE'FREES AN EXEC FILE FROM TIP TO THE OS 2200 SYSTEM.
@ . *** ALL TIP FILE ASSIGNMENTS ARE RETAINED.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 44R2 02/17/94 12:17:20 FS-LEVEL FS 003
TPFREE UDS$$SVN*SCHFILETIP.
TP FREE STARTED 12:17:20 17 FEB 94
TP FREE FINISHED 12:17:20 17 FEB 94
END FREIPS
@ . ***
@ . ***
@ . *** COPIES THE SCHEMA AND SUBSCHEMA ABSOLUTES FROM THE EXEC FILE
@ . *** TO THE TIP FILE.
@ . ***
@PRT,T UDS$$SVN*SCHFILEXEC.
FURPUR 30R7 (940125 0849:29) 1994 Feb 17 Thu 1217:21
STD#UDS$$SVN*SCHFILEXEC(1)
ABS PERSONNELTIP
ABS PERSONSUBTIP
OM S$WORK/PERSONSUBTIP
COBP S$PROC/PERSONSUBTIP(0)
@COPY,A UDS$$SVN*SCHFILEXEC.,UDS$$SVN*SCHFILETIP.
3 ABS
@PACK,P UDS$$SVN*SCHFILETIP.
END RELOCATABLE PREP. UDS$$SVN*SCHFILETIP(1) 0 REL 0 ENTRY PT(S) NO DUP(S)
END OBJECT MODULE PREP. UDS$$SVN*SCHFILETIP(1) 1 OM 1 ENTRY PT(S)
END PACK. TEXT=2,TOC=1,ABS=3
@PRT,TL UDS$$SVN*SCHFILETIP.
STD#UDS$$SVN*SCHFILETIP(1) ELEMENT TABLE
D NAME VERSION TYPE DATE TIME
PERSONNELTIP ABSOLUTE 17 FEB 94 12:17:14...
PERSONSUBTIP ABSOLUTE 17 FEB 94 12:17:18...
S$WORK PERSONSUBTIP OBJ-MODULE 17 FEB 94 12:17:18...
NEXT AVAILABLE LOCATION-
ASSEMBLER PROCEDURE TABLE EMPTY
COBOL PROCEDURE TABLE EMPTY
FORTRAN PROCEDURE TABLE EMPTY
RELOCATABLE ENTRY POINT TABLE EMPTY
PREP'D OBJECT MODULE ENTRY POINT TABLE
T NAME SEQ POS TYPE T NAME
S$PERSONSUBTIP 3 1 DATA
NON-PREP'D OBJECT MODULE ENTRY POINTS EMPTY
NO DUPLICATE OM ENTRY POINTS FOUND
@ . ***
@ . ***
@ . *** THE 'TPASG'ASSIGNS THE EXEC FILE BACK TO TIP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 44R2 02/17/94 12:17:33 FS-LEVEL FS 003
TPASG UDS$$SVN*SCHFILETIP.
TP ASSIGN STARTED 12:17:33 17 FEB 94
TP ASSIGN FINISHED 12:17:34 17 FEB 94
LFD,G 70
TIP FILE 70
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 64000 SIZE: 28 APPLICATION GROUP: 0
FILE NAME SCHFILETIP
PLACEMENT 0
LEG STATUS AVL-UP
END FREIPS
@ . ***
@ . ***
@ . *** USE THE INFORMATION PLACED IN THE REPOSITORY DATABASE BY THE DDL
@ . *** AND SDDL PROCESSORS TO CREATE SCHEMA AND SUBSCHEMA INFORMATION
@ . *** IN THE REPOSITORY AND PRODUCE THEIR FILE DESCRIPTION TABLES (FDTS)
@ . ***
@UDS$$SVN*UREP$ABS.DD,ES ,,APPSVN
UREP 3R2 (11/04/93 10:17:34) 02/17/94 12:17:34
1 PROCESS SCHEMA PERSONNELTIP INSTALL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA SCHEMA VERSION ABS for SCHEMA
PERSONNELTIP was SUCCESSFUL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA DEPTAREATIP VERSION ''for
SCHEMA PERSONNELTIP was SUCCESSFUL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA JOBAREATIP VERSION ''for SCHEMA
PERSONNELTIP was SUCCESSFUL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA EMPNOAREATIP VERSION ''for
SCHEMA PERSONNELTIP was SUCCESSFUL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA INDAREATIP VERSION ''for SCHEMA
PERSONNELTIP was SUCCESSFUL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA INDINDEXTIP VERSION ''for
SCHEMA PERSONNELTIP was SUCCESSFUL.
*REMARK* DSD4039 The PROCESS SCHEMA PERSONNELTIP is successfully completed.
2 PROCESS SUBSCHEMA PERSONSUBTIP FOR SCHEMA PERSONNELTIP INSTALL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA PERSONSUBTIP VERSION ABS for
SCHEMA PERSONNELTIP was SUCCESSFUL.
*REMARK* DSD4039 The PROCESS SUBSCHEMA PERSONSUBTIP is successfully complete
3 EXIT.
END UREP ( 0 )FATALS ( 0 )ERRORS ( 0 )WARNINGS ( 9 )REMARKS .
@ . ***
@ . ***
@ . *** ******** END OF THE DMS DATABASE DEFINITION SECTION ***********
The syntax for DML commands in UCS transaction programs is identical to the syntax
supported for non-UCS transaction programs.
A UCS DML transaction program can use DPS 2200 functions, MCB functions, and TIP
primitives.
The following figure summarizes a simple UCS DML transaction program described in
the following subsections. This sample transaction program uses DPS 2200. The
program
1. Reads an employee number
2. Accesses information about that individual from the DMS 2200 database
3. Displays the data
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSDMS INITIAL.
.
.
DATA DIVISION.
SUBSCHEMA SECTION.
INVOKE .....
.
.
WORKING-STORAGE SECTION.
01 EMPLOYEE-NUMBER ....
PROCEDURE DIVISION.
CALL 'D$INIT'....
CALL 'D$GETFL'....
CALL 'D$GETFL'....
CALL 'D$OPEN'....
IMPART
OPEN .... RETRIEVAL
FETCHs ....
MOVE DATA TO DPS FORM
DEPART
CALL 'D$SEND'....
CALL 'D$TERM'....
STOP RUN.
Refer to the DMS CDML Operations and Programming Reference Manual for more
information on coding UCS COBOL DML programs. Refer to the DMS FDML
Operations and Programming Reference Manual for more information on coding UCS
FORTRAN DML programs.
The ASCII COBOL DML (ADML) and FORTRAN DML (FDML) preprocessors required for
non-UCS programs are not needed and no longer exist in UCS.
d. If it does not find such a file, the compiler tries to assign the subschema file,
using the run's project-id as the subschema file's qualifier.
2. When compiling a UCS COBOL transaction program containing DML statements,
you must specify the COMPAT keyword option on the compiler call (but only if the
subschema includes items with USAGE COMP-1 or COMP-2, as of DMS level 17R1).
The COMPAT keyword option causes the compiler to interpret these as if they
were the correct COBOL 85 format.
No special keyword options are required for compilation of UCS FORTRAN DML
programs.
3. The UCS compilers access the object subschema and the S$PROC symbolic
element from the subschema file while parsing the DML syntax.
4. The output of the compiler is an object module that includes the D$WORK
information.
The following statements show how to compile the UCS COBOL DML transaction
program illustrated in this section.
@ASG,A UDS$$SVN*SCHFILEXEC.
@USE SCHFILEXEC,UDS$$SVN*SCHFILEXEC.
@UCOB,S QUAL*UCSTST.DPSDMS,QUAL*UCSTST.DPSDMS/COMP,,,;
NO-OPTIONS, NO-REMARK
The system automatically sets up application group library search chains for each of
the 64 application groups during installation of the Linking System. These library
search chains mean the applications programmer does not have to do either of the
following:
• Build a user-defined library search chain for linking
• Explicitly supply (INCLUDE) the object module containing the DMS 2200 interface
during static linking
The following generic format shows how to specify use of the appropriate application
group library search chain:
@USE LINK$PF,SYS$LIB$*APP$n
If you want to link a UCS program containing DML statements to the system software
in application group 7, use the following statement:
@USE LINK$PF.,SYS$LIB$*APP$7.
In this case, all references to DMS 2200 software would be resolved using
UDS$$SVN*D$MR.
If the DMS transaction program uses DPS 2200 functions, you can build a user-defined
library search chain that ensures that the file containing the desired version of DPS
2200 is included in the library search chain for the desired application group. How to
build this search chain for application group seven is shown in 4.5.1. If this search
chain is used, the LINK$PF statement is
You can use one of the following ways to ensure that the Linking System can locate
S$WORK:
• Explicitly supply (INCLUDE) the S$WORK object module from the subschema EXEC
file. (This method is used in the static linking example shown in "Statically Linking
a UCS DML Transaction Program," which follows.)
• Specify the file containing S$WORK in the USING clause of the RESOLVE
command.
• Set up a user-defined library search chain that searches both
− The file containing S$WORK
− The files containing the system software for the appropriate application group
Then specify an @USE LINK$PF statement to identify this library search chain.
The output of this static link must be a zero overhead object module.
Object
Subschema
S$PROC
Symbolic
Element
@USE LINK$PF,SYS$LIB$*APP$7. S$WORK
UDS DML or Object
UCS Object @USE LINK$PF,SYS$LIB$*APP$7DPS. Module
Module @LINK
UDS$$SVN*SCHFILEXEC.
qual*progfile.om/comp
UDS DML
UCS Linked
ZOOM
qual*progfile.zoom
The following example shows how to statically link a UCS transaction program
containing DML statements, producing a zero overhead object module:
Explanation:
1. This statement ensures that the program is statically linked using the DMS 2200
and DPS 2200 software located in the desired application group. This search chain
was built in 4.5.1 to include DPS 2200. If MCB functions are used in the transaction
program instead of DPS 2200 functions, the Unisys-supplied application group
library search chains can be used (SYS$LIB$*APP$7.). In this example, this
program is to execute in application group 7.
2. This statement calls the Linking System LINK Processor. The zero overhead object
module (ZOOM) to be produced is named QUAL*UCSTST.DPSDMS.
3. This command identifies the compiler-generated object module containing the
UCS DML program.
4. This command identifies the object module generated by SDDL that contains the
subschema's S$WORK element.
5. This command resolves external references, including those to the UCS Runtime
System library.
6. This command merges banks and attempts to produce a fast-load zero overhead
object module, otherwise a standard zero overhead object module is created.
7. This command deletes all definitions except the program's starting address,
START$. This decreases the size of the ZOOM.
8. This statement ends static linking.
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSDMS INITIAL.
******************************************************************
******************************************************************
* *
* SIMPLE TIP COBOL DPS DMS PROGRAM - DPSDMS *
* *
* initializes with DPS *
* reads the input data *
* opens the DPS form *
* moves the employee number to the form *
* imparts to the PERSONNELTIP database *
* retrieves the requested information from the DMS database *
* moves the DMS information to the form *
* departs from the PERSONNELTIP database *
* displays the DPS form *
* terminates with DPS *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
SUBSCHEMA SECTION.
INVOKE SUBSCHEMA PERSONSUBTIP IN FILE SCHFILEXEC
OF SCHEMA PERSONNELTIP
COPYING RECORDS INTO WORKING
COPYING DATA-NAMES INTO WORKING
RUN-UNIT-ID DPSALL
DMCA IS WORKING
ERROR DMS-GENERAL-ERROR-PARA.
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 ERR-MISSING-INPUT PIC X(78)
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
MOVE GETFIELD-TEXT TO EMPLOYEE-NUMBER.
IF GETFIELD-TYPE = 1
MOVE ERR-MISSING-INPUT TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
ELSE IF GETFIELD-LENGTH NOT EQUAL 5 OR
GETFIELD-TYPE NOT EQUAL 3
MOVE GETFIELD-TEXT TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
ELSE CONTINUE
END-IF
END-IF.
************************************************************
* EMPLOYEE NUMBER VALIDATION
************************************************************
VALID-EMPLOYEE-NUMBER.
IF EMP-PAGE <= 99 OR EMP-RECORD <= 0
MOVE GETFIELD-TEXT TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
END-IF.
************************************************************
* OPENS THE SCREEN TO BE SENT TO THE USER
************************************************************
DPS-OPEN-OUTPUT-SCREEN.
CALL 'D$OPEN'USING DPS-STATUS, SCREEN-DSPLYIND-50.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
************************************************************
* TRANSFERS THE EMPLOYEE NUMBER TO THE FORM DEFINITION
************************************************************
MOVE-EMPLOYEE-NUMBER.
MOVE EMPLOYEE-NUMBER TO S50-EMP-NUMBER.
************************************************************
* INITIALIZE WITH THE DATABASE SYSTEM
* PROGRAM TERMINATION
***********************************************************
TERMINATION-PARA.
STOP RUN.
************************************************************
* DMS - CHECK FOR A '0013'ERROR,
* IF THIS ERROR OCCURRED THE
* INVALID-EMPLOYEE-NUMBER MESSAGE IS PRINTED
* ELSE THE ERROR MESSAGE IS RETURNED TO THE PRINTER
* FOR DEBUGGING.
************************************************************
DMS-GENERAL-ERROR-PARA.
IF ERROR-NUM = '0013'
MOVE EMPLOYEE-NUMBER TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
ELSE DISPLAY 'DMS-GENERAL-ERROR-PARA.'UPON PRINTER
DISPLAY 'AREA = 'ERROR-AREA UPON PRINTER
DISPLAY 'RECORD = 'ERROR-RECORD UPON PRINTER
DISPLAY 'SET = ' ERROR-SET UPON PRINTER
DISPLAY 'ROLLBACK = 'RB-ERROR-CODE UPON PRINTER
DISPLAY 'FUNCTION = 'ERROR-FUNCTION UPON PRINTER
DISPLAY 'ERR NUM = ' ERROR-NUM UPON PRINTER
END-IF.
IF IMPART-DEPART EQUAL TO 1 PERFORM DMS-DEPART-PARA.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
*
*
************************************************************
* RETURNS AN ERROR MESSAGE TO THE USER IF THE INPUT
* MESSAGE WAS IN ERROR AND TERMINATES WITH THE
* TRANSACTION PROCESSING SYSTEM
************************************************************
INVALID-INPUT-PARA.
CALL 'D$SENDERR'USING DPS-STATUS, ERROR-MESSAGE,
ERROR-COORDINATES.
*
*
************************************************************
* ONLY EXECUTED WHEN A DPS ERROR OCCURS
* THE OUTPUT OF D$DUMP SHOULD BE INCLUDED WITH UCF
* DOCUMENTATION IF THIS PARAGRAPH WAS EXECUTED DUE TO
* TO A DPS INTERNAL ERROR.
************************************************************
DPS-GENERAL-ERROR-PARA.
CALL 'D$DUMP'.
CALL 'D$ERRMSG'USING DPS-STATUS.
IF IMPART-DEPART EQUAL TO 1 PERFORM DMS-DEPART-PARA.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** COMPILE OF THE BATCH INITIAL LOAD PROGRAM AND THE TIP TRANSACTION
@ . *** PROGRAM
@ . ***
@ . *** ASSIGN THE FILE CONTAINING SUBSCHEMA PROCESSING OUTPUT AND
@ . *** PUT A USE NAME ON IT.
@ . ***
@ASG,A UDS$$SVN*SCHFILEXEC.
@USE SCHFILEXEC,UDS$$SVN*SCHFILEXEC.
@ . ***
@ . ***
@ . *** INITIAL LOAD PROGRAM COMPILE
@ . ***
@UCOB QUAL*UCSTST.LOADDMSDBTP,QUAL*UCSTST.LOADDMSDBTP/COMP,,, ;
COMPAT, NO-OPTIONS
@ . ***
@ . ***
@ . *** RETRIEVAL PROGRAM COMPILE
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
@EOF
@ . ***
@ . ***
@ . *** COMPILE OF THE DPS DMS COBOL TRANSACTION PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
@UCOB QUAL*UCSTST.DPSDMS,QUAL*UCSTST.DPSDMS/COMP,,, COMPAT, NO-OPTIONS
@ . ***
@ . ***
@ . *** EXECUTION OF THE INITIAL LOAD PROGRAM USING DYNAMIC LINKING
@ . ***
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON BTLOADING
ON STICKING
@EOF
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*TIPSUPUR.,FIX
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
LFD 810
@EOF
@ . ***
@ . ***
@ . *** USES THE SUPUR UTILITY TO CREATE A SUPUR PROGRAM FILE,
@ . *** COPYS THE TRANSACTION PROGRAM INTO THE SUPUR PROGRAM FILE,
@ . *** AND PLACES THE SUPUR PROGRAM FILE ONLINE.
@ . ***
@TIP$*TIPRUN$.SUPUR,P
CREATE 810 MAIN
COPY ONLY DPSDMS FROM QUAL*UCSTST TO 810
ONLINE 810
LIST ALL FROM 810
EXIT
@ . ***
@ . ***
@ . *** EXAMPLE SETUP IS COMPLETE
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** COMPILE OF THE BATCH INITIAL LOAD PROGRAM AND THE TIP TRANSACTION
@ . *** PROGRAM
@ . ***
@ . *** ASSIGN THE FILE CONTAINING SUBSCHEMA PROCESSING OUTPUT AND
@ . *** PUT A USE NAME ON IT.
@ . ***
@ASG,A UDS$$SVN*SCHFILEXEC.
W:120533 filename not unique.
W:120133 file is already assigned.
@USE SCHFILEXEC,UDS$$SVN*SCHFILEXEC.
I:002333 USE complete.
@ . ***
@ . ***
@ . *** INITIAL LOAD PROGRAM COMPILE
@ . ***
@UCOB QUAL*UCSTST.LOADDMSDBTP,QUAL*UCSTST.LOADDMSDBTP/COMP,,, ;
COMPAT, NO-OPTIONS
UCOB- 6R2(940210) LSS- 8R2(940209) 940217 12:27:39
SIZES: CODE(EM6): 1701 DATA: 2089
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 6 REMARKS(CLARIFICATION)
@ . ***
@ . ***
@ . *** RETRIEVAL PROGRAM COMPILE
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
PDP 13R1J (931108 0108:39) 1994 Feb 17 Thu 1227:50
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 708 Entry Points: 1 Time: 2.885 Storage: 7070/0/7070/0106210
@ . ***
@ . ***
@ . *** COMPILE OF THE DPS DMS COBOL TRANSACTION PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
I:002333 USE complete.
@UCOB QUAL*UCSTST.DPSDMS,QUAL*UCSTST.DPSDMS/COMP,,, COMPAT, NO-OPTIONS
UCOB- 6R2(940210) LSS- 8R2(940209) 940217 12:27:53
SIZES: CODE(EM6): 1321 DATA: 822
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 6 REMARKS(CLARIFICATION)
@ . ***
@ . ***
@ . *** EXECUTION OF THE INITIAL LOAD PROGRAM USING DYNAMIC LINKING
@ . ***
@ . *** THE SUBSCHEMA ABSOLUTE IS COPIED TO QUAL*UCSTST. (HOME$)
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@COPY,A UDS$$SVN*SCHFILEXEC.S$WORK/PERSONSUBTIP,QUAL*UCSTST.
FURPUR 30R7 (940125 0849:29) 1994 Feb 17 Thu 1228:03
1 ABS
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@XQT QUAL*UCSTST.LOADDMSDBTP/COMP
IMPARTED
*******************
DATABASE VALIDATION
****
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'DPSDMS'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, A SPECIAL
@ . *** SEARCH CHAIN FOUND IN SYS$LIB$*APP$7DPS.SSDEF$ IS SPECIFIED
@ . *** USING AN "@USE LINK$PF" COMMAND. THIS SEARCH CHAIN IDENTIFIES
@ . *** THE DPS SYSTEM FILE FOR APPLICATION GROUP 7 AND SETS
@ . *** ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7DPS.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.DPSDMS
LINK 5R2 (940207 1635:57) 1994 Feb 17 Thu 1228:47
*WARNING (link 687)* The Linking System could NOT create a ZOOM that conforms
to the Fast Load format restriction of four banks or less. This is due to
incompatibilities in the attributes (e.g. merge order, mode, locality) of
certain banks, which prevent them from being merged. Such merging is required
to reduce the number of banks that are output. The ZOOM that is created will
be of the standard form.
END LINK , LINES : 5 , ERRORS : 0 , WARNINGS : 1 , XREFS : 0.
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 44R2#0000001 940217 1228:53
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
TPINIT 44R2#0000001 940217 1228:54
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 44R2#0000001 940217 1228:54
ON BTLOADING
ON STICKING
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
I:002333 CAT complete.
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 44R2 02/17/94 12:28:54 FS-LEVEL FS 003
TREG QUAL*TIPSUPUR.,FIX
TP REGISTER STARTED 12:28:54 17 FEB 94
TP REGISTER FINISHED 12:28:56 17 FEB 94
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 12:28:56 17 FEB 94
TP RESERVE FINISHED 12:28:56 17 FEB 94
LFD 810
>DPSDMS 10211
Support for the embedded SQL interface was added to UCS COBOL transaction
programs in SB4 and to UCS C in SB5R2. Also, as of SB5R2 UCS FORTRAN transaction
programs support the module language SQL interface.
The following subsections describe the steps involved in creating and accessing an
RDMS 2200 database using UCS TIP transactions. They discuss
• Table definitions
• SQL application TIP transaction programs
RDMS 2200 tables are kept in storage areas. You define storage areas by using the
Unisys Repository Manager (UREP).
Once you have defined the storage areas for the tables, you can define the tables
themselves using one of the following ways:
• By using the IPF SQL interface
• By coding an SQL program
• By using the MAPPER Relational Interface (MRI)
• Client-based tools using
− ODBC (Open DataBase Connectivity)
− Open Client/Open Server interconnect
When you define a table, UREP makes an entry in the Unisys repository that
symbolically describes the table's characteristics (for example, table names and
column names).
Coding an RDMS 2200 table definition has no special constraints in UCS. Existing table
definitions being used by non-UCS SQL programs can be used without change by UCS
interpreted SQL, UCS module language SQL, and embedded SQL programs.
The following figure shows the tables that are used in the RDMS 2200 example for
this section.
SCHOOL
is a table whose primary key is the school's unique number (SCH-NUMBER).
CHILD
is a table whose primary key is the individual's employee number (CHILD-EMP-
NUMBER) and the sequential number of the child in the family (CHILD-NUMBER).
The table also has a secondary index consisting of the child's name (child-last-
name, child-first-name). The child's school number (child-school-number) is a
foreign key to the SCHOOL table. The child's employee number (CHILD-EMP-
NUMBER) is a foreign key to the INDIVIDUALR table.
To keep the program simple, this example assumes that no individual will have more
than three children.
Note: Using TIP file control eliminates much Exec input/output overhead.
Therefore, it is recommended that RDMS 2200 databases that will be accessed by
TIP transactions be set up using TIP storage areas. This requires setting up a TIP
file for each underlying Exec file.
When you later define the storage areas using UREP, the UDS-TIP-CODE must match
the UDS-TIP file number.
For more information on setting up TIP files that hold RDMS 2200 storage areas, refer
to the Repository For ClearPath OS 2200 Administration Guide.
>DESCRIPTION<
THIS IS AN OPTIONAL DESCRIPTION SECTION, WHICH DESCRIBES
THE FORMAT OF THE DATA IN THIS FILE.
>END DESCRIPTION<
10211 FIELDING STEVEN 480719 FIELDING KATHY
10215 HELLER JENNIFER 590529 * *
10223 RALSTON KAREN 580910 EASTMAN JOHN
24101 ANDERSON MARY 520803 ANDERSON FRED
26503 MILLER RALPH 470317 * *
26504 BLAKE JOHN 650714 * *
26510 CARR GEORGE 561123 CARR SUSAN
32009 KAISER JAKE 531008 WRIGHT ANGEL
Example 5–17. Source Listing of the Load Data for INDIVIDUALR Table
(QUAL*INDLOAD.)
Example 5–18 is the source listing of the load data for the SCHOOL table. For this
example, the SCHOOL load data resides in the file QUAL*SCHLOAD.
>DESCRIPTION<
THIS IS AN OPTIONAL DESCRIPTION SECTION, WHICH DESCRIBES
THE FORMAT OF THE DATA IN THIS FILE.
>END DESCRIPTION<
1349 WOODBURY SENIOR HIGH 09 12
1361 EAGAN MIDDLE SCHOOL 06 08
2188 WESTERLY ELEMENTARY 01 05
3703 GLENVIEW ELEMENTARY 01 05
Example 5–18. Source Listing of the Load Data for SCHOOL Table
(QUAL*SCHLOAD.)
Example 5–19 is the source listing of the load data for the CHILD table. For this
example, the CHILD load data resides in the file QUAL*CHILDLOAD.
>DESCRIPTION<
THIS IS AN OPTIONAL DESCRIPTION SECTION, WHICH DESCRIBES
THE FORMAT OF THE DATA IN THIS FILE.
>END DESCRIPTION<
10211 01 FIELDING STEVEN JR 680108 * *
10211 02 FIELDING DANIEL 710708 * *
10211 03 FIELDING JANE 760411 1349 3.500
10215 01 HELLER VANESSA 851002 * *
10223 01 EASTMAN JAMES 880912 * *
24101 01 ANDERSON SEAN 800611 3703 2.850
24101 02 ANDERSON MICHELLE 800611 3703 4.000
32009 01 KAISER JASON 780213 1361 3.500
32009 02 KAISER SHARON 830228 2188 3.250
Example 5–19. Source Listing of the Load Data for CHILD Table
(QUAL*CHILDLOAD.)
@ . ***
@ . *** ******** START OF THE RDMS DATABASE DEFINITION SECTION **********
@ . ***
@ . *** CATALOG: CATALOGS THE DATABASE STORAGE AREA EXEC FILES
@ . *** THAT WILL CORRESPOND TO THE TIP FILES.
@ . ***
@ . *** TIP FILES ARE NOT AWARE OF EXEC QUALIFIERS, THEREFORE
@ . *** THE EXEC-filename MUST ESTABLISH UNIQUENESS WITHOUT
@ . *** THE QUALIFIER.
@ . ***
@CAT,P UDS$$SVN*INDRAREATIP.,F/20//20
@CAT,P UDS$$SVN*CHILDAREATIP.,F/20//20
@CAT,P UDS$$SVN*SCHOOLAREATP.,F/5//5
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE DATABASE STORAGE AREA FILES.
@ . ***
@ . *** 2. RESERVE THE DATABASE STORAGE AREAS FILES.
@ . ***
@ . *** 3. LIST THESE TIP FILES IN ORDER TO CONFIRM THEIR SETUP.
@ . ***
@ . *** THE UDS-TIP FILE NUMBERS ARE BACKWARDS FROM THE TIP FILE NUMBERS.
@ . *** THE FOLLOWING EQUATION COORDINATES THE TWO NUMBERS.
@ . ***
@ . ***
@ . *** UDS-TIP-FILE-NUMBER = TPFMAX + 1 - TIP-FILE-NUMBER
@ . ***
@ . *** EXAMPLE: CALCULATING THE UDS-TIP FILE NUMBER FOR
@ . *** UDS$$SVN*INDRAREATIP.
@ . *** GIVEN: TPFMAX = 2200 (EXEC CONFIGURATION TAG)
@ . *** Assigned TIP-FILE-NUMBER = 2134
@ . ***
@ . *** 2200 + 1 - 2134
@ . ***
@ . *** UDS-TIP-FILE-NUMBER FOR UDS$$SVN*INDRAREATIP = 67
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG UDS$$SVN*INDRAREATIP.,FIX
Example 5–20. Runstream to Define Storage Areas and Tables and Load Tables
TREG UDS$$SVN*CHILDAREATIP.,FIX
TREG UDS$$SVN*SCHOOLAREATP.,FIX
RES,G 67,40,896,,INDRAREATIP,,,WW=P,AUDIT=0,NREC
RES,G 68,40,896,,CHILDAREATIP,,,WW=P,AUDIT=0,NREC
RES,G 69,20,448,,SCHOOLAREATP,,,WW=P,AUDIT=0,NREC
LFD,G 67/69
@EOF
@ . ***
@ . ***
@ . ***
@ . *** USE THE UNISYS REPOSITORY TO DEFINE THE RDMS STORAGE AREAS
@ . ***
@UDS$$SVN*UREP$ABS.DD,E ,,APPSVN
CREATE SCHEMA FAMILYTIP.
CREATE STORAGE-AREA INDRAREATIP FOR SCHEMA FAMILYTIP
ADD FILE-TYPE IS UDS-TIP.
ADD DATA-FORMAT IS RSM.
ADD FILE-NAME IS INDRAREATIP.
ADD UDS-TIP-CODE IS 67.
ADD DOMAIN IS UDS.
ADD LOCK-STRATEGY IS PAGE.
ADD RECOVERED IS TRUE.
ADD AUDITED IS TRUE.
ADD PAGE-SIZE IS 896.
ADD MAXIMUM-PAGES IS 40.
ADD CHECKSUM IS NO.
CREATE STORAGE-AREA CHILDAREATIP FOR SCHEMA FAMILYTIP.
ADD FILE-TYPE IS UDS-TIP.
ADD DATA-FORMAT IS RSM.
ADD FILE-NAME IS CHILDAREATIP.
ADD UDS-TIP-CODE IS 68.
ADD DOMAIN IS UDS.
ADD LOCK-STRATEGY IS PAGE.
ADD RECOVERED IS TRUE.
ADD AUDITED IS TRUE.
ADD PAGE-SIZE IS 896.
ADD MAXIMUM-PAGES IS 40.
ADD CHECKSUM IS NO.
CREATE STORAGE-AREA SCHOOLAREATP FOR SCHEMA FAMILYTIP.
ADD FILE-TYPE IS UDS-TIP.
ADD DATA-FORMAT IS RSM.
ADD FILE-NAME IS SCHOOLAREATP.
ADD UDS-TIP-CODE IS 69.
ADD DOMAIN IS UDS.
ADD LOCK-STRATEGY IS PAGE.
ADD RECOVERED IS TRUE.
Example 5–20. Runstream to Define Storage Areas and Tables and Load
Tables
Example 5–20. Runstream to Define Storage Areas and Tables and Load
Tables
CHILD_LAST_NAME(10:29),
CHILD_FIRST_NAME(31:42),
CHILD_BIRTH_DATE(44:49),
CHILD_SCHOOL_NUMBER(51:54) NULLIF((51:51) = '*'),
CHILD_GRADE_AVERAGE(56:60) NULLIF((56:56) = '*') ;
@ . ***
@ . ***
@ . ***
@ . *** ******** END OF THE RDMS DATABASE DEFINITION SECTION *************
@ . ***
Example 5–20. Runstream to Define Storage Areas and Tables and Load
Tables
@ . ***
@ . *** ******** START OF THE RDMS DATABASE DEFINITION SECTION **********
@ . ***
@ . *** CATALOG: CATALOGS THE DATABASE STORAGE AREA EXEC FILES
@ . *** THAT WILL CORRESPOND TO THE TIP FILES.
@ . ***
@ . *** TIP FILES ARE NOT AWARE OF EXEC QUALIFIERS, THEREFORE
@ . *** THE EXEC-FILENAME MUST ESTABLISH UNIQUENESS WITHOUT
@ . *** THE QUALIFIER.
@ . ***
@CAT,P UDS$$SVN*INDRAREATIP.,F/20//20
I:002333 CAT complete.
@CAT,P UDS$$SVN*CHILDAREATIP.,F/20//20
I:002333 CAT complete.
@CAT,P UDS$$SVN*SCHOOLAREATP.,F/5//5
I:002333 CAT complete.
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE DATABASE STORAGE AREA FILES.
@ . ***
@ . *** 2. RESERVE THE DATABASE STORAGE AREAS FILES.
@ . ***
@ . *** 3. LIST THESE TIP FILES IN ORDER TO CONFIRM THEIR SETUP.
@ . ***
@ . *** THE UDS-TIP FILE NUMBERS ARE BACKWARDS FROM THE TIP FILE NUMBERS.
@ . *** THE FOLLOWING EQUATION COORDINATES THE TWO NUMBERS.
@ . ***
@ . ***
@ . *** UDS-TIP-FILE-NUMBER = TPFMAX + 1 - TIP-FILE-NUMBER
@ . ***
@ . *** EXAMPLE: CALCULATING THE UDS-TIP FILE NUMBER FOR
@ . *** UDS$$SVN*INDRAREATIP.
@ . ***
@ . *** GIVEN: TPFMAX = 2200 (EXEC CONFIGURATION TAG)
@ . *** ASSIGNED TIP-FILE-NUMBER = 2134
@ . ***
@ . *** 2200 + 1 - 2134
@ . ***
@ . *** UDS-TIP-FILE-NUMBER FOR UDS$$SVN*INDRAREATIP = 67
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 44R2 02/17/94 12:49:49 FS-LEVEL FS 003
TREG UDS$$SVN*INDRAREATIP.,FIX
TP REGISTER STARTED 12:49:49 17 FEB 94
TP REGISTER FINISHED 12:49:49 17 FEB 94
TREG UDS$$SVN*CHILDAREATIP.,FIX
TP REGISTER STARTED 12:49:49 17 FEB 94
TP REGISTER FINISHED 12:49:49 17 FEB 94
TREG UDS$$SVN*SCHOOLAREATP.,FIX
TP REGISTER STARTED 12:49:49 17 FEB 94
TP REGISTER FINISHED 12:49:49 17 FEB 94
RES,G 67,40,896,,INDRAREATIP,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 12:49:49 17 FEB 94
TP RESERVE FINISHED 12:49:49 17 FEB 94
RES,G 68,40,896,,CHILDAREATIP,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 12:49:49 17 FEB 94
TP RESERVE FINISHED 12:49:49 17 FEB 94
RES,G 69,20,448,,SCHOOLAREATP,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 12:49:49 17 FEB 94
TP RESERVE FINISHED 12:49:49 17 FEB 94
LFD,G 67/69
DMS AREA 67
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 40 SIZE: 896 APPLICATION GROUP: 0
FILE NAME INDRAREATIP
PLACEMENT 0
LEG STATUS AVL-UP
DMS AREA 68
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 40 SIZE: 896 APPLICATION GROUP: 0
FILE NAME CHILDAREATIP
PLACEMENT 0
LEG STATUS AVL-UP
DMS AREA 69
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 20 SIZE: 448 APPLICATION GROUP: 0
FILE NAME SCHOOLAREATP
PLACEMENT 0
LEG STATUS AVL-UP
END FREIPS
@ . ***
@ . ***
@ . ***
@ . *** USE THE UNISYS REPOSITORY TO DEFINE THE RDMS STORAGE AREAS
@ . ***
@UDS$$SVN*UREP$ABS.DD,E ,,APPSVN
UREP 3R2 (11/04/93 10:17:39) 02/17/94 12:49:50
1 CREATE SCHEMA FAMILYTIP.
2 CREATE STORAGE-AREA INDRAREATIP FOR SCHEMA FAMILYTIP
3 ADD FILE-TYPE IS UDS-TIP.
4 ADD DATA-FORMAT IS RSM.
5 ADD FILE-NAME IS INDRAREATIP.
6 ADD UDS-TIP-CODE IS 67.
7 ADD DOMAIN IS UDS.
8 ADD LOCK-STRATEGY IS PAGE.
9 ADD RECOVERED IS TRUE.
10 ADD AUDITED IS TRUE.
11 ADD PAGE-SIZE IS 896.
12 ADD MAXIMUM-PAGES IS 40.
13 ADD CHECKSUM IS NO.
14 CREATE STORAGE-AREA CHILDAREATIP FOR SCHEMA FAMILYTIP.
15 ADD FILE-TYPE IS UDS-TIP.
16 ADD DATA-FORMAT IS RSM.
17 ADD FILE-NAME IS CHILDAREATIP.
18 ADD UDS-TIP-CODE IS 68.
19 ADD DOMAIN IS UDS.
20 ADD LOCK-STRATEGY IS PAGE.
21 ADD RECOVERED IS TRUE.
22 ADD AUDITED IS TRUE.
23 ADD PAGE-SIZE IS 896.
24 ADD MAXIMUM-PAGES IS 40.
25 ADD CHECKSUM IS NO.
26 CREATE STORAGE-AREA SCHOOLAREATP FOR SCHEMA FAMILYTIP.
27 ADD FILE-TYPE IS UDS-TIP.
28 ADD DATA-FORMAT IS RSM.
29 ADD FILE-NAME IS SCHOOLAREATP.
30 ADD UDS-TIP-CODE IS 69.
31 ADD DOMAIN IS UDS.
32 ADD LOCK-STRATEGY IS PAGE.
33 ADD RECOVERED IS TRUE.
34 ADD AUDITED IS TRUE.
35 ADD PAGE-SIZE IS 448.
36 ADD MAXIMUM-PAGES IS 20.
37 ADD CHECKSUM IS NO.
38 PROCESS STORAGE-AREA ALL FOR SCHEMA FAMILYTIP INSTALL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA CHILDAREATIP VERSION ''for
SCHEMA FAMILYTIP was SUCCESSFUL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA INDRAREATIP VERSION ''for
SCHEMA FAMILYTIP was SUCCESSFUL.
CHILD_FIRST_NAME ASCENDING
The CREATE TABLE command completed successfully.
The END THREAD command completed successfully.
END IPF
@ . ***
@ . ***
@ . *** LOAD THE RDMS DATABASE
@ . ***
@SYS$LIB$*RDMS.RDMUTL,S APPSVN
RDMS 6R3 RELATIONAL UTILITY PROCESSOR 02/17/94 12:50:35
......... Begin thread ........
PLEASE ENTER RELATIONAL UTILITY COMMAND, FOLLOWED BY A SEMICOLON(;)
1 LOAD EXTERNAL FILE "QUAL*INDLOAD"
2 SORTED YES
3 LOAD FACTOR 50
4 INTO TABLE FAMILYTIP.INDIVIDUALR
5 FORMAT INDR_EMP_NUMBER(1:5),
6 INDR_LAST_NAME(7:26),
7 INDR_FIRST_NAME(28:39),
8 INDR_BIRTH_DATE(41:46),
9 INDR_SPOUSE_LAST_NAME(48:57) NULLIF((48:48) = '*'),
10 INDR_SPOUSE_FIRST_NAME(59:70) NULLIF((59:59) = '*');
Thread committed after reading line 22 of the input file at time 12:50:37
Thread committed after reading line 16 of the input file at time 12:50:37
21 LOAD FACTOR 50
22 INTO TABLE FAMILYTIP.CHILD
23 FORMAT CHILD_EMP_NUMBER(1:5),
24 CHILD_NUMBER(7:8),
25 CHILD_LAST_NAME(10:29),
26 CHILD_FIRST_NAME(31:42),
27 CHILD_BIRTH_DATE(44:49),
28 CHILD_SCHOOL_NUMBER(51:54) NULLIF((51:51) = '*'),
29 CHILD_GRADE_AVERAGE(56:60) NULLIF((56:56) = '*') ;
Thread committed after reading line 24 of the input file at time 12:50:39
When you code an RDMS 2200 TIP transaction program, the following applies:
• When you use UCS COBOL or UCS C, embedded SQL commands improve TIP
performance, since these commands are parsed at compilation time. SQL
commands specified using the interpreter (nonembedded) interface are parsed
during each execution.
• When you use UCS, FORTRAN, module language SQL commands improve TIP
performance, since these commands are parsed at compilation time. SQL
commands specified using the interpreter interface are parsed during each
execution.
• When you use RDMS 2200 in TIP transactions, a call to RSA$INIT must precede
the first RDMS 2200 command in the transaction program. This call allocates and
initializes all of the space required for the RDMS 2200 work area. Optionally, it
also allows the programmer to specify the size of the work area. You should
make only one call to RSA$INIT within the transaction sequence.
The syntax for this call is as follows:
− UCS COBOL
CALL "RSA$INIT" [USING work-area-size].
− UCS FORTRAN
CALL RSA$INIT [(work-area-size)]
− UCS C
rsa_init ([work-area-size]);
− UCS FORTRAN
INTEGER
− UCS C
int
The default work area provides an initial allocation of 2000 words. The system
acquires more space dynamically, as needed. The overhead incurred by obtaining
additional space is expensive. Therefore, for TIP transactions, you should
determine the amount of space required by the transaction program and set
work-area-size accordingly.
For details about how to determine the size of the work area, refer to 3.5.1.
• The following commands are local to the compilation unit; therefore, they must be
coded in each program module that requires their functioning:
− SET STATISTICS
− USE DEFAULT
− WHENEVER
For more information on using SQL in TIP transactions, refer to the RDMS SQL
Programming Reference Manual.
For information on coding RDMS 2200 embedded SQL programs, RDMS 2200 module
language SQL programs, or RDMS 2200 interpreter SQL programs, refer to the
following:
• "Coding with the RDMS 2200 Embedded SQL Interface," in 3.2.2
• COBOL Compiler Programming Reference Manual Volume 2
• RDMS SQL Programming Reference Manual
The following statement is a sample UCS COBOL compiler call used to compile an
embedded SQL program that uses application group 7:
@UCOB QUAL*UCSTST.MCBESQ/RDMS,QUAL*UCSTST.MCBESQ/COMP,,, ;
NO-OPTIONS,APPLICATION/APPSVN
The following figure represents the process used to compile an embedded SQL
transaction program:
1. The embedded SQL commands are passed to RDMS 2200 for parsing.
2. RDMS 2200 accesses the table and view definitions in the RDT$FILE belonging to
the application group specified in the APPLICATION/application-name keyword
option.
An SQL module implementation consists of at least two program units that you must
develop: the module language program, and the UCS FORTRAN host application
program.
The module language defines modules and procedures. Only one module is permitted
per host application program. A set of procedures make up the module. A procedure
consists of a procedure name, a list of parameter declarations, and a single SQL
statement. The SQLSTATE parameter must be included in the parameter list.
To execute an SQL statement, the host application program calls the module
procedure associated with a particular SQL statement in the same way it calls any
other subroutine or subprogram. The name of the subroutine or subprogram is the
module procedure name.
The SMLP interprets the module source language and generates a COBOL
subprogram element that must be compiled using the UCS COBOL compiler. The
COBOL subprogram combines with the host application program to manipulate the
RDMS database.
The following describes the steps involved in setting up an application that uses the
module SQL language to access an RDMS database and how the subprogram and host
program work together.
1. You develop a FORTRAN host application program and module language source as
follows:
• The host application program contains the calls to the module language source
procedures to execute SQL statements.
• The module SQL source defines procedures that contain the SQL statements
that the host program executes.
2. You call the SMLP to convert the module SQL source to a new source element
that consists of COBOL subprograms.
3. Use the UCS COBOL compiler to compile the COBOL subprograms. This step can
be performed either automatically by the SMLP, or manually by the user. The UCS
COBOL compiler processes embedded SQL statements by interfacing with RDMS.
The compilation produces an object module for each COBOL subprogram.
4. You call the UCS FORTRAN compiler to compile the host application program.
5. You statically link and execute the transaction program.
Table/View
Definitions
@LINK
002324
The SMLP generates a COBOL subprogram element from the module language source
program.
Specifying the C option on the SMLP call line disables the automatic COBOL
compilation. You must then compile the generated COBOL subprogram element
including the APPLICATION/application-name and MODULE keyword options.
@SMLP,C QUAL*UCSTST.DISPLAYFAM/MSQL-FMOD,QUAL*UCSTST.FMOD
@UCOB,S QUAL*UCSTST.FMOD/COB,QUAL*UCSTST.,,,NO-OPTIONS,NARROW;
APPLICATION/APPSVN,MODULE
@UFTN QUAL*UCSTST.DISPLAYFAM/MSQL-FHOST,QUAL*UCSTST.FHOST,,,NO-OPTIONS
The following statement is a sample UCS COBOL compiler call used to compile a
program using the SQL interpreter interface.
@UCOB QUAL*UCSTST.MCBISQ/RDMS,QUAL*UCSTST.MCBISQ/COMP,,, ;
NO-OPTIONS
The following figure represents the process used to compile a transaction program
using the SQL interpreter interface. Notice that only the compiler is used. This is
because all RDMS 2200 command syntax is parsed at execution time.
The system automatically sets up application group library search chains for each of
the 64 application groups during installation of the Linking System. These library
search chains mean the applications programmer does not have to do either of the
following:
• Build a user-defined library search chain for linking
• Explicitly supply (INCLUDE) the object module containing the RDMS 2200 interface
during static linking
The following generic format shows how to specify use of the appropriate application
group library search chain:
@USE LINK$PF,SYS$LIB$*APP$n
If you want to link a UCS program containing RDMS 2200 statements to the system
software in application group 7, use the following statement:
@USE LINK$PF.,SYS$LIB$*APP$7.
In this case, all references to RDMS 2200 software would be resolved using
UDS$$SVN*RSA. Embedded SQL programs and module SQL programs are compiled
for a specific application group. The default is application UDSSRC or application
group 3 (APP$3). Use of the APPLICATION/appname keyword option on the
compilation can target it for any application group you wish. You also should use the
@USE LINK$PF,SYS$LIB$*APP$n. statement specifying the file for the same
application group when either dynamically linking or static linking these programs. If
you wish to change the application that your compiled ESQL/Module-SQL object
modules will link to, you must follow the static linking procedure in "Portable
Embedded and Module Language SQL Programs" in 3.2.2.10.
If the RDMS transaction program uses DPS 2200 functions, you can build a user-
defined library search chain that ensures that the file containing the desired version of
DPS 2200 is included in the library search chain for the desired application group. See
4.5 for information on how to build such a search chain for application group seven. If
this search chain is used, the LINK$PF statement is as follows:
@USE LINK$PF,SYS$LIB$*APP$7DPS.
You must statically link a UCS transaction program containing RDMS 2200 statements.
The following steps are involved:
1. Specify use of the appropriate application group library search chain using an
@USE LINK$PF statement.
2. Call the LINK Processor (@LINK).
3. Specify static-linking commands, including a command that identifies the
program's compiler-produced object module.
The output of this static link must be a ZOOM.
The following example shows how to statically link a UCS transaction program
containing RDMS 2200 statements, producing a zero overhead object module:
Explanation
1. This statement ensures that the program is statically linked using the RDMS 2200
software located in the desired application group. (It ensures that the library
search chain for the correct application group is used.) In this example, this
program is to execute in application group 7. Any embedded SQL or module SQL
programs input to this static link must also have been compiled for this application
group.
2. If DPS 2200 functions are used in the transaction, use the search chain built in
4.5.1.
3. This statement calls the Linking System LINK Processor. The ZOOM to be
produced is named QUAL*UCSTST.MCBESQ.
4. This command identifies the compiler-generated object module containing the
UCS RDMS 2200 program.
5. This command resolves external references, including those to the UCS Runtime
System library.
6. This command merges banks and attempts to produce a fast-load ZOOM;
otherwise a standard ZOOM is created.
7. This command deletes all definitions except the program's starting address,
START$. This decreases the size of the ZOOM.
8. This statement ends static linking.
The MCBESQ program following shows the simple UCS MCB RDMS 2200 transaction
program used in the examples on the following pages. The program
1. Initializes with TIP
2. Reads an employee number
3. Accesses information about that individual from the RDMS 2200 database
4. Displays the data
5. Terminates with TIP
MCBESQ
IDENTIFICATION DIVISION.
PROGRAM-ID. MCBESQ INITIAL.
.
.
DATA DIVISION.
WORKING-STORAGE SECTION.
table definitions
.
.
.
01 EMPLOYEE-NUMBER ....
PROCEDURE DIVISION.
MCB INITIALIZATION
READ EMPLOYEE-NUMBER
BEGIN THREAD
USE DEFAULT QUALIFIER
SINGLETON SELECT
MOVE DATA TO OUTPUT MESSAGE
DECLARE CURSOR
OPEN CURSOR
FETCHs ....
MOVE DATA TO OUTPUT MESSAGE
END THREAD
SEND OUTPUT MESSAGE
MCB TERMINATION
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. MCBESQ INITIAL.
******************************************************************
******************************************************************
* *
* SIMPLE TIP COBOL MCB RDMS ESQL PROGRAM - MCBESQ *
* *
* initializes with MCB *
* reads the input employee number *
* moves the employee number to the output message *
* begins thread with UDS *
* retrieves the requested information from the RDMS database *
* moves the RDMS information to the output message *
* ends thread with UDS *
* sends the output message *
* terminates with MCB *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER
SYMBOLIC CHARACTERS EXT IS 4.
DATA DIVISION.
WORKING-STORAGE SECTION.
************************************************************
* WORK AREA BUFFERS
************************************************************
01 IN-TEXT PIC X(60) VALUE SPACES.
01 TRAN-CODE PIC X(6) VALUE SPACES.
************************************************************
* BUFFER TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
************************************************************
01 ERROR-TEXT.
05 ERR PIC X(132) OCCURS 5 TIMES.
************************************************************
* INDEX FOR GETERROR DISPLAYS
************************************************************
01 ERR-INDEX PIC 9.
************************************************************
* ALLERROR INDICATOR
************************************************************
01 xx PIC 9 VALUE 0.
88 ALLERR VALUE 1.
************************************************************
* COUNTER FOR CHILDREN
************************************************************
01 CHILD-COUNT PIC 9(1) VALUE 0.
************************************************************
* INDEX VARIABLE
************************************************************
01 I PIC 9(1).
*
PROCEDURE DIVISION.
************************************************************
* TIP INITIALIZATION WITH MCB
* READ OF THE INPUT MESSAGE
************************************************************
MCB-INITIALIZATION.
MOVE SPACES TO P-TRXBUFF.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 0 TO P-FLAGS.
MOVE 2 TO P-NODE.
MOVE 1 TO P-LVL.
MOVE P-TRINIT TO P-FUNC.
MOVE 1820 TO P-LENGTH.
MOVE 4 TO P-AUX.
CALL 'MCB$ENT'USING P-MCB-PACKET, P-MCB-STATUS, P-TRXBUFF.
IF P-STATBIT NOT EQUAL ZERO GO TO MCB-ERROR-EXIT.
************************************************************
* EXTRACTING THE EMPLOYEE NUMBER FROM THE INPUT MESSAGE
* VALIDATING THE EMPLOYEE NUMBER
************************************************************
MCB-INPUT-MESSAGE-ANALYSIS.
MOVE P-TRXBUFF (P-AUXTXN:60) TO IN-TEXT.
UNSTRING IN-TEXT DELIMITED BY ALL SPACES
INTO TRAN-CODE, EMPLOYEE-TEXT COUNT IN EMP-COUNT.
IF EMPLOYEE-TEXT (1:1) = EXT
EXEC SQL
GETERROR INTO :ERR(1),:ERR(2),:ERR(3),:ERR(4),:ERR(5)
END-EXEC
PERFORM VARYING ERR-INDEX FROM 1 BY 1 UNTIL ERR-INDEX = 6
DISPLAY ERR (ERR-INDEX) UPON PRINTER
IF ERR(ERR-INDEX) = SPACE SET ALLERR TO TRUE END-IF
END-PERFORM
END PERFORM.
PERFORM END-THREAD-TO-UDS.
PERFORM TERMINATION-PARA.
*
************************************************************
* RETURNS AN ERROR MESSAGE IF THE INPUT MESSAGE WAS IN ERROR
************************************************************
************************************************************
INVALID-INPUT-PARA.
MOVE 0 TO P-MCB-STATUS.
MOVE P-SENDD TO P-FUNC.
MOVE 0 TO P-ID.
MOVE 85 TO P-LENGTH.
MOVE 1 TO P-START.
MOVE 4 TO P-AUX.
MOVE 0 TO P-FLAGS.
MOVE 1 TO P-BIT0.
CALL 'MCB$ENT'USING P-MCB-PACKET, P-MCB-STATUS,
ERROR-MESSAGE.
IF P-STATBIT NOT EQUAL ZERO GO TO MCB-ERROR-EXIT.
*
*
************************************************************
* ONLY EXECUTED WHEN A MCB ERROR OCCURS
************************************************************
MCB-ERROR-EXIT.
DISPLAY '********* MCB ERROR *********'UPON PRINTER.
DISPLAY 'ERROR STATUS BIT = 'P-STATBIT UPON PRINTER.
DISPLAY 'ERROR CODE = 'P-ERRCODE UPON PRINTER.
DISPLAY 'ERROR CODE Q3 = 'P-ERRCODEQ3 UPON PRINTER.
DISPLAY 'ERROR CODE Q4 = 'P-ERRCODEQ4 UPON PRINTER.
IF THREAD-FLAG = 1 PERFORM END-THREAD-TO-UDS.
MOVE 0 to P-ID.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
STOP RUN.
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION ******************
@ . ***
@ . ***
@ . *** COMPILE OF THE MCB RDMS ESQL COBOL TRANSACTION PROGRAM
@ . ***
@UCOB QUAL*UCSTST.MCBESQ/RDMS,QUAL*UCSTST.MCBESQ/COMP,,, ;
NO-OPTIONS,APPLICATION/APPSVN
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'MCBESQ'.
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
@LINK ,QUAL*UCSTST.MCBESQ
INCLUDE QUAL*UCSTST.MCBESQ/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL*
VALCHG M
945 NAM,MCBESQ ACT,MCBESQ PRG,3 STF,0 QPR,1 STA,J OPT,TV
945 REC,Z AUD,7 PRT,PR
@EOF
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@EOF
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON BTLOADING
ON STICKING
@EOF
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*TIPSUPUR.,FIX
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
LFD 810
@EOF
@ . ***
@ . ***
@ . *** USES THE SUPUR UTILITY TO CREATE A SUPUR PROGRAM FILE,
@ . *** COPYS THE TRANSACTION PROGRAM INTO THE SUPUR PROGRAM FILE,
@ . *** AND PLACES THE SUPUR PROGRAM FILE ONLINE.
@ . ***
@TIP$*TIPRUN$.SUPUR,P
CREATE 810 MAIN
COPY ONLY MCBESQ FROM QUAL*UCSTST TO 810
ONLINE 810
LIST ALL FROM 810
EXIT
@ . ***
@ . ***
@ . *** EXAMPLE SETUP IS COMPLETE
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION ******************
@ . ***
@ . ***
@ . *** COMPILE OF THE MCB RDMS ESQL COBOL TRANSACTION PROGRAM
@ . ***
@UCOB QUAL*UCSTST.MCBESQ/RDMS,QUAL*UCSTST.MCBESQ/COMP,,, ;
NO-OPTIONS,APPLICATION/APPSVN
UCOB- 6R2 (940210) LSS- 8R2 (940209) 940217 12:55:43
SIZES: CODE(EM6): 1554 DATA: 1335
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 1 WARNING (LEVEL)
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'MCBESQ'.
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.MCBESQ
LINK 5R2 (940207 1635:57) 1994 Feb 17 Thu 1255:54
END LINK , LINES : 4 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
VTBUTL 44R2#0000001 940217 1256:00
*VALCHG M
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
TPINIT 44R2#0000001 940217 1556:01
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 44R2#0000001 940217 1556:01
ON BTLOADING
ON STICKING
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
I:002333 CAT complete.
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 44R2 02/17/94 12:56:02 FS-LEVEL FS 003
TREG QUAL*TIPSUPUR.,FIX
TP REGISTER STARTED 12:56:02 17 FEB 94
TP REGISTER FINISHED 12:56:04 17 FEB 94
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 12:56:04 17 FEB 94
TP RESERVE FINISHED 12:56:04 17 FEB 94
LFD 810
>MCBESQ 10211
The DPSESQ program following shows the simple UCS DPS RDMS 2200 transaction
program used in the examples on the following pages. The program
• Initializes with DPS
• Reads an employee number
• Accesses information about that individual from RDMS 2200 database
• Displays the data
• Terminates with DPS
DPSESQ
.
.
.
table definitions
.
.
.
char employee_number[5];
.
.
.
int main(void)
{
DPS INITIALIZATION
READ employee_number
BEGIN TRHREAD
USE DEFAULT QUALIFIER
SINGLETON SELECT
strncpy DATA TO DPS FORM
DECLARE CURSOR
OPEN CURSOR
FETCHs ...
strncpy DATA TO DPS FORM
END THREAD
SEND DPS FORM
DPS TERMINATION
return(0);
}
This program reads an employee number as input and displays the information
contained in the database about the individual's family in an output message.
/* ***************************************************************
* *
* SIMPLE TIP C DPS ESQL PROGRAM - DPSESQ *
* *
* initializes with DPS *
* reads the input employee number *
* opens the DPS form *
* moves the employee number to the form *
* begins thread with UDS *
* retrieves the requested information from the database*
* moves the RDMS information to the DPS form *
* ends thread with UDS *
* displays the DPS form *
* terminates with DPS *
* *
*************************************************************** */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <rsa.h>
#include <dpsfunc-def.h>
#include <dps-stat-def.h>
#include <info-buf-def.h>
#include <get-fld-def.h>
#include <senderr-def.h>
#include "screen-50.h"
/* ************************************************************
* EMPLOYEE NUMBER INPUT ERROR MESSAGE *
************************************************************ */
char err_employee_number[41];
/* ************************************************************
* ESQL STATEMENT STATUS *
************************************************************ */
char SQLSTATE[6];
#define NO_FIND_STATUS "02000"
/* ************************************************************
* RDMS WORK AREA SIZE *
************************************************************ */
int work_area_size = 2000;
/* ************************************************************
* UDS THREAD STATUS FLAG *
************************************************************ */
int thread_flag = 0;
/* ************************************************************
* RELATIONAL DATABASE INFORMATION *
************************************************************ */
EXEC SQL BEGIN DECLARE SECTION;
char employee_number[6];
char indr_last_name[21];
char indr_first_name[13];
char child_last_name[21];
char child_first_name[13];
EXEC SQL END DECLARE SECTION;
int main(void)
{
int i;
/* ************************************************************
* TIP INITIALIZATION WITH DPS *
************************************************************ */
d_init(&dps_status, &info_buffer);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
/* ************************************************************
* FREE FORMAT READ OF THE EMPLOYEE NUMBER *
* RETURNS THE EMPLOYEE NUMBER *
* GETFIELD-TYPE = 1 - TESTS FOR NO INPUT *
* GETFIELD-LENGTH = 5 - TESTS THE FIELD LENGTH *
* GETFIELD-TYPE = 3 - TESTS FIELD TYPE *
************************************************************ */
d_getfl(&dps_status, &get_field);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
d_getfl(&dps_status, &get_field);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
strncpy(employee_number, get_field.getfield_text,
sizeof(employee_number));
if(get_field.u_1.s_1.getfield_type == 1)
{ strcpy(error_message.error_text,
"NO EMPLOYEE NUMBER WAS SPECIFIED");
d_senderr(&dps_status, &error_message, &error_coordinates);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
d_term(&dps_status);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
return(0);
}
else
{ if((get_field.u_1.s_1.getfield_length != 5) ||
(get_field.u_1.s_1.getfield_type != 3))
{ strncpy(err_employee_number,
get_field.getfield_text, sizeof(err_employee_number));
err_employee_number[40] = '\0';
sprintf(error_message.error_text,
"NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER %s",
err_employee_number);
d_senderr(&dps_status, &error_message, &error_coordinates);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
d_term(&dps_status);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
return(0);
}
}
/* ************************************************************
* OPENS THE SCREEN TO BE SENT TO THE USER *
************************************************************ */
d_open(&dps_status, &screen_dsplyind_50);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
/* ************************************************************
* TRANSFERS THE EMPLOYEE NUMBER TO THE FORM DEFINITION *
************************************************************ */
strncpy(screen_dsplyind_50.screen_dsplyind_50_data.s50_emp_number,
get_field.getfield_text,
sizeof(screen_dsplyind_50.screen_dsplyind_50_data.s50_emp_number));
/* ************************************************************
* RSA WORK AREA SIZE
************************************************************ */
rsa_init (&work_area_size);
/* ************************************************************
* GENERAL ERROR PROCESSING FOR A NEGATIVE SQL ERROR
************************************************************ */
EXEC SQL WHENEVER SQLERROR GO TO: HANDLE_SQL_ERROR;
/* ************************************************************
* INITIALIZE WITH THE DATABASE SYSTEM
* SET DEFAULT QUALIFIER ON ALL TABLES IN THIS THREAD
************************************************************ */
EXEC SQL BEGIN THREAD CDSPDATA FOR APPSVN RETRIEVE;
thread_flag = 1;
EXEC SQL USE DEFAULT QUALIFIER FAMILYTIP;
/* ************************************************************
* SINGLETON SELECT OF THE INDIVIDUAL'S DATA
************************************************************ */
EXEC SQL
SELECT INDR_LAST_NAME, INDR_FIRST_NAME
INTO :indr_last_name, :indr_first_name
FROM INDIVIDUALR
WHERE INDIVIDUALR.INDR_EMP_NUMBER = :employee_number;
if (strcmp(SQLSTATE, NO_FIND_STATUS) == 0)
{ sprintf(error_message.error_text,
"NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER: %s",
employee_number);
d_senderr(&dps_status, &error_message, &error_coordinates);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
EXEC SQL END THREAD;
thread_flag = 0;
d_term(&dps_status);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
return(0);
}
else {
strncpy
(screen_dsplyind_50.screen_dsplyind_50_data.s50_ind_last_name,
indr_last_name, sizeof(screen_dsplyind_50.
screen_dsplyind_50_data.s50_ind_last_name));
strncpy
(screen_dsplyind_50.screen_dsplyind_50_data.s50_ind_first_name,
indr_first_name, sizeof(screen_dsplyind_50.
screen_dsplyind_50_data.s50_ind_first_name));
}
/* ************************************************************
* DEFINE CURSOR TO BE USED FOR DATA RETRIEVAL
* OPEN CURSOR
************************************************************ */
EXEC SQL
return(0);
/* ************************************************************
* RETURN AN ERROR MESSAGE ON THE PRINTER IF A
* DATABASE ERROR OCCURS
************************************************************ */
HANDLE_SQL_ERROR:
handle_sqlerror();
return(0);
}
void handle_sqlerror(void)
{
char msg[133];
EXEC SQL WHENEVER SQLERROR CONTINUE;
printf("***SQLSTATE = %p\n", SQLSTATE);
printf("GETERROR returned the following text for SQLSTATE:\n\n");
do{
EXEC SQL GETERROR INTO :msg;
printf("%s\n",msg);
} while(msg[0] != '\0');
EXEC SQL END THREAD;
thread_flag = 0;
d_term(&dps_status);
if(dps_status.status_word.status_indicator == STATUS_FATAL)
error_exit();
}
/* ************************************************************
* ONLY EXECUTED WHEN A DPS ERROR OCCURS *
* THE OUTPUT OF D$DUMP SHOULD BE INCLUDED WITH UCF *
* DOCUMENTATION IF THIS PARAGRAPH WAS EXECUTED DUE TO *
* TO A DPS INTERNAL ERROR. *
************************************************************ */
void error_exit(void)
{
d_dump();
d_errmsg(&dps_status);
if(thread_flag == 1)
{ EXEC SQL END THREAD;
thread_flag = 0;
d_term(&dps_status);
}
exit(1);
}
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION ******************
@ . ***
@ . *** COMPILE OF THE DPS RDMS ESQL C TRANSACTION PROGRAM
@ . ***
@USE C$PF,APP7*DPS.
@UC QUAL*UCSTST.DPSESQ/RDMS,QUAL*UCSTST.DPSESQ/COMP,,,NO-OPTIONS, ;
APPLICATION/APPSVN
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'DPSESQ'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, A SPECIAL
@ . *** SEARCH CHAIN FOUND IN SYS$LIB$*APP$7DPS.SSDEF$ IS SPECIFIED
@ . *** USING AN "@USE LINK$PF" COMMAND. THIS SEARCH CHAIN IDENTIFIES
@ . *** THE DPS SYSTEM FILE FOR APPLICATION GROUP 7 AND SETS
@ . *** ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7DPS.
@LINK ,QUAL*UCSTST.DPSESQ
INCLUDE QUAL*UCSTST.DPSESQ/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
*VALCHG M
948 NAM,DPSESQ ACT,DPSESQ PRG,3 STF,0 QPR,1 STA,J OPT,TV
948 REC,Z AUD,7 PRT,PR
@EOF
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@EOF
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON BTLOADING
ON STICKING
@EOF
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*TIPSUPUR.,FIX
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
LFD 810
@EOF
@ . ***
@ . ***
@ . *** USES THE SUPUR UTILITY TO CREATE A SUPUR PROGRAM FILE,
@ . *** COPYS THE TRANSACTION PROGRAM INTO THE SUPUR PROGRAM FILE,
@ . *** AND PLACES THE SUPUR PROGRAM FILE ONLINE.
@ . ***
@TIP$*TIPRUN$.SUPUR,P
CREATE 810 MAIN
COPY ONLY DPSESQ FROM QUAL*UCSTST TO 810
ONLINE 810
@ . ***
@ . *** ******** START OF THE EXAMPLE EXECUTION SECTION ******************
@ . ***
@ . *** COMPILE OF THE DPS RDMS ESQL C TRANSACTION PROGRAM
@ . ***
@USE C$PF,APP7*DPS.
I:002333 USE complete.
@UC QUAL*UCSTST.DPSESQ/RDMS,QUAL*UCSTST.DPSESQ/COMP,,,NO-OPTIONS, ;
APPLICATION/APPSVN
UC- 4R2(940208) LSS- 8R2(940209) 940227 22:33:56
SIZES: CODE(EM6): 1075 DATA: 1438
END UC- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 1 WARNING(LEVEL)
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'DPSESQ'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, A SPECIAL
@ . *** SEARCH CHAIN FOUND IN SYS$LIB$*APP$7DPS.SSDEF$ IS SPECIFIED
@ . *** USING AN "@USE LINK$PF" COMMAND. THIS SEARCH CHAIN IDENTIFIES
@ . *** THE DPS SYSTEM FILE FOR APPLICATION GROUP 7 AND SETS
@ . *** ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7DPS.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.DPSESQ
LINK 5R2 (940207 1635:57) 1994 Feb 27 Sun 2234:48
END LINK , LINES : 4 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
VTBUTL 44R2#0000001 940227 2235:18
*VALCHG M
>DPSESQ 10211
UCS TIP transaction programming first supported SFS for UCS COBOL, UCS FORTRAN,
and UCS C in SB3R1.
UCS TIP transaction programs using SFS 2200 provide access to both of the following
types of UCS COBOL files:
• Relative files
A UCS COBOL relative file is an SFS 2200 direct system data format (DSDF) file.
• Indexed files
A UCS COBOL indexed file is an SFS 2200 multi-indexed sequential access method
(MSAM) file.
UCS TIP transaction programs using SFS 2200 also provide support for direct SDF files
for UCS FORTRAN, and UCS C. In UCS C, direct sequential data files are called binary
files. Table 5-3 shows the SFS 2200 file access methods (file organization methods)
supported for the UCS TIP transaction programs.
The SFS 2200 example on the following pages uses an indexed (MSAM) COBOL file
that contains information about an individual's participation in company-organized
sports:
• It is assumed that no individual will participate in more than three sports.
• The SPT-ACTIVE-COUNT field identifies the number of company sports the
individual currently plays.
• The individual's employee number (SPT-EMP-NUMBER) uniquely identifies each
record occurrence.
• A second index exists on the last name of the individual (the last name is stored in
data item SPT-IND-LAST-NAME).
FD SPORTSTIP.
01 SPORTS-DATA.
05 SPT-EMP-NUMBER PIC X(5).
05 SPT-IND-LAST-NAME PIC X(20).
05 SPT-IND-FIRST-NAME PIC X(12).
05 SPT-ACTIVE-COUNT PIC 9.
05 SPT-SPORT OCCURS 3 TIMES.
10 SPT-NAME PIC X(10).
10 SPT-LEAGUE-TYPE PIC X(12).
10 SPT-DUES PIC 9(2).
2. Define the UDS storage areas that map to the SFS 2200 files, using UREP.
• There must be one storage area per SFS 2200 file.
• The DATA-FORMAT attribute for the storage area must have a value of one of
the following:
− DSDF (direct system data format)
− MSAM (multi-indexed sequential access method file)
• The QUALIFIER attribute must be the same as the name of the SCHEMA for
this file.
3. After you define the storage areas, create the file description tables (FDT) required
by UDS by using the PROCESS STORAGE-AREA...INSTALL command.
UCS COBOL and UCS FORTRAN SFS 2200 files require no further processing for
program use. In fact, the same COBOL and FORTRAN SFS 2200 files can be used by
both UCS and non-UCS programs, as long as they do not contain Fieldata characters.
UCS C SFS 2200 (binary) files require one more step in their setup, however. The
additional step is required because C does not have language syntax for specifying an
SFS 2200 file. You must create an external file description for C 2200 files, using the
Define File Processor (DFP), a stand-alone preprocessor. You create this external file
description as a define-file-block omnibus element in a program file. The following
runstream creates this omnibus element in a file called UDS$$SVN*DFP$.
Explanation
1. This statement catalogs a file to hold the define-file-block omnibus element
created by DFP. The file in this example might be used to hold all of the define-
file-block omnibus elements for application group 7.
2. This statement places the @USE name of DFP$ on the file into which DFP is to
place its output. This @USE name is required by the Define File Processor.
3. This statement calls the Define File Processor. The LE options specify that
• A define-file-block omnibus element containing the description of the external
data file is to be built.
• A listing is to be produced.
The first field on the processor call identifies the SFS 2200 data file for which this
block is being built. The second field identifies the file name (which must be DFP$)
and element name (which must be the same as the name of the data file) where
the define-file-block omnibus element is to be placed.
4. This input parameter identifies this file as an SFS 2200 (shared) file.
5. This statement terminates the runstream.
During execution of a UCS C SFS 2200 transaction program, whenever the program
opens an SFS 2200 file, the UCS Runtime System reads the define-file-block. This
means that prior to the fopen command in a UCS C 2200 transaction program, you
must do the following:
1. Assign the program file containing the define-file-block omnibus element to the
run.
2. Give the file an @USE name of DFP$.
This process is necessary so that when an SFS 2200 file is opened, the UCS Runtime
System knows where to locate the define-file-block omnibus element.
system("@ASG,A UDS$$SVN*DFP$.");
system("@USE DFP$,UDS$$SVN*DFP$.");
For more information on SFS 2200 programming, refer to the SFS 2200 Administration
and Support Reference Manual.
For more information on using DFP, refer to the DFP Administration and
Programming Reference Manual.
Note: Using TIP file control eliminates much Exec input/output overhead and
eliminates the need for file assignments. Therefore, it is recommended that SFS
2200 databases that will be accessed by TIP transactions be set up using TIP
storage areas. This requires setting up a TIP file for each underlying Exec file.
When you later define the storage areas using UREP, the UDS-TIP-CODE must match
the UDS/TIP file number.
Also, the underlying Exec files must use the qualifier TIP$SFS. If the QUALIFIER
attribute is used in the storage area definition, it must also have the value TIP$SFS.
For more information on setting up TIP files that are to hold SFS 2200 storage areas,
refer to the following documents:
• Repository for ClearPath OS 2200 Administration Guide
• SFS 2200 Administration and Support Reference Manual
Source Listing of Runstream to Define the SFS 2200 File and Storage Area
Example 5–28 shows the source listing of a runstream used to define the SFS 2200 file
and storage area. Noteworthy lines are bolded.
@ . ***
@ . *** ******** START OF THE SFS DATABASE DEFINITION SECTION **********
@ . ***
@ . *** CATALOG: CATALOGS THE DATABASE STORAGE AREA EXEC FILES
@ . *** THAT WILL CORRESPOND TO THE TIP FILES.
@ . ***
@ . *** TIP FILES ARE NOT AWARE OF EXEC QUALIFIERS, THEREFORE
@ . *** THE EXEC-filename MUST ESTABLISH UNIQUENESS WITHOUT
@ . *** THE QUALIFIER.
@ . ***
@CAT,P TIP$SFS*SPORTSTIP.,F/5//5
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE DATABASE STORAGE AREA FILES.
@ . ***
@ . *** 2. RESERVE THE DATABASE STORAGE AREAS FILES.
@ . ***
@ . *** 3. LIST THESE TIP FILES IN ORDER TO CONFIRM THEIR SETUP.
@ . ***
@ . *** THE UDS-TIP FILE NUMBERS ARE BACKWARDS FROM THE TIP FILE NUMBERS.
@ . *** THE FOLLOWING EQUATION COORDINATES THE TWO NUMBERS.
@ . ***
@ . ***
@ . *** UDS-TIP-FILE-NUMBER = TPFMAX + 1 - TIP-FILE-NUMBER
@ . ***
@ . *** EXAMPLE: CALCULATING THE UDS-TIP FILE NUMBER FOR
@ . *** TIP$SFS*SPORTSTIP.
@ . ***
@ . *** GIVEN: TPFMAX = 2200 (EXEC CONFIGURATION TAG)
@ . *** Assigned TIP-FILE-NUMBER = 2135
@ . ***
@ . *** 2200 + 1 - 2135
@ . ***
@ . *** UDS-TIP-FILE-NUMBER FOR TIP$SFS*SPORTSTIP = 66
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG TIP$SFS*SPORTSTIP.,FIX
RES,G 66,10,896,,SPORTSTIP,,,WW=P,AUDIT=0,NREC
Example 5–28. Runstream to Define the SFS 2200 File and Storage Area
LFD,G 66
@EOF
@ . ***
@ . ***
@ . ***
@ . *** USE THE UNISYS REPOSITORY TO DEFINE THE SFS STORAGE AREAS
@ . ***
@UDS$$SVN*UREP$ABS.DD,E ,,APPSVN
CREATE SCHEMA TIP$SFS.
CREATE STORAGE-AREA SPORTSTIP FOR SCHEMA TIP$SFS.
ADD FILE-TYPE IS UDS-TIP.
ADD DATA-FORMAT IS MSAM.
ADD FILE-NAME IS SPORTSTIP.
ADD UDS-TIP-CODE IS 66.
ADD DOMAIN IS UDS.
ADD RECOVERED IS TRUE.
ADD AUDITED IS TRUE.
ADD PAGE-SIZE IS 896.
ADD MAXIMUM-PAGES IS 10.
PROCESS STORAGE-AREA ALL FOR SCHEMA TIP$SFS INSTALL.
EXIT.
@ . ***
@ . ***
@ . ***
@ . ***
@ . *** ******** END OF THE SFS DATABASE DEFINITION SECTION *************
@ . ***
Example 5–28. Runstream to Define the SFS 2200 File and Storage Area
@ . ***
@ . *** ******** START OF THE SFS DATABASE DEFINITION SECTION **********
@ . ***
@ . *** CATALOG: CATALOGS THE DATABASE STORAGE AREA EXEC FILES
@ . *** THAT WILL CORRESPOND TO THE TIP FILES.
@ . ***
@ . *** TIP FILES ARE NOT AWARE OF EXEC QUALIFIERS, THEREFORE
@ . *** THE EXEC-FILENAME MUST ESTABLISH UNIQUENESS WITHOUT
@ . *** THE QUALIFIER.
@ . ***
@CAT,P TIP$SFS*SPORTSTIP.,F/5//5
I:002333 CAT complete.
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE DATABASE STORAGE AREA FILES.
@ . ***
@ . *** 2. RESERVE THE DATABASE STORAGE AREAS FILES.
@ . ***
@ . *** 3. LIST THESE TIP FILES IN ORDER TO CONFIRM THEIR SETUP.
@ . ***
@ . *** THE UDS-TIP FILE NUMBERS ARE BACKWARDS FROM THE TIP FILE NUMBERS.
@ . *** THE FOLLOWING EQUATION COORDINATES THE TWO NUMBERS.
@ . ***
@ . ***
@ . *** UDS-TIP-FILE-NUMBER = TPFMAX + 1 - TIP-FILE-NUMBER
@ . ***
@ . *** EXAMPLE: CALCULATING THE UDS-TIP FILE NUMBER FOR
@ . *** TIP$SFS*SPORTSTIP.
@ . ***
@ . *** GIVEN: TPFMAX = 2200 (EXEC CONFIGURATION TAG)
@ . *** ASSIGNED TIP-FILE-NUMBER = 2135
@ . ***
@ . *** 2200 + 1 - 2135
@ . ***
@ . *** UDS-TIP-FILE-NUMBER FOR TIP$SFS*SPORTSTIP = 66
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 44R2 02/17/94 13:28:00 FS-LEVEL FS 003
TREG TIP$SFS*SPORTSTIP.,FIX
TP REGISTER STARTED 13:28:00 17 FEB 94
TP REGISTER FINISHED 13:28:01 17 FEB 94
RES,G 66,10,896,,SPORTSTIP,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 13:28:01 17 FEB 94
TP RESERVE FINISHED 13:28:01 17 FEB 94
LFD,G 66
DMS AREA 66
TIP/DMS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 10 SIZE: 896 APPLICATION GROUP: 0
FILE NAME SPORTSTIP
PLACEMENT 0
LEG STATUS AVL-UP
END FREIPS
@ . ***
@ . ***
@ . ***
@ . *** USE THE UNISYS REPOSITORY TO DEFINE THE SFS STORAGE AREAS
@ . ***
@UDS$$SVN*UREP$ABS.DD,E ,,APPSVN
UREP 3R2 (11/04/93 10:17:39) 02/17/94 13:28:01
1 CREATE SCHEMA TIP$SFS.
2 CREATE STORAGE-AREA SPORTSTIP FOR SCHEMA TIP$SFS.
3 ADD FILE-TYPE IS UDS-TIP.
4 ADD DATA-FORMAT IS MSAM.
5 ADD FILE-NAME IS SPORTSTIP.
6 ADD UDS-TIP-CODE IS 66.
7 ADD DOMAIN IS UDS.
8 ADD RECOVERED IS TRUE.
9 ADD AUDITED IS TRUE.
10 ADD PAGE-SIZE IS 896.
11 ADD MAXIMUM-PAGES IS 10.
12 PROCESS STORAGE-AREA ALL FOR SCHEMA TIP$SFS INSTALL.
*REMARK* DSD4023 The INSTALL for STORAGE-AREA SPORTSTIP VERSION ''for
SCHEMA TIP$SFS was SUCCESSFUL.
*REMARK* DSD4036 Your PROCESS STORAGE-AREA ALL command was successful.
13 EXIT.
END UREP ( 0 )FATALS ( 0 )ERRORS ( 0 )WARNINGS ( 2 )REMARKS .
@ . ***
@ . ***
@ . ***
@ . ***
@ . *** ******** END OF THE SFS DATABASE DEFINITION SECTION *************
@ . ***
For UCS C, this is accomplished instead by use of the Define File Processor; refer to
"Defining SFS 2200 Files and Storage Areas" in this subsection. Also, the UCS C
transaction program must assign and place a USE statement on the program file
containing the define-file-block.
UCS COBOL
UCS COBOL identifies SFS 2200 files by using the A-SHARED-FILE syntax in the
SELECT clause. The following SELECT clauses show the syntax for identifying a
relative (DSDF) file and an indexed (MSAM) file for COBOL:
UCS FORTRAN
UCS FORTRAN identifies SFS 2200 files by the RFORM setting in the OPEN statement.
A value of LS, MS, ES, FS, US, or VS identifies the file as an SFS 2200 file. (The "S"
stands for shared.)
UCS C
In a UCS C transaction program using SFS, the program file containing the
define-file-block must be assigned (@ASG) and given a use name (@USE) of DFP$ prior
to the fopen command. The following is an example:
system ("@ASG,A UDS$$SVN*DFP$.");
system ("@USE DFP$,UDS$$SVN*DFP$.");
@UCOB . . .
or
@UCOB . . . ,,,APPLICATION/name
UCS SFS or UCS SFS
Source @UCOB . . .,,,COMPAT Object
Program or Module
@UCOB . . . ,,,APPLICATION/name,COMPAT
or
qual*progfile.source @UCOB . . .,,,COMPAT/FULL,NO-OPTIM qual*progfile.om/comp
or
@UCOB . . . ,,,APPLICATION/name,;
COMPAT/FULL,NO-OPTIM
or
@UFTN . . . .
or
@UC . . . .
or
@UC . . . ,,,APPLICATION/ name
002328
Only UCS COBOL might require a special keyword option. If the program uses the
ASCII COBOL usage clauses in the file definitions, you must use the COMPAT keyword
option to ensure an error-free compilation.
UCS COBOL and UCS C transaction programs that use the embedded format of the
BEGIN THREAD and END THREAD commands require the correct setting of the
APPLICATION/application-name keyword option.
The system automatically sets up application group library search chains for each of
the 64 application groups during installation of the Linking System. These library
search chains mean the applications programmer does not have to do either of the
following:
• Build a user-defined library search chain for linking
• Explicitly supply (INCLUDE) the object module containing the SFS 2200 interface
during static linking
The following generic format shows how to specify use of the appropriate application
group library search chain:
@USE LINK$PF,SYS$LIB$*APP$n
If you want to link a UCS program that accesses an SFS 2200 database to the system
software in application group 7, use the following statement:
@USE LINK$PF.,SYS$LIB$*APP$7.
In this case, all references to SFS 2200 software would be resolved using
UDS$$SVN*SFS.
If the SFS transaction program uses DPS 2200 functions, you can build a user-defined
library search chain that ensures that the file containing the desired version of DPS
2200 is included in the library search chain for the desired application group. See 4.5.1
for information on how to build a search chain for application group 7. If this search
chain is used, the LINK$PF statement is
@USE LINK$PF,SYS$LIB$*APP$7DPS.
You must statically link a UCS transaction program that accesses an SFS 2200
database. The following steps are involved:
1. Specify use of the application group library search chain using an @USE LINK$PF
statement.
2. Call the LINK Processor.
3. Specify static linking commands, including a command that identifies the
program's compiler-produced object module.
The following example shows how to statically link a UCS transaction program that
accesses an SFS 2200 database, producing a ZOOM:
Explanation
1. This statement ensures that the program is statically linked using the SFS 2200
and DPS 2200 software in the desired application group. This search chain was
built in to include DPS 2200. If MCB functions are used in the transaction instead
of DPS 2200 functions, the application group library search chain, which is supplied
by Unisys, can be used (SYS$LIB$*APP$7). In this example, this program is to
execute in application group 7.
2. This statement calls the Linking System LINK Processor. The ZOOM to be
produced is named QUAL*UCSTST.DPSSFS.
3. This command identifies the compiler-generated object module containing the
UCS program that accesses the SFS 2200 database.
4. This command resolves external references, including those to the UCS Runtime
System library.
5. This command merges banks and attempts to produce a fast load ZOOM,
otherwise a standard ZOOM is created.
6. This command deletes all definitions except the program's starting address,
START$. This decreases the size of the ZOOM.
7. This statement ends static linking.
The following figure summarizes the retrieval program used in the example. The
program
1. Initializes with DPS/TIP
2. Reads an employee number as input
3. Accesses information about that individual's sports activities from the SFS 2200
database
4. Displays the data
5. Terminates with DPS/TIP
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSSFS INITIAL.
.
.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT file-name
ASSIGN TO A-SHARED-FILE ....
.
.
FILE SECTION.
FD file-name
file definition ....
WORKING-STORAGE SECTION.
01 EMPLOYEE-NUMBER ....
.
.
PROCEDURE DIVISION.
DPS INITIALIZATION
READ EMPLOYEE-NUMBER
BEGIN THREAD
OPEN FILE
READ FILE
MOVE DATA TO OUTPUT FORM
CLOSE FILE
END THREAD
SEND OUTPUT MESSAGE
DPS TERMINATION
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSSFS INITIAL.
******************************************************************
******************************************************************
* *
* SIMPLE TIP COBOL DPS SFS PROGRAM - DPSSFS *
* *
* initializes with DPS *
* reads the input data *
* opens the DPS form *
* moves the employee number to the form *
* opens the SPORTSTIP SFS database file *
* retrieves the requested information from the SFS database *
* moves the SFS information to the form *
* closes the SPORTSTIP SFS database file *
* displays the DPS form *
* terminates with DPS *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SPORTSTIP
ASSIGN TO A-SHARED-FILE SPORTSTIP
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
RECORD KEY IS SPT-EMP-NUMBER
ALTERNATE RECORD KEY IS SPT-IND-LAST-NAME WITH DUPLICATES.
DATA DIVISION.
FILE SECTION.
FD SPORTSTIP.
01 SPORTS-DATA.
05 SPT-EMP-NUMBER PIC X(5).
05 SPT-IND-LAST-NAME PIC X(20).
05 SPT-IND-FIRST-NAME PIC X(12).
05 SPT-ACTIVE-COUNT PIC 9.
05 SPT-SPORT OCCURS 3 TIMES.
10 SPT-NAME PIC X(10).
10 SPT-LEAGUE-TYPE PIC X(12).
10 SPT-DUES PIC 9(2).
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 ERR-MISSING-INPUT PIC X(78)
VALUE 'NO EMPLOYEE NUMBER WAS SPECIFIED.'.
01 INVALID-EMPLOYEE-NUMBER.
02 TEXT-1 PIC X(40)
VALUE 'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER '.
02 ERR-EMPLOYEE-NO PIC X(10).
************************************************************
* NO SPORTS MESSAGE
************************************************************
01 NO-SPORTS PIC X(78)
VALUE '*** NO COMPANY-SPONSORED SPORTS PARTICIPATION ***'.
************************************************************
* DPS PROCEDURES
************************************************************
COPY DPSSTATUSCOB.
COPY INFO-BUFFER.
COPY GETFIELD.
COPY SENDERROR.
COPY SCREEN-DSPLYIND-50.
************************************************************
* VARIABLE TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
01 EMPLOYEE-NUMBER PIC X(5).
************************************************************
* INDEX VARIABLE
************************************************************
01 I PIC 9(1).
************************************************************
* ESQL STATEMENT STATUS
************************************************************
01 SQLSTATE PIC X(5).
************************************************************
* RELATIONAL COMMAND ERROR BUFFERS
************************************************************
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 RDMCA.
05 ERROR-STATUS PIC 9(4).
05 AUX-INFO PIC S9(9) USAGE BINARY.
EXEC SQL END DECLARE SECTION END-EXEC.
************************************************************
* GETERROR BUFFERS
************************************************************
01 ERROR-TEXT.
05 ERR PIC X(132) OCCURS 5 TIMES.
************************************************************
* INDEX FOR GETERROR DISPLAYS
************************************************************
01 ERR-INDEX PIC 9.
*
PROCEDURE DIVISION.
************************************************************
* TIP INITIALIZATION WITH DPS
************************************************************
DPS-INITIALIZATION.
CALL 'D$INIT'USING DPS-STATUS, INFO-BUFFER.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
************************************************************
* FREE FORMAT READ OF THE TRANSACTION CODE
************************************************************
DPS-FREE-FORMAT-READ1.
CALL 'D$GETFL'USING DPS-STATUS, GET-FIELD.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
************************************************************
* FREE FORMAT READ OF THE EMPLOYEE NUMBER
* RETURNS THE EMPLOYEE NUMBER
* GETFIELD-TYPE = 1 - TESTS FOR NO INPUT
* GETFIELD-LENGTH = 5 - TESTS THE FIELD LENGTH
************************************************************
DPS-FREE-FORMAT-READ2.
CALL 'D$GETFL'USING DPS-STATUS, GET-FIELD.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
SFS-RETRIEVE-SPORTS-DATA.
MOVE EMPLOYEE-NUMBER TO SPT-EMP-NUMBER.
READ SPORTSTIP RECORD
KEY IS SPT-EMP-NUMBER
INVALID KEY PERFORM BAD-KEY.
MOVE SPT-IND-FIRST-NAME TO S50-IND-FIRST-NAME.
MOVE SPT-IND-LAST-NAME TO S50-IND-LAST-NAME.
IF SPT-ACTIVE-COUNT = 0
MOVE NO-SPORTS TO S50-SPORTS-ACTION
ELSE PERFORM VARYING I FROM 1 BY 1 UNTIL I > SPT-ACTIVE-COUNT
MOVE SPT-NAME (I) TO S50-SPT-NAME (I)
MOVE SPT-LEAGUE-TYPE (I) TO S50-SPT-LEAGUE-TYPE (I)
END-PERFORM
END-IF.
************************************************************
* TERMINATE WITH THE DATABASE SYSTEMS
************************************************************
SFS-FILE-CLOSE-PARA.
CLOSE SPORTSTIP.
END THREAD.
************************************************************
* SENDS THE SCREEN TO THE USER
************************************************************
DPS-SEND-OUTPUT-SCREEN.
CALL 'D$SEND'USING DPS-STATUS, SCREEN-DSPLYIND-50.
IF STATUS-FATAL
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
END-IF.
************************************************************
* TERMINATION WITH DPS
************************************************************
DPS-TERMINATION.
CALL 'D$TERM'USING DPS-STATUS.
************************************************************
* PROGRAM TERMINATION
************************************************************
TERMINATION-PARA.
STOP RUN.
*
*
************************************************************
* SFS - DISPLAY OF BAD INPUT KEY
************************************************************
BAD-KEY.
MOVE EMPLOYEE-NUMBER TO ERR-EMPLOYEE-NO.
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE.
PERFORM INVALID-INPUT-PARA.
PERFORM SFS-FILE-CLOSE-PARA.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
*
*
************************************************************
* RETURNS AN ERROR MESSAGE TO THE USER IF THE INPUT
* MESSAGE WAS IN ERROR AND TERMINATES WITH THE
* TRANSACTION PROCESSING SYSTEM
************************************************************
INVALID-INPUT-PARA.
CALL 'D$SENDERR'USING DPS-STATUS, ERROR-MESSAGE,
ERROR-COORDINATES.
*
*
************************************************************
* ONLY EXECUTED WHEN A DPS ERROR OCCURS
* THE OUTPUT OF D$DUMP SHOULD BE INCLUDED WITH UCF
* DOCUMENTATION IF THIS PARAGRAPH WAS EXECUTED DUE TO
* TO A DPS INTERNAL ERROR.
************************************************************
DPS-GENERAL-ERROR-PARA.
CALL 'D$DUMP'.
CALL 'D$ERRMSG'USING DPS-STATUS.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
*
*
************************************************************
* RDMS - RETURN AN ERROR MESSAGE TO THE PRINTER FILE IF A
* DATABASE ERROR OCCURS
************************************************************
RDMS-ERROR-PARA.
EXEC SQL WHENEVER SQLERROR CONTINUE END-EXEC.
DISPLAY '***SQLSTATE = 'SQLSTATE UPON PRINTER.
DISPLAY '***RDMCA AUX-INFO = 'AUX-INFO UPON PRINTER.
DISPLAY '***ERROR STATUS = 'ERROR-STATUS OF RDMCA
UPON PRINTER.
GETERROR INTO :ERR(1), :ERR(2), :ERR(3), :ERR(4), :ERR(5).
PERFORM VARYING ERR-INDEX FROM 1 BY 1 UNTIL ERR-INDEX = 6
DISPLAY ERR (ERR-INDEX) UPON PRINTER
END-PERFORM.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** COMPILE OF THE BATCH INITIAL LOAD PROGRAM AND THE TIP TRANSACTION
@ . *** PROGRAM
@ . ***
@ . ***
@ . *** INITIAL LOAD PROGRAM COMPILE
@ . ***
@UCOB QUAL*UCSTST.LOADSFSDBTP,QUAL*UCSTST.LOADSFSDBTP/COMP,,,NO-OPTIONS
@ . ***
@ . ***
@ . *** RETRIEVAL PROGRAM COMPILE
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
@EOF
@ . ***
@ . ***
@ . *** COMPILE OF THE DPS SFS COBOL TRANSACTION PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
@UCOB QUAL*UCSTST.DPSSFS,QUAL*UCSTST.DPSSFS/COMP,,,NO-OPTIONS,;
APPLICATION/APPSVN
@ . ***
@ . ***
@ . *** EXECUTION OF THE INITIAL LOAD PROGRAM USING DYNAMIC LINKING
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
@XQT QUAL*UCSTST.LOADSFSDBTP/COMP
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'DPSSFS'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, A SPECIAL
@ . *** SEARCH CHAIN FOUND IN SYS$LIB$*APP$7DPS.SSDEF$ IS SPECIFIED
@ . *** USING AN "@USE LINK$PF" COMMAND. THIS SEARCH CHAIN IDENTIFIES
@ . *** THE DPS SYSTEM FILE FOR APPLICATION GROUP 7 AND SETS
@ . *** ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7DPS.
@LINK ,QUAL*UCSTST.DPSSFS
INCLUDE QUAL*UCSTST.DPSSFS/COMP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
*VALCHG M
907 NAM,DPSSFS ACT,DPSSFS PRG,3 STF,0 QPR,1 STA,J OPT,TV
907 REC,Z AUD,7 PRT,LANGPR
@EOF
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@EOF
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON BTLOADING
ON STICKING
@EOF
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** COMPILE OF THE BATCH INITIAL LOAD PROGRAM AND THE TIP TRANSACTION
@ . *** PROGRAM
@ . ***
@ . ***
@ . *** INITIAL LOAD PROGRAM COMPILE
@ . ***
@UCOB QUAL*UCSTST.LOADSFSDBTP,QUAL*UCSTST.LOADSFSDBTP/COMP,,,NO-OPTIONS
UCOB- 6R2 (940210) LSS- 8R2 (940209) 940217 13:33:35
SIZES: CODE(EM6): 686 DATA: 1026
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** RETRIEVAL PROGRAM COMPILE
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
PDP 13RJ (931109 0108:39) 1994 Feb 17 Thu 1333:50
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 708 Entry Points: 1 Time: 3.958 Storage: 7070/0/7070/0106210
@ . ***
@ . ***
@ . *** COMPILE OF THE DPS SFS COBOL TRANSACTION PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
I:OO2333 USE complete.
@UCOB QUAL*UCSTST.DPSSFS,QUAL*UCSTST.DPSSFS/COMP,,,COMPAT,NO-OPTIONS,;
APPLICATION/APPSVN
UCOB- 6R2 (940210) LSS- 8R2 (940209) 940217 13:33:57
SIZES: CODE(EM6): 1205 DATA: 380
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 1 WARNING(LEVEL)
@ . ***
@ . ***
@ . *** EXECUTION OF THE INITIAL LOAD PROGRAM USING DYNAMIC LINKING
@ . ***
@ . *** THE FOLLOWING STATEMENT SHOULD BE SET UP FOR THE APPROPRIATE
@ . *** APPLICATION GROUP:
@ . *** @USE LINK$PF,SYS$LIB$*APP$n
@ . *** WHERE "n" IS THE APPLICATION GROUP NUMBER
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7.
I:002333 USE complete.
@XQT QUAL*UCSTST.LOADSFSDBTP/COMP
*******************
DATABASE VALIDATION
*******************
****
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'DPSSFS'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, A SPECIAL
@ . *** SEARCH CHAIN FOUND IN SYS$LIB$*APP$7DPS.SSDEF$ IS SPECIFIED
@ . *** USING AN "@USE LINK$PF" COMMAND. THIS SEARCH CHAIN IDENTIFIES
@ . *** THE DPS SYSTEM FILE FOR APPLICATION GROUP 7 AND SETS
@ . *** ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7DPS.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.DPSSFS
LINK 5R2 (940207 1635:57) 1994 Feb 17 Mon 1334:36
END LINK , LINES : 4 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
VTBUTL 44R2#0000001 940217 1334:40
*VALCHG M
KEYWORDS FOR VALTAB FIELDS
LONG FORM SHORT FORM FIELD DESCRIPTION
--------- ---------- -----------------
(FIRST FIELD ON EACH CARD) PROGRAM NUMBER
NAME NAM PROGRAM NAME
ACTION ACT TRANSACTION CODE
RUNTIME RUN MAXIMUM RUN TIME
PRIORITY PRI PROGRAM PRIORITY
INDICATORS IND VALTAB INDICATORS
PRGTYPE PRG PROGRAM TYPE
OPTIONS OPT PROGRAM OPTIONS
STFILE STF STANDARD FILE NO.
COPIES COP MAXIMUM COPIES
STATUS STA PROGRAM STATUS
PRTDEVICE PRT PRINT QUEUE DEVICE
LEVEL LEV SWITCHING LEVEL
PCTBLOCKS PCT NUMBER PCT BLOCKS
WAITQ WAI WAIT-Q LENGTH
@ . ***
@ . ***
@ . *** EXAMPLE SETUP IS COMPLETE
>DPSSFS 10211
This type of program requires use of BEGIN THREAD and END THREAD commands, no
matter which of the data models are used. The other UDS commands (for example,
the DMS 2200 IMPART and DEPART commands and the SFS 2200 OPEN and CLOSE
commands) must follow the BEGIN THREAD command and precede the END THREAD
command. Specifying the BEGIN THREAD and END THREAD commands is known as
using explicit thread control. Programs that access multiple database models require
explicit thread control.
The following pages show an example of a program that uses the three database
models discussed earlier. This is possible because the databases all contain data
about a group of individuals, each is uniquely identified in each database by the same
employee number.
This example is a COBOL transaction program that is a combination of the DMS 2200,
RDMS 2200, and SFS 2200 programs shown previously (see 5.1.1, 5.1.2, and 5.1.3). The
transaction program uses DPS 2200 functions.
DPSALL
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSALL INITIAL.
.
.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT file-name
ASSIGN TO A-SHARED-FILE ....
.
.
DATA DIVISION.
SUBSCHEMA SECTION.
INVOKE .....
.
.
FILE SECTION.
FD file-name
file definition ....
WORKING-STORAGE SECTION.
table definitions ...
form definition
.
.
01 EMPLOYEE-NUMBER ....
.
PROCEDURE DIVISION.
CALL 'D$INIT'...
CALL 'D$GETFL'...
CALL 'D$GETFL'...
MOVE GET-FIELD-TEXT TO EMPLOYEE-NUMBER
CALL 'D$OPEN'...
MOVE EMPLOYEE-NUMBER TO form
BEGIN THREAD
OPEN FILE
IMPART
OPEN DMS areas .... RETRIEVAL
FETCHs ....
MOVE DMS data TO form
READ FILE
MOVE SFS data TO form
USE DEFAULT QUALIFIER
DEFINE CURSOR
OPEN CURSOR
FETCHs ....
IDENTIFICATION DIVISION.
PROGRAM-ID. DPSALL INITIAL.
******************************************************************
******************************************************************
* *
* SIMPLE TIP COBOL DPS/DMS/SFS/RDMS PROGRAM - DPSALL *
* *
* initializes with DPS *
* reads the input data *
* opens the DPS form *
* moves the employee number to the form *
* begins thread with UDS *
* opens the SPORTSTIP SFS database file *
* imparts to the PERSONNELTIP database *
* retrieves the requested information from the DMS database *
* moves the DMS information to the form *
* retrieves the requested information from the SFS database *
* moves the SFS information to the form *
* retrieves the requested information from the RDMS database *
* moves the RDMS information to the form *
* departs from the PERSONNELTIP database *
* closes the SPORTSTIP SFS database file *
* ends thread with UDS *
* displays the DPS form *
* terminates with DPS *
* *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SPORTSTIP
ASSIGN TO A-SHARED-FILE SPORTSTIP
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
RECORD KEY IS SPT-EMP-NUMBER
ALTERNATE RECORD KEY IS SPT-IND-LAST-NAME WITH DUPLICATES.
DATA DIVISION.
SUBSCHEMA SECTION.
INVOKE SUBSCHEMA PERSONSUBTIP IN FILE SCHFILEXEC
OF SCHEMA PERSONNELTIP
COPYING RECORDS INTO WORKING
COPYING DATA-NAMES INTO WORKING
RUN-UNIT-ID DPSALL
DMCA IS WORKING
ERROR DMS-GENERAL-ERROR-PARA.
FILE SECTION.
FD SPORTSTIP.
01 SPORTS-DATA.
05 SPT-EMP-NUMBER PIC X(5).
05 SPT-IND-LAST-NAME PIC X(20).
05 SPT-IND-FIRST-NAME PIC X(12).
05 SPT-ACTIVE-COUNT PIC 9.
05 SPT-SPORT OCCURS 3 TIMES.
10 SPT-NAME PIC X(10).
10 SPT-LEAGUE-TYPE PIC X(12).
10 SPT-DUES PIC 9(2).
WORKING-STORAGE SECTION.
************************************************************
* USER INPUT ERROR MESSAGE
************************************************************
01 ERR-MISSING-INPUT PIC X(78)
VALUE 'NO EMPLOYEE NUMBER WAS SPECIFIED.'.
01 INVALID-EMPLOYEE-NUMBER.
02 TEXT-1 PIC X(40)
VALUE 'NO EMPLOYEE EXISTS WITH EMPLOYEE NUMBER '.
02 ERR-EMPLOYEE-NO PIC X(10).
************************************************************
* NO SPORTS MESSAGE
************************************************************
01 NO-SPORTS PIC X(78)
VALUE '*** NO COMPANY-SPONSORED SPORTS PARTICIPATION ***'.
************************************************************
* DPS PROCEDURES
************************************************************
COPY DPSSTATUSCOB.
COPY INFO-BUFFER.
COPY GETFIELD.
COPY SENDERROR.
COPY SCREEN-DSPLYIND-50.
************************************************************
* VARIABLE TO HOLD EMPLOYEE NUMBER INPUT
************************************************************
01 EMPLOYEE-NUMBER.
05 EMP-PAGE PIC 9(3).
05 EMP-RECORD PIC 9(2).
************************************************************
* RDMS WORK AREA SIZE
************************************************************
01 WORK-AREA-SIZE PIC 1(36) USAGE BINARY-1 VALUE 2000.
************************************************************
* UDS THREAD STATUS FLAG
************************************************************
01 THREAD-FLAG PIC 9(1) VALUE 0.
************************************************************
* RELATIONAL DATABASE INFORMATION
************************************************************
01 CHILD-LAST-NAME PIC X(20).
01 CHILD-FIRST-NAME PIC X(12).
************************************************************
* ESQL STATEMENT STATUS
************************************************************
01 SQLSTATE PIC X(5).
************************************************************
* RELATIONAL COMMAND ERROR BUFFERS
************************************************************
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 RDMCA.
05 ERROR-STATUS PIC 9(4).
05 AUX-INFO PIC S9(9) USAGE BINARY.
EXEC SQL END DECLARE SECTION END-EXEC.
************************************************************
* GETERROR BUFFERS
************************************************************
01 ERROR-TEXT.
05 ERR PIC X(132) OCCURS 5 TIMES.
************************************************************
* INDEX FOR GETERROR DISPLAYS
************************************************************
01 ERR-INDEX PIC 9.
************************************************************
* ALLERROR INDICATOR
************************************************************
01 XX PIC 9 VALUE 0.
88 ALLERR VALUE 1.
************************************************************
* COUNTER FOR CHILDREN
************************************************************
01 CHILD-COUNT PIC 9(1) VALUE 0.
************************************************************
* INDEX VARIABLE
************************************************************
01 I PIC 9(1).
*
PROCEDURE DIVISION.
************************************************************
* TIP INITIALIZATION WITH DPS
************************************************************
DPS-INITIALIZATION.
CALL 'D$INIT'USING DPS-STATUS, INFO-BUFFER.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
************************************************************
* FREE FORMAT READ OF THE TRANSACTION CODE
************************************************************
DPS-FREE-FORMAT-READ1.
CALL 'D$GETFL'USING DPS-STATUS, GET-FIELD.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
************************************************************
* FREE FORMAT READ OF THE EMPLOYEE NUMBER
* RETURNS THE EMPLOYEE NUMBER
* GETFIELD-TYPE = 1 - TESTS FOR NO INPUT
* GETFIELD-LENGTH = 5 - TESTS THE FIELD LENGTH
************************************************************
DPS-FREE-FORMAT-READ2.
CALL 'D$GETFL'USING DPS-STATUS, GET-FIELD.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
MOVE GETFIELD-TEXT TO EMPLOYEE-NUMBER.
IF GETFIELD-TYPE = 1
MOVE ERR-MISSING-INPUT TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
ELSE IF GETFIELD-LENGTH NOT EQUAL 5 OR
GETFIELD-TYPE NOT EQUAL 3
MOVE GETFIELD-TEXT TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
ELSE CONTINUE
END-IF
END-IF.
************************************************************
* EMPLOYEE NUMBER VALIDATION
************************************************************
VALID-EMPLOYEE-NUMBER.
IF EMP-PAGE <= 99 OR EMP-RECORD <= 0
MOVE GETFIELD-TEXT TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
END-IF.
************************************************************
* OPENS THE SCREEN TO BE SENT TO THE USER
************************************************************
DPS-OPEN-OUTPUT-SCREEN.
CALL 'D$OPEN'USING DPS-STATUS, SCREEN-DSPLYIND-50.
IF STATUS-FATAL
PERFORM DPS-GENERAL-ERROR-PARA
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA.
************************************************************
* TRANSFERS THE EMPLOYEE NUMBER TO THE FORM DEFINITION
************************************************************
MOVE-EMPLOYEE-NUMBER.
MOVE EMPLOYEE-NUMBER TO S50-EMP-NUMBER.
************************************************************
* RDMS - SETS UP RDMS WORK AREA
* SETS UP RDMS GENERAL ERROR HANDLING
************************************************************
RDMS-SETUP.
CALL 'RSA$INIT'USING WORK-AREA-SIZE.
EXEC SQL
************************************************************
* RDMS - SET DEFAULT QUALIFIER ON ALL TABLES IN THIS THREAD
* DEFINE THE CURSOR TO BE USED FOR DATA RETRIEVAL
* OPEN THE CURSOR
* RETRIEVE DATA FROM THE CURSOR
* MOVE THE CHILD INFORMATION TO THE DPS FORM
************************************************************
RDMS-SET-DEFAULT-QUALIFIER.
EXEC SQL
USE DEFAULT QUALIFIER FAMILYTIP
END-EXEC.
RDMS-SETUP-CHILDDATA-CURSOR.
EXEC SQL
DECLARE CHILDDATA CURSOR
SELECT CHILD_LAST_NAME, CHILD_FIRST_NAME
FROM CHILD
WHERE CHILD.CHILD_EMP_NUMBER = :EMP-NUMBER
END-EXEC.
EXEC SQL
OPEN CHILDDATA
END-EXEC.
RDMS-FETCH-MOVE-CHILD-DATA.
PERFORM WITH TEST AFTER UNTIL SQLSTATE = "02000"
OR CHILD-COUNT = 3
EXEC SQL
FETCH NEXT CHILDDATA INTO
:CHILD-LAST-NAME, :CHILD-FIRST-NAME
END-EXEC
IF SQLSTATE NOT = "02000"
ADD 1 TO CHILD-COUNT
MOVE CHILD-FIRST-NAME
TO S50-CHILD-FIRST-NAME (CHILD-COUNT)
MOVE CHILD-LAST-NAME
TO S50-CHILD-LAST-NAME (CHILD-COUNT)
END-IF
END-PERFORM.
IF CHILD-COUNT = 0 MOVE 'C'TO S50-CHILDREN-ON-DYN.
************************************************************
* TERMINATE WITH THE DATABASE SYSTEMS
************************************************************
DMS-DEPART-PARA.
DEPART.
SFS-FILE-CLOSE-PARA.
CLOSE SPORTSTIP.
UDS-END-THREAD-PARA.
END THREAD.
MOVE 0 TO THREAD-FLAG.
************************************************************
* SENDS THE SCREEN TO THE USER
************************************************************
DPS-SEND-OUTPUT-SCREEN.
CALL 'D$SEND'USING DPS-STATUS, SCREEN-DSPLYIND-50.
IF STATUS-FATAL
PERFORM DPS-TERMINATION
PERFORM TERMINATION-PARA
END-IF.
************************************************************
* TERMINATION WITH DPS
************************************************************
DPS-TERMINATION.
CALL 'D$TERM'USING DPS-STATUS.
************************************************************
* PROGRAM TERMINATION
************************************************************
TERMINATION-PARA.
STOP RUN.
*
*
************************************************************
* DMS - CHECK FOR A '0013'ERROR,
* IF THIS ERROR OCCURRED THE
* INVALID-EMPLOYEE-NUMBER MESSAGE IS PRINTED
* ELSE THE ERROR MESSAGE IS RETURNED TO THE PRINTER
* FOR DEBUGGING.
************************************************************
DMS-GENERAL-ERROR-PARA.
IF ERROR-NUM = '0013'
MOVE EMPLOYEE-NUMBER TO ERR-EMPLOYEE-NO
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE
PERFORM INVALID-INPUT-PARA
ELSE DISPLAY 'DMS-GENERAL-ERROR-PARA.'UPON PRINTER
DISPLAY 'AREA = 'ERROR-AREA UPON PRINTER
DISPLAY 'RECORD = 'ERROR-RECORD UPON PRINTER
DISPLAY 'SET = ' ERROR-SET UPON PRINTER
DISPLAY 'ROLLBACK = 'RB-ERROR-CODE UPON PRINTER
DISPLAY 'FUNCTION = 'ERROR-FUNCTION UPON PRINTER
DISPLAY 'ERR NUM = ' ERROR-NUM UPON PRINTER
END-IF.
IF IMPART-DEPART EQUAL TO 1 PERFORM DMS-DEPART-PARA.
PERFORM SFS-FILE-CLOSE-PARA.
PERFORM UDS-END-THREAD-PARA.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
*
************************************************************
* SFS - DISPLAY OF BAD INPUT KEY
************************************************************
BAD-KEY.
MOVE EMPLOYEE-NUMBER TO ERR-EMPLOYEE-NO.
MOVE INVALID-EMPLOYEE-NUMBER TO ERROR-MESSAGE.
PERFORM INVALID-INPUT-PARA.
PERFORM DMS-DEPART-PARA.
PERFORM SFS-FILE-CLOSE-PARA.
PERFORM UDS-END-THREAD-PARA.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
*
************************************************************
* RDMS - RETURN AN ERROR MESSAGE TO THE PRINTER FILE IF A
* DATABASE ERROR OCCURS
************************************************************
RDMS-ERROR-PARA.
EXEC SQL WHENEVER SQLERROR CONTINUE END-EXEC.
DISPLAY '***SQLSTATE = 'SQLSTATE UPON PRINTER.
DISPLAY '***RDMCA AUX-INFO = 'AUX-INFO UPON PRINTER.
DISPLAY '***ERROR STATUS = 'ERROR-STATUS OF RDMCA
UPON PRINTER.
PERFORM UNTIL ALLERR
INITIALIZE ERROR-TEXT
EXEC SQL
GETERROR INTO :ERR(1),:ERR(2),:ERR(3),;ERR(4),:ERR(5)
END-EXEC
PERFORM VARYING ERR-INDEX FROM 1 BY 1 UNTIL ERR-INDEX = 6
DISPLAY ERR (ERR-INDEX) UPON PRINTER
IF ERR(ERR-INDEX) = SPACE SET ALLERR TO TRUE END-IF
END-PERFORM
END-PERFORM.
PERFORM DMS-DEPART-PARA.
PERFORM SFS-FILE-CLOSE-PARA.
PERFORM UDS-END-THREAD-PARA.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
*
*
************************************************************
* RETURNS AN ERROR MESSAGE TO THE USER IF THE INPUT
* MESSAGE WAS IN ERROR AND TERMINATES WITH THE
* TRANSACTION PROCESSING SYSTEM
************************************************************
INVALID-INPUT-PARA.
CALL 'D$SENDERR'USING DPS-STATUS, ERROR-MESSAGE,
ERROR-COORDINATES.
*
*
************************************************************
* ONLY EXECUTED WHEN A DPS ERROR OCCURS
* THE OUTPUT OF D$DUMP SHOULD BE INCLUDED WITH UCF
* DOCUMENTATION IF THIS PARAGRAPH WAS EXECUTED DUE TO
* TO A DPS INTERNAL ERROR.
************************************************************
DPS-GENERAL-ERROR-PARA.
CALL 'D$DUMP'.
CALL 'D$ERRMSG'USING DPS-STATUS.
IF IMPART-DEPART EQUAL TO 1 PERFORM DMS-DEPART-PARA.
IF THREAD-FLAG = 1 PERFORM UDS-END-THREAD-PARA.
PERFORM DPS-TERMINATION.
PERFORM TERMINATION-PARA.
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** COMPILE OF THE TIP TRANSACTION PROGRAM
@ . ***
@ . *** ASSIGN THE FILE CONTAINING SUBSCHEMA PROCESSING OUTPUT AND
@ . *** PUT A USE NAME ON IT.
@ . ***
@ASG,A UDS$$SVN*SCHFILEXEC.
@USE SCHFILEXEC,UDS$$SVN*SCHFILEXEC.
@ . ***
@ . ***
@ . *** RETRIEVAL PROGRAM COMPILE
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
@EOF
@ . ***
@ . ***
@ . *** COMPILE OF THE DPS DMS/RDMS ESQL/SFS COBOL TRANSACTION PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
@UCOB QUAL*UCSTST.DPSALL,QUAL*UCSTST.DPSALL/COMP,,, COMPAT, NO-OPTIONS,;
APPLICATION/APPSVN
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'DPSALL'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, A SPECIAL
@ . *** SEARCH CHAIN FOUND IN SYS$LIB$*APP$7DPS.SSDEF$ IS SPECIFIED
@ . *** USING AN "@USE LINK$PF" COMMAND. THIS SEARCH CHAIN IDENTIFIES
@ . *** THE DPS SYSTEM FILE FOR APPLICATION GROUP 7 AND SETS
@ . *** ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7DPS.
@LINK ,QUAL*UCSTST.DPSALL
INCLUDE QUAL*UCSTST.DPSALL/COMP
INCLUDE UDS$$SVN*SCHFILEXEC.S$WORK/PERSONSUBTIP
RESOLVE ALL REFERENCES USING LIBCODENAME
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
*VALCHG M
944 NAM,DPSALL ACT,DPSALL PRG,3 STF,0 QPR,1 STA,J OPT,TV
944 REC,Z AUD,7 PRT,PR
@EOF
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@EOF
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON BTLOADING
ON STICKING
@EOF
@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P QUAL*TIPSUPUR.,F/1000//1000
@ . ***
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE@ .
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*TIPSUPUR.,FIX
RES 810,64000,28,,TIPSUPUR,,,WW=P,AUDIT=0,NREC
LFD 810
@EOF
@ . ***
@ . ***
@ . *** USES THE SUPUR UTILITY TO CREATE A SUPUR PROGRAM FILE,
@ . *** COPYS THE TRANSACTION PROGRAM INTO THE SUPUR PROGRAM FILE,
@ . *** AND PLACES THE SUPUR PROGRAM FILE ONLINE.
@ . ***
@TIP$*TIPRUN$.SUPUR,P
CREATE 810 MAIN
COPY ONLY DPSALL FROM QUAL*UCSTST TO 810
ONLINE 810
LIST ALL FROM 810
EXIT
@ . ***
@ . ***
@ . *** EXAMPLE SETUP IS COMPLETE
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** COMPILE OF THE TIP TRANSACTION PROGRAM
@ . ***
@ . *** ASSIGN THE FILE CONTAINING SUBSCHEMA PROCESSING OUTPUT AND
@ . *** PUT A USE NAME ON IT.
@ . ***
@ASG,A UDS$$SVN*SCHFILEXEC.
W:120533 filename not unique.
W:120133 file is already assigned.
@USE SCHFILEXEC,UDS$$SVN*SCHFILEXEC.
I:002333 USE complete.
@ . ***
@ . ***
@ . *** RETRIEVAL PROGRAM COMPILE
@ . ***
@ . *** THE PROC FOR THE DPS PREDEFINED FORM RESIDES IN THE USER
@ . *** PROGRAM FILE. THIS PROCEDURE IS PDP'ED WITHIN THE
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . *** THIS PDP ONLY NEEDS TO BE DONE ONCE. THE PROC WILL THEN BE
@ . *** AVAILABLE TO ALL PROGRAMS COMPILED FROM THIS FILE.
@ . ***
@PDP,UC QUAL*UCSTST.SCREEN-50/COBP,.SCREEN-50
PDP 13RJ (931108 0108:39) 1994 Feb 17 Thu 1337:45
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 666 Entry Points: 1 Time: 3.103 Storage: 7070/0/7070/0106210
@ . ***
@ . ***
@ . *** COMPILE OF THE DPS DMS/RDMS ESQL/SFS COBOL TRANSACTION PROGRAM
@ . ***
@USE COB$PF,APP7*DPS.
I:0023333 USE complete.
@UCOB QUAL*UCSTST.DPSALL,QUAL*UCSTST.DPSALL/COMP,,, COMPAT, NO-OPTIONS,;
APPLICATION/APPSVN
UCOB- 6R2 (940210) LSS- 8R2 (940209) 940217 13:37:47
SIZES: CODE(EM6): 1917 DATA: 1623
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR) 1 WARNING(LEVEL)
6 REMARKS(CLARIFICATION)
@ . ***
@ . ***
@ . *** LINK OF THE STANDARD TIP TRANSACTION PROGRAM 'DPSALL'.
@ . ***
@ . *** PRIOR TO CALLING THE STATIC LINK PROCESSOR, A SPECIAL
@ . *** SEARCH CHAIN FOUND IN SYS$LIB$*APP$7DPS.SSDEF$ IS SPECIFIED
@ . *** USING AN "@USE LINK$PF" COMMAND. THIS SEARCH CHAIN IDENTIFIES
@ . *** THE DPS SYSTEM FILE FOR APPLICATION GROUP 7 AND SETS
@ . *** ACTIVE$APP TO APPLICATION GROUP 7.
@ . ***
@USE LINK$PF,SYS$LIB$*APP$7DPS.
I:002333 USE complete.
@LINK ,QUAL*UCSTST.DPSALL
LINK 5R2 (940207 1635:57) 1994 Feb 17 Thu 1338:12
*WARNING (LINK 687)* The Linking System could NOT create a ZOOM that conforms
to the Fast Load format restriction of four banks or less. This is due to
incompatibilities in the attributes (e.g. merge order, mode, locality) of
certain banks, which prevent them from being merged. Such merging is required
to reduce the number of banks that are output. The ZOOM that is created will
be of the standard form.
END LINK , LINES : 5 , ERRORS : 0 , WARNINGS : 1 , XREFS : 0.
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
VTBUTL 44R2#0000001 940217 1338:22
*VALCHG M
KEYWORDS FOR VALTAB FIELDS
LONG FORM SHORT FORM FIELD DESCRIPTION
--------- ---------- -----------------
(FIRST FIELD ON EACH CARD) PROGRAM NUMBER
NAME NAM PROGRAM NAME
ACTION ACT TRANSACTION CODE
RUNTIME RUN MAXIMUM RUN TIME
PRIORITY PRI PROGRAM PRIORITY
INDICATORS IND VALTAB INDICATORS
PRGTYPE PRG PROGRAM TYPE
OPTIONS OPT PROGRAM OPTIONS
STFILE STF STANDARD FILE NO.
>DPSALL 10211
For more information about how to code UCS programs for performance, refer to the
programming reference manual for the appropriate UCS language (for UCS COBOL,
UCS FORTRAN, and UCS C, this information is in Volume 2).
Note that PADS interactive debugging cannot be done on a program linked in this
manner. PADS postmortem debugging is still available.
• Use static linking to produce a FAST LOAD ZOOM whose banks have been
merged. You can accomplish this by using the following static linking command:
or,
OUTPUT FAST LOAD
If the Linker cannot create a FAST LOAD format ZOOM, it will give you a LINK
687 Warning and produce a standard ZOOM.
Note that a FAST LOAD format ZOOM is only possible with a very small
transaction program. In addition, the processing done for FAST LOAD causes the
Linker to do more aggressive bank-merging, and it will merge the URTS$TABLES
“heap” bank with other data banks. This may result in there not being enough
space available in URTS$TABLES to handle allocation requests and another bank
may then be acquired at runtime. If this is done TIP “sticking” and RESTART will
be lost for the transaction. You might then try and link your transaction into a
standard ZOOM instead of a FAST LOAD ZOOM to see if you can regain the TIP
'sticking' and RESTART capabilities for your transaction:
PROCESS FOR EXTENDED ZOOM
• Use a ZOOM with only the transaction program entry point defined.
Use static linking to produce a ZOOM with only the entry point definition for the
starting address of the transaction program. You can accomplish this by using the
following static linking command:
DELETE ALL DEFINITIONS EXCEPT START$
The URTS$TABLES bank will be expanded during execution as more space is needed.
If it runs out of room, other banks will be allocated and linked to the original so that
the capacity is somewhat open-ended. If the URTS$TABLES bank is expanded, or
others allocated, this will inhibit TIP “sticking” and RESTART for TIP transactions. It is
also relatively expensive for non-TIP executions if the execution time is short.
Therefore, it may be desirable when you static-link your executable programs to set
the size of the URTS$TABLES bank to the maximum that your programs need, or could
possibly need.
The new ClearPath 2200 machines have virtual memory and large real memories and it
is no longer productive to attempt to keep the size of your programs small with
memory reserves just barely large enough to keep them running. If your programs
can run with URTS$TABLES at its maximum limit of 0777777, then set its size
accordingly ( 0777777 - 060000 + 1 or 0720000). Put the following into the static link
sources of your executable programs, after all INCLUDE and RESOLVE statements:
SET SIZE = 0720000 FOR URTS$TABLES
Programs that use DPS may not run with this maximum size if it calls the basic mode
MCB. So, for DPS you might want to keep your URTS$TABLES upper limit to 0577777.
This would be a size of 0577777 - 060000 + 1, or 0520000 words. (Check the DPS
documentation to see if this is necessary.) To get your URTS$TABLES at an initial
limit of 0577777, put the following static linker statement in your static link source,
after all INCLUDE statements and RESOLVE statements:
SET SIZE = 0520000 FOR URTS$TABLES
Do not set the size of URTS$TABLES in HVTIP links, as HVTIP memory management is
done differently. Also, if you have created a FAST LOAD ZOOM, the URTS$TABLES
bank will have been merged with other banks, and you may have to set a different size
in order to get it to get to the desired 0777777 or 0577777 limit.
Once the URTS$TABLES bank is expanded to its maximum limit and all space within it
has been allocated, a new bank will be allocated if more space is needed. Note that
there may be several URTS space allocations done for something such as opening a
file. If one or more buffers is obtained for opening a given file, and another buffer
needs to be allocated to finish opening the file resulting in another URTS$TABLES bank
being acquired, an error will occur.
This is because (currently) all the buffers needed for a specific use such as handling of
a given file must be in the same bank. In order to keep this error from happening you
must use a keyword option on the compilation of the main program for your
executable program. The keyword is URTS$TABLES, and you give it a size which is a
reserve for “same-bank” allocations within the URTS$TABLES bank. This reserve is
used when a URTS$TABLES allocation is done and must be in the same bank as
another allocation and the “normal” space in the bank is used up. The initial reserve is
treated as an octal number, so do not use the digits 8 or 9 in the reserve.
You probably should not use this option if your program is not running out of
URTS$TABLES space since putting in a “same-bank” reserve virtually guarantees that
your program will acquire another URTS$TABLES bank at runtime. You also may not
want to use this mechanism if your program uses a product that requires that
URTS$TABLES not grow past some limit such as 0577777, since the URTS runtime
code will expand URTS$TABLES to 0777777 and use that space before it will acquire
another bank.
If the heap data bank space is tight and you wish to minimize its size, you should
consider doing the following:
• Closing PCIOS files when you are finished using them. This releases the space
that they were using.
• Using extended mode SORT (EM SORT). This moves the major portion of space
used by SORT processing to a separate bank so that it is no longer located in the
Heap Data Bank. The EM SORT is also much faster than the older basic mode
SORT.
• Use the "CALL RSA$INIT" routine to initially allocate all RDMS space so that it is
allocated as contiguous space.
For TIP (and also batch or demand) programs, if the main program is compiled with the
keyword option TIPMALLOC, there is a URTS object module that is linked into the
resulting ZOOM that defines space that instead will be used for malloc purposes. The
name of the bank is TIPMALLOC$$$, and it is an activity-level bank with an initial size
of 262144 words and a maximum size of 16 million words. However, you can change
the SIZE of the bank in the static link of your TIP program to be what you want. For
example, assuming that you compiled your main program with the TIPMALLOC
keyword option, put the following statement into the static link source of your
executable ZOOM, after all the INCLUDE and RESOLVE statements:
SET SIZE = 04000000 for TIPMALLOC$$$
This statement in the static link of your ZOOM will give you approximately 262144*4
words of dynamic space available for C malloc calls before the space would run out
and another bank acquired. This means that TIP “sticking” and RESTART will not be
lost until that point was reached if the program is executed under TIP. The
preservation of TIP “sticking” and RESTART can be a major concern in transaction
performance. The maximum size that you can set for TIPMALLOC$$$ would be
0100000000, or approximately 16 million words.
Do not use the TIPMALLOC keyword option on compilations to be linked into HVTIP
ZOOMs. HVTIP has its own memory allocation scheme and is controlled by code in
the URTS HVTIP loader.
The CREATE$BANK call causes your transaction to lose its TIP sticking and TIP restart.
To prevent this from occurring, the main program must use the keyword option
TIPMALLOC on the compilation of the program. Using TIPMALLOC results in the
TIPMALLOC$$$ bank being included within your link. Inclusion of this bank allows TIP
sticking and restart to function because a dynamic bank creation does not take place.
Allowing TIP sticking and restarting keeps RDMS and any other subsystem that is
called from acquiring the memory heap space from the URTS$TABLES heap bank.
Note that a fast-load zoom cannot be created with the TIPMALLOC option because the
total (collective) size is more than 262K words. (This is not the actual size, but the
potential growth size when the program requires more memory.)
The following example shows the HELPER output for the DPS 2200 software in file
APP7*DPS that was used in examples in this section. Noteworthy lines are bolded.
@APP7*DPS.HELPER
HELPER 5R1A APP7 DPS Helper Utility Processor 1991 Jun 27 Thu 1450:31
RES 2102,478400,28,$$TERMFILE$$,EXECFILE,NREC,AUDIT=0
THE SIZE OF THE TERMINAL FILE MUST BE 7475 TRACKS
RES 2105,200,112,$$PASSFILE$$,EXECFILE,NREC,AUDIT=0
THE SIZE OF THE PASSWORD FILE MUST BE 13 TRACKS
RES 2103,5001,2016,$$PAGEFILE$$,EXECFILE,NREC,AUDIT=0
THE SIZE OF THE PAGING FILE MUST BE 5627 TRACKS
RES 2108,126000,28,ALT$SCRNFILE,ALT$SCRNFILE,NREC,AUDIT=0
THE SIZE OF THIS FORM LIBRARY MUST BE 1969 TRACKS
RES 2109,126000,28,FORMS,FORMS,NREC,AUDIT=0
THE SIZE OF THIS FORM LIBRARY MUST BE 1969 TRACKS
2. Below this are four lines of output. The third and fourth lines apply to static
linking: If D$DEF routines are used in the program, refer to the fourth line.
Otherwise, refer to the third line.
3. Take the size shown on the appropriate line and use it in a static linking SET SIZE
command for the transaction program, as follows:
SET SIZE = SIZE + dps-helper-size FOR URTS$TABLES
For this example, assuming that the TIP transaction program does not use D$DEF
routines, the following command would be used in the static link of the transaction
program:
SET SIZE = SIZE + 10048 FOR URTS$TABLES
If your DPS TIP program is still losing its TIP sticking and restart and it uses RDMS
embedded or interpreted SQL, consider adding the TIPMALLOC keyword option to the
compilation of your main program. RDMS SQL space needs are satisfied from C
malloc calls, and that space will be satisfied from the auxiliary TIPMALLOC$$$ bank
instead of URTS$TABLES space when the TIPMALLOC keyword option is used. See
the preceding subsections regarding the TIPMALLOC keyword option and static linking
with RDMS.
Note: The SET SIZE command must follow the RESOLVE command. If both DPS
and RDMS are being used by the transaction program, use only one SET SIZE
command in the static link. Add the space required by DPS and RDMS together, and
use the result of this calculation in the SET SIZE command.
If your transactions contain different execution paths, you may want to apply these
techniques only to the high-priority execution paths in the transactions. Remember
that your transactions execute successfully without applying either of these
techniques.
To obtain the information to apply the techniques discussed in this subsection, you
must obtain a TIP DIAG$ file, which is then processed by PADS commands.
The transaction control program is called DPSDMS. One input to this transaction
sequence is the transaction code DPSDMS followed by an employee number (for
example, DPSDMS 10211). The following processing sequence is used for this input:
1. Initializes using DPS
2. Reads the employee number input
3. Validates the employee number
4. Opens a DPS form
5. Imparts to a DMS database
6. Retrieves data from the DMS database using the employee number
7. Moves the DMS data into the DPS form
8. Departs from the DMS database
9. Displays the DPS form on the terminal
10. Terminates using DPS
IDENTIFICATION DIVISION.
.
.
PROCEDURE DIVISION.
.
.
.
CALL 'D$INIT'...
reads input message
validation of input
CALL 'D$OPEN'...
IMPART.
retrieval from DMS database
move data to DPS form
DEPART.
CALL 'D$SEND'...
CALL 'D$TERM',,,
STOP RUN.
This transaction has been function-tested. The following performance aids have
already been applied:
• Coding
The INITIAL clause was added to the transaction program DPSDMS.
• Compiling
The OPTIM and REORDER keyword options were used when compiling
transaction program DPSDMS.
• Linking
The PADS interface code inclusion is prevented by the RESOLVE ALL REFERENCES
command.
The size of URTS$TABLES was increased to accommodate the use of DPS. This
was accomplished by adding a SET SIZE FOR URTS$TABLES command to the
static link of the transaction program DPSDMS.
A FAST LOAD ZOOM was requested by the PROCESS command in the static link.
For this example, the linking runstream for the DPSDMS transaction program is as
follows:
@USE LINK$PF,SYS$LIB$*APP$7DPS.
@LINK,S ,QUAL*PROGFILE.DPSDMS
INCLUDE QUAL*PROGFILE.DPSDMS/COMP
INCLUDE UDS$$SVN*SCHEXECFILE.S$WORK/PERSONSUBTIP
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
SET SIZE = SIZE + 10048 FOR URTS$TABLES
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
To continue the optimization process, you must collect information by executing the
transaction DPSDMS, producing a diagnostic dump in the process. The following
describes how to produce and process this dump.
UCS FORTRAN
CALL FERR
UCS C
ferr();
In the example, this call would be placed in the transaction program DPSDMS just
before the call to 'D$TERM', as follows:
IDENTIFICATION DIVISION.
.
.
PROCEDURE DIVISION.
.
.
CALL 'D$INIT'....
reads input message
validation of input
CALL 'D$OPEN'....
IMPART.
retrieval from DMS database
move data to DPS form
DEPART.
CALL 'D$SEND'...
CALL 'FERR'.
CALL 'D$TERM'....
STOP RUN.
Step 2: Recompile
Recompile the transaction program.
Step 3: Relink
Relink the transaction program producing a short listing (@LINK,S...)
Step 6: Execute
Depending upon your site setup, refer to the appropriate subsection that follows:
• If you have access to the operator console or a terminal that can be placed in
CONS MODE (@@CONS), refer to "Executing with Console Output."
• If you do not have access to the operator console output, refer to "Executing
Without Console Output."
1. Execute the transaction while watching the operator console output. When the
transaction aborts, the following message is displayed:
*nnnnn**TIP DIAG$ FILE CREATED - TIPDIAG$*xxxxxxnnnnn
where
nnnnn
is the generated id for this execution of the transaction.
xxxxxx
is the transaction name that is in error.
TIPDIAG$*xxxxxxnnnnn
is the name of the DIAG file which contains the dump for this execution of the
transaction.
When this example is executed, a message like the following is received:
*7022J**TIP DIAG$ FILE CREATED - TIPDIAG$*DPSDMS7022J
2. Call PADS. Supply the DIAG dump file name on the processor call, as in the
following example:
@pads diag,tipdiag$*dpsdms7022j.
3. Request the first DIAG dump file entry for this transaction execution.
# CMD > select first diag entry
After successful activation, PADS responds with the current number of entries in
the TIP error history file. There are one or more entries for each transaction
execution that errors and produces a DIAG dump.
The following is an example of this PADS output.
PADS 8R1 1993-07-11 2328:52
# Application 7 TIP Error History File contains 192 entries.
3. Locate the diagnostic information for your specific transaction execution. There
are several PADS commands you can use to accomplish this. The following are
examples:
• The following example command lists the last six entries with the transaction
code DPSDMS. You must enter the transaction code in capital letters.
# CMD >tiplog$code$ 'DPSDMS',6
• The following example command lists the last six entries created on July 11,
1993 (930711) with transaction code DPSDMS. You must enter the transaction
code in capital letters.
# CMD >tlog$search$ " tiplog.error_date (i) = '930711'and " !! %
# CMD > " tiplog.transaction_code (i) = 'DPSDMS'",6
• The following command lists the last six entries created after 11:00 PM
(230000) on July 11, 1993 (930711) with transaction code DPSDMS. You must
enter the transaction code in capital letters.
# CMD >tlog$search$ " tiplog.error_date (i) = '930711'and " !! %
# CMD > " tiplog.error_time (i) > '230000'and " !! %
# CMD > " tiplog.transaction_code (i) = 'DPSDMS'",6
Each of these queries produces a report on six or fewer entries that match the
criteria supplied. Look at the date (ERROR_DATE) and time (ERROR_TIME) on each
entry to select the entry for the time when you executed the transaction.
Often, one transaction execution produces multiple consecutive entries within the TIP
error history file. You can identify entries for the same execution by checking for the
same value in the FILENAME=TIPDIAG$*filename field. You want the oldest of these
entries; this is the entry with the highest TIPLOG number. To confirm this, check the
values in the ERROR_TIME field for the entries.
The following is a sample of the output for two entries for the same transaction
execution. The TIPLOG(4) entry is the one you want to interrogate further. The
bolded fields provide the information that is important to you.
# TIPLOG(3)
# PROGRAM_NAME=DPSDMS TRANSACTION_CODE=DPSDMS
# ERROR_INFO
# ERROR_VA=400013101005T CONTINGENCY_TYPE=2T ERROR_TYPE=0T
# ERROR_CODE=14T
# ERROR_AUX_INFO=21T ERROR_ID=34001000322T ERROR_DATE=930711
ERROR_TIME=
# 231014 ERROR_INS=0T
# TIP_INFO
# PID=10T TIP_TYPE=transaction HVTIP_LIB_BANK=OT
# FILENAME=TIPDIAG$*DPSDMS7022J.
# TIPLOG(4)
# PROGRAM_NAME=DPSDMS TRANSACTION_CODE=DPSDMS
# ERROR_INFO
# ERROR_VA=200444006077T CONTINGENCY_TYPE=12T ERROR_TYPE=3T
# ERROR_CODE=0T
# ERROR_AUX_INFO=0T ERROR_ID=34001001757T ERROR_DATE=930711
ERROR_TIME=
# 231012 ERROR_INS=0T
# TIP_INFO
# PID=10T TIP_TYPE=transaction HVTIP_LIB_BANK=OT
# FILENAME=TIPDIAG$*DPSDMS7022J.
4. Now that you know which TIPLOG entry reflects your transaction execution, issue
a TDIAG$ command to PADS, supplying the TIPLOG number. This command is as
follows for the example:
#CMD >tdiag$ 4
There are two bank sizes that you are interested in obtaining: the size of the activity-
local stack (ALS), and the size of the heap, URTS$TABLES. To improve the
performance of the transaction execution, you want to set the initial size of these
banks to the maximum size of these banks during transaction execution. This
prevents costly execution-time bank expansion.
The ALS is where all UCS automatic program storage resides. The upper limit of the
ALS is set by the Exec to 0677777. The initial size is currently 010000 by default. Note
that the ALS grows downwards, from high addresses towards lower addresses.
Automatic storage is used internally by the UCS Runtime System and externally by
certain user-defined variables. Only UCS COBOL, UCS FORTRAN, and UCS C let the
programmer define storage as automatic:
• In UCS COBOL, all WORKING-STORAGE is automatic and is placed on the ALS, if
the PROGRAM-ID statement includes the INITIAL clause.
• In UCS C, all storage defined as automatic is always placed on the ALS.
• In UCS FORTRAN, local procedure-level variables are allocated on the ALS if both
the following are true:
- The variable is not declared as STATIC, is not in COMMON, and does not
have a DATA statement on it.
- The MIN-DBANK keyword option is used on the compilation of the
FORTRAN program.
Since there is plenty of memory available on the newer ClearPath machines, it is
recommended that you simply set the initial size of the ALS to a fairly large size and
then not worry about it. An initial size of 0400000 should be sufficient for most
programs. It is not recommended that you set it to the full maximum size of 0700000,
since then its lower limit would overlap that of basic mode code and some programs
may no longer operate. You should not therefore set an initial size of over 0600000.
Put the following statement in the static link of your executable program to set it to
the recommended 0400000:
SET ALS_INIT_SIZE = 0400000
If you do not wish to set the ALS to a simple value such as 0400000 or 0600000
(which should handle most all situations), you may want to determine exactly the size
your ALS bank was expanded to in the execution of your TIP ZOOM. To determine the
size that the ALS reached and to set the initial size of the activity-local stack for your
ZOOM, do the following:
1. Issue an "inq bankinfo b1" command to PADS. Register B1 always points to the
ALS.
2. Use a static linking command similar to the following to set the size of the ALS:
SET ALS_INIT_SIZE = 0xxxx
The default initial size of the ALS is 010000 words. The default maximum size is
0700000 words. (The maximum size is also 0700000 words.) The size you specify
for the ALS should be a multiple of 01000.
Example
The following is an example of the process. User input is bolded.
The "inq bankinfo b1" command requests a display of information about the ALS bank
that is always pointed to by base register B1. The first line of output from the "inq
bankinfo b1" command contains the size of the ALS during transaction execution. In
this case, the size is 10000T (010000 words). PADS uses T to denote octal. This is the
size you use in the static linking SET ALS_INIT_SIZE command for non-XPA systems.
The following static link runstream shows the commands resulting from this process.
Notice that ALS_INIT_SIZE is set to the same value as the SIZE output by the PADS
query.
@USE LINK$PF,SYS$LIB$*APP$7DPS.
@LINK,S ,QUAL*PROGFILE.DPSDMS
INCLUDE QUAL*PROGFILE.DPSDMS/COMP
INCLUDE UDS$$SVN*SCHEXECFILE.S$WORK/PERSONSUBTIP
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
SET SIZE = SIZE + 10048 FOR URTS$TABLES
SET ALS_INIT_SIZE = 010000
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
The SET command should be placed after the RESOLVE command and before the
PROCESS command in the static link of the transaction program.
The heap is where dynamic runtime program storage resides. Dynamic storage is
used internally by the UCS Runtime System, RDMS 2200, DPS 2200, PCIOS files, and
Sort/Merge.
You are interested in the value of n in the second number. This is the bank
descriptor index (BDI) for the bank that contains the heap. It is used as input to
the next PADS command.
Example
The following is an example of the process defined by #1 and #2. (User input is
bolded.)
The ”dump r15” command requests the bank descriptor index (BDI) for the bank that
contains the heap, URTS$TABLES. In this example, the first half of the second entry in
the output provides this BDI. The value is 400006, making the input to the next
command the value 6.
3. Refer to the static link listing to find the size of the portions of the bank that are
not the heap, URTS$TABLES.
@LINK,S ,QUAL*UCSTST.DPSDMS
:
1 BANK GROUP EM$$GROUP_$A. 6 banks
:
5 Name: FL$DATA$BANK_$A. (new bank)
Bank_type = Data; LBN = 04
L,BDI = 0400006; Addr Range: 000060000 - 000133230
7 bank parts:
┌──1 QUAL*UCSTST(1).DPSDMS/COMP 1993 MAR 27 1910:55
│ Name: DPSDMS$3 000060000 - 000060113
│ 2 SYS$LIB$*EMOMRTS(857).URTS$TABLES 1993 Jan 19 1552:38
│ Name: SS$CGY_LIST 000060114 - 000060115
0472 │ 3 SYS$LIBEMOMRTS(857).URTS$TABLES 1993 Jan 19 1552:38
words ───-┤ Name: URST$TABLES$17 000060116 - 000060125
│ 4 SYS$LIB$*EMOMRTS(857).RTS-GCLSINT 1993 Jan 19 1552:38
│ Name: LV$GCLSINT 000060126 - 000060141
│ 5 SYS$LIB$*PADS(98).PADS$EMRTS 1993 Jan 7 1438:18
│ Name: PADS$LV 000060142 - 0000660341
│ 6 SYS$LIB$*LINKOMLIB(228).LS$INTERCEPT 1992 Dec 17 1417:57
└── Name: LS$INTERCEPT$04 000060342 - 000060471
4. Subtract the total size of the non-URTS$TABLES bank parts from the bank size
obtained from the PADS "bankinfo$" command.
In this example, the following subtraction produces the size of the heap
URTS$TABLES.
053300
- 000472
052606 is the size of URTS$TABLES
5. Round the result from the subtraction up to the nearest multiple of octal 1000. In
this case 053000. This is the size you use in the static linking SET command for
URTS$TABLES.
The following example static link runstream shows the commands resulting from
this process. If the static link already contains a SET SIZE FOR URTS$TABLES
command, it should be replaced by this new command.
@USE LINK$PF,SYS$LIB$*APP$DPS.
@LINK,S ,QUAL*PROGFILE.DPSDMS.
INCLUDE QUAL*PROGFILE.DPSDMS/COMP
INCLUDE UDS$$SVN*SCHEXECFILE.S$WORK/PERSONSUBTIP
RESOLVE ALL REFERENCES USING SYS$LIB$EMOMRTS.,LIBCODENAME
SET SIZE = 053000 FOR URTS$TABLES
SET ALS_INIT_SIZE = 010000
PROCESS FOR EXTENDED FAST LOAD
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
The SET command should be placed after the RESOLVE command and before the
PROCESS command in the static link of the transaction program.
All examples in Section 6 show UCS COBOL transactions. Unless otherwise indicated,
the same techniques also apply to UCS FORTRAN and UCS C HVTIP transactions.
Note: An HVTIP program can only use a single heap bank for data loading while an
HVTIP-II program can use multiple heap banks for data loading.
This subsection covers the following topics about creating HVTIP ZOOMs:
• Coding, compiling, and establishing the HVTIP environment for HVTIP initial control
programs (ICP) and subprograms
• Linking for functional testing
One central example is used throughout 0. It is expanded upon as new topics are
discussed. Figure 6–1 illustrates the HVTIP transaction sequence for this example.
In this example
1. The transaction code xxxHVT schedules the initial control program, called xxxICP.
2. xxxICP calls subprogram xxxSUBX.
3. xxxSUBX calls subprogram xxxSUBY.
In the actual examples, the string xxx is replaced with either “DPS” or “MCB,”
depending upon which function calls are being used in the example. The examples
describe any differences that exist between using DPS 2200 functions or MCB
functions.
Examples in Section 6 show UCS COBOL. Except where noted, everything discussed
regarding these examples also applies to UCS FORTRAN and UCS C.
Note: If the VALTAB for a transaction specifies data heap information with the
DLACTCNT, DLPRGCNT, DASIZL, DPSIZL, DSACTCNT, DSPRGCNT, DSLOWER,
DSUPPER, or DBMAX parameters, the actual transaction ZOOM must be an HVTIP-II
ZOOM if the additional heap banks are to be used.
If the VALTAB for a transaction does not specify data heap information and the
actual transaction is an HVTIP-II ZOOM that references BDIs other than program
level 5, the HVTIP heap manager will attempt to dynamically create the data heap
banks with the BDIs requested.
The HVTIP-II environment is capable of having more than one data heap bank available
for loading the nonshared static data of an HVTIP transaction. It consists of enhanced
Exec VALTAB options for specifying multiple data heap banks, and Linking System
syntax for a new type of ZOOM (an HVTIP-II ZOOM), to take advantage of the
additional data heaps.
This can be expensive and can create very complex HVTIP applications just to manage
one small program-level heap bank effectively. Inevitably there is a limit to how much
ICP and subprogram data can be processed. The HVTIP-II environment is an attempt
to remove this capacity limitation in a performance-effective manner.
At the beginning of an HVTIP-II transaction, the Exec will acquire any data heaps
requested through the VALTAB specifications. The pertinent data heap information is
passed to the HVTIP heap manager when the initial control program (ICP) is loaded. To
minimize the relocation path length, the LINK Processor SET LOWADR command
permits the user to indicate the starting virtual address of some or all of the data
segments (DSEG) and common block segments (CBSEG) of an HVTIP-II ZOOM. See
the Transaction Processing Programming Reference Manual and the Linking System
Programming Reference Manual for the exact syntax of the VALTAB specifications
and LINK commands applicable to the HVTIP-II environment.
The original UCS HVTIP environment allows you to specify, through VALTAB and LINK
commands, the following heap bank attributes:
• The initial size of the heap bank, using VALTAB DBK parameter (if it is zero, the
size of the HVTIP$$DBANK in the ICP will be used; you can control it with a SET
SIZE = n for HVTIP$$DBANK link statement).
• The maximum upper limit, using SET MAX_LIMIT = n for HVTIP$$DBANK at LINK
time (default is 0777777).
• The low address, using SET LOWADR = n for HVTIP$$DBANK at LINK time (default
equal to the smallest nonzero LOWADR of the input object module D-banks).
The HVTIP-II environment retains the main heap bank as an implicit small program-
level bank. Beyond the first heap, the VALTAB specification (for program-level and
activity-level heaps separately) indicates how many additional data heap banks are to
be used, the sizes of the large heap banks, and the size and starting offset of the small
heap banks. The LINK Processor SET LOWADR command allows you to specify for
any and all segments (like the original UCS HVTIP) its starting offset and the bank into
which it is to be allocated. Note that you can still use the original form of the SET
LOWADR command for the default heap bank (without BDI specifications); it is also
part of the HVTIP-II environment. You must use the new SET LOWADR syntax,
however, for all additional heaps specified through the VALTAB settings if the default
is not changed.
For the remainder of this section the differences between the original UCS HVTIP and
the new HVTIP-II environments will be noted as appropriate. From an application
development perspective, all of the capabilities of the original UCS HVTIP environment
have been retained in the new HVTIP-II environment. The new capabilities are add-ons
once an HVTIP-II ZOOM is specified through the LINK Processor OUTPUT or PROCESS
FOR EXTENDED commands.
Table 6–1 shows the interfaces supported for these host languages.
• As of SB5R2, UCS FORTRAN has added a module SQL interface for the relational
database module, RDMS 2200.
• All host languages can access the conventional shared file model, SFS 2200.
• All host languages support access to PCIOS files.
• All host languages support access to FCSS files.
The method for specifying whether a transaction ZOOM is for an ICP or a subprogram
differs in each host language:
• UCS COBOL
The default is an ICP or main program. A subprogram is designated if the
PROCEDURE DIVISION statement includes a “USING ......” clause. If this clause is
not present and you want to create a subprogram, use the SUBPROGRAM
keyword option on the UCS COBOL compiler call.
• UCS FORTRAN
The default is an ICP or main program. To create a subprogram, code the
SUBROUTINE statement or the FUNCTION statement in the FORTRAN program.
• UCS C
Any program containing a function named “main” is an ICP. All other programs are
subprograms.
In preparation for SB6 enhancements, when you link each ZOOM, you should specify
one of the following statements:
• SET ICP = TRUE
• SET ICP = FALSE
Shared Storage
Shared storage is storage shared by the ICP and the subprograms it calls. In other
words, this storage is visible to all program units in the transaction sequence. For UCS
HVTIP, this shared storage must be defined as common blocks. There is only one
copy of this storage at execution time. In COBOL, C, and FORTRAN, common storage
is defined by using common blocks. Common blocks are created by using
• The COMMON-STORAGE SECTION or EXTERNAL clause in COBOL
• The COMMON statement in FORTRAN
• The #pragma common statement in C. Note that C storage is activity-level by
default. If you want program-level common blocks, you will also need to bracket
the declarations you want to be at program-level with #pragma shared begin
program and #pragma shared end program statements.
Note: When coding the common storage definition, you must have the identical
definition in the ICP and all subprograms that could be called by the transaction
sequence for that ICP.
The segments for an FLSS subsystem are also loaded into “heap” banks by the HVTIP
loader. You therefore can also share the common blocks in your HVTIP transaction
with any FLSS subsystems you may call if the following statement is used in the
SSDEF of the FLSS subsystem:
SHARE HEAP BANKS WITH OTHER SUBSYSTEMS INCLUDING HVTIP
Local Storage
Local storage is storage that is visible only to the ICP or subprogram ZOOM that
defines it. All data storage generated internally by the UCS compilers is local storage.
User variables may also be in local storage:
• In COBOL, this storage is defined in the WORKING-STORAGE SECTION, those 01
variables that do not have the EXTERNAL attribute.
• In FORTRAN, this is all variables that are not in common blocks.
• In C, this is all variables other than those placed into common blocks.
This method of sharing storage is available in all three host languages. In COBOL and
FORTRAN, the actual parameters are passed. In C, pointers to the actual parameters
must be passed to achieve the same effect.
When passing many parameters, it is a good idea to define the global data as a
structure and pass only one parameter (the structure) or, in the case of UCS C, pass
only one pointer to the structure.
The use of static and automatic storage is important in understanding the two types
of HVTIP calls. There are four possible locations for HVTIP data bank storage:
• The HVTIP heap data bank and the HVTIP-II heap data banks
• Hold static storage
• The activity-local stack (ALS)
• Hold automatic storage
Whether static or automatic storage is used depends on the UCS language in use:
• UCS COBOL
For UCS COBOL, all COMMON-STORAGE is static storage.
Whether WORKING-STORAGE is static or automatic depends on how the program
is coded. If the INITIAL clause appears on the PROGRAM-ID statement,
WORKING-STORAGE is allocated as automatic storage and initialized each time the
ICP or subprogram is called. If there is no INITIAL clause, WORKING-STORAGE is
placed in static storage. For more information on the COBOL INITIAL clause, refer
to “Using the COBOL INITIAL Clause.”
• UCS FORTRAN
For UCS FORTRAN, all COMMON blocks are in static storage.
Local variables (variables declared within a subprogram), can be either in static or
automatic storage. Local variables will be put into automatic storage if the
MIN-DBANK keyword option is supplied to the compilation. An exception is local
variables that have initial values (DATA statements initializing them). Local
variables with initial values are placed into static storage.
• UCS C
UCS C allows the program to specifically define storage as static or automatic.
File-level declarations are static storage. Any declaration with the static attribute
also are given static storage. Variables placed into COMMON storage with the
#pragma common statement are given static storage also. For more information
on how to do this, refer to the C Compiler Programming Reference Manual
Volume 1.
DPS 2200 supports transactions written in UCS COBOL, UCS FORTRAN, and UCS C.
The code used to call DPS 2200 is the same in UCS programming as it was in non-UCS
programming. The same DPS 2200 software and forms files can be used in both
environments simultaneously.
UCS DPS 2200 HVTIP transactions can use either COMPOOL or MCB message
buffering, depending on
• The VALTAB STATUS (STA) keyword setting
• The availability of the MCB software
• The designation of MCB message buffering in the CMS 1100 configuration
If all of the following are true, DPS 2200 uses MCB message buffering:
• STA, J is specified in the VALTAB entry.
• MCB software is available.
• MCB message buffering is designated in CMS 1100.
If no J is specified on the STA keyword, then DPS 2200 uses COMPOOL message
buffering.
For more information on DPS 2200 coding, refer to the DPS 2200 Run-Time
Programming Reference Manual.
UCS COBOL, FORTRAN, and C all support calls to MCB functions. MCB functions can
be directly called from all UCS HVTIP transactions.
UCS COBOL
CALL 'MCB$ENT' USING mcb-packet, mcb-status
[,msg-buffer [,multi-dest-list]].
UCS FORTRAN
CALL MCB$ENT(mcb_packet, mcb_status [,msg_buffer [,multi_dest_list]])
UCS C
mcb_ent(&mcb_packet.&mcb_status [,&msg_buffer [,&multi_dest_list]])
Notice that these calls to MCB differ from their non-UCS counterparts. They include
two additional optional parameters:
• msg-buffer/msg_buffer
Identifies the storage area into which messages are read, and from which
messages are sent by the transaction. For UCS COBOL, this parameter eliminates
the need for the ASCII COBOL CLOCTE call (which sets up this buffer’s address).
• Mult-dest-list/multi_dest_list
Provides a simple method for identifying a multiple-destination list of position
identifiers (PID). For UCS COBOL, this parameter eliminates the need for the ASCII
COBOL CLOCTE call (which sets up the buffer’s address).
To aid the UCS programmer in coding these, the MCB release tape includes precoded
sample UCS COBOL and UCS FORTRAN procedures for these buffers. The two
elements containing these procedures are found in the MCB installation file. They are
also found in the Unisys-supplied system procedure file SYS$LIB$*PROC$. They have
the following names:
For UCS C, the following #include statement provides the definitions for the MCB
information. This element is found in the C include file.
#include <mcb.h>
For more information on MCB coding, refer to the MCB Programming Reference
Manual.
Primitive coding has not changed in UCS, except for the function names for the UCS
COBOL version.
CCONET CONECT
CDISCN DISCON
CCMMIT COMMIT
CRLBAK ROLLBACK
CFCSS FCSS
CUOPND UOPAND
CUOPGT UOPGET
CUOPTR UOPTOR
CTMABS TIMABS
CTMDEL TIMDEL
CTMREL TIMREL
CTMUPA TIMUPA
CTMUPR TIMUPR
UCS COBOL still supports the previous name of each of these calls in transactions;
however, when you code new UCS transactions or upgrade existing transactions to
UCS, it is recommended that you use the new name.
New TIP primitive procedures for UCS COBOL and UCS FORTRAN that require no
special keyword options are available as of SB4. They are found in TIP$*TIPLIB$. The
new procedure names are USYSDF and UCMPDF.
For UCS C, the following #include statement provides the definitions for the TIP
primitives. This element is found in the C include file.
#include <tip.h>
The ICP and subprograms are kept in an HVTIP library. Each ICP and subprogram is
identified by
• An HVTIP library number
• The bank number within that HVTIP library
In HVTIP processing, the end user enters a transaction code at the terminal or work
station. (This transaction code is identified by a precoded entry known as a VALTAB
entry.) Entering the transaction code on a TIP screen causes the transaction to be
scheduled, which in turn causes the ICP to be loaded and execution to begin. The ICP
can call one or more subprograms. These subprograms in turn can call other
subprograms, and so on.
The following subsections discuss the coding and setting up required to define an
HVTIP transaction sequence.
The following example shows the VALTAB entry for the example initial control
program DPSICP:
900 NAM,DPSICP ACT,DPSHVT PRG,5 STF,0 STA,J QPR,1 OPT,TV
900 REC,Z AUD,3 PRT,PR
The following example shows the VALTAB entry for the example initial control
program MCBICP:
920 NAM,MCBICP ACT,MCBHVT PRG,5 STF,0 STA,J QPR,1 OPT,TV
920 REC,Z AUD,3 PRT,PR
NAM,xxxxxx
Identifies the program name.
ACT,xxxxxx
Identifies the transaction code.
PRG,5
Identifies the Program Type as HVTIP.
STF,0
Sets the Standard File number to denote the use of HVTIP libraries and the TPUR
utility.
STA,J
Denotes that MCB message buffering will be used if the Communication
Management System (CMS 1100) is configured for MCB message buffering and
the MCB software is available.
QPR,1
Specifies the location in the input queuing tree structure where input requests are
to be queued for this transaction program.
REC,Z
Denotes that this is a recoverable step.
AUD,3
Identifies the audit trail number (application group number).
PRT,PR
Identifies the transaction printer queue.
OPT,TV
Allows the TIPDIAG$ file to be created for diagnostics upon termination.
(TIPTRACE must also be set to ON in the FLAGBOX to receive a TIPDIAG$ file.)
Also allows MCB to use a reduced output path length (ROPL) for non-recoverable
output messages.
Note: The use of the IND,O VARTAB is no longer recommended. It indicates the
use of TIP memory by the transaction, but this is no longer meaningful on the
current hardware with paging memories. In addition, use of the IND,O option
causes the transaction to error-off if an ER MCORE$ is done to expand a bank, If a
transaction needs to expand a bank, it should be allowed to do it without the
transaction erroring off.
HVTIP-II VALTABs
HVTIP provides you with the following optional VALTAB options. The values given
should match those given in the OUTPUT HVTIP2 statement in the static link of the
ICP. These VALTABs basically supply additional D-banks to the transaction to expand
address space. If the VALTABs are not supplied and the transaction requires
additional space that cannot be satisfied by the primary HVTIP heap bank (BDI 5), then
run-time CREATE_BANK calls are done by URTS to acquire the needed space. The
CREATE_BANK calls cause the transaction to lose TIP “sticking” and RESTART, causing
degraded performance. The extra D-banks provide space for loading HVTIP programs,
for UC malloc space, and for loading data for Fast Load Self Contained subsystems
(FLSS).
DSP[RGCNT], <number>
Indicates how many program level small banks (beyond the main heap) are
needed. The default is zero.
DLP[RGNT],<number>
Indicates how many program level large banks are needed. The default is zero.
DPS[IZL],<number>
Indicates how many BDIs each program level large bank should span. Each BDI
indicates 262K words of storage. Large banks start at offset zero, and are an
integral number of 262K blocks (BDIs). The default is 2.
DSA[CTCNT],<number>
Indicates how many activity level small banks are needed. The default is zero.
DLA[CTCNT],<number>
Indicates how many activity level large banks are needed. The default is zero.
DAS[IZL],<number>
Indicates how many BDIs each activity level large bank should span. The default is
2.
DSL[OWER],<number>
Indicates the lower limit of each additional small bank (excluding the primary heap
bank) for both program and activity level banks. The default is zero.
DSU[PPER],<number>
Indicates the upper limit of each additional small bank (excluding the primary heap
bank) for both program and activity level banks. The default (and maximum) value
is 0777777.
Use of the DSL and DSU VALTABs is recommended so that the resulting small
heap banks do not cause address overlap problems when calling basic mode
programs. Typical lower-limit and upper-limit values for programs using UDS are
0130000 and 0577777.
USING
4 SMALL_BANKS,
2 POOLED_SMALL_BANKS,
2 LARGE_BANKS,
1 POOLED_LARGE_BANKS,
LARGE_BANK_SIZE = 2
FOR PROGRAM_LEVEL_HEAP
USING
4 SMALL_BANKS,
3 POOLED_SMALL-BANKS,
1 LARGE BANKS,
1 POOLED_LARGE_BANKS
LARGE_BANK_SIZE = 3
FOR ACTIVITY_LEVEL_HEAP
For detailed information on how to set up and handle HVTIP libraries, refer to the
Transaction Processing Administration and Operations Reference Manual.
The following figure shows the HVTIP library and bank numbers for the DPS 2200
example transaction. HVTIP library 22 is used. DPSICP is in bank 1, DPSSUBX in bank
2, and DPSSUBY in bank 3.
The following figure shows the HVTIP library and bank numbers for the MCB example
transaction. HVTIP library 22 is used. MCBICP is in bank 6, MCBSUBX in bank 7, and
MCBSUBY in bank 8.
HVCALLS elements are created by coding a small MASM element that uses the
PROCs that are defined in SYS$LIB$*LINK.HVTIP$CALLS. (SYS$LIB$*LINK is one of
the installation files for the Linking System.) The MASM procedures (procs) used to
generate the required definitions are found in the HVTIP$CALLS element. Instructions
for using the HV$CALL, HV$XFR, HV$XFRCANCL, and HV$VECTOR PROCs are also in
the HVTIP$CALLS element. Note that in ClearPath OS 2200 Release 7.0, the HVTIP
library number limit was expanded from 63 (077) to 2047 (03777), and the bank number
limit was expanded from 4095 (07777) to 16383 (037777).
After you create the HVCALLS MASM object module containing the definitions, you
statically link it with the calling HVTIP ICP or subprogram ZOOM.
Note: An HVTIP or HVTIP-II ZOOM should not contain an entry point definition
with the same name as an HVCALLS definition. If this happens, the first one
included during static linking is used, and a duplicate definition message occurs.
You can combine these two types of high-level language calls in any feasible order to
meet the needs of the user application. The subsections that follow define each type
of call and show an example of its use.
The following figure illustrates the calls made in the DPS 2200 example. DPSICP calls
DPSSUBX, using the transfer-with-cancel interface (HV$XFR$CANCL). In turn,
DPSSUBX calls DPSSUBY, using the call interface (HV$CALL).
The following figure illustrates the calls made in the MCB example. MCBICP calls
MCBSUBX by using the transfer-with-cancel interface (HV$XFR$CANCL). In turn,
MCBSUBX calls MCBSUBY by using the call interface (HV$CALL).
DPS 2200 and MCB use the same method for defining these types of calls. Therefore,
only the DPS 2200 example is shown in the subsections that follow.
The call interface has no effect on the calling program’s automatic storage or static
storage. (For information on types of HVTIP storage, refer to “Defining Storage in
HVTIP Transactions.”) Both types of storage are kept intact. Return information is
kept so a return can be made to the calling program. Therefore, in our example, the
static storage and automatic storage for DPSSUBX remain intact when the call to
DPSSUBY takes place. Return information for DPSSUBX is saved.
Explanation
1. These statements obtain the MASM procs that are required to generate the
needed definitions. These procs are located on the Linking System release tape in
the element SYS$LIB$*LINK.HVTIP$CALLS.
2. The output of the assembly is placed into the object module
HVCALLSDEF/DPSSUBY. This is the HVCALLS element. Thus the reference in
subprogram DPSSUBX to subprogram DPSSUBY is resolved by the definition in
HVCALLSDEF/DPSSUBY.
3. This statement generates a code definition for DPSSUBY which, when called,
invokes the Executive system HVTIP call interface (HV$CALL$SUB) to make a call
to the HVTIP subprogram in HVTIP library number 22, bank number 3, at offset 0.
Format 1
Format 2
where
ll
is the HVTIP library number.
bbbb
is the bank number within the designated HVTIP library.
offset
instructs Exec where to begin execution in the subprogram. If this value is zero,
the default starting address of the subprogram ZOOM is used.
’subprogram-name’
is the name of the subprogram being called using Format 1. The subprogram
name can contain any character allowed by the UCS language being used. The
HVCALLS MASM source code requires an $ASCII directive if lowercase characters
are used in the subprogram name. The following is an example.
$OBJ
$ASCII
$INCLUDE 'OM$DEF'
$INCLUDE 'HVTIP$CALLS'
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL'
HV$CALL 22,3,0 'DPSSUBY'
$END
subprogram-name
is the name of the subprogram being called using Format 2. Only uppercase
characters and numbers are allowed for subprogram names specified in this field.
If the subprogram name contains other ASCII characters supported by the UCS
languages, Format 1 must be used.
When the COBOL statement “CALL ’DPSSUBY’.” is encountered, the definition created
by the HV$CALL statement is used to determine the HVTIP library and bank number to
be loaded.
If you program in FORTRAN, use a subroutine call in place of the COBOL subprogram
call. If you program in C, use a function call in place of the COBOL subprogram call.
The HVCALLS MASM source code can contain a mixture of HV$CALL and
HV$XFR$CANCL statements. However, the entry point name of the ZOOM being
linked should not appear in any of the HV$CALL or HV$XFR$CANCL statements in the
HVCALLS MASM element for that ZOOM or the static linker will produce duplicate
definition warnings and the program may not execute correctly.
To put the entry point name of the ZOOM being linked into the HVCALLS MASM
source code, add a DELETE DEFINITIONS (zoom-entry-point-name) BEFORE
RESOLUTION statement to the static link. For more information, see 6.1.4. The
following is an example of the static link format:
@USE LINK$PF...
@LINK...
OUTPUT HVTIP
INCLUDE HVCALLS ELEMENT
DELETE DEFINITIONS (ZOOM-ENTRY-POINT-NAME) BEFORE RESOLUTION
INCLUDE COMPILER-OM
RESOLVE....
DELETE ALL DEFINITIONS EXCEPT...
@EOF
Initial control program DPSICP calls subprogram DPSSUBX using the MASM proc
HV$XFR$CANCL. Using this proc eliminates all possibilities of returning to the caller.
A transfer-with-cancel releases all automatic storage (ALS storage) and all static
storage (HVTIP heap data bank) belonging to all previously called subprograms.
Common storage is not released. The ICP static storage is also not released, since it
contains the UCS Runtime System internal data. (For information on types of HVTIP
storage, refer to “Defining Storage in HVTIP Transactions.”)
Explanation
1. These statements obtain the MASM procs that are required to generate the
needed definitions. These procs are located on the Linking System release tape in
the element SYS$LIB$*LINK.HVTIP$CALLS.
2. The output of the assembly is placed into the object module
HVCALLSDEF/DPSSUBX. This is the HVCALLS element. Thus, initial control
program DPSICP’s reference to subprogram DPSSUBX is resolved by the definition
in HVCALLSDEF/DPSSUBX.
3. This statement generates a code definition for DPSSUBX which, when called,
invokes the Executive system HVTIP transfer-with-cancel interface
(HV$XFR$CANCL) to transfer to the HVTIP subprogram in HVTIP library number 22,
bank number 2, at offset 0.
Format 1
HV$XFR$CANCL ll,bbbb,offset 'subprogram-name'
Format 2
subprogram-name HV$XFR$CANCL ll,bbbb,offset
where
ll
is the HVTIP library number.
bbbb
is the bank number within the designated HVTIP library.
offset
instructs Exec where to begin execution in the subprogram. If this value is zero,
the default starting address of the subprogram ZOOM is used.
’subprogram-name’
is the name of the subprogram being called using Format 1. The subprogram
name can contain any character allowed by the UCS language being used. The
HVCALLS MASM source code requires an $ASCII directive if lowercase characters
are used in the subprogram name. The following is an example.
$OBJ
$ASCII
$INCLUDE 'OM$DEF'
$INCLUDE 'HVTIP$CALLS'
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL'
HV$XFR$CANCL 22,2,0 'DPSSUBX'
$END
subprogram-name
is the name of the subprogram being called using Format 2. Only uppercase
characters and numbers are allowed for subprogram names specified in this field.
If the subprogram name contains other ASCII characters supported by the UCS
languages, Format 1 must be used.
When the COBOL statement “CALL ’DPSSUBX’.” is encountered, the definition created
by the HV$XFR$CANCL statement is used to determine the HVTIP library and bank
number to be loaded.
If you program in FORTRAN, use a subroutine call in place of the COBOL subprogram
call. If you program in C, use a function call in place of the COBOL subprogram call.
The HVCALLS MASM source code can contain a mixture of HV$CALL and
HV$XFR$CANCL statements. However, the entry point name of the ZOOM being
linked should not appear in any of the HV$CALL or HV$XFR$CANCL statements in the
HVCALLS MASM element for that ZOOM.
To put the entry point name of the ZOOM being linked into the HVCALLS MASM
source code, add a DELETE DEFINITIONS (ZOOM-ENTRY-POINT-NAME) BEFORE
RESOLUTION statement to the static link. For more information, see 6.1.4. The
following is an example of the static link format:
@USE LINK$PF...
@LINK...
OUTPUT HVTIP
INCLUDE HVCALLS ELEMENT
DELETE DEFINITIONS (ZOOM-ENTRY-POINT-NAME) BEFORE RESOLUTION
INCLUDE COMPILER-OM
RESOLVE....
DELETE ALL DEFINITIONS EXCEPT...
@EOF
Optionally, you can use the HVTIP transfer-with-cancel interface to free all common
blocks in the transaction sequence except those introduced by the initial control
program. In other words, all common blocks introduced by previously called
subprograms are released in addition to the normal transfer-with-cancel function. This
is accomplished by adding a parameter to the CALL statement for the transfer-with-
cancel interface. During execution, when a transfer-with-cancel function is
encountered with a nonzero parameter count, all subprogram data including common
blocks will be freed before control is transferred.
The COBOL INITIAL clause has two functions in the HVTIP environment:
1. It automatically initializes all data defined with the VALUE clause, every time the
ICP or subprogram containing the INITIAL clause is called.
The INITIAL clause (refer to the previous subsection) could be used on the PROGRAM-
ID statement of the subprogram to be canceled. This would make most of the
subprogram’s local storage automatic storage, and thus place it on the activity-local
stack. In this case, the effect of using the CANCEL statement is not as great.
However, the subprogram would still have some local static storage that could be
released by a CANCEL statement.
By using the INITIAL clause, there is still some local static storage that can be released
by using the CANCEL statement. The amount left to be released can be determined
by looking at the SIZES line displayed just prior to the END UCOB signoff line at the
end of a compilation listing. The number associated with DATA on the SIZES line is the
amount of local storage that will be affected by using the CANCEL statement.
If you use a CANCEL statement, you should use one of the following methods:
• Use a special format of the HV$CALL statement (HV$CALL,1) for the subprogram
being canceled. By using the HV$CALL,1 format in the HVCALLS MASM source
code, two entry point definitions will be generated for the subprogram instead of
one. The first is the standard entry point that is always generated. The second is
the CANCEL entry point having a CN$$ prefix. The example shows HVCALLS
MASM source code using this method of generating the CANCEL entry point:
$OBJ
$ASCII
$INCLUDE 'OM$DEF'
$INCLUDE 'HVTIP$CALLS'
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL'
HV$CALL,1 22,9,0 'SUBE'
$END
• Use a static linking CHANGE REFERENCE command for each entry point name that
is canceled. See “COBOL ICPs Performing CANCEL Statements,” and “COBOL
Subprograms Performing CANCEL Statements,” that follow for more information.
The following figure illustrates compilation of a UCS COBOL, C, or FORTRAN ICP using
DPS 2200 functions. (Notice that the output of the ICP compilation is an object module
element called xxxICP/COMP.)
The following figure illustrates compilation of a UCS COBOL, C, or FORTRAN ICP using
MCB functions. (Notice that the output of the ICP compilation is an object module
element called xxxICP/COMP.)
requirements are satisfied, you should relink the ICP and its subprograms for
performance.
All HVTIP transactions must be statically linked HVTIP ZOOMs. You statically link the
ICP and each subprogram separately, creating separate HVTIP ZOOMs. The following
subsections show how.
Explanation
1. This statement ensures that the ICP is statically linked using the system software
located in the desired application group. (It ensures that the library search chain
for the correct application group is used.)
Replace n in “SYS$LIB$*APP$n” with the desired application group number. As an
example, use the following statement for application group number 7
:@USE LINK$PF.,SYS$LIB$*APP$7
This statement thus identifies the desired MCB interface software and the UDS
interface software; therefore, you do not need to use static linking INCLUDE
commands specifying the specific MCB and UDS product files. The desired files
are indicated by the library search chain. If the program uses embedded or
module SQL, this file must be for the same application group that the program
was compiled for.
For a complete discussion of how these library search chains are created and
used, see Section 4.
2. This statement calls the Linking System LINK Processor. The output HVTIP ZOOM
to be created is named QUAL*FILE.ICP.
3. This command specifies that the object module produced by static linking is an
HVTIP ZOOM. Bank merging occurs by default when you specify OUTPUT HVTIP
or OUTPUT HVTIP2.
It is recommended that the OUTPUT command be the first command in an HVTIP
static link. The OUTPUT command should be followed by the INCLUDE commands
and then the RESOLVE command, as in this example.
Note that this command must precede any SET command (for example, SET
LOWADR) for the bank HVTIP$$DBANK. (Such statements are used in
performance linking.)
4. This command supplies the compiler-generated object module for the ICP as input
to static linking.
5. This command supplies the HVCALLS MASM object module that defines the calls
for subprograms that may be called by this ICP. If this ICP never calls a
subprogram located in another HVTIP bank, you can omit this command.
6. This command supplies the appropriate interface object modules for ICPs that use
DPS 2200. (The SYS$LIB$*APP$n application group library search chains supplied
by Unisys do not supply DPS 2200 interface information.)
A site may update the application group library search chains supplied by Unisys
so that they include the DPS 2200 interface information for that application group.
Then this INCLUDE command is not necessary (see 4.5).
7. This command resolves external references, including those to the UCS Runtime
System library.
SYS$LIB$*EMOMRTS is required only if both of the following are true:
• PADS is installed on the system.
• A library search chain that includes a search of the PADS library is being used.
PADS cannot be included in an extended mode HVTIP static link because PADS
currently has basic mode banks; the bank merging that takes place during static
linking is unable to merge basic mode and extended mode banks.
SYS$LIB$*EMOMRTS specifically prevents PADS from being included in the static
link. The object module C$NPADS is used to resolve the PADS references instead.
If PADS is not installed or a library search chain is being used that does not specify
a search of the PADS library, use the following RESOLVE command instead:
RESOLVE ALL REFERENCES USING LIBCODENAME
8. This command deletes all entry point definitions except the starting address of the
ICP.
9. This command results in more efficient program loads since data areas with no
initial values do not have to be cleared to zero. This command only affects the
loads of OUTPUT HVTIP2 ZOOMs. Setting the ZEROFILL status for banks has no
effect on OUTPUT HVTIP ZOOMs, since uninitialized data areas are always cleared
on OUTPUT HVTIP ZOOMs. If you want uninitialized data areas to be cleared to
zeros when they are loaded, use the following statement:
(9) SET ZEROFILL = LOAD FOR ALL COMMON BLOCK BANKS
This CHANGE REFERENCE command should follow the INCLUDE command that
supplies the object module that contains the CANCEL statement.
In this case, you must include the following commands in the static link of the ICP:
INCLUDE QUAL*FILE.ICP/COMP
CHANGE REFERENCE ('CN$$SUBD') TO SUBD
@LINK ,QUAL*UCSTST.MCBICP
OUTPUT HVTIP . (or OUTPUT HVTIP2 ...)
INCLUDE QUAL*UCSTST.MCBICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/MCBSUBX
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
DELETE ALL DEFINITIONS EXCEPT START$
SET ZEROFILL = NONE FOR ALL BANKS
@EOF
Explanation
1. This statement ensures that the subprogram is statically linked using the system
software located in the desired application group. (It ensures that the library
search chain for the correct application group is used.)
Replace n in “SYS$LIB$*APP$n” with the desired application group number. As an
example, use the following statement for application group number 7:
@USE LINK$PF,SYS$LIB$*APP$7
This statement thus identifies the desired MCB interface software and the UDS
interface software; therefore, you do not need to use static linking INCLUDE
commands specifying the specific MCB and UDS product files. The desired files
are indicated by the library search chain. If the program uses embedded or
module SQL, this file must be for the same application group that the program
was compiled for.
For a complete discussion of how these library search chains are created and
used, see Section 4.
2. This statement calls the Linking System LINK Processor. The output HVTIP ZOOM
to be created is named QUAL*FILE.SUB.
3. This command specifies that the object module produced by static linking is an
HVTIP ZOOM. Bank merging occurs by default when you specify OUTPUT HVTIP.
It is recommended that the OUTPUT command be the first command in an HVTIP
static link. The OUTPUT command should be followed by the INCLUDE commands
and then the RESOLVE command, as in this example.
Note that this command must precede any SET command (for example, SET
LOWADR) for the bank HVTIP$$DBANK. (Such statements are used in
performance linking.)
4. This command supplies the compiler-generated object module for the
subprogram as input to static linking.
5. This command supplies the HVCALLS MASM object module that defines the calls
for subprograms that may be called by this subprogram. If this subprogram never
calls a subprogram located in another HVTIP bank, you can omit this command.
6. This command supplies the appropriate interface object modules for subprograms
that use DPS 2200. (The SYS$LIB$*APP$n application group library search chains
supplied by Unisys do not supply DPS 2200 interface information.)
A site may update the library search chains supplied by Unisys for application
groups so that they include the DPS 2200 interface information for that application
group. Then this INCLUDE command is not necessary (see 4.5).
7. This command resolves external references, including those to the UCS Runtime
System library.
SYS$LIB$*EMOMRTS is required only if both of the following are true:
• PADS is installed on the system.
• A library search chain that includes a search of the PADS library is being used.
PADS cannot be included in an extended mode HVTIP static link because PADS
currently has some basic mode banks; the bank merging that takes place during
static linking is unable to merge basic mode and extended mode banks.
SYS$LIB$*EMOMRTS specifically prevents PADS from being included in the static
link. The object module C$NPADS is used to resolve the PADS references instead.
If PADS is not installed or a library search chain is being used that does not specify
a search of the PADS library, use the following RESOLVE command instead:
RESOLVE ALL REFERENCES USING LIBCODENAME
8. This command deletes all entry point definitions except the one used to call this
subprogram. Replace sub with the actual entry point name.
The Linking System requires that this external reference to the subprogram be
kept. Scheduling of the subprogram uses the HVTIP library number, bank number,
and offset; not this external reference.
9. This command results in more efficient program loads since data areas with no
initial values do not have to be cleared to zero. This command only affects the
loads of OUTPUT HVTIP2 ZOOMs. Setting the ZEROFILL status for banks has no
effect on OUTPUT HVTIP ZOOMs, since unitialized data areas are always cleared
on OUTPUT HVTIP ZOOMs. If you want uninitialized areas to be cleared to zeros
when they are loaded, use the following statement:
(9) SET ZEROFILL = LOAD FOR ALL COMMON_BLOCK BANKS
In this case, you must include the following commands in the static link of the
subprogram SUBD:
INCLUDE QUAL*FILE.SUB/COMP
CHANGE REFERENCE ('CN$$SUBE') TO SUBE
@LINK ,QUAL*UCSTST.MCBSUBX
OUTPUT HVTIP . (or OUTPUT HVTIP2 ...)
INCLUDE QUAL*UCSTST.MCBSUBX/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/MCBSUBY
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS,LIBCODENAME
DELETE ALL DEFINITIONS EXCEPT MCBSUBX
@EOF
HVTIP Library 22
Transfer
with
Cancel
Terminal
Point of
No Return
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF AN INITIAL CONTROL PROGRAM "DPSICP" THAT PERFORMS A *
* TRANSFER WITH CANCEL TO A SUBPROGRAM "DPSSUBX". *
* *
******************************************************************
******************************************************************
PROGRAM-ID. DPSICP INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
COPY DPSSTATUSCOB.
COPY INFO-BUFFER.
PROCEDURE DIVISION.
******************************************************
. HVCALLS DEFINITION
. DPSSUBX is defined as a TRANSFER WITH CANCEL
.
$OBJ .
$INCLUDE 'OM$DEF' .
$INCLUDE 'HVTIP$CALLS' .
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL' .
HV$XFR$CANCL 22,2,0 'DPSSUBX'
$END
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "DPSSUBX" THAT WAS CALLED FROM THE ICP *
* "DPSICP" USING TRANSFER WITH CANCEL AND IN TURN CALLS A *
* SUBPROGRAM "DPSSUBY". *
* *
******************************************************************
******************************************************************
PROGRAM-ID. DPSSUBX INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
COPY DPSSTATUSCOB.
PROCEDURE DIVISION.
******************************************************
*** DPSSUBX START UP ***
******************************************************
START-UP-SUBX.
DISPLAY ' THIS IS DPSSUBX' UPON PRINTER.
******************************************************
*** CALL TO DPSSUBY ***
******************************************************
CALL-SUBY.
DISPLAY ' DPSSUBX CALLING DPSSUBY' UPON PRINTER.
CALL 'DPSSUBY'.
******************************************************
*** RETURN TO DPSSUBX ***
******************************************************
RETURN-FROM-DPSSUBY.
DISPLAY ' RETURNED TO DPSSUBX ' UPON PRINTER.
******************************************************
*** TRANSACTION TERMINATION ***
******************************************************
END-TRANSACTION.
DISPLAY ' TERMINATING FROM DPSSUBX' UPON PRINTER.
CALL 'D$TERM' USING DPS-STATUS.
IF STATUS-FATAL GO TO ERROR-EXIT.
STOP RUN.
******************************************************
* THIS IS THE FATAL ERROR PARAGRAPH. ALL *
* FATAL DPS ERRORS IN THIS PROGRAM WILL *
* CAUSE AN UNCONDITIONAL JUMP HERE: *
******************************************************
ERROR-EXIT.
DISPLAY ' DPSSUBX ERROR EXIT' UPON PRINTER.
CALL 'D$DUMP'.
CALL 'D$ERRMSG' USING DPS-STATUS.
CALL 'D$TERM' USING DPS-STATUS.
STOP RUN.
. HVCALLS DEFINITION
. DPSSUBY is defined as a CALL
.
$OBJ .
$INCLUDE 'OM$DEF' .
$INCLUDE 'HVTIP$CALLS' .
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL' .
HV$CALL 22,3,0 'DPSSUBY '
$END
Example 6–8. Source Listing of the HVCALLS Element for First Subprogram
(QUAL*UCSTST.HVCALLSDEF/DPSSUBY)
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "DPSSUBY" THAT WAS CALLED FROM THE *
* SUBPROGRAM "DPSSUBX" WITH A CALL AND IN TURN IT RETURNS TO *
* SUBPROGRAM "DPSSUBX". *
* *
******************************************************************
******************************************************************
PROGRAM-ID. DPSSUBY INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
******************************************************
*** DPSSUBY START UP ***
******************************************************
START-UP-SUBY.
DISPLAY ' THIS IS DPSSUBY' UPON PRINTER.
******************************************************
*** RETURN TO DPSSUBX ***
******************************************************
RETURN-SUBX.
DISPLAY ' DPSSUBY RETURNING TO DPSSUBX'
UPON PRINTER.
EXIT PROGRAM.
@ . ***
@ . *** *** START OF THE EXAMPLE SETUP SECTION *************************
@ . ***
@ . ***
@ . *** COBOL COMPILE OF THE ICP AND SUBPROGRAMS;
@ . *** MASM ASSEMBLY OF THE HVCALLS ROUTINES.
@ . ***
@ . *** THE USER-WRITTEN MASM ROUTINES "HVCALLS" DIRECTS EACH
@ . *** CALL TO A SUBPROGRAM TO THE CORRECT HVTIP LIBRARY NUMBER
@ . *** AND BANK NUMBER.
@ . ***
@USE MASM$PF1.,SYS$LIB$*LINK.
@ASG,A MASM$PF1.
@ . ***
@ . ***
@ . *** * ICP DPSICP ******
@ . *** COMPILE THE ICP "DPSICP" AND ASSEMBLE ITS HVCALLS
@ . *** TRANSFER WITH CANCEL ELEMENT "HVCALLSDEF/DPSSUBX
@ . ***
@USE COB$PF,APP3*DPS.
@UCOB QUAL*UCSTST.DPSICP,.DPSICP/COMP,,,NO-OPTIONS
@MASM,N QUAL*UCSTST.HVCALLSDEF/DPSSUBX,.HVCALLSDEF/DPSSUBX
@EOF
@ . ***
@ . ***
@ . *** * SUBPROGRAM DPSSUBX ******
@ . *** COMPILE THE FIRST SUBPROGRAM "DPSSUBX" AND ASSEMBLE ITS
@ . *** HVCALLS CALL ELEMENT "HVCALLSDEF/DPSSUBY"
@ . ***
@UCOB QUAL*UCSTST.DPSSUBX,.DPSSUBX/COMP,,,NO-OPTIONS,SUBPROGRAM
@MASM,N QUAL*UCSTST.HVCALLSDEF/DPSSUBY,.HVCALLSDEF/DPSSUBY
@EOF
@ . ***
@ . ***
@ . *** * SUBPROGRAM DPSSUBY ******
@ . *** COMPILE THE SECOND SUBPROGRAM "DPSSUBY"
@ . ***
@ . *** THIS SUBPROGRAM CONTAINS NO DPS COMMANDS.
@ . ***
@UCOB QUAL*UCSTST.DPSSUBY,.DPSSUBY/COMP,,, NO-OPTIONS,SUBPROGRAM
Example 6–10. Runstream to Set Up, Compile, and Link—COBOL DPS HVTIP
Transaction Sequence
@ . ***
@ . ***
@ . *** THE ICP AND SUBPROGRAMS ARE LINKED SEPARATELY CREATING
@ . *** HVTIP ZOOMS.
@ . ***
@ . *** SINCE DPS IS BEING USED IN THIS EXAMPLE THE FOLLOWING
@ . *** STATEMENT MUST BE ADDED TO THE STATIC LINK OF EACH
@ . *** TRANSACTION THAT USES DPS. THE FILENAME IS DEPENDENT ON
@ . *** THE INSTALLATION OF DPS. THE FILENAME 'APP3*DPS' IS USED
@ . *** IN THIS EXAMPLE.
@ . ***
@ . *** INCLUDE APP3*DPS.UCS/INTERFACE, APP3*DPS.EMCBEP$$DPS
@ . ***
@ . ***
@ . *** *** DPSICP LINK ********
@ . *** LINK THE ICP "DPSICP" INCLUDING THE HVCALLS ELEMENT
@ . *** "HVCALLSDEF/DPSSUBX"
@ . ***
@LINK ,QUAL*UCSTST.DPSICP
OUTPUT HVTIP2
INCLUDE QUAL*UCSTST.DPSICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/DPSSUBX
INCLUDE APP3*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS, LIBCODENAME
DELETE ALL DEFINITIONS EXCEPT START$
SET ZEROFILL = NONE FOR ALL BANKS
@EOF
@ . ***
@ . ***
@ . *** *** DPSSUBX LINK ********
@ . *** LINK THE SUBPROGRAM "DPSSUBX" INCLUDING THE HVCALLS ELEMENT
@ . *** "HVCALLSDEF/DPSSUBY"
@ . ***
@LINK ,QUAL*UCSTST.DPSSUBX
OUTPUT HVTIP2
INCLUDE QUAL*UCSTST.DPSSUBX/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/DPSSUBY
INCLUDE APP3*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS, LIBCODENAME
DELETE ALL DEFINITIONS EXCEPT DPSSUBX
SET ZEROFILL = NONE FOR ALL BANKS
@EOF
@ . ***
@ . ***
@ . *** *** DPSSUBY LINK ********
@ . *** LINK THE SUBPROGRAM "DPSSUBY"
@ . ***
Example 6–10. Runstream to Set Up, Compile, and Link—COBOL DPS HVTIP
Transaction Sequence
@ . ***
@ . ***
@ . *** HVTIP LIBRARY INFORMATION
@ . ***
@ . *** THE TIP FILE NUMBERS THAT CAN BE USED AS HVTIP LIBRARIES
@ . *** ARE DEFINED BY THE EXEC GENERATION.
@ . ***
@ . *** TPLIB nn - DEFINES THE STARTING TIP FILE NUMBER FOR
@ . *** HVTIP LIBRARIES
@ . *** HVTIP nn - DEFINES THE NUMBER OF HVTIP LIBRARIES FOR
@ . *** THIS SYSTEM
@ . ***
@ . *** HVTIP-LIBRARY-TIP-file-number - TPLIB = HVTIP-LIBRARY-number
@ . ***
@ . *** FOR EXAMPLE: TPLIB = 70
@ . *** HVTIP = 64
@ . *** HVTIP-LIBRARY-TIP-file-number = 92
@ . *** THEREFORE:
@ . *** 92 - 70 = 22 (HVTIP-LIBRARY-number)
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE HVTIP LIBRARY TIP FILE THIS TEST USES FOR
@ . *** THE TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*HVTIPLIB22.,FIX
RES 92,64000,28,,HVTIPLIB22,,,WW=P,AUDIT=0,NREC
LFD 92
@EOF
@ . ***
@ . *** * HVTIP LIBRARY LOAD ******
@ . ***
@ . *** USE THE TPUR UTILITY TO COPY TRANSACTION PROGRAMS INTO
@ . *** THE HVTIP LIBRARY.
@ . ***
@ . *** BRING AN HVTIP LIBRARY THAT IS INITIALIZED AND CONTAINS
@ . *** AT LEAST ONE PROGRAM BANK ONLINE SO TRANSACTIONS CAN BE
@ . *** EXECUTED FROM THIS HVTIP LIBRARY.
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON RECOVERY
OFF SCHEDULE
@ . ***
@ASG,A QUAL*UCSTST.
@ . ***
@XQT,MUX TIP$*TIPRUN$.TPUR
CREATE,K 22,30
COPY,IVK 22,1,QUAL*UCSTST.DPSICP
COPY,IK 22,2,QUAL*UCSTST.DPSSUBX
COPY,IK 22,3,QUAL*UCSTST.DPSSUBY
LIST 22
LOAD,K 22
STATUS,K 22
@EOF
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF RECOVERY
ON SCHEDULE
@ . ***
@ . ***
@ . EXAMPLE SETUP IS COMPLETE
@ . ***
@ . *** *** START OF THE EXAMPLE SETUP SECTION *************************
@ . ***
@ . ***
@ . *** COBOL COMPILE OF THE ICP AND SUBPROGRAMS;
@ . *** MASM ASSEMBLY OF THE HVCALLS ROUTINES.
@ . ***
@ . *** THE USER-WRITTEN MASM ROUTINES "HVCALLS" DIRECTS EACH
@ . *** CALL TO A SUBPROGRAM TO THE CORRECT HVTIP LIBRARY NUMBER
@ . *** AND BANK NUMBER.
@ . ***
@USE MASM$PF1.,SYS$LIB$*LINK.
I:002333 USE complete.
@ASG,A MASM$PF1.
I:002333 ASG complete.
@ . ***
@ . ***
@ . *** * ICP DPSICP ******
@ . *** COMPILE THE ICP "DPSICP" AND ASSEMBLE ITS HVCALLS
@ . *** TRANSFER WITH CANCEL ELEMENT "HVCALLSDEF/DPSSUBX
@ . ***
@USE COB$PF,APP3*DPS
I:002333 USE complete.
@UCOB QUAL*UCSTST.DPSICP,.DPSICP/COMP,,,NO-OPTIONS
UCOB- 8R1 (970210) LSS-10R1 (970209) 970223 12:30:04
SIZES: CODE(EM6): 229 DATA: 232 COMMON: 3
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@MASM,N QUAL*UCSTST.HVCALLSDEF/DPSSUBX,.HVCALLSDEF/DPSSUBX
MASM 6R2A (960423 0008:22) 1997 Feb 23 Sun 1230:08
END MASM - LINES: 134 TIME: 5.438 STORAGE: 29345/7895
@ . ***
@ . ***
@ . *** * SUBPROGRAM DPSSUBX ******
@ . *** COMPILE THE FIRST SUBPROGRAM "DPSSUBX" AND ASSEMBLE ITS
@ . *** HVCALLS CALL ELEMENT "HVCALLSDEF/DPSSUBY"
@ . ***
@UCOB QUAL*UCSTST.DPSSUBX,.DPSSUBX/COMP,,,NO-OPTIONS,SUBPROGRAM
UCOB- 8R1 (970210) LSS-10R1 (970209) 970223 12:30:10
SIZES: CODE(EM6): 140 DATA: 203 COMMON: 3
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970223 1230:32
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
TPINIT 45R2#0000001 970223 1230:32
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970223 1230:32
ON BTLOADING
ON STICKING
@ . ***
@ . *** ** HVTIP LIBRARY SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** HVTIP LIBRARY TIP FILE.
@ . ***
@CAT,P QUAL*HVTIPLIB22.,F/1000//1000
I:002333 CAT complete.
@ . ***
@ . ***
@ . *** HVTIP LIBRARY INFORMATION
@ . ***
@ . *** THE TIP FILE NUMBERS THAT CAN BE USED AS HVTIP LIBRARIES
@ . *** ARE DEFINED BY THE EXEC GENERATION.
@ . ***
@ . *** TPLIB NN - DEFINES THE STARTING TIP FILE NUMBER FOR
@ . *** HVTIP LIBRARIES
@ . *** HVTIP NN - DEFINES THE NUMBER OF HVTIP LIBRARIES FOR
@ . *** THIS SYSTEM
@ . ***
TIP FILE 92
DIR-ACCESS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 64000 SIZE: 28 APPLICATION GROUP: 0
FILE NAME HVTIPLIB22
PLACEMENT 0
LEG STATUS AVL-UP
END FREIPS
@ . ***
@ . *** * HVTIP LIBRARY LOAD ******
@ . ***
@ . *** USE THE TPUR UTILITY TO COPY TRANSACTION PROGRAMS INTO
@ . *** THE HVTIP LIBRARY.
@ . ***
@ . *** BRING AN HVTIP LIBRARY THAT IS INITIALIZED AND CONTAINS
@ . *** AT LEAST ONE PROGRAM BANK ONLINE SO TRANSACTIONS CAN BE
@ . *** EXECUTED FROM THIS HVTIP LIBRARY.
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970223 1230:35
ON RECOVERY
OFF SCHEDULE
@ . ***
@ASG,A QUAL*UCSTST.
I:002333 ASG complete.
@ . ***
@XQT,MUX TIP$*TIPRUN$.TPUR
TPUR 45R2#0000001 970223 1230:36
CREATE,K 22,30
LIBRARY NUMBER: 22 NUMBER OF BANKS ALLOWED: 30
NEXT AVAILABLE RECORD: 7 LIBRARY CYCLE: MAIN
COPY,IVK 22,1,QUAL*UCSTST.DPSICP
COPY,IK 22,2,QUAL*UCSTST.DPSSUBX
COPY,IK 22,3,QUAL*UCSTST.DPSSUBY
LIST 22
STATUS,K 22
ONLINE LIBRARY STATUS
LIBRARY NUMBER: 22 NUMBER OF BANKS ALLOWED: 30
BANK RTN LOAD STATUS BANK BANK TIP MEM LOWER START RECORD
NUMB COUNT INDICATORS SIZE TYPE GROUP# LIMIT ADDR NUMBER
---- ----- ----------- ------- ------- --- ------ ------ ------
1 0 0013500 Z,DY,EM 2 001000 001001 7
2 0 0007100 Z,DY,EM 2 001000 001001 221
3 0 0004100 Z,DY,EM 1 001000 001001 353
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970223 1230:38
OFF RECOVERY
ON SCHEDULE
@ . ***
@ . ***
@ . EXAMPLE SETUP IS COMPLETE
>DPSHVT
THIS IS DPSICP
INITIALIZATION COMPLETE
THIS IS DPSSUBX
THIS IS DPSSUBY
RETURNED TO DPSSUBX
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF AN INITIAL CONTROL PROGRAM "MCBICP" THAT PERFORMS A *
* TRANSFER WITH CANCEL TO A SUBPROGRAM "MCBSUBX". *
* *
******************************************************************
******************************************************************
PROGRAM-ID. MCBICP INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
COPY MCBPKT-UCOB.
PROCEDURE DIVISION.
****************************************************
*** TRANSACTION INITIALIZATION ***
****************************************************
START-UP-ICP.
DISPLAY 'THIS IS MCBICP' UPON PRINTER.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 1 TO P-BIT2.
MOVE P-TRINIT TO P-FUNC.
MOVE 80 TO P-LENGTH.
MOVE 63 TO P-AUX.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS, P-TRXBUFF.
IF P-STATBIT NOT EQUAL ZERO GO TO ERROR-EXIT.
DISPLAY 'INITIALIZATION COMPLETE' UPON PRINTER.
****************************************************
*** TRANSFER WITH CANCEL TO MCBSUBX ***
****************************************************
TRANSFERCANCEL-SUBX.
DISPLAY 'MCBICP TRANSFERRING WITH CANCEL TO MCBSUBX'
UPON PRINTER.
CALL 'MCBSUBX'.
****************************************************
*** ERROR RETURN ***
****************************************************
ERROR-RETURN.
DISPLAY 'RETURNED TO MCBICP - ERROR' UPON PRINTER.
DISPLAY 'TERMINATING FROM MCBICP - ERROR' UPON PRINTER.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 0 TO P-FLAGS.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
STOP RUN.
****************************************************
*** MCB ERROR HANDLING ***
****************************************************
ERROR-EXIT.
DISPLAY '********* MCB ERROR *********' UPON PRINTER.
DISPLAY 'ERROR STATUS BIT = ' P-STATBIT UPON PRINTER.
DISPLAY 'ERROR CODE = ' P-ERRCODE UPON PRINTER.
MOVE 0 to P-ID.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
STOP RUN.
MCBPKT-UCOB PROC
/
*
* Sample MCB procedure for use in UCOB transactions
*
************************************************
** TRANSACTION CODE BUFFER **
************************************************
01 P-TRXCODE PIC X(6).
************************************************
** INPUT BUFFER **
** This buffer will hold a 24 X 80 screen. **
** The maximum size is PIC X(262143). **
************************************************
01 P-INMSG PIC X(1920).
**************************************************
** BUFFER ADDRESS **
**************************************************
01 P-MSG-LENGTH PIC 9(10) BINARY.
01 P-SAVEPID PIC 1(18) BINARY-1.
01 P-TRXBUFF PIC X(1920) VALUE SPACES.
**************************************************
** MCB ERROR STATUS RETURN **
**************************************************
01 P-MCB-STATUS.
02 P-STATBIT PIC S9(5) BINARY.
02 P-ERRCODE PIC 9(5) BINARY.
02 P-ERRCODEQ REDEFINES P-ERRCODE.
04 P-ERRCODEQ3 PIC 1(9) BINARY-1.
04 P-ERRCODEQ4 PIC 1(9) BINARY-1.
*************************************************
** FUNCTION CODES FOR INTERFACES TO THE MCB **
*************************************************
* TRINIT VALUE 2. initialize
* TERM VALUE 10. terminate
* COMMIT VALUE 11. commit
* ROLBAK VALUE 12. rollback
* P-FAC facilities
* P-VER version
03 P-AUX PIC 1(6) BINARY-1.
03 P-FAC PIC 1(6) BINARY-1.
03 P-VER PIC 1(6) BINARY-1.
****
03 P-FLAGS.
.
. (additional statements)
.
. HVCALLS DEFINITION
. MCBSUBX is defined as a TRANSFER WITH CANCEL
.
$OBJ .
$INCLUDE 'OM$DEF' .
$INCLUDE 'HVTIP$CALLS' .
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL' .
HV$XFR$CANCL 22,7,0 'MCBSUBX'
$END
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "MCBSUBX" THAT WAS CALLED FROM THE ICP *
* "MCBICP" USING TRANSFER WITH CANCEL AND IN TURN CALLS A *
* SUBPROGRAM "MCBSUBY". *
* *
******************************************************************
******************************************************************
PROGRAM-ID. MCBSUBX INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
COPY MCBPKT-UCOB.
PROCEDURE DIVISION.
****************************************************
*** MCBSUBX START UP ***
****************************************************
START-UP-SUBX.
DISPLAY ' THIS IS MCBSUBX' UPON PRINTER.
****************************************************
*** CALL TO MCBSUBY ***
****************************************************
CALL-SUBY.
DISPLAY ' MCBSUBX CALLING MCBSUBY' UPON PRINTER.
CALL 'MCBSUBY'.
****************************************************
*** RETURN TO MCBSUBX ***
****************************************************
RETURN-FROM-MCBSUBY.
DISPLAY ' RETURNED TO MCBSUBX ' UPON PRINTER.
****************************************************
*** TRANSACTION TERMINATION ***
****************************************************
MCB-TERMINATE.
DISPLAY ' TERMINATING FROM MCBSUBX' UPON PRINTER.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 0 TO P-FLAGS.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
IF P-STATBIT NOT EQUAL ZERO GO TO ERROR-EXIT.
STOP RUN.
****************************************************
*** MCB ERROR HANDLING ***
****************************************************
ERROR-EXIT.
DISPLAY '********* MCB ERROR *********' UPON PRINTER.
DISPLAY 'ERROR STATUS BIT = ' P-STATBIT UPON PRINTER.
DISPLAY 'ERROR CODE = ' P-ERRCODE UPON PRINTER.
MOVE 0 to P-ID.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
STOP RUN.
. HVCALLS DEFINITION
. MCBSUBY is defined as a CALL
.
$OBJ .
$INCLUDE 'OM$DEF' .
$INCLUDE 'HVTIP$CALLS' .
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL' .
HV$CALL 22,8,0 'MCBSUBY'
$END
Example 6–16. Source Listing of the HVCALLS Element for First Subprogram
(QUAL*UCSTST.HVCALLSDEF/MCBSUBY)
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "MCBSUBY" THAT WAS CALLED FROM THE *
* SUBPROGRAM "MCBSUBX" WITH A CALL AND IN TURN IT RETURNS TO *
* SUBPROGRAM "MCBSUBX". *
* *
******************************************************************
******************************************************************
PROGRAM-ID. MCBSUBY INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
******************************************************
*** MCBSUBY START UP ***
******************************************************
START-UP-SUBY.
DISPLAY ' THIS IS MCBSUBY' UPON PRINTER.
******************************************************
*** RETURN TO MCBSUBX ***
******************************************************
RETURN-SUBX.
DISPLAY ' MCBSUBY RETURNING TO MCBSUBX'
UPON PRINTER.
EXIT PROGRAM.
@ . ***
@ . *** *** START OF THE EXAMPLE SETUP SECTION *************************
@ . ***
@ . ***
@ . *** COBOL COMPILE OF THE ICP AND SUBPROGRAMS;
@ . *** MASM ASSEMBLY OF THE HVCALLS ROUTINES.
@ . ***
@ . *** THE MCB PACKET PROCEDURE IS PDP'ED WITHIN THE USER
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . ***
@ . *** THE USER-WRITTEN MASM ROUTINES "HVCALLS" DIRECTS EACH
@ . *** CALL TO A SUBPROGRAM TO THE CORRECT HVTIP LIBRARY NUMBER
@ . *** AND BANK NUMBER.
@ . ***
@PDP,UC QUAL*UCSTST.MCBPKT/UCOB,.MCBPKT-UCOB
@EOF
@ . ***
@ . ***
@USE MASM$PF1.,SYS$LIB$*LINK.
@ASG,A MASM$PF1.
@ . ***
@ . ***
@ . *** * ICP MCBICP ******
@ . *** COMPILE THE ICP "MCBICP" AND ASSEMBLE ITS HVCALLS
@ . *** TRANSFER WITH CANCEL ELEMENT "HVCALLSDEF/MCBSUBX
@ . ***
@UCOB QUAL*UCSTST.MCBICP,.MCBICP/COMP,,,NO-OPTIONS
@MASM,N QUAL*UCSTST.HVCALLSDEF/MCBSUBX,.HVCALLSDEF/MCBSUBX
@EOF
@ . ***
@ . ***
@ . *** * SUBPROGRAM MCBSUBX ******
@ . *** COMPILE THE FIRST SUBPROGRAM "MCBSUBX" AND ASSEMBLE ITS
@ . *** HVCALLS CALL ELEMENT "HVCALLSDEF/MCBSUBY"
@ . ***
@UCOB QUAL*UCSTST.MCBSUBX,.MCBSUBX/COMP,,,NO-OPTIONS,SUBPROGRAM
@MASM,N QUAL*UCSTST.HVCALLSDEF/MCBSUBY,.HVCALLSDEF/MCBSUBY
@EOF
@ . ***
@ . ***
@ . *** * SUBPROGRAM MCBSUBY ******
Example 6–18. Runstream to Set Up, Compile, and Link—COBOL MCB HVTIP
Transaction Sequence
@ . ***
@ . *** * HVTIP LIBRARY SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** HVTIP LIBRARY TIP FILE.
@ . ***
@CAT,P QUAL*HVTIPLIB22.,F/1000//1000
@ . ***
@ . ***
@ . *** * HVTIP LIBRARY INFORMATION
@ . ***
@ . *** THE TIP FILE NUMBERS THAT CAN BE USED AS HVTIP LIBRARIES
@ . *** ARE DEFINED BY THE EXEC GENERATION.
@ . ***
@ . *** TPLIB nn - DEFINES THE STARTING TIP FILE NUMBER FOR
@ . *** HVTIP LIBRARIES
@ . *** HVTIP nn - DEFINES THE NUMBER OF HVTIP LIBRARIES FOR
@ . *** THIS SYSTEM
@ . ***
@ . *** HVTIP-LIBRARY-TIP-file-number - TPLIB = HVTIP-LIBRARY-number
@ . ***
@ . *** FOR EXAMPLE: TPLIB = 70
@ . *** HVTIP = 64
@ . *** HVTIP-LIBRARY-TIP-file-number = 92
@ . *** THEREFORE:
@ . *** 92 - 70 = 22 (HVTIP-LIBRARY-number)
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE HVTIP LIBRARY TIP FILE THIS TEST USES FOR
@ . *** THE TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*HVTIPLIB22.,FIX
RES 92,64000,28,,HVTIPLIB22,,,WW=P,AUDIT=0,NREC
LFD 92
@EOF
@ . ***
@ . ***
@ . *** * HVTIP LIBRARY LOAD ******
@ . *** USE THE TPUR UTILITY TO COPY TRANSACTION PROGRAMS INTO
@ . ***
@ . *** *** START OF THE EXAMPLE SETUP SECTION *************************
@ . ***
@ . ***
@ . *** COBOL COMPILE OF THE ICP AND SUBPROGRAMS;
@ . *** MASM ASSEMBLY OF THE HVCALLS ROUTINES.
@ . ***
@ . *** THE MCB PACKET PROCEDURE IS PDP'ED WITHIN THE USER
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . ***
@ . *** THE USER-WRITTEN MASM ROUTINES "HVCALLS" DIRECTS EACH
@ . ***
@ . *** ** VALTAB SETUP
@ . ***
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@ . *** INPUT:
@ . *** *VALCHG M
@ . *** NNN NAM,XXXXXX ACT,XXXXXX PRG,5 STF,0 STA,J QPR,N OPT,TV
@ . *** NNN REC,Z AUD,N PRT,XXXXXX
@ . ***
@ . ***
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
VTBUTL 45R2#0000001 970223 1241:05
*VALCHG M
KEYWORDS FOR VALTAB FIELDS
LONG FORM SHORT FORM FIELD DESCRIPTION
--------- ---------- -----------------
(FIRST FIELD ON EACH CARD) PROGRAM NUMBER
NAME NAM PROGRAM NAME
ACTION ACT TRANSACTION CODE
RUNTIME RUN MAXIMUM RUN TIME
PRIORITY PRI PROGRAM PRIORITY
INDICATORS IND VALTAB INDICATORS
PRGTYPE PRG PROGRAM TYPE
OPTIONS OPT PROGRAM OPTIONS
STFILE STF STANDARD FILE NO.
COPIES COP MAXIMUM COPIES
STATUS STA PROGRAM STATUS
PRTDEVICE PRT PRINT QUEUE DEVICE
LEVEL LEV SWITCHING LEVEL
PCTBLOCKS PCT NUMBER PCT BLOCKS
WAITQ WAI WAIT-Q LENGTH
DBKSIZ DBK D-BANK SIZE
AUDIT AUD AUDIT TRAIL NUMBER
RECOVERY REC RECOVERY OPTIONS
MASK MAS ACCESS MASK
QPRIORITY QPR QUEUING PRIORITY
TCASIZ TCA TCA BANK SIZE
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970223 1241:06
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
TPINIT 45R2#0000001 970223 1241:06
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970223 1241:06
ON BTLOADING
ON STICKING
@ . ***
@ . ***
@ . *** * HVTIP LIBRARY SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** HVTIP LIBRARY TIP FILE.
@ . ***
@CAT,P QUAL*HVTIPLIB22.,F/1000//1000
I:002333 CAT complete.
@ . ***
@ . ***
@ . *** * HVTIP LIBRARY INFORMATION
@ . ***
@ . *** THE TIP FILE NUMBERS THAT CAN BE USED AS HVTIP LIBRARIES
@ . *** ARE DEFINED BY THE EXEC GENERATION.
@ . ***
@ . *** TPLIB NN - DEFINES THE STARTING TIP FILE NUMBER FOR
@ . *** HVTIP LIBRARIES
@ . *** HVTIP NN - DEFINES THE NUMBER OF HVTIP LIBRARIES FOR
@ . *** THIS SYSTEM
@ . ***
@ . *** HVTIP-LIBRARY-TIP-FILE-NUMBER - TPLIB = HVTIP-LIBRARY-NUMBER
@ . ***
@ . *** FOR EXAMPLE: TPLIB = 70
@ . *** HVTIP = 64
@ . *** HVTIP-LIBRARY-TIP-FILE-NUMBER = 92
@ . *** THEREFORE:
@ . *** 92 - 70 = 22 (HVTIP-LIBRARY-NUMBER)
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE HVTIP LIBRARY TIP FILE THIS TEST USES FOR
@ . *** THE TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 45R2 02/23/97 12:41:06 FS-LEVEL FS 003
TREG QUAL*HVTIPLIB22.,FIX
TP REGISTER STARTED 12:41:06 23 FEB 97
TP REGISTER FINISHED 12:41:09 23 FEB 97
RES 92,64000,28,,HVTIPLIB22,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 12:41:09 23 FEB 97
TP RESERVE FINISHED 12:41:09 23 FEB 97
LFD 92
TIP FILE 92
DIR-ACCESS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 64000 SIZE: 28 APPLICATION GROUP: 0
FILE NAME HVTIPLIB22
PLACEMENT 0
LEG STATUS AVL-UP
END FREIPS
@ . ***
@ . ***
@ . *** * HVTIP LIBRARY LOAD ******
@ . *** USE THE TPUR UTILITY TO COPY TRANSACTION PROGRAMS INTO
@ . *** THE HVTIP LIBRARY.
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970223 1241:09
ON RECOVERY
OFF SCHEDULE
@ . ***
@ASG,A QUAL*UCSTST.
I:002333 ASG complete.
@ . ***
@XQT,MUX TIP$*TIPRUN$.TPUR
TPUR 45R2#0000001 970223 1241:09
CREATE,K 22,30
LIBRARY NUMBER: 22 NUMBER OF BANKS ALLOWED: 30
NEXT AVAILABLE RECORD: 7 LIBRARY CYCLE: MAIN
COPY,IVK 22,6,QUAL*UCSTST.MCBICP
LLBBBB : 260006 LIB# : 22 BANK# : 6
ELEMENT SPECIFICATION : QUAL*UCSTST.MCBICP
CREATION DATE : 02/23/97 CREATION TIME : 12:40:54
BANK SIZE : 011200 BANK TYPE : Z,DY,EM
START ADDRESS : 001011 START RECORD NUMBER : 7
LOWER LIMIT : 001000
COPY,IK 22,7,QUAL*UCSTST.MCBSUBX
COPY,IK 22,8,QUAL*UCSTST.MCBSUBY
LOAD,K 22
STATUS,K 22
BANK RTN LOAD STATUS BANK BANK TIP MEM LOWER START RECORD
NUMB COUNT INDICATORS SIZE TYPE GROUP# LIMIT ADDR NUMBER
---- ----- ----------- ------- ------- --- ------ ------ ------
6* 0 0011200 Z,DY,EM 2 001000 001011 7
7 0 0004600 Z,DY,EM 1 001000 001011 178
8 0 0004100 Z,DY,EM 1 001000 001001 266
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970223 1241:12
OFF RECOVERY
ON SCHEDULE
@ . ***
@ . **
@ . EXAMPLE SETUP IS COMPLETE
>MCBHNT
THIS IS MCBICP
INITIALIZATION COMPLETE
THIS IS MCBSUBX
THIS IS MCBSUBY
RETURNED TO MCBSUBX
As shown in the following table, the transaction code specified by the end user
determines
• Whether subprogram MCBSUBA or subprogram MCBSUBX is called
• Which entry point in MCBSUBA is used if MCBSUBA is called
Transaction
Code Description
The following figure summarizes the program code for MCBICP, MCBSUBA, and
MCBSUBX. Notice that the PROCEDURE DIVISION statement in MCBSUBA identifies
the extra entry points using the clause WITH ENTRY POINTS MCBEP2, MCBEP3.
Example 6–20 is an example of the MASM jump vector routine used to define the
three entry points into MCBSUBA. When MCBICP calls MCBSUBA, this MASM jump
vector routine is entered first and transfers control to the appropriate address within
MCBSUBA: MCBSUBA (MCBEP1), MCBEP2, or MCBEP3.
MCBEP1.
CALL 'MCBEP3'.
MCBEP2.
Subprogram MCBSUBA
Bank 10
Example 6–20. MASM Jump Vector Routine to Define Multiple Entry Points
Explanation
1. These statements obtain the MASM procs, located on the Linking System product
file, required to generate the jump vector.
2. The name of the MASM jump vector routine is
QUAL*UCSTST.JUMPVECTOR/MCBSUBA.
3. This statement gives bank “jv” (location counter 1) a merge order attribute of
FIRST and causes it to start at offset 01000.
4. This MASM jump vector routine has an externalized definition (entry point) name
of JUMPER. Thus, the HVTIP subprogram ZOOM is supplied with this single entry
point.
5. Each of the three HV$VECTOR calls generates three extended mode instructions
that, when executed, pass program control to the corresponding entry point in the
bank.
If hyphens or lowercase characters are present in the entry point name, you must
put the entry point name in single quotes on the HV$VECTOR statement. The
following is an example.
HV$VECTOR ‘mcbsuba’
HV$VECTOR ‘mcbep2’
HV$VECTOR ‘mcbep3’
Also, you should place an $ASCII directive after the $OBJ directive in the MASM
jump vector routine.
The HV$VECTOR statements will receive “U” flags at assembly time, indicating
undefined names in the assembly. These names will be resolved by the static
linking process when creating the subprogram ZOOM.
@USE LINK$PF,SYS$LIB$*APP$3.
@LINK ,QUAL*UCSTST.MCBSUBA
OUTPUT HVTIP2
INCLUDE QUAL*UCSTST.MCBSUBA/COMP
(1) INCLUDE QUAL*UCSTST.JUMPVECTOR/MCBSUBA
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
(2) DELETE ALL DEFINITIONS EXCEPT JUMPER
SET ZEROFILL = NONE FOR ALL BANKS
@EOF
Explanation
1. This command includes the MASM jump vector routine.
2. This command deletes all definitions except JUMPER. This is to make sure that
the external definition JUMPER is the only entry point in the HVTIP subprogram
ZOOM.
Example 6–21 shows how to create the HVCALLS element for this example.
@USE MASM$PF1,SYS$LIB$*LINK.
@ASG,A MASM$PF1
@MASM,N ,QUAL*UCSTST.HVCALLSDEF/MCBSUBXSUBA
. HVCALLS DEFINITION
. MCBSUBX is defined as a TRANSFER WITH CANCEL
. MCBSUBA first entry point is defined as a CALL
. MCBSUBA second entry point (MCBEP2) is defined as a CALL
. MCBSUBA third entry point (MCBEP3) is defined as a CALL
.
$OBJ .
$INCLUDE 'OM$DEF' .
$INCLUDE 'HVTIP$CALLS' .
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL' .
HV$XFR$CANCL 22,7,0 'MCBSUBX' (1)
HV$CALL 22,10,01000 'MCBSUBA' (2)
HV$CALL 22,10,01003 'MCBEP2' (2)
HV$CALL 22,10,01006 'MCBEP3' (2)
$END
Example 6–21. Creating the HVCALLS Element for the Calling Program
Explanation
1. MCBSUBX is defined as a transfer-with-cancel to HVTIP library 22 bank number 7.
2. All three of the MCBSUBA entry points are defined using HV$CALL, so that a
return is possible.
The labels on these statements correspond to the three entry points; you must
define them in the same order as designated in the multiple entry point jump
vector MASM routine described in the previous subsection.
Notice that each label has the same HVTIP library (22) and bank number (10),
followed by its jump vector’s relative address in the subprogram, starting at octal
01000. Each entry is three words apart because its corresponding jump vector
entry is three instructions long, resulting in the octal addresses: 01000, 01003, and
01006.
@USE LINK$PF,SYS$LIB$*APP$3.
@LINK ,QUAL*UCSTST.MCBICP
OUTPUT HVTIP2
INCLUDE QUAL*UCSTST.MCBICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/MCBSUBXSUBA
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
Figure 6–3. Example Showing HVTIP Subprogram with Multiple Entry Points
COBOL and MCB functions are used in this example. There are no changes in the
techniques shown for handling HVTIP subprograms with multiple entry points if DPS
2200 functions are used instead of MCB functions.
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF AN INITIAL CONTROL PROGRAM "MCBICP" USING MCB THAT *
* PERFORMS A TRANSFER WITH CANCEL TO A SUBPROGRAM "MCBSUBX" OR *
* A CALL TO ONE OF THE SUBPROGRAM "MCBSUBA ENTRY POINTS: *
* MCBSUBA (the first entry point), MCBEP2, MCBEP3. *
* *
******************************************************************
******************************************************************
PROGRAM-ID. MCBICP INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
COPY MCBPKT-UCOB.
PROCEDURE DIVISION.
****************************************************
*** TRANSACTION INITIALIZATION ***
****************************************************
START-UP-ICP.
DISPLAY 'THIS IS MCBICP' UPON PRINTER.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 1 TO P-BIT2.
MOVE P-TRINIT TO P-FUNC.
MOVE 80 TO P-LENGTH.
MOVE 4 TO P-AUX.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS, P-TRXBUFF.
IF P-STATBIT NOT EQUAL ZERO GO TO ERROR-EXIT.
DISPLAY 'INITIALIZATION COMPLETE' UPON PRINTER.
MOVE FUNCTION UPPER-CASE (P-MCB-TRANS-CODE)
TO COMMON-FIELD-1.
******************************************************
*** TRANSFER WITH CANCEL TO MCBSUBX ***
*** OR ***
*** CALL TO ONE OF THREE ENTRY POINTS ***
*** OF MCBSUBA ***
*** DEPENDING UPON THE TRANSACTION CODE ***
******************************************************
SETUP-CALL-TO-SUBPROGRAM.
EVALUATE COMMON-FIELD-1
WHEN 'MCBHVT'
DISPLAY 'MCBICP TRANSFERRING WITH CANCEL TO MCBSUBX'
UPON PRINTER
CALL 'MCBSUBX'
WHEN 'MCBEP1'
DISPLAY 'MCBICP CALLING MCBSUBA' UPON PRINTER
CALL 'MCBSUBA'
WHEN 'MCBEP2'
DISPLAY 'MCBICP CALLING MCBEP2' UPON PRINTER
CALL 'MCBEP2'
WHEN OTHER
DISPLAY 'MCBICP CALLING MCBEP3' UPON PRINTER
CALL 'MCBEP3'
END-EVALUATE.
******************************************************
*** RETURN TO MCBICP ***
******************************************************
RETURN-FROM-MCBSUBA.
DISPLAY 'RETURNED TO MCBICP FROM SUBPROGRAM MCBSUBA'
UPON PRINTER.
****************************************************
*** TRANSACTION TERMINATION ***
****************************************************
MCB-TERMINATE.
DISPLAY 'TERMINATING FROM MCBICP' UPON PRINTER.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 0 TO P-FLAGS.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
STOP RUN.
****************************************************
*** MCB ERROR HANDLING ***
****************************************************
ERROR-EXIT.
DISPLAY '********* MCB ERROR *********' UPON PRINTER.
DISPLAY 'ERROR STATUS BIT = ' P-STATBIT UPON PRINTER.
DISPLAY 'ERROR CODE = ' P-ERRCODE UPON PRINTER.
DISPLAY 'ERROR CODE Q3 = ' P-ERRCODEQ3 UPON PRINTER.
DISPLAY 'ERROR CODE Q4 = ' P-ERRCODEQ4 UPON PRINTER.
MOVE 0 to P-ID.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
STOP RUN.
. HVCALLS DEFINITION
. MCBSUBX is defined as a TRANSFER WITH CANCEL
. MCBSUBA first entry point is defined as a CALL
. MCBSUBA second entry point (MCBEP2) is defined as a CALL
. MCBSUBA third entry point (MCBEP3) is defined as a CALL
.
$OBJ .
$INCLUDE 'OM$DEF' .
$INCLUDE 'HVTIP$CALLS' .
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL' .
HV$XFR$CANCL 22,7,0 'MCBSUBX'
HV$CALL 22,10,01000 'MCBSUBA'
HV$CALL 22,10,01003 'MCBEP2'
HV$CALL 22,10,01006 'MCBEP3'
$END
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "MCBSUBA" THAT WAS CALLED FROM THE ICP *
* "MCBICP" USING A CALL TO ONE OF THE THREE ENTRY POINTS: *
* MCBSUBA, MCBEP2, MCBEP3. *
* *
******************************************************************
******************************************************************
PROGRAM-ID. MCBSUBA INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
PROCEDURE DIVISION WITH ENTRY POINTS MCBEP2, MCBEP3.
*
MCBEP1.
DISPLAY ' THIS IS MCBSUBA "MCBEP1" ENTRY POINT'
UPON PRINTER.
DISPLAY ' TRANSACTION CODE ' COMMON-FIELD-1 ' WAS'
UPON PRINTER.
DISPLAY ' USED TO ENTER MCBSUBA AT THIS ENTRY POINT'
UPON PRINTER.
DISPLAY ' RETURNING TO MCBICP ' UPON PRINTER.
EXIT PROGRAM.
*
MCBEP2.
DISPLAY ' THIS IS MCBSUBA "MCBEP2" ENTRY POINT '
UPON PRINTER.
DISPLAY ' TRANSACTION CODE ' COMMON-FIELD-1 ' WAS'
UPON PRINTER.
DISPLAY ' USED TO ENTER MCBSUBA AT THIS ENTRY POINT'
UPON PRINTER.
DISPLAY ' RETURNING TO MCBICP ' UPON PRINTER.
EXIT PROGRAM.
*
MCBEP3.
DISPLAY ' THIS IS MCBSUBA "MCBEP3" ENTRY POINT '
UPON PRINTER.
DISPLAY ' TRANSACTION CODE ' COMMON-FIELD-1 ' WAS'
UPON PRINTER.
DISPLAY ' USED TO ENTER MCBSUBA AT THIS ENTRY POINT'
UPON PRINTER.
DISPLAY ' RETURNING TO MCBICP ' UPON PRINTER.
EXIT PROGRAM.
IDENTIFICATION DIVISION.
*******************************************************************************
*********************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "MCBSUBX" THAT WAS CALLED FROM THE ICP *
* "MCBICP" USING TRANSFER WITH CANCEL *
* *
*******************************************************************************
*********************************************************************
PROGRAM-ID. MCBSUBX INITIAL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
COPY MCBPKT-UCOB
PROCEDURE DIVISION.
****************************************************
*** MCBSUBX START UP ***
****************************************************
START-UP-SUBX.
DISPLAY ' THIS IS MCBSUBX' UPON PRINTER.
****************************************************
*** TRANSACTION TERMINATION ***
****************************************************
MCB-TERMINATE.
DISPLAY ' TERMINATING FROM MCBSUBX' UPON PRINTER.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 0 TO P-FLAGS.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
IF P-STATBIT NOT EQUAL ZERO GO TO ERROR-EXIT.
STOP RUN.
*****************************************************
*** MCB ERROR HANDLING ***
*****************************************************
ERROR-EXIT.
DISPLAY '********* MCB ERROR ********* UPON PRINTER.
DISPLAY 'ERROR STATUS BIT = ' P-STATBIT UPON PRINTER.
DISPLAY 'ERROR CODE = ' P-ERRCODE UPON PRINTER.
DISPLAY 'ERROR CODE Q3 = ' P-ERRCODEQ3 UPON PRINTER.
DISPLAY 'ERROR CODE Q4 = ' P-ERRCODEQ4 UPON PRINTER.
MOVE 0 TO P-ID.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
STOP RUN.
@ . ***
@ . *** *** START OF THE EXAMPLE SETUP SECTION *************************
@ . ***
@ . *** COBOL COMPILE OF THE ICP AND SUBPROGRAMS:
@ . *** MASM ASSEMBLY OF THE HVCALLS ROUTINES.
@ . ***
@ . *** THE MCB PACKET PROCEDURE IS PDP'ED WITHIN THE USER
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . ***
@ . *** THE USER-WRITTEN MASM ROUTINES "HVCALLS" DIRECTS EACH
@ . *** CALL TO A SUBPROGRAM TO THE CORRECT HVTIP LIBRARY NUMBER
@ . *** AND BANK NUMBER.
@ . ***
@PDP,UC QUAL*UCSTST.MCBPKT/UCOB,.MCBPKT-UCOB
@EOF
@ . ***
@USE MASM$PF1.,SYS$LIB$*LINK.
@ASG,A MASM$PF1.
@ . ***
@ . *** * ICP MCBICP ******
@ . *** COMPILE THE ICP "MCBICP AND ASSEMBLE ITS HVCALLS
@ . *** TRANSFER WITH CANCEL AND CALL ELEMENT
@ . *** "HVCALLSDEF/MCBSUBXSUBA"
@ . ***
@UCOB QUAL*UCSTST.MCBICP/MULTEP,.MCBICP/COMP,,,NO-OPTIONS
@MASM,N QUAL*UCSTST.HVCALLSDEF/MCBSUBXSUBA,.HVCALLSDEF/MCBSUBXSUBA
Example 6–27. Runstream to Set Up, Compile, and Link—COBOL MCB HVTIP
Transaction Program Sequence Using Multiple Entry Points
@EOF
@ . ***
@ . *** * MULTIPLE ENTRY POINT SUBPROGRAM MCBSUBA ******
@ . *** COMPILE THE MULTIPLE ENTRY POINT SUBPROGRAM "MCBSUBA" AND
@ . *** ASSEMBLE ITS JUMP VECTOR ELEMENT "JUMPVECTOR/MCBSUBA"
@ . ***
@ . *** THIS SUBPROGRAM CONTAINS NO MCB FUNCTIONS.
@ . ***
@UCOB QUAL*UCSTST.MCBSUBA,.MCBSUBA/COMP,,,NO-OPTIONS,SUBPROGRAM
@MASM,N QUAL*UCSTST.JUMPVECTOR/MCBSUBA,.JUMPVECTOR/MCBSUBA
@EOF
@ . ***
@ . *** * SUBPROGRAM MCBSUBX ******
@ . *** COMPILE SUBPROGRAM "MCBSUBX"
@ . ***
@UCOB QUAL*UCSTST.MCBSUBX/NOCALLS,.MCBSUBX/COMP,,,NO-OPTIONS,SUBPROGRAM
@ . ***
@ . *** THE ICP AND SUBPROGRAMS ARE LINKED SEPARATELY CREATING
@ . *** HVTIP ZOOMS.
@ . ***
@ . *** SINCE MCB IS BEING USED IN THIS EXAMPLE, IDENTIFYING
@ . *** THE CORRECT APPLICATION GROUP SEARCH CHAIN WILL
@ . *** LOCATE THAT APPLICATION GROUP'S MCB.
@ . ***
@ . *** @USE LINK$PF.,SYS$LIB$*APP$n.
@ . ***
@ . *** WHERE "n" IS REPLACED WITH THE APPLICATION GROUP NUMBER
@ . ***
@ . *** IDENTIFY THE APPLICATION GROUP SEARCH CHAIN
@USE LINK$PF,SYS$LIB$*APP$3.
@ . ***
@ . *** CREATE SYMBOLIC ELEMENTS TO HOLD THE "OUTPUT" STATEMENT
@ . *** AND THE "SET LOWADR" STATEMENTS FOR BLANK COMMON THAT EACH
@ . *** OF THE STATIC LINKS WILL NEED:
@ . ***
@ELT,I QUAL*UCSTST.OUTPUTSTMT
. Setup an HVTIP2 heap environment consisting of:
. Program-level banks:
. Small banks: (4, each with limits of 060000 to 0577777)
. BDIs 06
. 07
. 010 (pooled)
. 011 (pooled)
. Large banks: (2, 2 BDIs each)
. BDIs 012 & 013
. 014 & 015 (pooled)
. Activity-level banks:
@ . ***
@LINK ,QUAL*UCSTST.MCBICP
ADD QUAL*UCSTST.OUTPUTSTMT
INCLUDE QUAL*UCSTST.MCBICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/MCBSUBXSUBA
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
ADD QUAL*UCSTST.COMMON
SET ZEROFILL = NONE FOR ALL BANKS
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** *** MCBSUBA LINK ********
@ . *** LINK THE SUBPROGRAM "MCBSUBA" INCLUDING THE JUMP VECTOR ELEMENT
@ . *** "JUMPVECTOR/MCBSUBA"
@ . ***
@LINK ,QUAL*UCSTST.MCBSUBA
ADD QUAL*UCSTST.OUTPUTSTMT
INCLUDE QUAL*UCSTST.MCBSUBA/COMP
INCLUDE QUAL*UCSTST.JUMPVECTOR/MCBSUBA
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
ADD QUAL*UCSTST.COMMON
SET LOWADR = 0400007060100 FOR HVTIP$$DSEG
SET ZEROFILL = NONE FOR ALL BANKS
DELETE ALL DEFINITIONS EXCEPT JUMPER
@EOF
@ . ***
@ . ***
@ . *** *** MCBSUBX LINK ********
@ . *** LINK THE SUBPROGRAM "MCBSUBX"
@ . ***
@LINK ,QUAL*UCSTST.MCBSUBX
ADD QUAL*UCSTST.OUTPUTSTMT
INCLUDE QUAL*UCSTST.MCBSUBX/COMP
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
ADD QUAL*UCSTST.COMMON
SET LOWADR = 0400005170000 FOR HVTIP$$DSEG
SET ZEROFILL = NONE FOR ALL BANKS
DELETE ALL DEFINITIONS EXCEPT MCBSUBX
@EOF
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@ . *** VTBUTL IS THE UTILITY FOR MANAGING THE VALTAB ENTRIES
@ . ***
@ . *** 1. REGISTER THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE HVTIP LIBRARY TIP FILE THIS TEST USES FOR
@ . *** THE TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*HVTIPLIB22.,FIX
RES 92,64000,28,,HVTIPLIB22,,,WW=P,AUDIT=0,NREC
LFD 92
@EOF
@ . *** * HVTIP LIBRARY LOAD ******
@ . ***
@ . *** USE THE TPUR UTILITY TO COPY TRANSACTION PROGRAMS INTO
@ . *** THE HVTIP LIBRARY.
@ . ***
@ . *** BRING AN HVTIP LIBRARY THAT IS INITIALIZED AND CONTAINS
@ . *** AT LEAST ONE PROGRAM BANK ONLINE SO TRANSACTIONS CAN BE
@ . *** EXECUTED FROM THIS HVTIP LIBRARY.
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON RECOVERY
OFF SCHEDULE
@ . ***
@ASG,A QUAL*UCSTST.
@ . ***
@XQT,MUX TIP$*TIPRUN$.TPUR
CREATE,K 22,30
COPY,IVK 22,6,QUAL*UCSTST.MCBICP
COPY,IK 22,7,QUAL*UCSTST.MCBSUBX
COPY,IK 22,10,QUAL*UCSTST.MCBSUBA
LIST 22
LOAD,K 22
STATUS,K 22
@EOF
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF RECOVERY
ON SCHEDULE
@EOF
@ . ***
@ . ***
@ . *** EXAMPLE SETUP IS COMPLETE
@ . ***
@ . *** *** START OF THE EXAMPLE SETUP SECTION *************************
@ . ***
@ . *** COBOL COMPILE OF THE ICP AND SUBPROGRAMS:
@ . *** MASM ASSEMBLY OF THE HVCALLS ROUTINES.
@ . ***
@ . *** THE MCB PACKET PROCEDURE IS PDP'ED WITHIN THE USER
@ . *** FILE SO THE PROCEDURE CAN BE LOCATED BY THE COMPILER.
@ . ***
@ . *** THE USER-WRITTEN MASM ROUTINES "HVCALLS" DIRECTS EACH
@ . *** CALL TO A SUBPROGRAM TO THE CORRECT HVTIP LIBRARY NUMBER
@ . *** AND BANK NUMBER.
@ . ***
@PDP,UC QUAL*UCSTST.MCBPKT/UCOB,.MCBPKT-UCOB
PDP 13R2 (960429 0508:57) 1997 Feb 06 Thu 1354:33
Copyright (c) 1994 Unisys Corporation.
All rights reserved.
UNISYS PROPRIETARY
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 278 Entry Points: 1 Time: 2.134 Storage: 7070/0/7070/0920 73
@ . ***
@USE MASM$PF1.,SYS$LIB$*LINK.
I:002333 USE complete.
@ASG,A MASM$PF1.
W:120333 file is assigned to another run.
W:120133 file is already assigned.
@ . ***
@ . *** * ICP MCBICP ******
@ . *** COMPILE THE ICP "MCBICP AND ASSEMBLE ITS HVCALLS
@ . *** TRANSFER WITH CANCEL AND CALL ELEMENT
@ . *** "HVCALLSDEF/MCBSUBXSUBA"
@ . ***
@UCOB QUAL*UCSTST.MCBICP/MULTEP,.MCBICP/COMP,,,NO-OPTIONS
UCOB- 8R1(970210) LSS- 10R1(970209) 960206 13:54:33
SIZES: CODE(EM6): 327 DATA: 565 COMMON: 3
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@MASM,N QUAL*UCSTST.HVCALLSDEF/MCBSUBXSUBA,.HVCALLSDEF/MCBSUBXSUBA
MASM 6R2A U2 (970423 1042:19) 1997 Feb 06 Thu 1354:37
COPYRIGHT (c) 1994 Unisys Corporation.
All rights reserved.
UNISYS PROPRIETARY
END MASM - LINES: 497 TIME: 3.929 STORAGE: 29399/8152
@ . ***
@ . *** * MULTIPLE ENTRY POINT SUBPROGRAM MCBSUBA ******
@ . *** COMPILE THE MULTIPLE ENTRY POINT SUBPROGRAM "MCBSUBA" AND
@ . *** ASSEMBLE ITS JUMP VECTOR ELEMENT "JUMPVECTOR/MCBSUBA"
@ . ***
@ . *** THIS SUBPROGRAM CONTAINS NO MCB FUNCTIONS.
@ . ***
@UCOB QUAL*UCSTST.MCBSUBA,.MCBSUBA/COMP,,,NO-OPTIONS,SUBPROGRAM
UCOB- 8R1(970210) LSS- 10R1(970209) 970206 13:54:38
SIZES: CODE(EM6): 132 DATA: 380 COMMON: 3
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@MASM,N QUAL*UCSTST.JUMPVECTOR/MCBSUBA,.JUMPVECTOR/MCBSUBA
MASM 6R2A U2 (960423 1042:19) 1997 Feb 06 Thu 1354:39
COPYRIGHT (c) 1994 Unisys Corporation.
All rights reserved.
UNISYS PROPRIETARY
ASSEMBLY CONTAINS WARNINGS: - FLAGS: U
END MASM - LINES: 258 TIME: 3.904 STORAGE: 29399/7972 WARNINGS: U(3)
@ . ***
@ . *** * SUBPROGRAM MCBSUBX ******
@ . *** COMPILE SUBPROGRAM "MCBSUBX"
@ . ***
@UCOB QUAL*UCSTST.MCBSUBX/NOCALLS,.MCBSUBX/COMP,,,NO-OPTIONS,SUBPROGRAM
UCOB- 8R1(970210) LSS- 10R1(970209) 970206 13:54:39
SIZES: CODE(EM6): 179 DATA: 262 COMMON: 3
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . *** THE ICP AND SUBPROGRAMS ARE LINKED SEPARATELY CREATING
@ . *** HVTIP ZOOMS.
@ . ***
@ . *** SINCE MCB IS BEING USED IN THIS EXAMPLE, IDENTIFYING
@ . *** THE CORRECT APPLICATION GROUP SEARCH CHAIN WILL
@ . *** LOCATE THAT APPLICATION GROUP'S MCB.
@ . ***
@ . *** @USE LINK$PF.,SYS$LIB$*APP$N.
@ . ***
@ . *** WHERE "N" IS REPLACED WITH THE APPLICATION GROUP NUMBER
@ . ***
@ . *** IDENTIFY THE APPLICATION GROUP SEARCH CHAIN
@ . ***
@USE LINK$PF,SYS$LIB$*APP$3.
I:002333 USE complete.
@ . ***
@ . *** CREATE SYMBOLIC ELEMENTS TO HOLD THE "OUTPUT" STATEMENT
@ . *** AND THE "SET LOWADR" STATEMENTS FOR BLANK COMMON THAT EACH
@ . *** OF THE STATIC LINKS WILL NEED:
@ . ***
@ELT,I QUAL*UCSTST.OUTPUTSTMT
ELT 8R3 (960423 1235:55) 1997 Feb 06 Thu 1354:42
END ELT. ERRORS: NONE. TIME: 1.179 SEC. IMAGE COUNT: 48
@ELT,I QUAL*UCSTST.COMMON
ELT 8R3 (960423 1235:55) 1997 Feb 06 Thu 1354:42
END ELT. ERRORS: NONE. TIME: 1.098 SEC. IMAGE COUNT: 4
@ . ***
@ . ***
@ . *** *** MCBICP LINK ********
@ . *** LINK THE ICP "MCBICP" INCLUDING THE HVCALLS ELEMENT
@ . *** "HVCALLSDEF/MCBSUBXSUBA"
@ . ***
@LINK ,QUAL*UCSTST.MCBICP
LINK 7R1 (970207 1144:41) 1997 Feb 06 Thu 1354:42
END LINK , LINES : 59 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** *** MCBSUBA LINK ********
@ . *** LINK THE SUBPROGRAM "MCBSUBA" INCLUDING THE JUMP VECTOR ELEMENT
@ . *** "JUMPVECTOR/MCBSUBA"
@ . ***
@LINK ,QUAL*UCSTST.MCBSUBA
LINK 7R1 (970207 1144:41) 1997 Feb 06 Thu 1354:48
END LINK , LINES : 60 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** *** MCBSUBX LINK ********
@ . *** LINK THE SUBPROGRAM "MCBSUBX"
@ . ***
@LINK ,QUAL*UCSTST.MCBSUBX
LINK 7R1 (970207 1144:41) 1997 Feb 06 Thu 1354:50
*INFO (LINK 780)* The Linking System will create a ZOOM that conforms to the
HVTIP2 format. It can only be executed in the HVTIP2 environment.
END LINK , LINES : 59 , ERRORS : 0 , WARNINGS : 0 , XREFS : 0.
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . *** SETS UP THE VALTAB FOR THIS EXAMPLE'S TRANSACTION.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@ . *** VTBUTL IS THE UTILITY FOR MANAGING THE VALTAB ENTRIES
@ . *** AND THE VINDEX.
@ . ***
PLACEMENT 0
LEG STATUS AVL-UP
END FREIPS
@ . *** * HVTIP LIBRARY LOAD ******
@ . ***
@ . *** USE THE TPUR UTILITY TO COPY TRANSACTION PROGRAMS INTO
@ . *** THE HVTIP LIBRARY.
@ . ***
@ . *** BRING AN HVTIP LIBRARY THAT IS INITIALIZED AND CONTAINS
@ . *** AT LEAST ONE PROGRAM BANK ONLINE SO TRANSACTIONS CAN BE
@ . *** EXECUTED FROM THIS HVTIP LIBRARY.
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970206 1354:54
ON RECOVERY
OFF SCHEDULE
@ . ***
@ASG,A QUAL*UCSTST.
W:120533 filename not unique.
W:120133 file is already assigned.
@ . ***
@XQT,MUX TIP$*TIPRUN$.TPUR
TPUR 45R2#0000001 970206 1354:54
CREATE,K 22,30
LIBRARY NUMBER: 22 NUMBER OF BANKS ALLOWED: 30
NEXT AVAILABLE RECORD: 7 LIBRARY CYCLE: MAIN
COPY,IVK 22,6,QUAL*UCSTST.MCBICP
LLBBBB : 170006 LIB# : 22 BANK# : 6
ELEMENT SPECIFICATION : QUAL*UCSTST.MCBICP
CREATION DATE : 02/06/97 CREATION TIME : 13:54:47
BANK SIZE : 011000 BANK TYPE : Z,DY,EM
START ADDRESS : 001013 START RECORD NUMBER : 7
LOWER LIMIT : 001000 STATUS BITS : NONE
COPY,IK 22,7,QUAL*UCSTST.MCBSUBX
LLBBBB : 170007 LIB# : 22 BANK# : 7
ELEMENT SPECIFICATION : QUAL*UCSTST.MCBSUBX
CREATION DATE : 02/06/97 CREATION TIME : 13:54:52
BANK SIZE : 04700 BANK TYPE : Z,DY,EM
START ADDRESS : 001011 START RECORD NUMBER : 173
LOWER LIMIT : 001000 STATUS BITS : NONE
COPY,IK 22,10,QUAL*UCSTST.MCBSUBA
LLBBBB : 170012 LIB# : 22 BANK# : 10
ELEMENT SPECIFICATION : QUAL*UCSTST.MCBSUBA
CREATION DATE : 02/06/97 CREATION TIME : 13:54:50
BANK SIZE : 05000 BANK TYPE : Z,DY,EM
START ADDRESS : 001000 START RECORD NUMBER : 264
LOWER LIMIT : 001000 STATUS BITS : NONE
LIST 22
LIBRARY NUMBER: 22 NUMBER OF BANKS ALLOWED: 30
NEXT AVAILABLE RECORD: 357 LIBRARY CYCLE: MAIN
LLBBBB : 170006 LIB# : 22 BANK# : 6
ELEMENT SPECIFICATION : QUAL*UCSTST.MCBICP
CREATION DATE : 02/06/97 CREATION TIME : 13:54:47
BANK SIZE : 011000 BANK TYPE : Z,DY,EM
START ADDRESS : 001013 START RECORD NUMBER : 7
LOWER LIMIT : 001000 STATUS BITS : NONE
LLBBBB : 170007 LIB# : 22 BANK# : 7
ELEMENT SPECIFICATION : QUAL*UCSTST.MCBSUBX
CREATION DATE : 02/06/97 CREATION TIME : 13:54:52
BANK SIZE : 04700 BANK TYPE : Z,DY,EM
START ADDRESS : 001011 START RECORD NUMBER : 173
LOWER LIMIT : 001000 STATUS BITS : NONE
LLBBBB : 170012 LIB# : 22 BANK# : 10
ELEMENT SPECIFICATION : QUAL*UCSTST.MCBSUBA
CREATION DATE : 02/06/97 CREATION TIME : 13:54:50
BANK SIZE : 05000 BANK TYPE : Z,DY,EM
START ADDRESS : 001000 START RECORD NUMBER : 264
LOWER LIMIT : 001000 STATUS BITS : NONE
LOAD,K 22
STATUS,K 22
ONLINE LIBRARY STATUS
LIBRARY NUMBER: 22 NUMBER OF BANKS ALLOWED: 30
BANK RTN LOAD STATUS BANK BANK LOWER START RECORD
NUMB COUNT INDICATORS SIZE TYPE LIMIT ADDR NUMBER
---- ----- ----------- ------- ------- ------ ------ ------
6* 0 0011000 Z,DY,EM 001000 001013 7
7 0 0004700 Z,DY,EM 001000 001011 173
10* 0 0005000 Z,DY,EM 001000 001000 264
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970206 1354:57
OFF RECOVERY
ON SCHEDULE
@ . ***
@ . ***
@ . *** EXAMPLE SETUP IS COMPLETE
>MCBHNT
THIS IS MCBICP
INITIALIZATION COMPLETE
THIS IS MCBSUBX
Example 2
The following screen shows another execution of the HVTIP transaction described
previously. User input is bolded.
>MCBEP1
THIS IS MCBICP
INITIALIZATION COMPLETE
RETURNING TO MCBICP
Example 3
The following screen shows another execution of the HVTIP transaction described
previously. User input is bolded.
>MCBEP2
THIS IS MCBICP
INITIALIZATION COMPLETE
RETURNING TO MCBICP
Example 4
The following screen shows another execution of the HVTIP transaction described
previously. User input is bolded.
>MCBEP3
THIS IS MCBICP
INITIALIZATION COMPLETE
RETURNING TO MCBICP
HVTIP programs can switch modes when doing a CALL or TRANSFER to another
HVTIP subprogram. In other words, an extended mode HVTIP ZOOM can access a
basic mode HVTIP absolute and vice-versa. This is allowed for all HVTIP transactions
where:
• The ICP is an extended mode ZOOM
• The VALTAB W indicator is used (IND, W)
More extended mode d-banks can be obtained if the DSP, DLP, DSA, or DLA VALTAB
entries are specified. The extended mode ICP and subprograms must also have an
OUTPUT HVTIP2 statement in their static links that indicates mixed mode:
D-bank limits may also be supplied in the OUTPUT HVTIP2 statement and should
match those in the VALTAB entries.
If the extended mode programs wish to share COMMON with the basic mode
programs, then SET LOWADR statements must be supplied to the extended mode
HVTIP static links. This places the common blocks at the addresses in BDI 5 where
the basic mode code expects them to be. Extended mode HVTIP programs should
NOT put anything into the BDI 5 d-bank other than common blocks, and their
placement (assigned addresses) must match that given them by the basic mode ACOB
ICP
To use the mixed-mode feature, an environment switch must be done and parameter
passing protocols matched when a CALL or TRANSFER is done to code in the opposite
mode. This can be done using intercept routines.
The basic mode side of a mixed-mode transaction must still have a basic mode (ACOB)
main program to initialize the basic mode run-time environment. The basic mode main
program must be called (or transferred to) from the extended mode side, and it will
never return since it is a main program.
The ACOB MAPHVTIP runstream has been updated to help support mixed-mode.
(MAPHVTIP is in the ACOB TIP library file, SYS$LIB$*ACOB-TIPLIB.) A new USING
clause is defined to indicate that the HVTIP absolutes it creates are to possibly
execute in a mixed- mode environment:
USING MIXEDMODE
This option causes the generated MAP symbolic for the basic mode ICP to include the
BMSTACK intercept first in the ICP’s RSEG and BLANK$COMMON second (if it is
used). This is necessary so that their addresses can be reliably predicted since they
must be given constant values on the extended mode side. (Constant values must be
supplied to MIXEDMODESKL for BMSTACK’s address and to the static links of the
extended mode HVTIP ZOOMs for Blank Common’s address.) The BMSTACK intercept
defines an interface area used by the intercept routines for passing and staging
parameters. Its default size is 512 words.
The extended mode side is assumed to be UCOB, but can actually be any UCS
language as long as you are careful with the data types used for parameters and are
aware of the language differences. Any UC program being called (or calling) from/to
ACOB code (or from/to UCOB or UFTN for that matter) will require a #pragma
interface statement to accept or pass the parameters properly. This pragma results
in the UC generated code changing all pointer parameters for the entry point named in
the pragma to be pass-by-reference parameters. This then matches UFTN, UCOB, or
ACOB parameter-passing. See the UC PRM. The BMSTACK interface area must be
initialized before the first extended mode call to basic mode. The entry point B$INIT
(in intercept object module B$INIT) must be called before the first call to basic mode
code to do this initialization. In addition, if the extended mode side is going to call any
basic mode ACOB-based AFCBs, the entry point R$INIT (in relocatable intercept
R$INIT) must be called from the basic mode HVTIP code before any extended mode
calls to basic mode AFCBs can be done. Note that the appropriate ...SYSDTA
relocatables associated with the basic mode AFCBs must be included in the collection
of the basic mode HVTIP code that calls the R$INIT initialization intercept. This results
in the d-bank for the ACOB AFCBs being collected into the RSEG of the HVTIP absolute
that calls the R$INIT initialization intercept.
The first example is trivial, in that the extended mode ICP simply calls a basic mode
HVTIP main program that calls another basic mode HVTIP subprogram.
The second example has the extended mode ICP call a basic mode HVTIP main
program which then calls an extended mode HVTIP subprogram passing a parameter.
Both modes also share the same common storage.
The third example is quite extensive, with an extended mode ICP, a basic mode ICP,
and extended mode and basic mode subprograms. COMMON is shared between
modes and parameters are passed between modes. An ACOB AFCB and an extended
mode subsystem are also accessed from both modes. Finally, VALTAB entries define
five transactions where one is extended mode, one is basic mode, and three are
mixed-mode. The extended mode and mixed-mode transactions share the same
extended mode ICP, and the basic mode transaction’s ICP is called from the mixed-
mode transactions.
The examples are meant to show what is needed to traverse modes and are artificial.
Transaction outputs consist of symbiont prints (COBOL DISPLAY...UPON PRINTER and
FORTRAN PRINT statements). Only the runstreams are shown and the transaction
outputs. The execution of the runstreams is not shown. The runstreams have been
given line numbers for ease of reference.
1: @ .
2: @ . >>>>>>
3: @ . >>>>>> SIMPLE MIXED-MODE EXAMPLE:
4: @ . >>>>>>
5: @ . >>>>>> Use TIP file 87, HVTIP library # 17 with a
6: @ . >>>>>> filename of QUAL*HVTIPLIB17.
7: @ . >>>>>> The EM ICP will be Bank # 020.
8: @ . >>>>>> The BM ICP will be Bank # 021.
9: @ . >>>>>> BM subprogram BMSUB will be Bank # 022.
10: @ . >>>>>> Use VALTAB 615 for the transaction, and
11: @ . >>>>>> name the transaction MIXED1.
12: @ . >>>>>> Use Application # 9.
13: @ . >>>>>> Have all print queued to print queue HOLDPR.
14: @ . >>>>>>
15: @ .
16: @ucob,i emicp,,,,no-options
17: IDENTIFICATION DIVISION.
18: PROGRAM-ID. EICP.
19: ENVIRONMENT DIVISION.
20: CONFIGURATION SECTION.
21: SOURCE-COMPUTER. UNISYS-2200.
22: OBJECT-COMPUTER. UNISYS-2200.
23: DATA DIVISION.
24: PROCEDURE DIVISION.
25: BEGIN.
26: CALL 'B$INIT'.
27: CALL 'BMICP'.
28: STOP RUN.
29: @acob,i bmicp
78: starting_mode,em ;
79: bm_language,acob ;
80: bm_initialbasing,BDR1,C$DML
81: .
82: . Ensure that the offset given BMSTACK below matches the
83: . Dbank address in the Collection of the Basic Mode ICP.
84: .
85: bmstack is lbdi,0400005 offset,040000 length,01000
86: intercept_elt emint contains entrypoint,BMICP ;
87: needing translation,ucob2acob
88: entrypoint BMICP needs calltype,hvtipcall ;
89: hvtarget_lb,021,021 . *** Lib#=021,Bank#=021 ***
90: @eof
91: @eof
92: @add sys$lib$*acob-tiplib.maphvtip
93: hvtip icp,bmicp
94: hvtip subprogram,bmsub
95: control ctrl
96: nocommon
97: cobol lib,cb tipversion,tiplib ;
98: common banked ;
99: cbep$,sys$lib$*acob-dml ;
100: utility,ascii
101: using mixedmode
102: @eof
103: @eof
104: @elt,i tpf$.output-stmt
105: output hvtip2 with env=mixed_mode
106: bm_limits=040000 to 0177777
107: @link,is linkemicp,emicp
108: add tpf$.output-stmt
109: include tpf$.emicp,.b$init,.emint
110: resolve all references using
111: local_defs,sys$lib$*emomrts.,lcn
112: set icp=true
113: delete all definitions except start$
114: @eof
115: @ .
116: @ . >>>>>>
117: @ . >>>>>> Completely release, deregister and delete the
118: @ . >>>>>> HVTIP library before recreating it.
119: @ . >>>>>> Also delete the VALTAB entry we are going to use.
120: @ . >>>>>> Note that this runstream is tailored for a
121: @ . >>>>>> system using shared files.
122: @ . >>>>>>
123: @qual,d shared#
124: @prt,fc qual*hvtiplib17.
The following screen shows an execution of the MIXED1 HVTIP transaction. User
input is bolded.
>MIXED1
1: @ .
2: @ . >>>>>>
3: @ . >>>>>> MIXED-MODE EXAMPLE 2:
4: @ . >>>>>>
5: @ . >>>>>> Use TIP file 87, HVTIP library # 17 with a
6: @ . >>>>>> filename of QUAL*HVTIPLIB17.
7: @ . >>>>>> The EM ICP will be Bank # 020.
8: @ . >>>>>> The BM ICP will be Bank # 021.
9: @ . >>>>>> EM subprogram ESUB will be Bank # 023.
10: @ . >>>>>> Use VALTAB 616 for the transaction, and
11: @ . >>>>>> name the transaction MIXED2.
12: @ . >>>>>> Use Application # 9.
13: @ . >>>>>> Have all print queued to print queue HOLDPR.
14: @ . >>>>>>
15: @ .
16: @asg,t source.
17: @asg,t rel.
18: @ucob,i source.eicp,rel.,,,no-options
19: IDENTIFICATION DIVISION.
20: PROGRAM-ID. EICP.
68: begin.
69: move 'NEW VALUE' to param.
70: add 1 to comm.
71: quit.
72: exit program.
73: @use tiplib,sys$lib$*acob-tiplib
74: @use cb,sys$lib$*acob.
75: @asg,t ctrl.
76: @elt,i ctrl.xfr$mnq
77: @elt,i ctrl.call$mnq
78: dummy$* equ 0 .
79: end
80: @eof
81: @use masm$pf,sys$lib$*link
82: @asg,a masm$pf
83: @masm,i source.hvcalls,rel.
84: $obj
85: $INCLUDE 'OM$DEF'
86: $INCLUDE 'HVTIP$CALLS'
87: $INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL'
88: hv$call 021,021,0 'BMICP' . Lib#=021, Bank#=021
89: $end
90: @eof
91: @add sys$lib$*urts.mixedmodeskl
92: files are source,source rel,rel
93: execution environment,mmhvtip ;
94: starting_mode,em ;
95: bm_language,acob ;
96: bm_initialbasing,BDR1,C$DML
97: .
98: . Ensure that the offset given BMSTACK below matches the
99: . Dbank address in the Collection of the Basic Mode ICP.
100: .
101: bmstack is lbdi,0400005 offset,040000 length,01000
102: intercept_elt eint contains entrypoint,BICP ;
103: needing translation,ucob2acob
104: entrypoint BICP needs calltype,hvtipcall ;
105: target_name,BMICP . Access via HVCALLS mechanism
106: intercept_elt bint contains entrypoint,ESUB ;
107: needing translation,acob2ucob
108: . We are not using the TARGET_NAME option for our basic mode to
109: . extended mode HVTIP CALLL. If we did use that option, we would have
110: . to link the EMSHELL/ESUB intercept OM (generated by MIXEDMODESKL)
111: . with the ESUB extended mode subprogram in order to preserve register
112: . X11. (The ACOB runtime code to the ER CALL$ requires that X11 be
113: . preserved across the CALL$ ER.) We would also have to define an
256: fb
257: off recovery
258: on schedule
259: on tiptrace
260: on sticking
261: fb
262: @eof
263: @prt,f qual*hvtiplib17.
264: @qual,r
265: @ . >>>>>> The transaction MIXED2 is ready to use.
The following screen shows an execution of the MIXED2 HVTIP transaction. User
input is bolded.
>MIXED2
The same extended mode ICP is used for the last four transactions. The basic mode
ICP for the first transaction is also called (or Transferred-to) from the mixed-mode
transactions. This shows that there is some flexibility available when you are laying-
out the functionality and flow of your transactions.
There are four separate runstreams for this example, roughly divided by function.
The second runstream (Example 6–32) compiles the ACOB programs needed for the
ACOB HVTIP absolutes and creates the ACOB HVTIP absolutes using the MAPHVTIP
runstream in the ACOB TIP library file, SYS$LIB$*ACOB-TIPLIB.
The third runstream (Example 6–33) compiles and links the UCOB HVTIP ZOOMs.
Several D-banks beyond the standard BDIs 5 and 6 are defined in the OUTPUT HVTIP2
link statements to show the greatly increased data capabilities of HVTIP-II. The source
for the PROC element MCBPKT/UCOB is not shown. It is a copy of the MCB COBOL
PROC element in SYS$LIB$*PROC$.MCBDEF-UCOB.
The fourth runstream (Example 6–34) installs the new HVTIP ZOOMs and absolutes in
the appropriate HVTIP library file. The HVTIP library is first completely released,
deregistered, and deleted in case it had been in use for something else (other tests).
The VALTAB entries supply bank limits for the mixed-mode and extended mode
transactions, and all print is queued to the HOLDPR print queue for all five
transactions.
1: @ .
2: @ . >>>>>> The SOLAR SGSs used to install product MTEST, which defines
3: @ . >>>>>> an Extended Mode fixed-gate subsystem and one Basic Mode
4: @ . >>>>>> AFCB. This product was installed earlier using SOLAR and
5: @ . >>>>>> this SOLAR$SGS element. Note that this runstream had to
6: @ . >>>>>> be executed first since it sets up the files needed by
7: @ . >>>>>> these SGSs.
8: @ .
9: @ELT,I SOLAR$SGS
10: . ******************************************************************
11: . * *
12: . * PRODUCT : MTEST Element Name : SOLAR$SGS *
13: . * *
14: . * FUNCTION : Provide product descriptor SGS's for SOLAR load. *
15: . * *
16: . * USED BY : SOLAR PRODLD *
17: . * *
18: . ******************************************************************
19: .
20: PRODUCT ;
21: NAME,MTEST ;
22: LEVEL,1R1 ;
23: MODE,A
24: .
25: DEFAULT_MODE A
26: .
27: FILE ;
28: MODE,A ;
29: SOURCE,JMH*AFCB2 ;
30: DEST,JMH*AFCB2 ;
31: ATTRIBUTES,PACK,PREP,FIXED_NAME
32: .
33: FILE ;
34: MODE,A ;
35: SOURCE,JMH*FGSS ;
36: DEST,JMH*FGSS ;
37: ATTRIBUTES,PACK,PREP,FIXED_NAME
38: .
39: .
40: SHARED_SUBSYSTEM ;
41: MODE,A ;
42: FILE,JMH*FGSS ;
43: FIXED_GATE,SSDEF$,0203370 . An FGSS SSDEF
44: .
45: AFCB ;
46: MODE,A ;
47: FILE,JMH*AFCB2 ;
48: BANK,0403372,AFCB2,AFCB2,D,W . An ACOB BM AFCB
49: @eof
50: @ .
51: @ . >>>>>> Create intercepts for mixed-mode operation using MIXEDMODESKL.
52: @ .
53: @ . >>>>>> - EMINT is an Extended Mode object module, and is used to
54: @ . >>>>>> interface from Extended Mode HVTIP ZOOMs to Basic Mode
55: @ . >>>>>> HVTIP ZOOMs and a Basic Mode AFCB.
56: @ . >>>>>> - EMINT2 is an Extended Mode object module used to access one
57: @ . >>>>>> entry point of an Extended Mode FGSS. Could have used an
58: @ . >>>>>> intercept generated by SSDP, but do it this way to
59: @ . >>>>>> show that it can be done this way for gated entry points.
60: @ . >>>>>> - BMINT is a Basic Mode relocatable, and interfaces
61: @ . >>>>>> from Basic Mode HVTIP ZOOMs to Extended Mode HVTIP ZOOMs
62: @ . >>>>>> and to an Extended Mode fixed-gate subsystem.
63: @ .
64: @add sys$lib$*urts.mixedmodeskl
65: execution environment,MMHVTIP ;
66: starting_mode,em ;
67: bm_language,acob ;
68: bm_initialbasing,utilityi,c$dml . Get C$DML on UI BDR
69: .
70: . Ensure that the offset given BMSTACK below matches the
71: . Dbank address in the Collection of the Basic Mode ICP.
72: .
73: bmstack is lbdi,0400005 offset,040000 length,01000
74:
75: intercept_elt EMINT contains ;
76: entrypoint,BMICP,BMSUB,BMSUB2,BMSUB2XFR,;
77: AFCB1,AFCB22,AFCB3 ;
78: needing translation,ucob2acob
79: entrypoint BMICP needs calltype,hvtipxfr ; . Note: HVTIPXFR
80: hvtarget_lb,021,013
81: entrypoint BMSUB needs calltype,hvtipcall ;
82: hvtarget_lb,021,014
83:
84: . BMSUB2 can be entered either by an HVTIP CALL or TRANSFER:
85:
86: entrypoint BMSUB2 needs calltype,hvtipcall ;
87: hvtarget_lb,021,015
88: entrypoint BMSUB2XFR needs calltype,hvtipxfr ;
89: hvtarget_lb,021,015
90: entrypoint AFCB1 needs calltype,normal ;
91: target_va,0203372001000 ;
92: dbank,acob
93: entrypoint AFCB22 needs calltype,normal ;
94: target_va,0203372001001 ;
95: dbank,acob
96: entrypoint AFCB3 needs calltype,normal ;
97: target_va,0203372001002 ;
98: dbank,acob
99: intercept_elt EMINT2 contains entrypoint,SSEP2_CALLER ;
100: needing translation,em2em . Q&D CBEP!
101: entrypoint SSEP2_CALLER needs calltype,normal ;
102: target_va,0203370001140 . Needs EM form!
103:
104: intercept_elt BMINT contains ;
105: entrypoint,SSEP1,SSEP2,MCBSUBA,MCBSUBX, ;
106: MCBSUBB,SSEP3,MCBSUBXCL ;
107: needing translation,acob2ucob
108: entrypoint SSEP1 needs calltype,normal ;
109: target_va,0403370001100 . BM form of SSEP1_CALLER
110: entrypoint SSEP2 needs calltype,normal ;
111: target_va,0403370001140 ; . BM form of SSEP2_CALLER
112:
113: parmcount,2 ;
114: param,1,TYPE,char,BYTESIZE,80 ;
115: param,2,TYPE,char,BYTESIZE,40
116: entrypoint SSEP3 needs calltype,normal ;
117: target_va,0403370001200 . BM form of SSEP3_CALLER
118:
119: entrypoint MCBSUBA needs calltype,hvtipcall ;
120: hvtarget_lb,021,012
121: entrypoint MCBSUBB needs calltype,hvtipcall ;
122: hvtarget_lb,021,016
123:
124: . Subprogram MCBSUBX also can be entered either by an
125: . HVTIP CALL or TRANSFER:
126:
127: entrypoint MCBSUBX needs calltype,hvtipxfr ;
128: hvtarget_lb,021,07 . Terminates MCB & TRANSFERs to BMSUB2
129: entrypoint MCBSUBXCL needs calltype,hvtipcall ;
130: hvtarget_lb,021,07 . Terminates MCB & does a STOP RUN
131:
132: @eof
133: @copy,rs bmint,jmh*acobtests2. . for MAP
134: @copy,rs bmstack,jmh*acobtests2. . for MAP
135: @copy,rs r$init,jmh*acobtests2. . for MAP
136: @copy,as emint,jmh*ucstst2. . for LINK
137: @copy,as emint2,jmh*ucstst2. . for LINK
138: @copy,as b$init,jmh*ucstst2. . for LINK
139: @pack,p jmh*ucstst2.
140: @ .
141: @ .
142: @ . >>>>>>> Now create the ACOB AFCB. There are 3 subprograms, a
143: @ . >>>>>>> MASM jump vector, and we use the BMINT intercept from
144: @ . >>>>>>> MIXEDMODESKL to access an Extended Mode Fixed Gate
145: @ . >>>>>>> subsystem.
146: @ .
147: @hdg make acob afcb with 3 subprograms: AFCB1, AFCB22, AFCB3
148: @acob,iv jmh*acobtests2.AFCB1
149: IDENTIFICATION DIVISION.
150: PROGRAM-ID. AFCB1
151: ENVIRONMENT DIVISION.
152: CONFIGURATION SECTION.
153: SOURCE-COMPUTER. UNIVAC-1100.
154: OBJECT-COMPUTER. UNIVAC-1100 memory 3 modules.
155: SPECIAL-NAMES.
156: PRINTER IS PRINTER.
157: DATA DIVISION.
158: working-storage section.
159: 01 oparm40 pic x(40).
160: 01 oparm80 pic x(80).
161: 01 p4 pic x(4).
162: 01 mydepth pic 9999 value zero.
163: LINKAGE SECTION.
164: 01 parm80 pic x(80).
165: PROCEDURE DIVISION using parm80.
166: begin.
167: compute mydepth = mydepth + 1.
168: display ' BM AFCB1 Entry # ' mydepth upon printer.
169:
170: * Call EM AFCB SSEP2 if EM called us.
171: * ('SSEP' will be at beginning of our parameter.)
172:
173: move parm80 to p4.
174: if p4 is not equal to 'SSEP' go to skip-em-call.
175: move 'AFCB1 calling you, Mr. EM AFCB!!' to oparm80.
176: move 'Arg#2 ' to oparm40.
177: call 'SSEP2' using oparm80 oparm40.
178: skip-em-call.
179: move 'AFCB1 got your message!!!!!' to parm80.
180: quit.
181: exit program.
182: @eof
183: @acob,iv jmh*acobtests2.AFCB22
184: IDENTIFICATION DIVISION.
185: PROGRAM-ID. AFCB22
186: ENVIRONMENT DIVISION.
187: CONFIGURATION SECTION.
1: @ .
2: @ . >>>>>> Now we compile the ACOB programs that make-up the ACOB
3: @ . >>>>>> HVTIP basic mode absolutes for our transactions.
4: @ . >>>>>> We also setup the XFR$MNQ and CALL$MNQ MASM elements
5: @ . >>>>>> that supply the HVTIP library # and bank # for the
6: @ . >>>>>> various entry points.
7: @ . >>>>>> Finally, we collect the HVTIP absolutes using the ACOB
8: @ . >>>>>> MAPHVTIP @add stream.
9: @ .
10: @ . Our ACOB HVTIP absolutes need the MIXEDMODESKL intercepts, and
11: @ . the ACOB AFCB subprogram dbanks for Mapping.....
12: @ .
13: @use tiplib,sys$lib$*acob-tiplib
14: @use cb,sys$lib$*acob. . Common-banked library
15: @asg,t ctrl,///9999
16: @elt,il ctrl.xfr$mnq
17: d$dummy2* EQU 0 .
18: bmsub2xfr* equ 0210015000000 . bank 015, TRANSFER (with CANCEL) EP
19: c$bbmsub2xfr* equ 0 .
20: END
21: @eof
22: @elt,il ctrl.call$mnq
23: d$dummy* EQU 0 .
24: .
25: BMSUB* EQU 0210014000000 . Lib# 021 (17), Bank# 014
26: C$BBMSUB* EQU 0 .
27: .
28: bmsub2* equ 0210015000000 . bank 015, CALL ep to use
29: c$bbmsub2* equ 0 .
30: END .
31: @eof
32: @acob,i jmh*acobtests2.bmicp
33: IDENTIFICATION DIVISION.
34: PROGRAM-ID. BMICP
35: ENVIRONMENT DIVISION.
84:
85: if tran3 is equal to 'JMH'
86: call 'SSEP3' using 0 'BM'.
87:
88: * Call a BM AFCB subprogram to show we can do it (if mixed-mode).
89: * Arg #1 is a print flag
90: * Arg #2 (Character*2) is a 'who called' indicator.
91:
92: if tran3 is equal to 'JMH'
93: call 'AFCB3' using 0 'BM'.
94:
95: move 'BMICP' to comwho.
96: move 'STOPIT' to stopit.
97: move 1 to terminate-mcb.
98:
99: call 'MCBSUBX'.
100: display '?!?!? EM subprog Returned to us ?!?!?'
101: upon printer.
102: STOP RUN.
103:
104: skip-restart-attempt.
105: display '*********!!NOW IN THE BASIC MODE ICP!!************'
106: upon printer.
107: display ' COMMON-FIELD-1 is: ' common-field-1
108: upon printer.
109: display ' COM80 is: ' com80 upon printer.
110: display ' COMWHO is: ' comwho upon printer.
111:
112: move zeroz to bmflag.
113: if tran3 is equal to 'JMH'
114: go to em-tag.
115: display 'This is a BM-only transaction' upon printer.
116:
117: move onez to bmflag.
118: go to bm-tag.
119:
120: em-tag.
121: display 'Calling R$INIT from BMICP:' upon printer.
122: call 'R$INIT'.
123: call 'SSEP3' using 1 'BM'.
124:
125: bm-tag.
126: call 'AFCB3' using 1 'BM'.
127:
128: move 'Calling from BMICP' to parm80.
129: call 'AFCB1' using parm80.
130:
1: @ .
2: @ . >>>>>>>>> This runstream creates the Extended Mode HVTIP
3: @ . >>>>>>>>> transactions. It does the compilations and the
4: @ . >>>>>>>>> static links.
5: @ .
6: @ . Transaction BMICP is a BM-only transaction. It does some calls
7: @ . to BM HVTIP absolutes and to BM AFCBs.
8: @ . Transaction JMHHVT is an EM-only transaction. It does a TRANSFER
9: @ . to an EM HVTIP ZOOM and some calls to EM Subsystems.
57: ******************************************************************
58: PROGRAM-ID. MCBICP INITIAL.
59: ENVIRONMENT DIVISION.
60: CONFIGURATION SECTION.
61: SOURCE-COMPUTER. UNISYS-2200.
62: SPECIAL-NAMES.
63: PRINTER IS PRINTER.
64: DATA DIVISION.
65: COMMON-STORAGE SECTION.
66: 01 COMMON-FIELD-1 PIC X(6).
67: 01 com80 pic x(80).
68: 01 comwho pic x(8).
69: 01 bmflag pic 9.
70: 01 restart pic x(7).
71: 01 stopit pic x(6).
72: 01 active-flag pic x(6).
73: 01 terminate-mcb pic 9.
74:
75: WORKING-STORAGE SECTION.
76: 01 no-prints pic 9.
77: COPY MCBPKT-UCOB.
78: PROCEDURE DIVISION.
79: ****************************************************
80: *** TRANSACTION INITIALIZATION ***
81: ****************************************************
82: START-UP-ICP.
83: *
84: * -Do not put any initial values on Blank Common so that we have
85: * a way of detecting a TIP RESTART. (Initial values on one small
86: * var in common may cause zeros to be put in the rest of common.)
87: * -If STOPIT was not 'STOPIT', we check the ACTIVE variable for
88: * having the value 'ACTIVE'. If it does, this is presumeably a
89: * TIP RESTART, and we set the RESTART value to 'RESTART'.
90: * -We open MCB, setup some more Common vars.
91: * -At this point, if it was NOT a RESTART, we try to ensure that
92: * a RESTART will occur next time by NOT printing anything and by
93: * doing very little. We at least call or transfer to the BM ICP,
94: * and it also will do very little before calling/transfering back
95: * to here after setting STOPIT to 'STOPIT'.
96: *
97: move 1 to no-prints.
98: display 'ACTIVE-FLAG: ' active-flag .
99: if active-flag is equal to 'ACTIVE'
100: move 'RESTART' to restart
101: move 0 to no-prints.
102:
103: move 'ACTIVE' to active-flag.
386: *
387: BEGIN.
388: compute mydepth = mydepth + 1.
389: DISPLAY 'EM MCBSUBB Entry # ' mydepth
390: UPON PRINTER.
391:
392:
393: if comwho is equal to 'MCBICP'
394: go to skipbm.
395: call 'AFCB22' using parm80.
396: move 'SSEP :MCBSUBB calling YOU!' to parm80.
397: call 'AFCB1' using parm80.
398: move 'ANTIDISESTABLISHMENTARIANISM' to parm80.
399:
400: skipbm.
401:
402: * If STOPIT is 'CALLxM', we are to get a chain of calls going.
403: * Our job is to call BMSUB2 (and it will NOT return.....)...
404:
405: move 'CALLxM' to callxm.
406: if stopit is not equal to 'CALLxM' go to retnow.
407: call 'BMSUB2'.
408: display 'BMSUB2 ..returned.. to MCBSUBB!!!' upon printer.
409: retnow.
410: move '''Message-Received''' to parm40.
411: display 'Returning from MCBSUBB now....' upon printer.
412:
413: EXIT PROGRAM.
414: @ . ***
415: @ . *** * SUBPROGRAM MCBSUBX ******
416: @ . *** COMPILE SUBPROGRAM "MCBSUBX"
417: @ . ***
418: @UCOB,I JMH*UCSTST2.MCBSUBX/callbm,.MCBSUBX/COMP,,,COMPAT,;
419: NO-OPTIONS,SUBPROGRAM
420: IDENTIFICATION DIVISION.
421: ******************************************************************
422: ******************************************************************
423: * *
424: * EXAMPLE OF A SUBPROGRAM "MCBSUBX" THAT WAS CALLED FROM THE ICP *
425: * "MCBICP" USING TRANSFER WITH CANCEL
426: * *
427: ******************************************************************
428: ******************************************************************
429: PROGRAM-ID. MCBSUBX.
430: ENVIRONMENT DIVISION.
431: CONFIGURATION SECTION.
432: SOURCE-COMPUTER. UNISYS-2200.
433: SPECIAL-NAMES.
434: PRINTER IS PRINTER.
435: DATA DIVISION.
436: COMMON-STORAGE SECTION.
437: 01 COMMON-FIELD-1 PIC X(6).
438: 01 com80 pic x(80).
439: 01 comwho pic x(8).
440: 01 bmflag pic 9.
441:
442: 01 restart pic x(7).
443: 01 stopit pic x(6).
444: 01 active-flag pic x(6).
445: 01 terminate-mcb pic 9.
446:
447: WORKING-STORAGE SECTION.
448: 01 parm80 pic x(80).
449: 01 parm40 pic x(40).
450: 01 mydepth pic 9999 value zero.
451: COPY MCBPKT-UCOB.
452: PROCEDURE DIVISION.
453: ****************************************************
454: *** MCBSUBX START UP ***
455: ****************************************************
456: START-UP-SUBX.
457: *
458: * BM may have called us to do a clean EM exit in order to
459: * preserve TIP RESTART. If so DON'T PRINT ANYTHING, or TIP
460: * RESTART is inhibited.
461: *
462: if stopit is equal to 'STOPIT' go to mcb-terminate.
463:
464: * If stopit is 'CALLxM', we are to get a long chain of calls
465: * goint, and MCBSUBX was entered by a CALL as vs. a TRANSFER.
466: *
467:
468: compute mydepth = mydepth + 1.
469: display ' MCBSUBX Entry # ' mydepth upon printer.
470: if stopit is equal to 'CALLxM'
471: go to skip-transferprint.
472:
473: display ' ****************' upon printer.
474: display 'MCBSUBX, was TRANSFERred-to from: ' comwho
475: upon printer.
476: display ' ****************' upon printer.
477: skip-transferprint.
478:
479: * Can't call BM AFCB if BMICP was never entered:
527: skip-stopit.
528: * No Mixed-Mode if Tran code is JMHHVT:
529: if common-field-1 is equal to 'JMHHVT'
530: go to skip-bm-call.
531: display 'Now doing a *TRANSFER* (with CANCEL) to BMSUB2:'
532: upon printer.
533: call 'BMSUB2XFR'.
534: skip-bm-call.
535: display 'MCBSUBX doing a STOP RUN now....' upon printer.
536: STOP RUN.
537: ****************************************************
538: *** MCB ERROR HANDLING ***
539: ****************************************************
540: ERROR-EXIT.
541: DISPLAY '********* MCB ERROR *********' UPON PRINTER.
542: DISPLAY 'ERROR STATUS BIT = ' P-STATBIT UPON PRINTER.
543: DISPLAY 'ERROR CODE = ' P-ERRCODE UPON PRINTER.
544: DISPLAY 'ERROR CODE Q3 = ' P-ERRCODEQ3 UPON PRINTER.
545: DISPLAY 'ERROR CODE Q4 = ' P-ERRCODEQ4 UPON PRINTER.
546: MOVE 0 to P-ID.
547: MOVE P-TERM TO P-FUNC.
548: CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
549: STOP RUN.
550: @ . ***
551: @ . *** THE ICP AND SUBPROGRAMS ARE LINKED SEPARATELY CREATING
552: @ . *** HVTIP ZOOMS.
553: @ . ***
554: @ . *** SINCE MCB IS BEING USED IN THIS EXAMPLE, IDENTIFYING
555: @ . *** THE CORRECT APPLICATION GROUP SEARCH CHAIN WILL
556: @ . *** LOCATE THAT APPLICATION GROUP'S MCB.
557: @ . ***
558: @ . *** @USE LINK$PF.,SYS$LIB$*APP$n.
559: @ . ***
560: @ . *** WHERE "n" IS REPLACED WITH THE APPLICATION GROUP NUMBER
561: @ . ***
562: @ . *** IDENTIFY THE APPLICATION GROUP SEARCH CHAIN
563: @ . ***
564: @USE LINK$PF,SYS$LIB$*APP$9.
565: @ . ***
566: @ . *** CREATE SYMBOLIC ELEMENTS TO HOLD THE "OUTPUT" STATEMENT
567: @ . *** AND THE "SET LOWADR" STATEMENTS FOR BLANK COMMON THAT EACH
568: @ . *** OF THE STATIC LINKS WILL NEED:
569: @ . ***
570: @ELT,I JMH*UCSTST2.OUTPUTSTMT
571: . Setup an HVTIP2 heap environment consisting of:
572: . Program-level banks:
573: . Basic Mode heap, BDI 05
621: .
622: . Have the HVTIP$$DBANK limits match the small bank limits too:
623: .
624: set lowadr = 060000 for HVTIP$$DBANK
625: set size = 0520000 for HVTIP$$DBANK
626:
627: @ELT,I JMH*UCSTST2.COMMON
628: . Ensure EM alignment and size match BM for Blank Common:
629:
630: CONCEAL MESSAGES 613
631: SET ALIGNMENT = 0 FOR $BLANK$COMMON$
632: SET SIZE = SIZE - 1 FOR $BLANK$COMMON$
633:
634: . Offset for next statement is obtained by examining the
635: . MAP listing of the collection of BICP. The offset should
636: . be set to the BICP DBANK starting offset plus the offset
637: . of Blank Common (BLANK$COMMON in Basic Mode) in its RSEG:
638:
639: SET LOWADR=0400005041000 FOR $BLANK$COMMON$
640:
641: @EOF
642: @ . ***
643: @ . ***
644: @ . *** *** MCBICP LINK ********
645: @ . *** LINK THE ICP "MCBICP" INCLUDING THE HVCALLS ELEMENT
646: @ . *** "HVCALLSDEF/MCBSUBXSUBA"
647: @ . ***
648: @link,ie JMH*UCSTST2.JMHICP
649: ADD JMH*UCSTST2.OUTPUTSTMT
650: INCLUDE JMH*UCSTST2.MCBICP/callbm
651: INCLUDE JMH*UCSTST2.HVCALLSDEF/callbm
652: INCLUDE tpf$.emint,.b$init . Intercepts to get to BM
653: INCLUDE jmh*ucstst2.ssint1/nodb . To get to EM subsystem
654: RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LCN
655: ADD JMH*UCSTST2.COMMON
656: SET ZEROFILL = NONE FOR ALL BANKS
657: DELETE ALL DEFINITIONS EXCEPT START$
658: @EOF
659: @ . ***
660: @ . *** *** MCBSUBA LINK ********
661: @ . *** LINK THE SUBPROGRAM "MCBSUBA" INCLUDING THE JUMP VECTOR ELT
662: @ . *** "JUMPVECTOR/MCBSUBA"
663: @ . ***
664: @link,ie JMH*UCSTST2.MCBSUBA/link,.mcbsuba
665: ADD JMH*UCSTST2.OUTPUTSTMT
666: INCLUDE JMH*UCSTST2.MCBSUBA/COMP
667: INCLUDE JMH*UCSTST2.JUMPVECTOR/MCBSUBA
668: .
669: . EMINT is an intercept to get to BM HVTIP absolute BMSUB.
670: . SSINT1/DB is an FLSS intercept to get to EM subsystem
671: . entry points SSEP1, SSEP2, SSEP3.
672: . EMINT2 is an intercept to get to the EM subsystem gated
673: . entry points of SSEP1_CALLER and SSEP2_CALLER.
674: .
675: INCLUDE tpf$.emint
676: include jmh*ucstst2.ssint1/db
677: include tpf$.emint2
678: RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LCN
679: ADD JMH*UCSTST2.COMMON
680: SET LOWADR = 0400007115000 FOR HVTIP$$DSEG
681: SET ZEROFILL = NONE FOR ALL BANKS
682: DELETE ALL DEFINITIONS EXCEPT JUMPER
683: @EOF
684: @ . ***
685: @ . *** *** MCBSUBB LINK ********
686: @ . *** LINK THE SUBPROGRAM "MCBSUBB"
687: @ . ***
688: @link,ie JMH*UCSTST2.MCBSUBB/link,.mcbsubb
689: ADD JMH*UCSTST2.OUTPUTSTMT
690: INCLUDE JMH*UCSTST2.MCBSUBB/COMP
691: INCLUDE tpf$.emint
692: include jmh*ucstst2.ssint1/db
693: include tpf$.emint2
694: RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LCN
695: ADD JMH*UCSTST2.COMMON
696: SET LOWADR = 0400007120000 FOR HVTIP$$DSEG
697: SET ZEROFILL = NONE FOR ALL BANKS
698: DELETE ALL DEFINITIONS EXCEPT MCBSUBB
699: @EOF
700: @ . ***
701: @ . ***
702: @ . *** *** MCBSUBX LINK ********
703: @ . *** LINK THE SUBPROGRAM "MCBSUBX"
704: @ . ***
705: @link,ie JMH*UCSTST2.MCBSUBX/link,.mcbsubx
706: ADD JMH*UCSTST2.OUTPUTSTMT
707: INCLUDE JMH*UCSTST2.MCBSUBX/COMP
708: include tpf$.emint . FOR BMSUB2XFR
709: include jmh*ucstst2.ssint1/nodb
710: RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LCN
711: ADD JMH*UCSTST2.COMMON
712: SET LOWADR = 0400006170000 FOR HVTIP$$DSEG
713: SET ZEROFILL = NONE FOR ALL BANKS
714: DELETE ALL DEFINITIONS EXCEPT MCBSUBX
715: @EOF
716: @ .
717: @ . *** EXAMPLE SETUP IS COMPLETE
1: @ .
2: @ . >>>>>> First, completely release, deregister, and delete the
3: @ . >>>>>> HVTIP library before recreating it, since it is used
4: @ . >>>>>> for testing other transactions.
5: @ . >>>>>> Also delete the VALTAB entries we are going to use
6: @ . >>>>>> before recreating them with new contents.
7: @ . >>>>>> Note that this runstream is tailored for a system
8: @ . >>>>>> using shared files.
9: @ .
10: @qual,d shared#
11: @prt,fc qual*HVTIPLIB17.
12: @use tip$,std#tip$*tiprun$.
13: @xqt,icx TIP$.tpur
14: STATUS,K 17
15: UNLOAD,K 17
16: @EOF
17: @ .
18: @xqt,iux tip$.freips
19: rel 87
20: dreg qual*hvtiplib17.
21: @eof
22: @ .
23: @EOF
24: @ . RELEASE TIP FILE 87 (HVTIP LIB # 17)
25: @ .
26: @delete,c qual*HVTIPLIB17.
27: @ .
28: @ . Delete possible old VALTAB entries from previous testing.
29: @ . Since this is a test runstream and re-uses old VALTABs,
30: @ . we must delete all variations that we know about.
31: @ .
32: @xqt,ixmuz tip$.vtbutl
33: *valchg m
34: 615 ACT,JMHHVT DELETE
35: 616 ACT,JMHEP1 DELETE
36: 617 ACT,JMHEP2 DELETE
37: 618 ACT,JMHEP3 DELETE
38: 619 ACT,BMICP DELETE
39: @eof
183: @ . ***
184: @ . *** BRING AN HVTIP LIBRARY THAT IS INITIALIZED AND CONTAINS
185: @ . *** AT LEAST ONE PROGRAM BANK ONLINE SO TRANSACTIONS CAN BE
186: @ . *** EXECUTED FROM THIS HVTIP LIBRARY.
187: @ . ***
188: @prt,fc qual*hvtiplib17.
189: @XQT,P tip$.BOXER
190: ON RECOVERY
191: OFF SCHEDULE
192: @use tst,std#jmh*ucstst2.
193: @asg,a tst
194: @use acob,std#jmh*acobtests2.
195: @asg,a acob
196: @ . ***
197: @XQT,IMUX tip$.TPUR
198: CREATE,K 17,30
199: COPY,IVK 17,6,TST.JMHICP
200: COPY,IK 17,7,TST.MCBSUBX
201: COPY,IK 17,012,TST.MCBSUBA
202: COPY,IK 17,016,TST.MCBSUBB
203: COPY,IVK 17,013,acob.bmicp
204: COPY,IK 17,014,acob.bmsub
205: COPY,IK 17,015,acob.bmsub2
206: LIST 17
207: LOAD,K 17
208: STATUS,K 17
209: @EOF
210: @ . ***
211: @XQT,P tip$.BOXER
212: FB
213: OFF RECOVERY
214: ON SCHEDULE
215: ON TIPTRACE
216: ON STICKING
217: FB
218: @EOF
219: @prt,fc qual*hvtiplib17.
220: @free qual*hvtiplib17.
221: @qual,r
222: @ . ***
223: @ . ***
The following screen shows an execution of the basic mode BMICP transaction. User
input is bolded.
>BMICP
This produces the following output on the HOLDPR print queue. Note that the lines
have been numbered here for ease of reference:
The following screen shows an execution of the extended mode JMHHVT transaction.
User input is bolded.
>JMHHVT
This produces the following output on the HOLDPR print queue. Note that the lines
have been numbered here for ease of reference, and blank lines have been removed:
>JMHEP1
This produces the following output on the HOLDPR print queue. Note that the lines
have been numbered here for ease of reference, and that blank lines have been
removed:
>JMHEP2
>JMHEP2
This produces the following output on the HOLDPR print queue. Note that the lines
have been numbered here for ease of reference, and that blank lines have been
removed:
1: THIS IS MCBICP
2: This was also a TIP RESTART!!!!!!
3: EMICP, MCB initialized.
4: Transaction code was JMHEP2
5: EM SSEP1 Entry # 1
6: EM MCBSUBA Entry Point MCBEP2: Entry # 001
7: EM SSEP1 Entry # 2
8: RETURNING from MCBSUBA, MCBEP2
9: MCBICP calling B$INIT
10: MCBICP now calling BMICP
11: *********!!NOW IN THE BASIC MODE ICP!!************
12: COMMON-FIELD-1 is: JMHEP2
13: COM80 is: A message from the EM ICP!
14: COMWHO is: MCBICP
15: Calling R$INIT from BMICP:
16: Calling EM SSEP3 from EM SSEP3_CALLER:
17: In SSEP3 EM FGSS subroutine. Entry # 1 WHO arg is: BM
18: In BM AFCB3: Entry # 0001 PARAM = BM
19: BM AFCB1 Entry # 0001
20: Calling BMSUB
21: In BMSUB: Entry # 0001 PARAM = CALL1
22: EM MCBSUBB Entry # 0001
23: BM AFCB22 Entry # 0001
24: BM AFCB1 Entry # 0002
25: Calling EM SSEP2 from EM SSEP2_CALLER:
26: EM SSEP2 Entry # 1
27: Returning from MCBSUBB now....
>JMHEP3
This produces the following output on the HOLDPR print queue. Note that the lines
have been numbered here for ease of reference, and that blank lines have been
removed:
You may want to use a transfer-with-cancel statement when the ICP is using the
multiple INITAL feature.
Explanation
1. The first time the ICP is called, it initializes with TIP, which opens a step. Next, an
IMPART to a DMS 2200 database occurs followed by the first input message being
processed. This processing may include calls to several subprograms.
2. A call to subprogram SUB. During this processing the DMS 2200 database is
accessed and possibly updated. After processing, the database updates are
committed and the active step is closed. This is done with the FREE WITH
MESSAGE TERMINATE command in this example.
3. The ICP calls the subprogram MYCANCELLER, which calls the alternate entry point
in the ICP using an HVTIP transfer-with-cancel function. This alternate entry point
is named CANCELALL. The code at CANCELALL directs the execution flow to the
top of the multiple INITAL loop. Then, if any messages are waiting, a new step is
opened and the next message is read and processed.
$OBJ
$ASCII
$EXTEND
$INCLUDE 'MAXR$'
$INCLUDE 'OM$DEF'
$INCLUDE 'HVTIP$CALLS'
OM$USE_LV,0
$(1) $BANK HV$CODE_EMB,01000
JUMPER*
HV$VECTOR START$
HV$VECTOR CANCELALL
$END
An HVTIP ZOOM has by definition only one code bank. All code that is brought into
the static link of the ZOOM, whether by INCLUDE statements or from RESOLVE
statements, is merged together into one extended mode code bank. Also in this code
bank is the template information to initialize the local data and COMMON blocks for
the ZOOM, which are defined as segments in the ZOOM. (HVTIP$$DSEG is the
segment name used for the merged-up bank holding all local data.)
The default generated code from UCS compilations can be merged up to the 262K
architectural limit for code banks. (However, if you use the older EXTENDED/0,
EXTENDED/2, or EXTENDED/4 keyword options, then the code cannot be merged past
65K unless you also use the SEGCODE option.) Code brought into your static links
from the URTS run-time library can generally be loaded at greater than 65K addresses
also. There might be MASM object modules from other products that cannot be
merged at greater than 65K addresses. The static linker will normally automatically
merge banks that cannot be loaded at greater than 65K addresses at less than 65K
addresses so that truncation errors do not occur. You can also control the order of
bank merging to some extent by use of the MERGE_ORDER attributes of HI and LO.
See the discussion on Merging Banks (MERGE) in the Linking System Programming
Reference Manual.
For each database interface, there are requirements that are unique to the HVTIP
environment. The following subsections discuss these requirements.
Note: Using TIP file control eliminates much Exec input/output overhead and
eliminates the need for file assignments. Therefore, it is recommended that DMS
2200 databases that will be accessed by HVTIP transactions be set up using TIP
schema, subschema, and storage area files. This requires setting up a TIP file for
each underlying Exec file.
Schema File
If the schema file is a TIP file, the Data Definition Language (DDL) syntax must identify
the schema as residing in a TIP file. This is accomplished by using the following clause
in the SCHEMA NAME statement:
IN TIP FILE uds-tip-file-code
For more information on coding a DMS 2200 schema that uses TIP areas, refer to the
DMS DDL Administration, Operations, and Programming Guide.
Furthermore, the area code for each area definition in the schema must be the same
as the UDS-TIP file number of the TIP file for that area.
For more information on setting up TIP files that will hold DMS 2200 storage areas,
refer to the Repository for ClearPath OS 2200 Administration Guide.
Subschema File
If the subschema file is a TIP file, the Subschema Data Definition Language (SDDL)
syntax must identify the subschema as residing in a TIP file. This is accomplished by
using the following clause in the SUBSCHEMA NAME statement:
IN TIP FILE uds-tip-file-code
For more information on coding a DMS 2200 subschema that uses TIP areas, refer to
the DMS SDDL Administration, Operations, and Programming Guide.
When the schema or subschema is to be accessed by more than one subprogram, this
option should be used to facilitate placing S$WORK in common storage. The
programs can be HVTIP, although this is not required. HVTIP programs that will not
use multiple subprograms to access a schema or subschema are not required to use
the C option.
For example, the following statement generates the UCS COBOL subschema
PERSONSUB so that it can be used by HVTIP transactions:
@UDS$$SVN*DMRMT$.SDDL,CDN
QUAL*UCSTST.PERSONSUB,UDS$$SVN*SCHFILE.PERSONSUB
2. The INVOKE clause may optionally include the following clause for UCS FORTRAN:
ENVIRONMENT = HVTIP
For more information about using the DMS 2200 data manipulation language in HVTIP
transactions, refer to one of the following, depending on whether you are using UCS
COBOL or UCS FORTRAN:
• DMS CDML Operations and Programming Reference Manual
• DMS FDML Operations and Programming Reference Manual
For example, in the following command, S$PERSONSUB_$A is the common block bank
name for the definer common block created by the SDDL processor because of the C
option on the @SDDL processor call:
INDEX COMMON BANKS $BLANK$COMMON$, S$PERSONSUB_$A
You can find the name of the subschema common block bank by looking for this bank
in an @LINK,S listing.
When static linking a UDS DMS HVTIP transaction program where the subschema was
produced as a common block bank (the “C” option was used on the SDDL processor
call), the following warning will occur:
*WARNING (LINK 647)* Sizes vary for common block S$subschema-name
This warning can be ignored. It occurs because the UCS compilers are not aware of
the size of the subschema common block bank; therefore, they create a one-word
bank. During static linking, the Linking System detects that the size assigned by the
UCS compilers does not match the actual size of the common block bank. The Linking
Systems then issues the warning message.
Note: Using TIP file control eliminates much Exec input/output overhead.
Therefore, it is recommended that RDMS 2200 databases that will be accessed by
HVTIP transactions be set up using TIP storage areas. This requires setting up a
TIP file for each underlying Exec file.
When you later define the storage areas using UREP, the UDS-TIP-CODE must match
the UDS/TIP file number.
For more information on setting up TIP files that will hold RDMS 2200 storage areas,
refer to the Repository for ClearPath OS 2200 Administration Guide.
− UCS FORTRAN
CALL RSA$INIT [(work-area-size)]
− UCS C
rsa_init [(work-area-size)]
− UCS FORTRAN
INTEGER
− UCS C
int
The default work area provides an initial allocation of 14,000 words. The system
acquires more space dynamically, as needed. The overhead incurred by obtaining
additional space is expensive. Therefore, for HVTIP transactions, you should
determine the amount of space required by the transaction sequence and set
work-area-size accordingly.
For details about how to determine the size of the work area, refer to 3.5.1.
• The following commands are local to the compilation unit; therefore, they must be
coded in each program module that requires their functioning:
− SET STATISTICS
− USE DEFAULT
− WHENEVER
− Cursor declarations (DECLARE CURSOR and ALLOCATE CURSOR) must appear
in the source listing prior to any static embedded SQL reference to the cursor.
• The following commands may produce unpredictable results if they span
compilation units; this is because they require carry-over information in the RDMS
2200 data bank area between calls. The listed precautions will help avoid
problems:
− GETERROR
The GETERROR command must be in all program modules that meet both of
the following conditions:
ο Contain RDMS 2200 commands that can receive errors
ο Must use the GETERROR command for handling error messages
− GET DESCRIPTION
The GET DESCRIPTION command and its corresponding DECLARE CURSOR
command must be in the same program module.
− FETCH NEXT
The performance shortcut used by the FETCH NEXT command occurs only
when the FETCH command to which it refers is in the same program module.
If the FETCH command to which it refers is not in the same program module,
the FETCH NEXT command still works, but does not take the shortcut.
− DEBUG
The DEBUG command must be in the program module in which debugging is
to occur.
For more information on using SQL in HVTIP transactions, refer to the RDMS SQL
Programming Reference Manual.
Note: Using TIP file control eliminates much Exec input/output overhead and
eliminates the need for file assignments. Therefore, it is recommended that SFS
2200 databases that will be accessed by HVTIP transactions be set up using TIP
storage areas. This requires setting up a TIP file for each underlying Exec file.
When you later define the storage areas using UREP, the UDS-TIP-CODE must match
the UDS/TIP file number.
Also, the underlying Exec files must use the qualifier TIP$SFS. If the QUALIFIER
attribute is used in the storage area definition, it must also have the value TIP$SFS.
For more information on setting up TIP files that are to hold SFS 2200 storage areas,
refer to the following documents:
• Repository for ClearPath OS 2200 Administration Guide
• SFS Administration and Support Reference Manual.
This type of program requires use of BEGIN THREAD and END THREAD commands, no
matter which of the data models are used. The other UDS commands (for example,
the DMS 2200 IMPART and DEPART commands and the SFS 2200 OPEN and CLOSE
commands) must follow the BEGIN THREAD command and precede the END THREAD
command. Specifying the BEGIN THREAD and END THREAD commands is known as
using explicit thread control. Programs that access multiple database models require
explicit thread control.
This command results in the uninitialized data areas of your program not being
cleared to zeros when they are loaded, which helps run-time efficiency
considerably. This is especially true for the ICP and for programs that have large
arrays or COMMON blocks.
The default ZEROFILL status for object modules produced by UCS compilations is
− LOAD for local data under $0. The HVTIP$$DSEG segment is always given a
default ZEROFILL status of LOAD, which means that uninitialized local data
areas for HVTIP-II programs are cleared to zeros as a default.
− NONE for COMMON blocks. COMMON block segments always have a default
ZEROFILL status of NONE, which means that uninitialized areas of COMMON
blocks in HVTIP-II programs default to not being cleared to zeros.
Uninitialized user data areas in HVTIP-II programs that are not cleared to zeros are
subject to unknown initial contents in the following situations:
− When a data area released by COBOL CANCEL OR TRANSFER-WITH-CANCEL
is reused by the URTS loader when loading data for an HVTIP-II ZOOM.
− When a TIP RESTART occurs on an HVTIP execution, the contents of the
HVTIP heap banks cannot be assumed to be zeros.
If you wish uninitialized data areas of your programs to be cleared to zeros when
they are loaded, use the following statement in your HVTIP-II static links:
SET ZEROFILL = LOAD FOR ALL COMMON_BLOCK BANKS
This results in the ZEROFILL status for the HVTIP$DBANK “heap” bank of the
HVTIP ICP also having a value of LOAD, which can hurt performance. On a TIP
RESTART, this means that the HVTIP$$DBANK ’heap’ bank and all other heap
banks that are dynamically acquired by the URTS loader will be cleared to zeros by
the loader. This could cost over a hundred thousand CPU cycles per heap bank. It
is usually faster to clear uninitialized areas on a segment basis as needed instead
of clearing whole heap banks up front when they are acquired.
For more information about how to code UCS programs for performance, refer to the
programming reference manual for the appropriate UCS language (for UCS COBOL,
UCS FORTRAN, and UCS C, this information is in Volume 2).
Note: Since the HVTIP-II ZOOM also has the potential to operate in a multiple data
heap environment under user control, conserving data heap space in the HVTIP-II
environment is not as critical as in the original UCS HVTIP environment.
For HVTIP transaction sequences that use memory efficiently, follow these
suggestions during coding:
• Use the COBOL INITIAL clause
Code all UCS COBOL HVTIP transaction programs using the INITIAL clause. The
INITIAL clause causes all storage defined in the Working-Storage Section to be
allocated as automatic storage. This storage is located on the activity-local stack
(ALS). When the EXIT PROGRAM statement is executed, this storage is released.
Because this storage is allocated on the ALS and not in the HVTIP heap data bank,
the size of the HVTIP heap data bank is decreased.
Refer to “Using the COBOL INITIAL Clause” for more information about using the
INITIAL clause.
• Use the UCS COBOL CANCEL statement
Whenever possible, cancel a UCS COBOL subprogram after it returns to its calling
program. The CANCEL statement causes the release of all local storage belonging
to the canceled subprogram. Release of this storage can be critical to a memory-
tight HVTIP transaction sequence. Consider using HVTIP-II (OUTPUT HVTIP2),
which greatly increases the amount of local storage that is available.
• When coding UCS COBOL programs
− Use the inline PERFORM statement for loops.
− Define all parameters to be passed as 01 level data items and use the
COMPAT/ARGUMENTS compiler keyword option when compiling these
programs.
− Use the SQRT intrinsic function instead of n**.5 to figure square roots.
• When coding UCS C programs
− Use the alternate calling sequence (ACS) instead of the standard calling
sequence (SCS) when C programs call C functions. This can be done by using
the ALT-CALL compiler keyword option for a global effect or by using the
“#pragma alternate function-name” statement for a specific function call.
− Use the “#pragma expand” and the #pragma inline function-name” statements
to expand function calls inline. This will have the greatest effect if:
ο The function is small.
ο The function executes for a short period of time.
ο The function call is in a loop.
• When executing a HVTIP transaction program, an error will occur if the program
exceeds the maximum size of the heap data bank (HVTIP$$DBANK). This bank has
a maximum size of octal 720K words (decimal 237K words) because of its starting
address of 060000. Exceeding this bank’s limits can be avoided by managing the
space used within it. A default size of 010000 words is allotted to this bank for
use by the UCS Runtime System, PCIOS file handling, basic mode SORT
processing, DPS 2200, and RDMS 2200.
If the heap data bank space is tight, you should consider
− Closing PCIOS files when you are finished using them. This releases the space
that they were using.
− Use the "CALL RSA$INIT” routine to initially allocate all RDMS space so that it
is allocated as contiguous space.
− Use the HVTIP-II feature. HVTIP-II allows you to define as many heap banks as
you may need for your program’s data storage. This also means that you may
be able to remove CANCEL statements that you may currently be using to
help conserve storage. HVTIP-II programs are HVTIP programs that are linked
using an OUTPUT HVTIP2 statement and where special HVTIP-II VALTAB
entries are used for the ICP.
For more information about these keyword options and other ways to compile UCS
programs for performance, refer to the programming reference manual for the
appropriate UCS language.
The SET SIZE + 0nnnnn FOR URTS$TABLES statement is not valid for HVTIP or HVTIP2
links. In a non-HVTIP FAST LOAD static link, the URTS$TABLES bank segment is
merged last and the URTS heap area is defined by the size of the URTS$TABLES bank
segment. The URTS heap area can then be expanded dynamically to the end of the
bank if more space is needed. Increasing the size of URTS$TABLES during the link will
then increase the size of the static URTS heap area and reduce or eliminate the need
for dynamic bank expansion. In the non-HVTIP case, URTS can redefine the end of the
URTS heap area by determining the upper limit of the bank.
In the HVTIP or HVTIP2 link, the Linking System does not honor the request to merge
the URTS$TABLES bank last, because the HVTIP data heap area is much different than
the standard URTS heap area. Since the URTS$TABLES bank segment is not merged
last, URTS has no dynamic mechanism available to determine the end of the
URTS$TABLES data segment. The URTS heap area is defined by the size of the
URTS$TABLES data segment at assembly time. When that space is not sufficient, the
URTS heap manager must call the HVTIP heap manager to acquire additional space.
The HVTIP heap manager will then dynamically expand the heap bank as needed. In
the HVTIP or HVTIP2 case, you must adjust the size of the HVTIP heap bank
(HVTIP$$DBANK) to prevent dynamic bank expansions. You do not adjust the size of
the URTS$TABLES bank-part.
Space for the malloc function comes from the main BDI 5 program-level D-bank
HVTIP$$DBANK in an HVTIP transaction where the ICP uses the OUTPUT HVTIP
statement. The space comes from activity-level "pooled" banks in a transaction where
the ICP uses the OUTPUT HVTIP2 statement. So, if your SQL HVTIP program is losing
its TIP sticking and restart, you must address these two cases differently.
Considering the large memories current machines have, you should always set the
size of your HVTIP$$DBANK bank to its maximum possible size in your static link. The
default size given to the HVTIP$$DBANK bank in the static link of the ICP is only large
enough to handle the data segments (HVTIP$$DSEG and COMMON blocks) defined by
the ICP. This size is generally not sufficient to handle other HVTIP segments or run-
time space allocation needs. (If it is not sufficient, the run-time system expands the
size of HVTIP$$DBANK by a MODIFY$BANK call, and TIP sticking and restart are lost
for the transaction.)
The maximum HVTIP$$DBANK size is determined by the starting offset it has (look in
a test static link listing to find this) and the last offset it can have. This last offset is
either 0777777 (the maximum offset a small bank can have) or might be dictated by
the requirements of some basic mode products your program uses, such as DPS or
MCB. You subtract the last desired offset from the starting offset, add 1, and then
supply this size to a SET SIZE statement in your HVTIP link, as shown below. (Put this
statement after your OUTPUT HVTIP or OUTPUT HVTIP2 statement.)
This statement should be sufficient to regain your TIP sticking and restart for HVTIP
programs where OUTPUT HVTIP is used in the static link of the ICP.
Note: Do not confuse the HVTIP$$DBANK bank in the static link listing with the
URTS$TABLES bank part or the HVTIP$$DSEG segment in the listing. In an HVTIP
ICP static link, URTS$TABLES is only a subportion of the HVTIP$$DSEG segment
that is dynamically loaded at execution time into an HVTIP heap bank. The
HVTIP$$DBANK D-bank is the main heap bank for an HVTIP program.
For OUTPUT HVTIP2 programs, you need to supply one or more activity-level "pooled"
banks to the transaction since malloc space comes from those banks on HVTIP2
programs. You must supply the "pooled" clauses in your OUTPUT HVTIP2 statement
and also must ensure that the banks are there at execution time with DSACTCNT or
DLACTCNT VALTAB clauses supplied to the VTBUTL processor. See 6.5, "HVTIP-II
Environment Details" for details on OUTPUT HVTIP2. Note that for OUTPUT HVTIP2
programs, you should also maximize the size of your BDI 5 HVTIP$$DBANK bank since
that bank is used extensively for other allocations and can be expanded if it isn't big
enough.
However, you can get a more exact size to set for HVTIP$$DBANK if you want to go
to the trouble to do it. During static linking of the initial control program, you should
set the size for HVTIP$$DBANK to reflect the default size, plus the size obtained by
calling the DPS 2200 HELPER processor.
Example 6–40 shows the HELPER output for the DPS 2200 software in file APP3*DPS,
used in examples in this section. Noteworthy lines are bolded.
@APP3*DPS.HELPER
HELPER R1A APP3-DPS DPS Helper Utility Processor 1997 Jun 26 Thu 1450:31
RES 2102,478400,28,$$TERMFILE$$,EXECFILE,NREC,AUDIT=0
THE SIZE OF THE TERMINAL FILE MUST BE 7475 TRACKS
RES 2105,200,112,$$PASSFILE$$,EXECFILE,NREC,AUDIT=0
THE SIZE OF THE PASSWORD FILE MUST BE 13 TRACKS
RES 2103,5001,2016,$$PAGEFILE$$,EXECFILE,NREC,AUDIT=0
THE SIZE OF THE PAGING FILE MUST BE 5627 TRACKS
RES 2108,126000,28,ALT$SCRNFILE,ALT$SCRNFILE,NREC,AUDIT=0
THE SIZE OF THIS FORM LIBRARY MUST BE 1969 TRACKS
RES 2109,126000,28,FORMS,FORMS,NREC,AUDIT=0
THE SIZE OF THIS FORM LIBRARY MUST BE 1969 TRACKS
DPS MEMORY USAGE REQUIREMENTS
1. In the DPS HELPER output, locate the information with the following title:
UCS/INTERFACE data bank size requirements:
2. Below this are four lines of output. The third and fourth lines apply to static
linking:
• If D$DEF routines are used in the program, refer to the fourth line.
• Otherwise, refer to the third line.
3. Take the size shown on the appropriate line and use it in a static linking SET SIZE
command for the initial control program, as follows:
SET SIZE = SIZE + dps-helper-size FOR HVTIP$$DBANK
For this example, assuming that the HVTIP transaction sequence does not use D$DEF
routines, use the following command in the static link of the initial control program:
SET SIZE = SIZE + 10048 FOR HVTIP$$DBANK
Note: The SET SIZE command must follow the RESOLVE command. If your DPS
HVTIP program fails due to insufficient memory, consider using OUTPUT HVTIP2 in
the ICP static file. The HVTIP-II environment allows for more than one D-bank to
get space from. See 6.5, "The HVTIP-II Environment Details", for more information.
In a very simple case, the transaction sequence can consist of an initial control
program and one subprogram, as follows:
• When the HVTIP transaction code is entered, followed by good data, the initial
control program is executed.
• The initial control program, in turn, calls the subprogram.
• The subprogram completes its processing and returns to the initial control
program.
• The initial control program sends output back to the terminal.
• Processing terminates.
This first transaction execution uses the entire transaction sequence, and is illustrated
by the following figure.
A second execution, in which bad data is input, uses only the initial control program.
The subprogram is not called. The initial control program
• Detects the incorrect data
• Sends an error message to the terminal
• Terminates the transaction
The preceding example of a transaction sequence includes two zero overhead object
modules (ZOOMs):
• The initial control program, ICP
• The subprogram, SUBPROG
HVTIP$$GROUP
This bank group contains all of the actual text of an HVTIP ZOOM. It contains two
banks, HVTIP$$CODE and HVTIP$$DBANK:
• HVTIP$$CODE is a single code bank containing the text of all of the code, data, and
common block banks of the object modules supplied to the static linking process.
The following diagram represents two object modules being linked together to
form the HVTIP$$CODE portion of the HVTIP ZOOM for the initial control program
ICP:
− The code banks for the two object modules become the code bank portion of
HVTIP$$CODE.
− The two data banks become the data segment in HVTIP$$CODE.
− Each unique common block bank becomes a common block bank segment in
HVTIP$$CODE.
This same process also occurs when you statically link subprograms.
You may also set the LOWADR of HVTIP$$DBANK if you wish. It defaults to
01000 less than the HVTIP$$DSEG LOWADR, so it usually is at 057000. However,
it could be set down to as low as 045000 to gain a little more space if you wish.
Just remember that the lower you set it the more likely it will be to overlap some
basic mode code space and have things stop working.
HVTIP$$SEGS
This bank group is for documentation purposes only (It is also very useful when
debugging to see where things were allocated.) In a long listing from a static link of an
HVTIP ZOOM, HVTIP$$SEGS includes descriptions of the segments whose text
resides within HVTIP$$CODE, as if those segments were still separate banks.
HVTIP$$SEGS describes
• The data segment holding all noncommon data for the ZOOM (called
HVTIP$$DSEG)
• All common block segments
This description includes the address range of each segment (bank); this information is
critical for debugging.
Note that common blocks are only initialized when they are initially allocated by the
URTS HVTIP loader. When a subprogram is loaded that also defines an existing
common block, the common block is not reinitialized, the subprogram is simply linked
to the existing copy. Therefore, all initial values for COMMON blocks should be given
in the ICP.
An S-option static link listing will show that the extent of the HVTIP$$CODE bank is
well beyond the limits of the last code bank-part that is linked in. This area at the end
holds the loading and initialization information for the segments defined in the HVTIP
ZOOM.
This example can demonstrate what happens when an HVTIP transaction is executed.
The following diagrams illustrate the execution of the example transaction sequence.
When the HVTIP transaction code is entered, the initial control program ICP is loaded
as follows:
• HVTIP$$CODE for the initial control program is loaded into the bank designated by
program local BDI 4.
• The uninitialized bank HVTIP$$DBANK is made available at program local BDI 5.
• The ICP data segment is copied from HVTIP$$CODE (BDI 4) to HVTIP$$DBANK
(BDI 5).
• The ICP common block bank 1 segment is copied from HVTIP$$CODE (BDI 4) to
HVTIP$$DBANK (BDI 5).
• The ICP common block bank 2 segment is copied from HVTIP$$CODE (BDI 4) to
HVTIP$$DBANK (BDI 5).
If any other common block banks were part of the initial control program, they would
also be copied from HVTIP$$CODE (BDI 4) to HVTIP$$DBANK (BDI 5).
If the subprogram SUBPROG is called by the initial control program, the following
occurs:
• HVTIP$$CODE for the subprogram is loaded into the BDI 4 bank, replacing
HVTIP$$CODE for the initial control program.
• The subprogram data segment is copied from HVTIP$$CODE (BDI 4) to
HVTIP$$DBANK (BDI 5).
• If the subprogram contains any common block bank segments that have not been
previously encountered, each is copied from HVTIP$$CODE (BDI 4) to
HVTIP$$DBANK (BDI 5).
In this example, all common blocks have already been loaded by the initial control
program. Because of this, no common block bank segments are loaded when the
subprogram is called.
When the OS 2200 operating system creates the HVTIP$$DBANK bank and the UCS
Runtime System loads each of the segments within HVTIP$$DBANK, the starting
address of the HVTIP$$DBANK bank and each segment within this bank is referred to
as its LOWADR.
In the HVTIP links up to this point, LOWADR values have been automatically set by the
static linking process. This discussion provides background so that you can adjust
these LOWADR settings for more efficient use of space.
As segments are loaded into the HVTIP$$DBANK “heap” bank, the UCS Runtime
System loads the segments at the address specified by the LOWADRs they received
in the static link of the HVTIP ZOOMs, if possible. In the following cases, this is not
possible:
• If segments have overlapping addresses (for example, two segments both have
LOWADRs of 070000).
• If the LOWADR of HVTIP$$DBANK has been adjusted through special LINK
commands; this can override the LOWADRs of the segments that are loaded into
HVTIP$$DBANK.
• If segments have so much empty space between them that loading at the
specified LOWADRs would waste a significant amount of space.
In these cases, the LOWADR is ignored. Instead, the segments are loaded at the next
available locations. This is known as relocation. Relocation is not desirable from a
performance standpoint. However, to eliminate all run-time relocation of your DATA
and COMMON block segments can be a significant amount of work, and may have to
be completely redone if even minor changes occur in segment sizes in the application.
In addition, complex execution paths through your subprograms may make it almost
impossible to come up with a segment address layout that will fit all situations. It may
not be worthwhile to take the effort to attempt to eliminate the run-time relocation.
It is assumed that you have already applied the techniques described previously in this
section for performance coding and linking.
Your application can contain many different HVTIP transaction execution paths. After
reading this subsection, you may want to apply some of these techniques to each ICP
and all of its subprograms. You may want to apply some techniques only to the high-
priority execution paths in the transaction sequences. Remember that your
transactions will execute successfully without applying any of these techniques.
The basic principle is that the segments (HVTIP$$DSEGs and common blocks) from
each of the HVTIP static links must not have overlapping addresses. Since the static
linker does not know what segment addresses (LOWADRs) have been assigned in
other static links, the segment addresses will definitely overlap unless something is
done about it. The ICP is the only static link where the segment addresses will not
overlap. This is because it is loaded first and gets preference. The segments defined
in the ICP will be loaded at their statically-linked addresses unless the HVTIP$$DBANK
bank supplied at run-time does not have the same address range as the one in the ICP
static link. (It can be overridden with VALTAB settings.)
Simple Method
If all the common blocks are defined in the ICP link, you can get their starting
addresses from an S-option output of the static link of the ICP. Then you can supply
SET LOWADR statements for them in an ADD element, giving those offsets. It may
be preferable to “pad” these a bit, so that minor changes in sizes of the ICP DSEG or in
the common block sizes do not result in a new set of LOWADRs being needed. You
should also probably put the following statement in the ADD element to ensure that all
of the SET LOWADRs are honored by the HVTIP loader:
SET RELOAD_SKIP_SIZE=0777000
Use this ADD element in an ADD statement in all of your HVTIP links, including the ICP.
As far as the HVTIP$$DSEG (and other common block) addresses for your HVTIP
subprograms, just do a SET LOWADR statement in each HVTIP link to set the segment
addresses to an open spot, again leaving some “pad” for growth on each. Look at the
output of an initial static link for each HVTIP ZOOM to see what the extent of the
HVTIP$$DSEG segment is so you can leave enough room. (Do the same for any
additional common blocks they may define that the ICP did not have.) Just remember
that if you do it wrong and some segments overlap, it will all work fine anyway, you
will just incur some relocation costs at run-time. It is also best to set the SIZE of the
HVTIP$$DBANK “heap” bank in the ICP static link to the maximum that it can be for
your transaction so that a run-time expansion will not be needed. This generally
brings it out to a MAX_LIMIT of 0777777, though you might want to clamp it at
0577777 for DPS programs.
Complex Method
However, if you want to set up your segment addresses the hard way, just perform
the following process. To obtain the information to apply the techniques discussed in
this subsection, you must obtain a DIAG dump, which is then processed by a PADS
procedure supplied by Unisys. This procedure is discussed later.
The initial control program is called DMSICP. The subprogram is called DMSSUB. One
input to this transaction sequence is the transaction code DMSHVT followed by an
employee number (for example, DMSHVT 10211). The processing sequence for this
input is as follows:
This transaction sequence has been function tested. The following performance aids
have already been applied:
• Coding
The INITIAL clause was added to both the initial control program DMSICP and the
subprogram DMSSUB.
• Compiling
The OPTIM and REORDER keyword options were used when compiling both the
initial control program DMSICP and the subprogram DMSSUB.
• Linking
The size of HVTIP$$DBANK was increased to accommodate the use of DPS. This
was accomplished by adding a SET SIZE FOR HVTIP$$DBANK command to the
static link of the initial control program DMSICP.
For this example, the linking runstream for the initial control program is as follows:
@USE LINK$PF,SYS$LIB$*APP$3.
@LINK,S ,QUAL*UCSTST.DMSICP
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.DMSICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/DMSSUB
INCLUDE UDS$$SRC*SCHEXECFILE.S$WORK/PERSONSUBTIP
INCLUDE APP3*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
SET SIZE = SIZE + 10048 FOR HVTIP$$DBANK
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
To continue the optimization process, you must collect information by executing the
transaction DMSHVT, producing a diagnostic dump in the process. The following
describes how to produce and process this dump.
UCS COBOL
CALL 'FERR'.
UCS FORTRAN
CALL FERR
UCS C
ferr();
Note: If this dump occurs after a UCS COBOL CANCEL statement or an HVTIP
transfer-with-cancel function, information about the canceled HVTIP$$DSEG
segments is lost.
In the example, this call would be placed in the initial control program DMSICP just
before the call to ’D$TERM’, as follows:
IDENTIFICATION DIVISION.
.
.
PROCEDURE DIVISION.
.
.
CALL 'D$INIT'....
.
reads input message
validation of input
.
IMPART.
CALL 'DMSSUB'.
DEPART.
CALL 'FERR'.
CALL 'D$TERM'....
STOP RUN.
Step 2: Recompile
Recompile the portion of the transaction sequence to which you added this call.
Step 3: Relink
Relink the part of the transaction sequence that contains this call.
• If you do not have access to the operator console output, refer to “Executing
without Console Output.”
where
nnnnn
is the generated id for this execution of the transaction.
xxxxxx
is the transaction name that errored.
TIPDIAG$*xxxxxxnnnnn
is the name of the DIAG file which contains the dump for this execution of the
transaction.
When this example is executed, a message like the following is received:
*30JVL**TIP DIAG$ FILE CREATED - TIPDIAG$*DMSICP30JVL
2. Call PADS. Supply the DIAG dump file name on the processor call, as in the
following example:
@pads diag,tipdiag$*dmsicp30jvl.
3. Request the first DIAG dump file entry for this transaction execution.
# CMD > select first diag entry
4. Add (@ADD) the PADS procedure HVTIP$INFO, found in the file SYS$LIB$*URTS:
# CMD >@add sys$lib$*urts.hvtip$info
# CMD >HVTIP$INFO pl(5)
This procedure
• Provides the size of the ALS
• Detects run-time relocation
• Produces a report on the addresses for the data banks and the common block
banks
The following is a sample of this process using the example transaction. User input is
bolded.
@pads diag,tipdiag$*dmsicp30jvl.
PADS 8R2 1997-02-21 1252:35
.
. (system output)
.
# CMD >select first diag entry
# CMD >@add sys$lib$*urts.hvtip$info
# CMD >HVTIP$INFO pl(5)
# *********************************************************************
# ** HVTIP$INFO ** (07/01/97)
# (Numbers are octal. LLBBBB refers to HVTIP Library and bank number.)
#
# Current ALS Size is 004000 words.
#
# Runtime relocation was performed on one or more data segments.
#
# Current HVTIP Program Heap Address Range: 0400005 => 0047000 - 0402777
#
# The Currently Allocated Heap Data Segments:
# Seg LLBBBB EM Start End
# Numb BDI Address Address
# 0000 020001 0400005 => 0047005 - 0122510
# 0001 020002 0400005 => 0153246 - 0154111
#
# Common Blocks:
# Common Blocks are Named (Indexed would be more optimal).
# Seg LLBBBB EM Start End Common Block
# Numb BDI Address Address Name
# 0000 020001 0400005 => 0122511 - 0124007 $BLANK$COMMON$
# 0000 020001 0400005 => 0124010 - 0124743 S$PERSONSUBTIP_$A
#
# These HVTIP ZOOMs have been referenced
# (and have not been CANCELed):
# Seg # LLBBBB Received Control as
# 0000 020001 ICP (Main prog)
# 0001 020002 HVTIP Subroutine
# *********************************************************************
# CMD >exit pads
After successful activation, PADS responds with the current number of entries in
the TIP error history file. There are one or more entries for each transaction
execution that errors and produces a DIAG dump.
The following is an example of this PADS output.
PADS 10R1 1997-02-21 1222:10
# Application 3 TIP Error History File contains 566 entries.
3. Locate the diagnostic information for your specific transaction execution. There
are several PADS commands you can use to accomplish this. The following are
examples:
• The following example command lists the last six entries with the transaction
code DMSHVT. You must enter the transaction code in capital letters.
# CMD >tiplog$code$ 'DMSHVT',6
• The following example command lists the last six entries created on February
21, 1997 (970221) with transaction code DMSHVT. You must enter the
transaction code in capital letters.
# CMD >tlog$search$ " tiplog.error_date (i) = '970221' and " !! %
#CMD > " tiplog.transaction_code (i) = 'DMSHVT' ",6
• The following command lists the last six entries created after 10:00 AM
(100000) on February 21, 1997 (970221) with transaction code DMSHVT. You
must enter the transaction code in capital letters.
# CMD >tlog$search$ " tiplog.error_date (i) = '970221' and " !! %
# CMD > " tiplog.error_time (i) > '100000' and " !! %
# CMD > " tiplog.transaction_code (i) = 'DMSHVT' ",6
Each of these queries produces a report on six or fewer entries that match the
criteria supplied. Look at the date (ERROR_DATE) and time (ERROR_TIME) on each
entry to select the entry for the time when you executed the transaction.
Often, one transaction execution produces multiple consecutive entries within the
TIP error history file. You can identify entries for the same execution by checking
for the same value in the FILENAME=TIPDIAG$*filename field. You want the
oldest of these entries; this is the entry with the highest TIPLOG number. To
confirm this, check the values in the ERROR_TIME field for the entries.
The following is a sample of the output for two entries for the same transaction
execution. The TIPLOG(4) entry is the one you want to interrogate further. The
shaded fields provide the information that is important to you.
# TIPLOG(3)
# PROGRAM_NAME=DMSICP TRANSACTION_CODE=DMSHVT
# ERROR_INFO
# ERROR_VA=0T CONTINGENCY_TYPE=2T ERROR_TYPE=0T ERROR_CODE=14T
# ERROR_AUX_INFO=21T ERROR_ID=34001000311T ERROR_DATE=970221
ERROR_TIME=
# 122100 ERROR_INS=0T
# TIP_INFO
# PID=734T TIP_TYPE=transaction HVTIP_LIB_BANK=20001T
# FILENAME=TIPDIAG$*DMSICP30JVL.
# TIPLOG(4)
# PROGRAM_NAME=DMSICP TRANSACTION_CODE=DMSHVT
# ERROR_INFO
# ERROR_VA=202172004606 CONTINGENCY_TYPE=12T ERROR_TYPE=3T
ERROR_CODE=0T
# ERROR_AUX_INFO=0T ERROR_ID=34001001757T ERROR_DATE=970221
ERROR_TIME=
# 122059 ERROR_INS=0T
# TIP_INFO
# PID=734T TIP_TYPE=transaction HVTIP_LIB_BANK=20001T
# FILENAME=TIPDIAG$*DMSICP30JVL.
4. Now that you know which TIPLOG entry reflects your transaction execution, issue
a TDIAG$ command to PADS, supplying the TIPLOG number. This command is as
follows for the example:
# CMD >tdiag$ 4
5. Add (@ADD) the PADS procedure HVTIP$INFO, found in the file SYS$LIB$*URTS.
# CMD >@add sys$lib$*urts.hvtip$info
# CMD >HVTIP$INFO pl(5)
This procedure
• Provides the size of the ALS
• Detects run-time relocation
• Produces a report on the addresses for the data banks and the common block
banks
The following is a sample of this process using the example. User input is bolded.
@pads tipdiag,3
PADS 10R1 1997-02-21 1222:10
# Application 3 TIP Error History File contains 566 entries.
# CMD >tlog$search$ " tiplog.error_date(i) = '970221' and " !! %
# CMD > " tiplog.error_time(i) > '100000' and " !! %
# CMD > " tiplog.transaction_code(i) = 'DMSHVT' ",4
# TIPLOG(3)
# PROGRAM_NAME=DMSICP TRANSACTION_CODE=DMSHVT
# ERROR_INFO
# ERROR_VA=0T CONTINGENCY_TYPE=2T ERROR_TYPE=0T ERROR_CODE=14T
# ERROR_AUX_INFO=21T ERROR_ID=34001000311T ERROR_DATE=970221 ERROR_TIME=
# 122100 ERROR_INS=0T
# TIP_INFO
# PID=734T TIP_TYPE=transaction HVTIP_LIB_BANK=20001T
# FILENAME=TIPDIAG$*DMSICP30JVL.
# TIPLOG(4)
# PROGRAM_NAME=DMSICP TRANSACTION_CODE=DMSHVT
# ERROR_INFO
# ERROR_VA=202172004606T CONTINGENCY_TYPE=12T ERROR_TYPE=3T
# ERROR_CODE=0T
# ERROR_AUX_INFO=0T ERROR_ID=34001001711T ERROR_DATE=970221 ERROR_TIME=
# 122059 ERROR_INS=0T
# TIP_INFO
# PID=734T TIP_TYPE=transaction HVTIP_LIB_BANK=20001T
# FILENAME=TIPDIAG$*DMSICP30JVL.continued
# TIPLOG(10)
# PROGRAM_NAME=DMSICP TRANSACTION_CODE=DMSHVT
# ERROR_INFO
# ERROR_VA=0T CONTINGENCY_TYPE=2T ERROR_TYPE=0T ERROR_CODE=14T
# ERROR_AUX_INFO=21T ERROR_ID=34001000311T ERROR_DATE=970221 ERROR_TIME=
# 095201 ERROR_INS=0T
# TIP_INFO
# PID=734T TIP_TYPE=transaction HVTIP_LIB_BANK=20001T
# FILENAME=TIPDIAG$*DMSICP30JVK.
# TIPLOG(11)
# PROGRAM_NAME=DMSICP TRANSACTION_CODE=DMSHVT
# ERROR_INFO
# ERROR_VA=202172004606T CONTINGENCY_TYPE=12T ERROR_TYPE=3T
# ERROR_CODE=0T
# ERROR_AUX_INFO=0T ERROR_ID=34001001757T ERROR_DATE=970221 ERROR_TIME=
# 095200 ERROR_INS=0T
# TIP_INFO
# PID=734T TIP_TYPE=transaction HVTIP_LIB_BANK=20001T
# FILENAME=TIPDIAG$*DMSICP30JVK.
# CMD >tdiag$ 4
# PROGRAM_NAME=DMSCIP TRANSACTION_CODE=DMSHVT
# ERROR_INFO
# ERROR_VA=202172004606T CONTINGENCY_TYPE=12T ERROR_TYPE=3T
# ERROR_CODE=0T
# ERROR_AUX_INFO=0T ERROR_ID=34001001757T ERROR_DATE=970221 ERROR_TIME=
# 122059 ERROR_INS=0T
# TIP_INFO
# PID=734T TIP_TYPE=transaction HVTIP_LIB_BANK=200001T
# FILENAME=TIPDIAG$*DMSICP30JVL.
# Diagnostic file from runid: *30JVL
.
. (the remainder of output from tlog$search$ command) .
# CMD >@add sys$lib$*urts.hvtip$info
# CMD >HVTIP$INFO pl(5)
# *********************************************************************
# ** HVTIP$INFO ** (07/01/97)
# (Numbers are octal. LLBBBB refers to HVTIP Library and bank number.)
#
# Current ALS Size is 004000 words.
#
# Runtime relocation was performed on one or more data segments.
# Current HVTIP Program Heap Address Range: 0400005 => 0047000 - 0402777
#
# The Currently Allocated Heap Data Segments:
# Seg LLBBBB EM Start End
# Numb BDI Address Address
# 0000 020001 0400005 => 0047005 - 0122510
# 0001 020002 0400005 => 0153246 - 0154111
#
# Common Blocks:
# Common Blocks are Named (Indexed would be more optimal).
# Seg LLBBBB EM Start End Common Block
# Numb BDI Address Address Name
# 0000 020001 0400005 => 0122511 - 0124007 $BLANK$COMMON$
# 0000 020001 0400005 => 0124010 - 0124743 S$PERSONSUBTIP_$A
#
# These HVTIP ZOOMs have been referenced
# (and have not been CANCELed):
# Seg # LLBBBB Received Control as
# 0000 020001 ICP (Main prog)
# 0001 020002 HVTIP Subroutine
# *********************************************************************
# CMD >exit pads
For more information about how to use PADS commands, refer to the PADS
Programming Guide.
6. Remove the abort call from the transaction sequence after receiving the required
information.
The UCS compilers also use the ALS for temporary storage. When you enter a
routine, ALS storage for temporary use and for user variables is bought. When you
exit a routine (RETURN), the storage is released. The ALS is a stack and it is a push-
pop operation. Note that the ALS grows from high addresses to low address,
backwards.
The maximum size of the ALS defaults to 0700000. You can change this with a static
linker SET ALS_MAX_SIZE command, but this is not recommended. You cannot
increase it to greater than 0700000, and it serves no purpose to lower it. If you lower
the ALS max size too much, some software may no longer work. The ALS is used by
virtually all extended mode code. The default initial size of the ALS is 010000 words.
You may wish to increase this initial size so that a run-time expansion is not
necessary. It might be wise to not increase it past a size of 0600000 (resulting in a
lower limit of 0100000) so that it does not overlap basic mode code address space. A
recommended value would be 0400000. :
SET ALS_INIT_SIZE = 0400000
If the INDEX command is used, every possible program in the transaction sequence
(the initial control program and all its subprograms) must contain the identical INDEX
command. All programs must list every common block bank in the transaction
sequence in the exact same order, whether the program contains that common block
bank or not.
An INDEX command can contain up to 200 common block bank names; however,
multiple INDEX commands may be used.
Note: There is a limit of 4095 common block banks that can be indexed.
You should place this INDEX command after the RESOLVE command and before the
DELETE ALL DEFINITIONS command in each static link.
By looking at the PADS procedure output, you can tell if the common block banks are
indexed. If not, the PADS procedure prints the names.
# *********************************************************************
# ** HVTIP$INFO ** (07/01/97)
# (Numbers are octal. LLBBBB refers to HVTIP Library and bank number.)
#
# Current ALS Size is 004000 words.
#
# Runtime relocation was performed on one or more data segments.
#
# Current HVTIP Program Heap Address Range: 0400005 => 0047000 - 0402777
#
# The Currently Allocated Heap Data Segments:
# Seg LLBBBB EM Start End
# Numb BDI Address Address
# 0000 020001 0400005 => 0047005 - 0122510
# 0001 020002 0400005 => 0153246 - 0154111
#
# Common Blocks:
# Common Blocks are Named (Indexed would be more optimal).
# Seg LLBBBB EM Start End Common Block
# Numb BDI Address Address Name
# 0000 020001 0400005 => 0122511 - 0124007 $BLANK$COMMON$
# 0000 020001 0400005 => 0124010 - 0124743 S$PERSONSUBTIP_$A
#
# These HVTIP ZOOMs have been referenced
# (and have not been CANCELed):
# Seg # LLBBBB Received Control as
# 0000 020001 ICP (Main prog)
# 0001 020002 HVTIP Subroutine
# *********************************************************************
The line “Common Blocks are Named (Indexed would be more optimal)” tells you that
the current static links do not use the INDEX command. If the INDEX command were
being used, this line would read “Common Blocks are Indexed.”
These names should appear in the INDEX command in the static link of each ZOOM in
the HVTIP transaction sequence. If any common block banks for this transaction
sequence are not reflected in this execution, they must also be listed in each INDEX
command.
The updated link source for the initial control program is as follows:
@USE LINK$PF,SYS$LIB$*APP$3.
@LINK,S ,QUAL*UCSTST.DMSICP
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.DMSICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/DMSSUB
INCLUDE UDS$$SRC*SCHEXECFILE.S$WORK/PERSONSUBTIP
INCLUDE APP3*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
SET SIZE = SIZE + 10048 FOR HVTIP$$DBANK
INDEX COMMON BANKS $BLANK$COMMON$, S$PERSONSUBTIP_$A
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
You should place this SET command after the RESOLVE command and before the
DELETE ALL DEFINITIONS command in the static link of the initial control program.
The output from the PADS procedure provides the address that you should use for
HVTIP$$DSEG of the initial control program. You can determine this address by
looking at the “Currently Allocated Heap Data Segments” section; one line has the
HVTIP library and bank number (LLBBBB) for the initial control program.
In this case, DMSICP has an HVTIP library number of 2 and a bank number of 1. The
address range for the data segment for DMSICP is at the end of the same line.
# *********************************************************************
# ** HVTIP$INFO ** (07/01/97)
# (Numbers are octal. LLBBBB refers to HVTIP Library and bank number.)
#
# Current ALS Size is 004000 words.
#
# Runtime relocation was performed on one or more data segments.
#
# Current HVTIP Program Heap Address Range: 0400005 => 0047000 - 0402777
#
# The Currently Allocated Heap Data Segments:
# Seg LLBBBB EM Start End
# Numb BDI Address Address
# 0000 020001 0400005 => 0047005 - 0122510
# 0001 020002 0400005 => 0153246 - 0154111
#
# Common Blocks:
# Common Blocks are Named (Indexed would be more optimal).
# Seg LLBBBB EM Start End Common Block
# Numb BDI Address Address Name
# 0000 020001 0400005 => 0122511 - 0124007 $BLANK$COMMON$
# 0000 020001 0400005 => 0124010 - 0124743 S$PERSONSUBTIP_$A
#
# These HVTIP ZOOMs have been referenced
# (and have not been CANCELed):
# Seg # LLBBBB Received Control as
# 0000 020001 ICP (Main prog)
# 0001 020002 HVTIP Subroutine
# *********************************************************************
In the example, the data segment for the initial control program (library 2 bank 1 -
020001) is at address range 047005-122510.
If the low address in this range is not a multiple of four, you should round it up to a
multiple of four. (This would be an octal number that ends in either zero or four.)
In the example, 047005 is rounded up to 047010. This means the high address for this
segment becomes 0122513. The new address range is 047010-0122513.
The following SET LOWADR command is added to the static link of DMSICP:
SET LOWADR = 047010 FOR HVTIP$$DSEG
This command results in the following HVTIP heap data bank layout. You can find the
start and end addresses for HVTIP$$DBANK by looking at the line in the PADS
procedure output labeled “Current HVTIP Program Heap Address Range.”
The updated link source for the initial control program is as follows:
@USE LINK$PF,SYS$LIB$*APP$3.
@LINK,S ,QUAL*UCSTST.DMSICP
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.DMSICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/DMSSUB
INCLUDE UDS$$SRC*SCHEXECFILE.S$WORK/PERSONSUBTIP
INCLUDE APP3*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
SET SIZE = SIZE + 10048 FOR HVTIP$$DBANK
SET LOWADR = 047010 FOR HVTIP$$DSEG
INDEX COMMON BANKS $BLANK$COMMON$, S$PERSONSUBTIP_$A
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
You must place the LOWADR command for a common block bank only in the static
links of ZOOMs that actually reference that common block bank. The format for this
command is as follows:
SET LOWADR = 0nnnnnn FOR common_block_bank_1
You should place this command after the RESOLVE command and before the DELETE
ALL DEFINITIONS command in the static link of each ZOOM that references that
common block bank.
Duplicate common blocks are not loaded. By setting LOWADRs as described here,
you make sure the common block banks are referenced using the same addresses
throughout the transaction sequence. Thus, no address adjustment is necessary, and
performance is not degraded. If any common block banks do not appear in the
execution, give them an address that is greater than the end address of the last
common block bank in HVTIP$$DBANK. Make sure they do not overlap with any data
segment or other common block banks.
Using the PADS procedure output, you can see the list of common blocks.
# *********************************************************************
# ** HVTIP$INFO ** (07/01/97)
# (Numbers are octal. LLBBBB refers to HVTIP Library and bank number.)
#
# Current ALS Size is 004000 words.
#
# Runtime relocation was performed on one or more data segments.
#
# Current HVTIP Program Heap Address Range: 0400005 => 0047000 - 0402777
#
# The Currently Allocated Heap Data Segments:
# Seg LLBBBB EM Start End
# Numb BDI Address Address
# 0000 020001 0400005 => 0047005 - 0122510
# 0001 020002 0400005 => 0153246 - 0154111
#
# Common Blocks:
# Common Blocks are Named (Indexed would be more optimal).
# Seg LLBBBB EM Start End Common Block
# Numb BDI Address Address Name
# 0000 020001 0400005 => 0122511 - 0124007 $BLANK$COMMON$
# 0000 020001 0400005 => 0124010 - 0124743 S$PERSONSUBTIP_$A
#
.
. (the remainder of the PADS procedure output)
.
In the example, there are two common blocks. The output shows that
• $BLANK$COMMON$ starts at octal address 122511.
• S$PERSONSUBTIP_$A starts at octal address 124010.
If the low address in this range is not a multiple of four, it should be rounded up to a
multiple of four. (This would be an octal number that ends in either zero or four.)
Also, you must check that there is no address overlap with the HVTIP$$DSEG address
range established by setting the LOWADR for HVTIP$$DSEG for the initial control
program.
These addresses represent the addresses that should be used in the SET LOWADR
commands in the initial control program and subprograms that contain these common
blocks.
These commands result in the following HVTIP heap data bank layout. You can find
the start and end addresses for HVTIP$$DBANK by looking at the line in the PADS
procedure output labeled “Current HVTIP Program Heap Address Range”.
The updated linking runstream for the initial control program looks as follows:
@USE LINK$PF,SYS$LIB$*APP$3.
@LINK,S ,QUAL*UCSTST.DMSICP
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.DMSICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/DMSSUB
INCLUDE UDS$$SRC*SCHEXECFILE.S$WORK/PERSONSUBTIP
INCLUDE APP3*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
SET SIZE = SIZE + 10048 FOR HVTIP$$DBANK
SET LOWADR = 047010 FOR HVTIP$$DSEG
SET LOWADR = 0122514 FOR $BLANK$COMMON$
SET LOWADR = 0124014 FOR S$PERSONSUBTIP_$A
INDEX COMMON BANKS $BLANK$COMMON$, S$PERSONSUBTIP_$A
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@USE LINK$PF,SYS$LIB$*APP$3.
@LINK,S ,QUAL*UCSTST.DMSSUB
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.DMSSUB/COMP
INCLUDE UDS$$SRC*SCHEXECFILE.S$WORK/PERSONSUBTIP
INCLUDE APP3*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
SET LOWADR = 0122514 FOR $BLANK$COMMON$
SET LOWADR = 0124014 FOR S$PERSONSUBTIP_$A
INDEX COMMON BANKS $BLANK$COMMON$, S$PERSONSUBTIP_$A
DELETE ALL DEFINITIONS EXCEPT DMSSUB
@EOF
3. In the absence of either of the preceding, the default equals the sum of the size of
the data segment for the ICP, plus all common block segments, plus control
information.
If HVTIP$$DBANK is not big enough to contain all of the data and common block
segments for the transaction execution, one of the following occurs:
• If EXPANSION_SIZE equals 0, a run-time error message is received and the
transaction aborts.
• If the EXPANSION_SIZE does not equal 0, the UCS Runtime System expands
the size of HVTIP$$DBANK by at least the size specified by EXPANSION_SIZE,
using an Executive request to MCORE$.
EXPANSION_SIZE has a default size of 010000. This causes expansion to occur
in increments no smaller than 4,096 (010000) words.
HVTIP$$DBANK should initially be set to the maximum size required by the most
commonly-used execution paths for the transaction sequence. Doing so avoids the
overhead of dynamically acquiring space. For rarely-used execution paths that require
a larger HVTIP$$DBANK, expansion should be allowed to occur. Note, however, that if
HVTIP$$DBANK is expanded by the URTS run-time system, TIP “sticking” and
RESTART are lost for that transaction.
You set the initial size of HVTIP$$DBANK by using the following command in the static
link of the initial control program (ICP):
SET SIZE = 0nnnnn FOR HVTIP$$DBANK
The leading zero denotes an octal number. You should place this command after the
RESOLVE command and before the DELETE ALL DEFINITIONS command in the static
link of the initial control program.
By looking at the output of the PADS procedure, you can find the address range from
this execution of the transaction. From this address range you can calculate the size
of HVTIP$$DBANK.
The following is a portion of the PADS procedure output for the example transaction.
The shaded line contains the octal address range of HVTIP$$DBANK.
# *********************************************************************
# ** HVTIP$INFO ** (07/01/97)
# (Numbers are octal. LLBBBB refers to HVTIP Library and bank number.)
#
# Current ALS Size is 004000 words.
#
# Runtime relocation was performed on one or more data segments.
#
# Current HVTIP Program Heap Address Range: 0400005 => 0047000 - 0402777
#
By subtracting 047000 from 0402777, you determine that the size of HVTIP$$DBANK
is 0334000. If this size is not a multiple of 01000, you should round it up to a multiple
of 01000. (This would be an octal number that ends in 000.)
Also, you must check to be sure that there is no address range specified as a result of
the SET LOWADR commands (added to the static link of the initial control program)
that fall outside the new address range of HVTIP$$DBANK.
In the static link of the initial control program, add the following command:
SET SIZE = 0334000 FOR HVTIP$$DBANK
This command results in the HVTIP heap data bank layout as shown in the following
diagram.
The updated link source for the initial control program is as follows:
@USE LINK$PF,SYS$LIB$*APP$3.
@LINK,S ,QUAL*UCSTST.DMSICP
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.DMSICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/DMSSUB
INCLUDE UDS$$SRC*SCHEXECFILE.S$WORK/PERSONSUBTIP
INCLUDE APP3*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LIBCODENAME
SET SIZE = 0334000 FOR HVTIP$$DBANK
SET LOWADR = 047010 FOR HVTIP$$DSEG
SET LOWADR = 0122514 FOR $BLANK$COMMON$
SET LOWADR = 0124014 FOR S$PERSONSUBTIP_$A
INDEX COMMON BANKS $BLANK$COMMON$, S$PERSONSUBTIP_$A
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
You may also set the LOWADR of HVTIP$$DBANK if you wish. It defaults to 01000
less than the HVTIP$$DSEG LOWADR, so it usually is at 057000. However, it could be
set down to as low as 045000 to gain a little more space if you need it. Just
remember that the lower you set it, the more likely it will be to overlap some basic
mode code space and have things stop working. Many things would stop working if
you dropped it below 045000.
0
No expansion is allowed. The transaction results in an error if expansion is
required.
n
HVTIP$$DBANK is expanded in increments no smaller than n words. The value of
n should be a multiple of 01000 words.
You should set the initial size for HVTIP$$DBANK to reflect the size required by the
commonly-used execution paths in the transaction sequence. For these cases, no
expansion of HVTIP$$DBANK should occur. For rarely-used execution paths in the
transaction sequence that require a larger HVTIP$$DBANK, expansion will occur.
You use the following static-linking command to change the expansion size for a
subprogram:
SET EXPANSION_SIZE = 0nnnnn
The leading zero denotes an octal number. You should place this command after the
RESOLVE command and before the DELETE ALL DEFINITIONS command in the static
link.
For the example, the expansion size is allowed to default to a value of 010000. No
changes are made to the static link of DMSSUB.
In this example, there are 06000 words of empty space between Segment 1 and
Segment 2 when they are loaded in HVTIP$$DBANK. Depending on the user
application, this may or may not be wasteful of storage space.
For example, one subprogram might call another subprogram only conditionally.
Assume the conditionally-called subprogram is Segment 3, as follows:
In this case, Segment 3, if called, occupies the space between Segments 1 and 2.
Thus, the space is not wasted. In other applications, however, this amount of space
might be wasted.
RELOAD_SKIP_SIZE allows you to set an upper limit on the amount of space between
segments. When a segment is loaded, one of two conditions exists:
You can change the default setting of RELOAD_SKIP_SIZE by using the following
command:
The leading zero denotes an octal number. You should place this command after the
RESOLVE command and before the DELETE ALL DEFINITIONS command in the static
link of each ZOOM for which you want to reset the RELOAD_SKIP_SIZE. It cannot be
placed before the OUTPUT statement.
RELOAD_SKIP_SIZE affects all heap banks. In HVTIP-II (OUTPUT HVTIP2), the SET
RELOAD_SKIP_SIZE = 0777777 feature no longer terminates the transaction if any
relocation occurs in the specified zoom. If the SET RELOAD_SKIP_SIZE = 0777777
statement is present in the transaction’s ICP link source code; it is treated as if the
statement SET FAST_LOAD_MONITOR = 5 is present and it causes a message to be
sent to the transaction’s print file for each relocation or CREATE$BANK Exec call. The
SET RELOAD_SKIP_SIZE = 0777777 statement has no effect in the links of HVTIP-II
subprograms, only the ICP.
If you have carefully done SET LOWADR statements in all of your HVTIP static links so
that no segments overlap and so no relocation occurs, you may wish to put the
following statement into the links to ensure that the URTS HVTIP Loader honors your
LOWADRs and does not attempt to “save” space by packing your segments together
and causing relocation to occur:
SET RELOAD_SKIP_SIZE = 0777000
@USE LINK$PF,SYS$LIB$*APP$3.
@LINK,S ,QUAL*UCSTST.DMSICP
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.DMSICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/DMSSUB
INCLUDE UDS$$SRC*SCHEXECFILE.S$WORK/PERSONSUBTIP
INCLUDE APP3*DPS.UCS/INTERFACE,.EMCBEP$$DPS
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LCN
SET SIZE = 0334000 FOR HVTIP$$DBANK
SET LOWADR = 047010 FOR HVTIP$$DSEG
SET LOWADR = 0122514 FOR $BLANK$COMMON$
SET LOWADR = 0124014 FOR S$PERSONSUBTIP_$A
INDEX COMMON BANKS $BLANK$COMMON$, S$PERSONSUBTIP_$A
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
This performance link runstream produces the following output. Notable lines are
marked with numbers in parentheses; explanations follow.
Explanations
1. This @USE LINK$PF statement identifies the application-group-dependent search
chain to be used by this static link. In this case, the search chain for application
group three is specified.
3. These are echoes of the static linking commands input from the source runstream.
Some are followed with comments verifying that the action requested was taken.
6. This line provides the number of entry points that were deleted as a result of the
DELETE ALL DEFINITIONS command. The DELETE command decreases the size of
a ZOOM produced by the static link.
7. HVTIP$$SEGS is the first bank group. It defines the data segments of the ZOOM.
It exists for documentation purposes only. The initialization text of the banks
contained in HVTIP$$SEGS actually exists in bank HVTIP$$CODE. These segments
are loaded at run time by the HVTIP heap manager. They might or might not be
loaded at the addresses shown here.
In this case, the banks contained in HVTIP$$SEGS are the following:
• $BLANK$COMMON$
• S$PERSONSUBTIP_$A
• HVTIP$$DSEG
• DMSICP$3
8. The first bank within HVTIP$$SEGS has a bank_type of “common.” This bank is
named $BLANK$COMMON$. It comes from the object module
QUAL*UCSTST.DMSICP/COMP.
QUAL*UCSTST(1).DMSICP/COMP
Name: $BLANK$COMMON$
Bank_type = Common; LBN = 02
9. The address ranges shown are for documentation purposes since the segments
may actually be loaded at different addresses at run time. If the transaction ends
in an error, this information can help with debugging. The initialization text actually
exists in part of the address range of HVTIP$$CODE.
10. The second bank, S$PERSONSUBTIP_$A, was produced by the Subschema Data
Definition Language (SDDL) processor because the “C” option was used. It has a
bank_type of “common.”
UDS$$SRC*SCHEXECFILE(1).S$WORK/PERSONSUBTIP
Name: S$PERSONSUBTIP_$A (Old name = S$PERSONSUBTIP)
Bank_type = Common; LBN = 03
11. The bank HVTIP$$DSEG, created by static linking, describes the data segment
whose initialization text actually exists in HVTIP$$CODE. It contains the input
banks now listed as bank parts.
Name: HVTIP$$DSEG (new bank)
Bank_type = Data; LBN = 04
12. This describes the input banks to HVTIP$$DSEG. The address ranges shown are
for documentation. If the program ends in an error, this information can help with
debugging.
Bank names are preceded by the name of the object module that originally
contained the bank. In this example, HVTIP$$DSEG contains the bank parts as
follows:
• The following lines are for the data bank for the initial control program
DMSICP.
QUAL*UCSTST(1).DMSICP/COMP
Name: DMSICP$0
• The following lines are for a UCS Runtime System data bank. It contains the
UCS Runtime System tables, I/O buffers and packets, entry point definitions,
and the storage management reserve.
SYS$LIB$*EMOMRTS(19).URTS$TABLES
Name: URTS$TABLES
• The following lines are for a UCS Runtime System data bank. It is a dummy
bank used to satisfy SS_CGY_REF in URTS$TABLES, when the user does not
supply a contingency routine for a chameleon subsystem to access its
unshared data. If chameleon subsystems are not being used, this bank is not
used.
SYS$LIB$*EMOMRTS(19).URTS$TABLES
Name: SS$CGY_LIST
• The following lines are for the link vector bank for the UCS Runtime System
contingency processing routine.
SYS$LIB$*EMOMRTS(19).RTS-GCLSINT
Name: LV$GCLSINT
• The following lines are for the link vector bank DPS uses to access its work
area in URTS$TABLES.
APP3*DPS(13).UCS/INTERFACE
Name: DPS$LINKBK
• The following lines are for the link vector bank for the UCS Runtime System.
SYS$LIB$*EMOMRTS(19).URTS$TABLES
Name: URTS$TABLES$17
• This bank contains the link vector for the Executive requests (ERs).
SYS$LIB$*EMSRVC(19).SRVC-ERTRAN1
Name: ERTRAN1LVB
• The following lines are for the link vector bank for the intercept routine used
to resolve PADS references.
SYS$LIB$*EMOMRTS(19).C$NPADS
Name: C$NPADS_LV
• The following lines are for the link vector bank for the intercept routines used
to call PADS from the UCS Runtime System Common Bank.
SYS$LIB$*EMOMTS(19).RTS-PADSINT
Name: LS$PADSINT
• The following lines are for the link vector bank for the Linking System.
SYS$LIB$*LINKOMLIB(252).LS$INTERCEPT
Name: LS$INTERCEPT$04
13. This is a special bank group used during postmortem debugging with PADS. It is a
symbolic debugging dictionary. It provides information that allows PADS to
reference data and code statements in the user program using symbolic names.
QUAL*UCSTST(1).DMSICP/COMP
Name: DMSICP$3
Bank_type = SDD; LBN = 05
14. This bank group contains banks HVTIP$$CODE and HVTIP$$DBANK. This is the
bank group that is loaded into BDI 4 when the initial control program is loaded.
15. HVTIP$$CODE contains all of the actual text of the input banks, plus control
information. Code banks, data banks, and common blocks banks (if present) exist
as segments in this bank.
16. This address range is where all input code banks and the initialization information
for all data banks and common block banks actually resides.
17. Only the code banks are listed here (as bank parts), although all of the initialization
text for HVTIP$$DSEG and the common block segments also reside in
HVTIP$$CODE. The code banks are as follows:
• The following lines are for the code bank of the initial control program
DMSICP.
QUAL*UCSTST(1).DMSICP/COMP
Name: DMSICP$1
• The following lines are for the code bank that contains the UCS interface for
DPS.
APP3*DPS(13).UCS/INTERFACE
Name: DPS$CODEBK
• The following lines are for a UCS Runtime System code bank used as the
interface to the Linking system from the generated code and the UCS Runtime
System.
SYS$LIB$*EMOMRTS(19).RTS-GCLSINT
Name: RTS-GCLSINT
• The following lines are for a UCS Runtime System code bank. It provides the
interface to the Executive requests (ERs).
SYS$LIB$*EMSRVC(19).SRVC-ERTRAN1
Name: SRVC-ERTRAN1
• The following lines are for an intercept routine used to resolve PADS
references.
SYS$LIB$*EMOMRTS(19).C$NPADS
Name: C$NPADS
• This is the entry point virtual address into the RDMS application group defined
by ACTIVE$APP in the library search chains.
SYS$LIB$*RSA(29).RSAC-UCSEMOM
Name: I_BANK
• The following lines are for an intercept routine used to call PADS from the UCS
Runtime System Common Bank.
SYS$LIB$*EMOMRTS(19).RTS-PADSINT
Name: RTS-PADSINT
• The following lines are for a Linking System code bank. It provides the entry
points for the program-callable interfaces in the Linking system used by PADS
and FLIT.
SYS$LIB$*LINKOMLIB(252).LS$INTERCEPT
Name: LS$INTERCEPT$01
18. HVTIP$$SEGS text and control information occupies the address range from
000017107 to 000026177 (line 16).
19. HVTIP$$DBANK is a void bank representing the HVTIP heap data bank.
Name: HVTIP$$DBANK (new bank)
Bank_type = Data; LBN = 01
20. This address range is established by the LOWADR and SIZE settings for
HVTIP$$DBANK. This information has no meaning for HVTIP subprograms.
The ICP static link defines the HVTIP$$DBANK that is used as the “heap” bank
by the transaction.
21. This is the sign-off line for the LINK Processor. It identifies
• The number of lines of @LINK commands entered by the user (LINES : 12)
• The number of errors that occurred in this @LINK session (ERRORS : 0)
• The number of warnings that were issued in this @LINK session
(WARNINGS : 1)
• The number of external references not resolved during the @LINK session
(XREFS : 0)
External references not resolved by static linking must be resolved by the dynamic
linker during execution. In the case of an HVTIP ZOOM, the number of external
references must always be zero.
4 bank parts:
1 QUAL*UCSTST(1).DMSSUB/COMP 1997 Feb 24 1218:12
Name: DMSSUB$0 000000010 - 000000501
2 SYS$LIB$*EMOMRTS(19).RTS-GCLSINT 1997 Mar 27 1535:38
Name: RTS-GCLSINT$17 000000502 - 000000505
3 APP3*DPS(13).UCS/INTERFACE 1996 May 17 1434:58
Name: DPS$LINKBK 000000506 - 000000517
4 SYS$LIB$*LINKOMLIB(252).LS$INTERCEPT 1996 May 6 1506:03
Name: LS$INTERCEPT$04 000125464 - 000125613
6 bank parts:
1 QUAL*UCSTST(1).DMSSUB/COMP 1997 Feb 24 1218:12
Name: DMSSUB$1 000001000 - 000001565
2 APP3*DPS(13).UCS/INTERFACE 1995 May 17 1434:58
Name: DPS$CODEBK 000001566 - 000004544
3 SYS$LIB$*EMOMRTS(19).RTS-GCLSINT 1997 Mar 26 1535:38
Name: RTS-GCLSINT 000004545 - 000005437
4 SYS$LIB$*LINKOMLIB(252).LS$INTERCEPT 1996 May 6 1506:03
Name: LS$INTERCEPT$01 000005440 - 000007066
For error message descriptions, see subsection “UCS Runtime System Messages
(URTS)” in Appendix B of the appropriate UCS language manual, either:
When you use interpreted or embedded SQL in a program, RDMS uses the UCS C
malloc function to acquire dynamic memory allocations. Under HVTIP, C malloc space
is acquired from the HVTIP D-bank, program level BDI 5. When heap space runs out,
the malloc calls fail, returning NULL, and the program execution fails. However, if the
HVTIP ICP static link has an OUTPUT HVTIP2 statement instead of an OUTPUT HVTIP
statement, C malloc space then is taken from separate activity-level banks called
"pooled" banks. If your static link and VTBUTL VALTAB settings also supply activity-
level pooled banks, those banks are used for malloc space. If you do not supply any
pooled banks, CREATE$BANK calls are done to dynamically acquire activity-level banks
which are used for C malloc space. Those system calls result in your transaction losing
its TIP sticking and restart. See the OS 2200 Transaction Processing Administration
and Operations Reference Manual (7830 7881) for more details on how to supply
extra banks to the transaction. See the Linking System Programmer Reference
Manual for a description of the OUTPUT HVTIP2 statement.
Example
DSACTCNT, 2 DLACTCNT, 3 DASIZL, 3 DSPRGCNT, 2 DLPRGCNT, 3
DPSIZL, 3
DSLOWER, 0100000 DSUPPER, 0577777
where
Program-level
BDI 4 is the code bank, BDI 5 is the implicit (main) data heap bank, and extra
program-level heap banks start at BDI 6. The small banks will be allocated first,
followed by the large banks.
Activity-level
BDI 1 is reserved for code. BDI 2 is reserved for template data. Extra activity-level
heap banks start at BDI 3. The small banks are allocated first, followed by the
large banks.
Note: The extra program-level and activity-level heap banks are those specified
using the new VALTAB parameters. However, if no extra heap banks are specified
using new VALTAB parameters, and the LINK for the HVTIP-II ZOOM references
extra BDIs, the HVTIP heap manager will attempt to dynamically acquire those
specific BDIs.
Program-level BDI 4 and BDI 5 have the same meaning and purpose as in the original
UCS HVTIP environment. All other BDIs allocated represent bank containers with a
lower-limit of 0 and an upper-limit ending with 777777 (262,144 word blocks) unless
the DSLOWER or DSUPPER VALTAB keywords are used.
Example
HVTIP-II ICP LINK
@LINK
:
OUTPUT HVTIP2 WITH ALLOW_CREATE_BANK = FALSE,
TS_MISMATCH_ACTION = CANCEL
USING 4 SMALL_BANKS,
2 POOLED_SMALL_BANKS,
1 LARGE_BANKS,
LARGE_BANK_SIZE=2 FOR PROGRAM_LEVEL_HEAP
1 LARGE_BANKS,
LARGE_BANK_SIZE = 3
FOR ACTIVITY_LEVEL_HEAP
SET ICP=TRUE
SET BOOKKEEPING_SIZE=1
SET FAST_LOAD_MONITOR=1
SET LOWADR = 0600003002000 FOR HVTIP$$DSEG
where
The bank numbers of pooled banks (program or activity level) are always allocated at
the end of the corresponding (small or large) bank set. Large banks (program or
activity) always follow all small banks in the bank numbering scheme. (Pooled banks
are HVTIP-II heap banks that are reserved for data other than HVTIP segments. The
current uses for pooled banks include FLSS subsystem heap space and UCS malloc
space.) Note that malloc space is currently allocated only out of activity-level banks.
Also be aware that RDMS does C malloc calls to acquire workspace. If your HVTIP2
application uses RDMS and you do not supply any activity-level pooled banks, URTS
does a CREATE$BANK call and your transaction loses TIP sticking and restart.
Following the default BDI allocation mapping at program and activity level, the Linking
System creates an HVTIP-II ZOOM with this heap bank information since this ZOOM is
also an ICP:
In this example, small pooled banks are allocated at LBDI=0400010 and 0400011. Data
segments cannot be allocated to these banks. It is advisable to use the SET ICP
command to indicate whether or not the ZOOM being created is an ICP. Without the
SET ICP command, the Linking System has to determine whether or not the ZOOM
being created is an ICP, which is not possible to determine accurately in all situations.
When multiple heaps are being used, you should use the appropriate WITH and USING
clauses of the OUTPUT or PROCESS command to ensure that the pooled banks and
segments in large banks are handled as intended. Pooled bank count information is
only processed by the HVTIP heap manager if the ZOOM is truly being loaded as an
ICP, since that is the only time when heaps are initialized for the transaction. VALTAB
information overrides ZOOM information if they conflict.
The TS_MISMATCH_ACTION WITH clause is used to inform the HVTIP heap manager
what action to take when it finds that a subprogram ZOOM has been changed during
the execution of the transaction and its timestamp no longer matches the value it had
the last time the HVTIP heap manager loaded it.
The SET BOOKKEEPING_SIZE command allows for tailoring of various internal tables
used by the HVTIP heap manager. The most common reason for using this command
is when the following message is issued during transaction execution:
"Nested CALL limit exceeded, reLINK ICP"
In this case, the ICP should be relinked with a larger PSEUDOSTACK size. The SET
BOOKKEEPING_SIZE=1 command in the example sets the PSEUDOSTACK size to
accommodate 16 entries (the default is 8). Tailoring of the other tables and areas is
described in the Linking System Programming Reference Manual.
The SET FAST_LOAD_MONITOR command is used to set certain debugging flags for
processing by the HVTIP heap manager.
As noted earlier, the SET LOWADR command has been expanded for HVTIP-II. In the
example, a segment named HVTIP$$DSEG is to be located in the activity-level heap
specified by BDI 3 (LBDI 0600003) with a lower offset of 02000. The 0600003002000
is known as an extended mode virtual address (VA). The purpose of SET LOWADR is
the same in the HVTIP-II environment as in the original UCS HVTIP environment: to
eliminate or minimize data segment relocation within data heap banks, since relocation
is a costly operation. Given the expanded heap space available in HVTIP-II, it should be
much easier to allocate data segments to specific heap banks to avoid relocation
when loading.
The SET DEFAULT_LBDI command selects the LBDI for data banks and segments that
have no SET LOWADR LBDI specified. During an HVTIP-II or FLSS static link, the linker
remembers the latest program-level BDI and the latest activity-level BDI. The initial
default program-level BDI is 5, and the initial default activity-level BDI is 3. When the
statement SET LOWADR = 0100000 for x is encountered, the linker attaches the
current default BDI for bank x’s locality to bank x. If no SET LOWADR statement
exists for bank x, the last default is used.
Appendix E, "FLSS Heap Banks, Segment Addresses, and TIP Restarts" in the Linking
System Subsystems Programming Guide (7830 7451) gives good information on
details concerning linking and segment addresses for both FLSS subsystems and
HVTIP-II. There is a lot of similarity in the structure and run-time handling of FLSS
subsystems and HVTIP-II ZOOMs.
This section discusses topics relating to the use of the COBOL CALL identifier feature
in application programs.
Figure 7–1 shows the use of the CALL identifier statement. SUBPRGA and SUBPRGB
represent subprogram names. During execution, PROGRAM1 supplies either the value
SUBPRGA or the value SUBPRGB to identifier-1, depending upon the value of the
variable data-1. SUBPRGA or SUBPRGB is then called.
CALL identifier is a reference to a user program; therefore, the COBOL compiler has
attached the library code name UCS$EMUSER to the reference. (For information on
this process, see the Linking System Programming Reference Manual.) Thus, the
Linking System searches the files represented by UCS$EMUSER for the definition of
identifier.
• Define the library code name $LOCAL to include a search of the file containing the
desired subprogram. (For information on this process, see the Linking System
Programming Reference Manual.)
Note that when you use CALL identifier for ASCII identifiers, COBOL automatically
converts all letters in the reference name to uppercase before passing the name to
the Linking System.
When using the COBOL CALL identifier in object modules, the code that is targeted
does not need to be static linked into your application. The linker can find and load the
code if the entry point called does not exist in the currently executing code. If you
have a very large application where most of the code will usually never be called, this
can help minimize the size of the code that is loaded during execution. If a module isn't
called it will not be loaded. You can also do this with standard calls (CALL subprog-
name). You can leave the targets of the calls “dangling” (unresolved) by not linking
them into your application. If called at execution time, a link-fault will occur and the
code will be loaded by the linker.
Note: This strategy does not work with ZOOMs. ZOOMs cannot link-fault.
For standard object modules, the default method of handling the COBOL CALL
identifier results in a call to the linker. This involves a lookup and possibly an object
module load if the code has not been loaded yet. The linker is single-thread on these
calls. Transactions that call into a subsystem that heavily uses COBOL CALL identifier
can end up queuing behind the linker's Test & Set cell due to the heavy traffic. This is
especially true if the subsystem is a Self Contained Subsystem (SCSS) that often also
needs the linker to load the local SCSS dbank when called from a new transaction
copy. A load takes much longer than a simple name-resolution call. So, object modules
(and especially SCSSs) would benefit greatly from using the expedited LSI$RES-NAME
method to handle CALL identifier calls that was originally implemented for ZOOMs
and is described in the following sections. Object modules can also use the LSI$RES-
NAME method in a way that blends and optimizes the two approaches to handling
CALL identifier. That is described in section 7.4
From the release tape, you copy a source program that explicitly resolves the CALL
identifier statement. (This interface is named LS$RES_NAME.) You edit this program
as necessary, so that it includes all definitions potentially needed for resolving CALL
identifier statements in your program You assemble this program. Finally, you include
this program in the static link when you create your TIP or HVTIP ZOOM.
2. At the designated place in this element, write a DECLARE directive for each
possible CALL identifier value. DECLARE directives create the required entry
point definitions. Make sure that the value of identifier is in uppercase. For
example
DECLARE 'IDENTIFIER-1',*0,*0,*0
4. Include the object module produced in step 3 in the static link when creating the
calling program’s COBOL ZOOM. This incorporates the set of CALL identifier
definitions into the ZOOM.
For example
INCLUDE Q*USER-FILE.LSI$RES-NAME/OM
RESOLVE ALL REFERENCES EXCEPT LS$RES_NAME USING LCN
or
RESOLVE ALL REFERENCES USING Q*USER-FILE.,LCN
or
INCLUDE Q*USER-FILE.LSI$RES-NAME/OM
RESOLVE ALL REFERENCES USING LOCAL_DEFS, LCN
When the system loads the COBOL ZOOM, the code included within the ZOOM in
step 4 resolves each CALL identifier reference using the definitions provided by the
DECLARE directives described in step 2. Each definition represents a subprogram
entry point; when the CALL identifier statement calls such an entry point, the called
subprogram is loaded and executed.
See 7.3.1 for the listing of the LSI$RES-NAME element described in step 1. See 7.3.2
for a description of the DECLARE directive mentioned in step 2.
. 02273
ls$resnm_stp* $equ $-ls$resnm_dat . 05512
'*RES' . tag the end 05512
'END*' . tag the end 05512
+0 . # Dynamic calls done to linker 05515
. 02273
$(1) $bank om$code_emb . 02273
. 02273
ls$res_name* . 02273
. 02273
lx,u x2,0 . Void the LV register 02408
lbu b2,r0 . Base the LVE bank 02273
. 02273
$IF DESIRED_RES=0 . 05512
om$call ls$fastresnm . Call the actual LS$RES_NAME code(3)02273
$ELSE . 05512
l,u a2,DESIRED_RES . 05512
om$call ls$fastres2 . This one will dynamically-resolve 05512
. any EPs not in the list,and add them
. to the 'RES' area of the list. 05512
$ENDF . 05512
rtn . Return to the caller 02273
. 02273
$end . 02273
Explanations
1. These are examples of DECLARE directives (see 7.3.2) for programs called by
COBOL CALL identifier statements.
2. Specify your DECLARE directives immediately following the comment “Put the
SET or DECLARE directives here.”
3. During assembly (@MASM), the “om$call ls$fastresnm” statement receives a “U”
flag, indicating an undefined name in the assembly. You can ignore this “U” flag:
The name will be resolved by the static-link process when you statically link the
ZOOM.
(The two-word definition is in link-vector-entry format: One word contains the virtual
address of the entry point, one word contains the virtual address of the called
subprogram’s link vector bank. See the Linking System Programming Reference
Manual for details.)
Generic Format
DECLARE[,1] 'string-name', exref-name, libcodename, type
,1
is an optional flag indicating that the CANCEL CN$$... version of the entry point
should be generated also. This only works on the LSI$RES-NAMH version.
where
'subprog-name'
is the subprogram name whose entry point definition is required. (This is the actual
subprogram name, not the variable data name specified in the CALL identifier
statement itself.)
Enclose the value within apostrophes. Make sure the value you supply for
subprog-name is in uppercase.
exref-name
is typically the same as ’subprog-name’. The default, denoted by *0, is
’subprog-name’.
libcodename
is the library code name representing the file or files containing the definition of
’subprog-name’. The default, denoted by *0, is $DEFAULT. Always specify *0.
type
identifies the kind of resolution needed so that the correct type of definition is
returned for ’subprog-name’ The default, denoted by *0, is LS$STRONG_LVE.
Examples
Assume that a COBOL program contained the following statement:
CALL name.
where name is an alphanumeric variable that contains one of the following ASCII
strings: “SUBPRGA” or “SUBPRGB”. The following DECLARE directives would be
used for subprograms SUBPRGA and SUBPRGB.
DECLARE 'SUBPRGA',*0,*0,*0
DECLARE 'SUBPRGB',*0,*0,*0
If you are in an HVTIP environment, you must use an HVCALLS element to identify the
location of the HVTIP library and bank number for the desired subprogram. In this
case, the subprogram name specified in the HV$CALL or HV$XFR$CANCL statement
must exactly match the subprogram name in the DECLARE directive.
(These examples assume SUBPRGA resides in library number 4, bank number 15, and
SUBPRGB in library number 4, bank number 16.)
Examples
As an example, a COBOL subprogram both calls and CANCELs an identifier whose
value could be ’SUBPRGA’ or ’SUBPRGB’. Here is a portion of the COBOL program,
and the DECLARE directives necessary for the LSI$RES-NAME and LSI$RES-NAMH
elements.
.
.
LINKAGE SECTION.
01 PROGNAME PIC X(12).
01 PARM1 PIC X(12).
PROCEDURE DIVISION USING PROGNAME PARM1.
BEGIN.
CALL PROGNAME USING PARM1.
CANCEL PROGNAME.
EXIT PROGRAM.
You should also see Appendix D in the Linking System Subsystems Programming
Guide (7830 7451–004) concerning the COBOL CANCEL statement. It gives more
details on COBOL CANCEL, including CANCELs of code in fixed-gate subsystems.
However, that may result in a lot more code and data being loaded than is actually
needed if many of those entry points will never be called. This is true both for Home
Subsystem executables and fixed gate subsystems. For Self Contained Subsystems
(SCSS) this can be especially important since every execution thread using an SCSS
requires the linker to load its local data. Loading “extra” data for code that will never
be called can result in a significant amount of wasted memory.
For object modules (but not for ZOOMs), you can use the LSI$RES-NAME method in a
way that blends the quite-dynamic method of calling the linker and the quite-static
method of linking-in all of the code into your application at static link time. In the
LSI$RES-NAME source, there is a place where it tells you to put your DECLARE
directives. Right after it is a place where you can define a reserve area that can be
used to dynamically place entry points that are called by CALL identifier and that are
not in the original DECLARE list. If you define a reserve area and a CALL identifier
name is not in the list, the linker will be called to resolve the name (and load it if it
hasn't been loaded yet) and it will be placed into the list in the reserve area. It is then
immediately accessible the next time it is needed with no linker call. The reserve area
is empty in the supplied LSI$RES-NAME copy in the linker file. This is the statement
that defines it:
You can even take it to the extreme and not place any DECLARE directives in the
LSI$RES-NAME element, and define only a reserve area if you wish. All names called
by CALL identifier will then be dynamically resolved by the linker and placed into the
list. Once most of the names that are being called have been placed into the list, you
are no longer calling the linker and potentially queuing-up behind its Test & Set. If the
list is not large enough for all of the entry points that are called by CALL identifier, new
ones will still be resolved by dynamic calls to the linker but will not be tabled in the list.
Each call will go to the linker to be “resolved”, which is the same thing that happens
on normal CALL identifer calls with object modules.
When you define a reserve area in LSI$RES-NAME, you must estimate the space that
is needed. Each entry point needs space for the entry point name in ASCII and for 3
words of control information. The entry point "DB-SUBPROG" would need 6 words.
When you estimate the reserve area size, don't make it too small. If the list fills-up
then the CALL identifier calls executed on entry points not in the list will end-up
always going to the linker, impairing efficiency.
Here is an example. Assume you wish to set up an LSI$RES-NAME for your application
where you want to initially only put the names "ICP-DRIVER" and "VALIDATE-PARMS"
into the DECLARE list. You have also determined that you would need about 300
words for the dynamic reserve area to handle the other names that will come-in
dynamically. This is what the LSI$RES-NAME code would look like. (Some of the
comments that tell you how to use this method have been removed from the source
below.)
. 02273
. ************************************************************** 03151
. ** COBOL CALL identifier-1 EXAMPLEs: ** 05512
. ** If an entry point can be CANCEL'd, put in its ** 05512
. ** CN$$... name also. ** 05512
. ** ** 03151
. ** DECLARE 'SUBPRGA',*0,*0,*0 ** 03151
. ** DECLARE 'DATABASE-UPDATE',*0,*0,*0 ** 05512
. ** DECLARE 'CN$$DATABASE-UPDATE',*0,*0,*0 ** 05512
. ** ** 03151
. ************************************************************** 03151
. 03151
. Put your SET or DECLARE directives here. (They are case-sensitive) 05512
. There is no minimum or maximum number (within reason) 05512
. 02273
DECLARE 'ICP-DRIVER',*0,*0,*0,*0
DECLARE 'VALIDATE-PARMS',*0,*0,*0
. 02273
. End of user-inserted SET or DECLARE directives 05512
. 02273
. ************************************************************** 02273
. 02273
. 02273
. If you wish to define a list 'RES' area for names to be dynamically 05512
. found and added to the list at runtime, put the desired reserve value 05512
. in the tag DESIRED_RES below. 05512
. 05512
. 05512
DESIRED_RES $EQU 300 . <<< Change this value to define a 'RES' area<<<<<<<
. 05512
$DO DESIRED_RES , +0 . <<< Do NOT edit this line, zeros are required<<<<<<
. 05512
. ******************************************************************** 05512
. 02273
ls$resnm_stp* $equ $-ls$resnm_dat . 05512
The following figure summarizes the COBOL main program and subprograms used in
the example. In this example, PROGRAM1 is a main program that calls either
subprogram SUBPRGA or subprogram SUBPRGB, depending on the value of the
variable data-1. Either ’SUBPRGA’ or ’SUBPRGB’ is substituted for identifier-1 in the
CALL identifier statement.
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A MAIN PROGRAM "PROGRAM1" THAT USES THE *
* CALL identifier-1 STATEMENT TO CALL EITHER *
* SUBPROGRAM "SUBPRGA" OR SUBPROGRAM "SUBPRGB" *
* *
******************************************************************
******************************************************************
PROGRAM-ID. PROGRAM1.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DATA-1 PIC X(3).
01 IDENTIFIER-1 PIC X(7).
PROCEDURE DIVISION.
******************************************************
*** PROGRAM1 START UP ***
******************************************************
BEGIN.
DISPLAY 'THIS IS PROGRAM1' UPON PRINTER.
******************************************************
*** READ INPUT DATA ***
******************************************************
READ-DATA-INPUT.
ACCEPT DATA-1.
******************************************************
*** CALL TO SUBPRGA OR SUBPRGB ***
*** DEPENDING ON INPUT DATA ***
******************************************************
CALL-ID.
DISPLAY ' PROGRAM1: DATA-1 = ' DATA-1 UPON PRINTER.
IF DATA-1 = 'ABC'
THEN
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "SUBPRGA" THAT IS CALLED USING *
* CALL identifier-1 FROM THE MAIN PROGRAM "PROGRAM1" *
* *
******************************************************************
******************************************************************
PROGRAM-ID. SUBPRGA.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
******************************************************
*** SUBPRGA START UP ***
******************************************************
BEGIN.
DISPLAY ' THIS IS SUBPROGRAM SUBPRGA' UPON PRINTER.
DISPLAY ' SUBPRGA: CALL IDENTIFIER-1. WORKED'
UPON PRINTER.
******************************************************
*** SUBPROGRAM RETURN ***
******************************************************
RETURN-TO-PROGRAM1.
DISPLAY ' RETURN FROM SUBPROGRAM SUBPRGA'
UPON PRINTER.
EXIT PROGRAM.
Example 7–5 shows the complete source listing of subprogram SUBPRGB. In this
example, this program is found in element QUAL*UCSTST.SUBPRGB.
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "SUBPRGB" THAT IS CALLED USING *
* CALL identifier-1 FROM THE MAIN PROGRAM "PROGRAM1" *
* *
******************************************************************
******************************************************************
PROGRAM-ID. SUBPRGB.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
******************************************************
*** SUBPRGB START UP ***
******************************************************
BEGIN.
DISPLAY ' THIS IS SUBPROGRAM SUBPRGB' UPON PRINTER.
DISPLAY ' SUBPRGB: CALL IDENTIFIER-1. WORKED'
UPON PRINTER.
******************************************************
*** SUBPROGRAM RETURN ***
******************************************************
RETURN-TO-PROGRAM1.
DISPLAY ' RETURN FROM SUBPROGRAM SUBPRGB'
UPON PRINTER.
EXIT PROGRAM.
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** ****** CALL 'identifier' LSI$RES-NAME ROUTINE*****
@ . ***
@ . ***
@ . *** THE LINKING SYSTEM ELEMENT SYS$LIB$*LINK.LSI$RES-NAME
@ . *** IS COPIED TO THE USER FILE USING THE FOLLOWING STATEMENT.
@ . ***
@ . *** @COPY,S SYS$LIB$*LINK.LSI$RES-NAME,
@ . *** QUAL*UCSTST.LSI$RES-NAME/STANDARD
@ . ***
@ . ***
@ . *** THE USER ELEMENT LSI$RES-NAME/STANDARD IS THEN EDITED TO
@ . *** INCLUDE THE TWO DECLARE STATEMENTS FOR THE TWO SUBPROGRAMS.
@ . ***
@ . *** DECLARE 'SUBPRGA',*0,*0,*0
@ . *** DECLARE 'SUBPRGB',*0,*0,*0
@ . ***
@ . ***
@ . *** THE USER ELEMENT LSI$RES-NAME/STANDARD IS THEN ASSEMBLED.
@ . ***
@MASM,N QUAL*UCSTST.LSI$RES-NAME/STANDARD,QUAL*UCSTST.
@EOF
@ . ***
@ . ***
@ . *** COMPILE OF MAIN PROGRAM 'PROGRAM1'
@ . ***
@UCOB QUAL*UCSTST.PROGRAM1,.PROGRAM1/COMP,,,NO-OPTIONS
@ . ***
@ . ***
@ . *** COMPILE OF SUBPROGRAM 'SUBPRGA'
@ . ***
@UCOB QUAL*UCSTST.SUBPRGA,.SUBPRGA/COMP,,,SUBPROGRAM,NO-OPTIONS
@ . ***
@ . ***
@ . *** COMPILE OF SUBPROGRAM 'SUBPRGB'
Example 7–6. Runstream to Set Up, Compile, Link and Execute—COBOL Standard
ZOOM
@ . ***
@UCOB QUAL*UCSTST.SUBPRGB,.SUBPRGB/COMP,,,SUBPROGRAM,NO-OPTIONS
@ . ***
@ . ***
@ . *** LINK OF THE MAIN PROGRAM 'PROGRAM1',
@ . *** SUBPROGRAM 'SUBPRGA', AND
@ . *** SUBPROGRAM 'SUBPRGB'.
@ . *** THIS INCLUDES THE USER ELEMENT LSI$RES-NAME/STANDARD.
@ . ***
@LINK ,QUAL*UCSTST.PROGRAM1
INCLUDE QUAL*UCSTST.PROGRAM1/COMP
INCLUDE QUAL*UCSTST.LSI$RES-NAME/STANDARD
INCLUDE QUAL*UCSTST.SUBPRGA/COMP
INCLUDE QUAL*UCSTST.SUBPRGB/COMP
RESOLVE ALL REFERENCES EXCEPT LS$RES_NAME USING LIBCODENAME
PROCESS FOR EXTENDED ZOOM
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** ******* FIRST EXECUTION *******
@ . ***
@ . *** THE FIRST EXECUTION OF MAIN PROGRAM 'PROGRAM1'
@ . *** WILL PROVIDE INPUT 'ABC' THEREFORE SUBPROGRAM 'SUBPRGA'
@ . *** WILL BE CALLED
@ . ***
@XQT QUAL*UCSTST.PROGRAM1
ABC
@ . ***
@ . ***
@ . *** ******* SECOND EXECUTION *******
@ . ***
@ . *** THE SECOND EXECUTION OF MAIN PROGRAM 'PROGRAM1'
@ . *** WILL PROVIDE INPUT 'XYZ' THEREFORE SUBPROGRAM 'SUBPRGB'
@ . *** WILL BE CALLED
@ . ***
@XQT QUAL*UCSTST.PROGRAM1
XYZ 0000
@ . ***
@ . ***
@ . *** TESTING IS COMPLETE
Example 7–6. Runstream to Set Up, Compile, Link and Execute—COBOL Standard
ZOOM
@ . ***
@ . ******** START OF THE EXAMPLE SETUP SECTION **********************
@ . ***
@ . ***
@ . *** ****** CALL 'IDENTIFIER' LSI$RES-NAME ROUTINE*****
@ . ***
@ . ***
@ . *** THE LINKING SYSTEM ELEMENT SYS$LIB$*LINK.LSI$RES-NAME
@ . *** IS COPIED TO THE USER FILE USING THE FOLLOWING STATEMENT.
@ . ***
@ . *** @COPY,S SYS$LIB$*LINK.LSI$RES-NAME,
@ . *** QUAL*UCSTST.LSI$RES-NAME/STANDARD
@ . ***
@ . ***
@ . *** THE USER ELEMENT LSI$RES-NAME/STANDARD IS THEN EDITED TO
@ . *** INCLUDE THE TWO DECLARE STATEMENTS FOR THE TWO SUBPROGRAMS.
@ . ***
@ . *** DECLARE 'SUBPRGA',*0,*0,*0
@ . *** DECLARE 'SUBPRGB',*0,*0,*0
@ . ***
@ . ***
@ . *** THE USER ELEMENT LSI$RES-NAME/STANDARD IS THEN ASSEMBLED.
@ . ***
@MASM,N QUAL*UCSTST.LSI$RES-NAME/STANDARD,QUAL*UCSTST.
MASM 6R2A (960423 0008:22) 1997 Feb 20 Thu 1527:31
ASSEMBLY CONTAINS WARNINGS: - FLAGS: U
END MASM - LINES: 592 TIME: 4.651 STORAGE: 29345/10294 WARNINGS: U(1)
@ . ***
@ . ***
@ . *** COMPILE OF MAIN PROGRAM 'PROGRAM1'
@ . ***
@UCOB QUAL*UCSTST.PROGRAM1,.PROGRAM1/COMP,,,NO-OPTIONS
UCOB- 8R1 (970210) LSS- 10R1 (970209) 970220 15:27:34
SIZES: CODE(EM6): 143 DATA: 394
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@ . ***
@ . ***
@ . *** COMPILE OF SUBPROGRAM 'SUBPRGA'
@ . ***
@UCOB QUAL*UCSTST.SUBPRGA,.SUBPRGA/COMP,,,SUBPROGRAM,NO-OPTIONS
THIS IS PROGRAM1
@ . ***
@ . ***
THIS IS PROGRAM1
@ . ***
@ . ***
@ . *** TESTING IS COMPLETE
The following figure summarizes the COBOL main program and subprograms used in
the example. In this example, PRGRM1 is a TIP main program that calls either TIP
subprogram SUBPRGC or TIP subprogram SUBPRGD, depending on the value of the
variable data-1. Either “SUBPRGC” or “SUBPRGD” is substituted for identifier-1 in the
CALL identifier statement.
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A TIP MAIN PROGRAM "PRGRM1" THAT USES THE *
* CALL identifier-1 STATEMENT TO CALL EITHER *
* SUBPROGRAM "SUBPRGC" OR SUBPROGRAM "SUBPRGD" *
* *
******************************************************************
******************************************************************
PROGRAM-ID. PRGRM1.
ENVIRONMEN DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DATA-1 PIC X(3).
01 IDENTIFIER-1 PIC X(7).
******************************************************
*** DPS PROCEDURES ***
******************************************************
COPY DPSSTATUSCOB.
COPY INFO-BUFFER.
COPY GETFIELD.
PROCEDURE DIVISION.
******************************************************
*** TRANSACTION INITIALIZATION ***
******************************************************
BEGIN.
CALL 'D$INIT' USING DPS-STATUS, INFO-BUFFER.
IF STATUS-FATAL GO TO DPS-GENERAL-ERROR-PARA.
DISPLAY 'THIS IS PRGRM1' UPON PRINTER.
******************************************************
*** READ INPUT DATA ***
******************************************************
READ-DATA-INPUT.
CALL 'D$GETFL' USING DPS-STATUS, GET-FIELD.
IF STATUS-FATAL GO TO DPS-GENERAL-ERROR-PARA.
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "SUBPRGC" THAT IS CALLED USING *
* CALL identifier-1 FROM THE TIP MAIN PROGRAM "PRGRM1" *
* *
******************************************************************
******************************************************************
PROGRAM-ID. SUBPRGC.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
******************************************************
*** SUBPRGC START UP ***
******************************************************
BEGIN.
DISPLAY ' THIS IS SUBPROGRAM SUBPRGC' UPON PRINTER.
DISPLAY ' SUBPRGC: CALL IDENTIFIER-1. WORKED'
UPON PRINTER.
******************************************************
*** SUBPROGRAM RETURN ***
******************************************************
RETURN-TO-PRGRM1.
DISPLAY ' RETURN FROM SUBPROGRAM SUBPRGC'
UPON PRINTER.
EXIT PROGRAM.
Example 7–11 shows the complete source listing of subprogram SUBPRGD. In this
example, this program is found in element QUAL*UCSTST.SUBPRGD.
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "SUBPRGD" THAT IS CALLED USING *
* CALL identifier-1 FROM THE TIP MAIN PROGRAM "PRGRM1" *
* *
******************************************************************
******************************************************************
PROGRAM-ID. SUBPRGD.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
******************************************************
*** SUBPRGD START UP ***
******************************************************
BEGIN.
DISPLAY ' THIS IS SUBPROGRAM SUBPRGD' UPON PRINTER.
DISPLAY ' SUBPRGD: CALL IDENTIFIER-1. WORKED'
UPON PRINTER.
******************************************************
*** SUBPROGRAM RETURN ***
******************************************************
RETURN-TO-PRGRM1.
DISPLAY ' RETURN FROM SUBPROGRAM SUBPRGD'
UPON PRINTER.
EXIT PROGRAM.
Example 7–12. Runstream to Set Up, Compile, and Link—COBOL TIP ZOOM
Example 7–12. Runstream to Set Up, Compile, and Link—COBOL TIP ZOOM
@XQT,XIMUZ TIP$*TIPRUN$.VTBUTL
*VALCHG M
970 NAM,PRGRM1 ACT,PRGRM1 PRG,3 STF,0 QPR,1 STA,J
970 REC,Z AUD,3 PRT,PR
@EOF
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF BTLOADING
OFF STICKING
ON RECOVERY
OFF SCHEDULE
@EOF
@ . ***
@XQT TIP$*TIPRUN$.TPINIT
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
ON BTLOADING
ON STICKING
@EOF@ . ***
@ . ***
@ . *** ** SUPUR FILE SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** SUPUR TIP FILE.
@ . ***
@CAT,P UDS$$SRC*SUPURFILE.,F/1000//1000
@ . ***
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE TIP SUPUR FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE SUPUR TIP FILE THIS TEST USES FOR THE
@ . *** TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG UDS$$SRC*SUPURFILE.,FIX
RES 997,64000,28,,SUPURFILE,,,WW=P,AUDIT=0,NREC
LFD 997
@EOF
@ . ***
@ . *** USE THE SUPUR UTILITY TO CREATE A SUPUR PROGRAM FILE,
@ . *** COPY TRANSACTION PROGRAMS INTO THE SUPUR PROGRAM FILE, AND
@ . *** PLACE THE SUPUR PROGRAM FILE ONLINE.
@ . ***
Example 7–12. Runstream to Set Up, Compile, and Link—COBOL TIP ZOOM
@TIP$*TIPRUN$.SUPUR,P
CREATE 997 MAIN
COPY ONLY PRGRM1 FROM QUAL*UCSTST TO 997
ONLINE 997
LIST ALL FROM 997
EXIT
@ . ***
@ . ***
@ . *** EXAMPLE SETUP IS COMPLETE
Example 7–12. Runstream to Set Up, Compile, and Link—COBOL TIP ZOOM
PRGRM1 ABC
THIS IS PRGRM1
Example 2
The following screen shows another execution of the TIP transaction described
previously. User input is bolded.
PRGRM1XYZ
THIS IS PRGRM1
The following figure summarizes the COBOL ICP and subprograms used in the
example. In this example, MCBICP is an HVTIP ICP that calls one of the following,
depending upon the input transaction code:
• One of three entry points in subprogram MCBSUBA
• The main (and only) entry point in subprogram MCBSUBX
Any of the following is substituted for identifier-1 in the CALL identifier statement:
• MCBSUBA (the first entry point of subprogram MCBSUBA)
• MCBEP2 (the second entry point of subprogram MCBSUBA)
• MCBEP3 (the third entry point of subprogram MCBSUBA)
• MCBSUBX (the main entry point of MCBSUBA)
MCBICP
IDENTIFICATION DIVISION.
PROGRAM-ID. MCBICP. MCBSUBA
IDENTIFICATION DIVISION.
DATA DIVISION. PROGRAM-ID. MCBSUBA.
EXIT PROGRAM.
EVALUATE P-MCB-TRANS-CODE MCBEP2.
WHEN 'MCBHVT'
MOVE 'MCBSUBX' TO identifier-1
EXIT PROGRAM.
WHEN 'MCBEP1'
MOVE 'MCBSUBA' TO identifier-1 MCBEP3.
WHEN 'MCBEP2'
MOVE 'MCBEP2' TO identifier-1 EXIT PROGRAM.
WHEN OTHER
MOVE 'MCBEP3' TO identifier-1
END-EVALUATE.
CALL identifier-1.
MCBSUBX
STOP RUN
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF AN INITIAL CONTROL PROGRAM "MCBICP" USING MCB THAT *
* PERFORMS A TRANSFER WITH CANCEL TO A SUBPROGRAM "MCBSUBX" OR *
* A CALL TO ONE OF THE SUBPROGRAM "MCBSUBA ENTRY POINTS: *
* MCBSUBA (the first entry point), MCBEP2, MCBEP3. *
* CALL identifier-1 IS USED. *
* *
******************************************************************
******************************************************************
PROGRAM-ID. MCBICP.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
01 IDENTIFIER-1 PIC X(7).
COPY MCBPKT-UCOB.
PROCEDURE DIVISION.
******************************************************
*** TRANSACTION INITIALIZATION ***
******************************************************
START-UP-ICP.
DISPLAY 'THIS IS MCBICP' UPON PRINTER.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 1 TO P-BIT2.
MOVE P-TRINIT TO P-FUNC.
MOVE 80 TO P-LENGTH.
MOVE 63 TO P-AUX.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS, P-TRXBUFF.
IF P-STATBIT NOT EQUAL ZERO GO TO ERROR-EXIT.
DISPLAY 'INITIALIZATION COMPLETE' UPON PRINTER.
MOVE P-MCB-TRANS-CODE TO COMMON-FIELD-1.
******************************************************
*** TRANSFER WITH CANCEL TO MCBSUBX ***
*** OR ***
*** CALL TO ONE OF THREE ENTRY POINTS ***
*** OF MCBSUBA ***
*** DEPENDING ON THE TRANSACTION CODE ***
*** USING CALL identifier-1 ***
******************************************************
SETUP-CALL-TO-SUBPROGRAM.
EVALUATE P-MCB-TRANS-CODE
WHEN 'MCBHVT'
DISPLAY 'MCBICP TRANSFERRING WITH CANCEL TO MCBSUBX'
UPON PRINTER
MOVE 'MCBSUBX' TO identifier-1
WHEN 'MCBEP1'
DISPLAY 'MCBICP CALLING MCBSUBA' UPON PRINTER
MOVE 'MCBSUBA' TO identifier-1
WHEN 'MCBEP2'
DISPLAY 'MCBICP CALLING MCBEP2' UPON PRINTER
MOVE 'MCBEP2' TO identifier-1
WHEN OTHER
DISPLAY 'MCBICP CALLING MCBEP3' UPON PRINTER
MOVE 'MCBEP3' TO identifier-1
END-EVALUATE.
CALL IDENTIFIER-1.
******************************************************
*** RETURN TO MCBICP ***
******************************************************
RETURN-FROM-MCBSUBA.
DISPLAY 'RETURNED TO MCBICP FROM SUBPROGRAM MCBSUBA'
UPON PRINTER.
****************************************************
*** TRANSACTION TERMINATION ***
****************************************************
MCB-TERMINATE.
DISPLAY 'TERMINATING FROM MCBICP ' UPON PRINTER.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 0 TO P-FLAGS.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
IF P-STATBIT NOT EQUAL ZERO GO TO ERROR-EXIT.
STOP RUN.
****************************************************
*** MCB ERROR HANDLING ***
****************************************************
ERROR-EXIT.
DISPLAY '********* MCB ERROR *********' UPON PRINTER.
MCBPKT-UCOB PROC
/
*
* Sample MCB procedure for use in UCOB transactions
*
************************************************
** TRANSACTION CODE BUFFER **
************************************************
01 P-TRXCODE PIC X(6).
************************************************
** INPUT BUFFER **
** This buffer will hold a 24 X 80 screen. **
** The maximum size is PIC X(262143). **
************************************************
01 P-INMSG PIC X(1920).
**************************************************
** BUFFER ADDRESS **
**************************************************
01 P-MSG-LENGTH PIC 9(10) BINARY.
01 P-SAVEPID PIC 1(18) BINARY-1.
01 P-TRXBUFF PIC X(1920) VALUE SPACES.
**************************************************
** MCB ERROR STATUS RETURN **
**************************************************
01 P-MCB-STATUS.
02 P-STATBIT PIC S9(5) BINARY.
02 P-ERRCODE PIC 9(5) BINARY-1.
02 P-ERRCODE REDEFINES P-ERRCODE.
04 P-ERRCODEQ3 PIC 1(9) BINARY-1.
. HVCALLS DEFINITION
. MCBSUBX is defined as a TRANSFER WITH CANCEL
. MCBSUBA first entry point is defined as a CALL
. MCBSUBA second entry point (MCBEP2) is defined as a CALL
. MCBSUBA third entry point (MCBEP3) is defined as a CALL
.
$OBJ .
$INCLUDE 'OM$DEF' .
$INCLUDE 'HVTIP$CALLS' .
$INCLUDE 'SYS$*RLIB$.CBEP$$EMCALL' .
MCBSUBX HV$XFR$CANCL 22,7,0 . transfer with cancel to MCBSUBX code
MCBSUBA HV$CALL 22,10,01000 . call MCBSUBA definition
MCBEP2 HV$CALL 22,10,01003 . call MCBEP2 definition
MCBEP3 HV$CALL 22,10,01006 . call MCBEP3 definition
$END
. If you wish to define a list 'RES' area for names to be dynamically 05512
. found and added to the list at runtime, put the desired reserve value 05512
. in the tag DESIRED_RES below. 05512
. 05512
DESIRED_RES $EQU 0 . <<< Change this value to define a 'RES' area<<<<<<<
05512
$DO DESIRED_RES , +0 . <<< Do NOT edit this line, zeros are required<<<<<
. 05512
. ********************************************************************* 05512
. 02273
ls$resnm_stp* $equ $-ls$resnm_dat . 05512
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "MCBSUBA" THAT WAS CALLED FROM THE ICP *
* "MCBICP" USING A CALL TO ONE OF THE THREE ENTRY POINTS: *
* MCBSUBA, MCBEP2, MCBEP3. *
* *
******************************************************************
******************************************************************
PROGRAM-ID. MCBSUBA.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
PROCEDURE DIVISION WITH ENTRY POINTS MCBEP2, MCBEP3.
MCBEP1.
DISPLAY ' THIS IS MCBSUBA "MCBEP1" ENTRY POINT'
UPON PRINTER.
DISPLAY ' TRANSACTION CODE ' COMMON-FIELD-1 ' WAS'
UPON PRINTER.
DISPLAY ' USED TO ENTER MCBSUBA AT THIS ENTRY POINT'
UPON PRINTER.
DISPLAY ' RETURNING TO MCBICP ' UPON PRINTER.
EXIT PROGRAM.
*
MCBEP2.
DISPLAY ' THIS IS MCBSUBA "MCBEP2" ENTRY POINT '
UPON PRINTER.
DISPLAY ' TRANSACTION CODE ' COMMON-FIELD-1 ' WAS'
UPON PRINTER.
DISPLAY ' USED TO ENTER MCBSUBA AT THIS ENTRY POINT'
UPON PRINTER.
DISPLAY ' RETURNING TO MCBICP ' UPON PRINTER.
EXIT PROGRAM.
*
MCBEP3.
DISPLAY ' THIS IS MCBSUBA "MCBEP3" ENTRY POINT '
UPON PRINTER.
DISPLAY ' TRANSACTION CODE ' COMMON-FIELD-1 ' WAS'
UPON PRINTER.
DISPLAY ' USED TO ENTER MCBSUBA AT THIS ENTRY POINT'
UPON PRINTER.
DISPLAY ' RETURNING TO MCBICP ' UPON PRINTER.
EXIT PROGRAM.
. JUMPVECTOR DEFINITION
. THE THREE ENTRY POINTS FOR MCBSUBA ARE DEFINED
. MCBSUBA first entry point (MCBEP1)
. MCBSUBA second entry point (MCBEP2)
. MCBSUBA third entry point (MCBEP3)
.
$OBJ
$EXTEND
$INCLUDE 'MAXR$'
$INCLUDE 'OM$DEF'
$INCLUDE 'SYS$LIB$*LINK.HVTIP$CALLS'
. .
OM$USE_LV,0 . Define link vector bank as $(0)
. .
$(1) $BANK HV$CODE_EMB,01000 . Define an extended mode code bank
. . that starts at 01000 and has the
. . MERGE_ORDER bank attribute set to
. . FIRST.
. . That causes this bank to always
. . be at the front of any bank
. . into which it is merged.
. .
JUMPER* . Start address for HVTIP subprogram
. .
HV$VECTOR MCBSUBA . Offset 01000 will pass control
. . to MCBSUBA (MCBEP1)
. .
HV$VECTOR MCBEP2 . Offset 01003 will pass control
. . to MCBEP2
. .
HV$VECTOR MCBEP3 . Offset 01006 will pass control
. . to MCBEP3
. .
$END
Example 7–19. Source Listing of Jump Vector Element for Subprogram MCBSUBA
(QUAL*UCSTST.JUMPVECTOR/MCBSUBA)
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
* *
* EXAMPLE OF A SUBPROGRAM "MCBSUBX" THAT WAS CALLED FROM THE ICP *
* "MCBICP" USING TRANSFER WITH CANCEL
* *
******************************************************************
******************************************************************
PROGRAM-ID. MCBSUBX.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
SPECIAL-NAMES.
PRINTER IS PRINTER.
DATA DIVISION.
COMMON-STORAGE SECTION.
01 COMMON-FIELD-1 PIC X(6).
WORKING-STORAGE SECTION.
COPY MCBPKT-UCOB.
PROCEDURE DIVISION.
******************************************************
*** MCBSUBX START UP ***
******************************************************
START-UP-SUBX.
DISPLAY ' THIS IS MCBSUBX' UPON PRINTER.
****************************************************
*** TRANSACTION TERMINATION ***
****************************************************
MCB-TERMINATE.
DISPLAY ' TERMINATING FROM MCBSUBX' UPON PRINTER.
MOVE LOW-VALUES TO P-MCB-PACKET.
MOVE 0 TO P-MCB-STATUS.
MOVE 0 TO P-FLAGS.
MOVE P-TERM TO P-FUNC.
CALL 'MCB$ENT' USING P-MCB-PACKET, P-MCB-STATUS.
IF P-STATBIT NOT EQUAL ZERO GO TO ERROR-EXIT.
STOP RUN.
****************************************************
Example 7–21. Runstream to Set Up, Compile, and Link—COBOL HVTIP ZOOM
@ . ***
@PDP,UC QUAL*UCSTST.MCBPKT/UCOB,.MCBPKT-UCOB
@EOF
@ . ***
@USE MASM$PF1.,SYS$LIB$*LINK.
@ASG,A MASM$PF1.
@ . ***
@ . ***
@ . *** * ICP MCBICP ******
@ . *** COMPILE THE ICP "MCBICP" AND ASSEMBLE ITS HVCALLS
@ . *** TRANSFER WITH CANCEL AND CALL ELEMENT
@ . *** "HVCALLSDEF/MCBSUBXSUBA"
@ . ***
@UCOB QUAL*UCSTST.MCBICP/CALLID,.MCBICP/COMP,,,NO-OPTIONS
@MASM,N QUAL*UCSTST.HVCALLSDEF/MCBSUBXSUBA,.HVCALLSDEF/MCBSUBXSUBA
@EOF
@ . ***
@ . ***
@ . *** * MULTIPLE ENTRY POINT SUBPROGRAM MCBSUBA ******
@ . *** COMPILE THE MULTIPLE ENTRY POINT SUBPROGRAM "MCBSUBX" AND
@ . *** ASSEMBLE ITS JUMP VECTOR ELEMENT "JUMPVECTOR/MCBSUBA"
@ . ***
@ . *** THIS SUBPROGRAM CONTAINS NO MCB FUNCTIONS.
@ . ***
@UCOB QUAL*UCSTST.MCBSUBA,.MCBSUBA/COMP,,, SUBPROGRAM,NO-OPTIONS
@MASM,N QUAL*UCSTST.JUMPVECTOR/MCBSUBA,.JUMPVECTOR/MCBSUBA
@EOF
@ . ***
@ . ***
@ . *** * SUBPROGRAM MCBSUBX ******
@ . *** COMPILE SUBPROGRAM "MCBSUBX"
@ . ***
@UCOB QUAL*UCSTST.MCBSUBX/NOCALLS,.MCBSUBX/COMP,,, SUBPROGRAM,NO-OPTIONS
@ . ***
@ . ***
@ . *** LINK OF THE HVTIP ICP AND SUBPROGRAMS
@ . ***
@ . *** SINCE MCB IS BEING USED IN THIS EXAMPLE, IDENTIFYING
@ . *** THE CORRECT APPLICATION GROUP SEARCH CHAIN WILL
@ . *** LOCATE THAT APPLICATION GROUP'S MCB.
@ . ***
@ . *** @USE LINK$PF.,SYS$LIB$*APP$n.
@ . ***
@ . *** WHERE "n" IS REPLACED WITH THE APPLICATION GROUP NUMBER
@ . ***
@ . *** IDENTIFY THE APPLICATION GROUP SEARCH CHAIN
@ . ***
Example 7–21. Runstream to Set Up, Compile, and Link—COBOL HVTIP ZOOM
@USE LINK$PF.,SYS$LIB$*APP$3.
@ . ***
@ . *** *** MCBICP LINK ********
@ . *** LINK OF THE HVTIP INITIAL CONTROL PROGRAM 'MCBICP'
@ . *** THIS INCLUDES THE USER ELEMENT HVCALLSDEF/MCBSUBXSUBA.
@ . *** THIS INCLUDES THE USER ELEMENT LSI$RES-NAME/MCBHVTIP.
@ . ***
@LINK ,QUAL*UCSTST.MCBICP
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.MCBICP/COMP
INCLUDE QUAL*UCSTST.HVCALLSDEF/MCBSUBXSUBA
INCLUDE QUAL*UCSTST.LSI$RES-NAME/MCBHVTIP
RESOLVE ALL REFERENCES EXCEPT LS$RES_NAME USING SYS$LIB$*EMOMRTS, LCN
DELETE ALL DEFINITIONS EXCEPT START$
@EOF
@ . ***
@ . ***
@ . *** *** MCBSUBA LINK ********
@ . *** LINK OF THE HVTIP SUBPROGRAM 'MCBSUBA'
@ . *** THIS INCLUDES THE USER ELEMENT JUMPVECTOR/MCBSUBA.
@ . ***
@LINK ,QUAL*UCSTST.MCBSUBA
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.MCBSUBA/COMP
INCLUDE QUAL*UCSTST.JUMPVECTOR/MCBSUBA
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS, LIBCODENAME
DELETE ALL DEFINITIONS EXCEPT JUMPER
@EOF
@ . ***
@ . ***
@ . *** *** MCBSUBX LINK ********
@ . *** LINK THE SUBPROGRAM "MCBSUBX"
@ . ***
@LINK ,QUAL*UCSTST.MCBSUBX
OUTPUT HVTIP
INCLUDE QUAL*UCSTST.MCBSUBX/COMP
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS, LIBCODENAME
DELETE ALL DEFINITIONS EXCEPT MCBSUBX
@EOF
@ . ***
@ . ***
@ . *** ** VALTAB SETUP
@ . *** SETS UP THE VALTABS FOR THIS EXAMPLE'S TRANSACTIONS.
@ . *** THE NEW VINDEX IS THEN LOADED INTO MEMORY.
@ . ***
@ . *** INPUT:
@ . *** *VALCHG M
Example 7–21. Runstream to Set Up, Compile, and Link—COBOL HVTIP ZOOM
Example 7–21. Runstream to Set Up, Compile, and Link—COBOL HVTIP ZOOM
@CAT,P QUAL*HVTIPLIB22.,F/1000//1000
@ . ***
@ . ***
@ . *** HVTIP LIBRARY INFORMATION
@ . ***
@ . *** THE TIP FILE NUMBERS THAT CAN BE USED AS HVTIP LIBRARIES
@ . *** ARE DEFINED BY THE EXEC GENERATION.
@ . ***
@ . *** TPLIB nn - DEFINES THE STARTING TIP FILE NUMBER FOR
@ . *** HVTIP LIBRARIES
@ . *** HVTIP nn - DEFINES THE NUMBER OF HVTIP LIBRARIES FOR
@ . *** THIS SYSTEM
@ . ***
@ . *** HVTIP-LIBRARY-TIP-file-number - TPLIB = HVTIP-LIBRARY-number
@ . ***
@ . *** FOR EXAMPLE: TPLIB = 70
@ . *** HVTIP = 64
@ . *** HVTIP-LIBRARY-TIP-file-number = 92
@ . *** THEREFORE:
@ . *** 92 - 70 = 22 (HVTIP-LIBRARY-number)
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE HVTIP LIBRARY TIP FILE THIS TEST USES FOR
@ . *** THE TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
TREG QUAL*HVTIPLIB22.,FIX
RES 92,64000,28,,HVTIPLIB22,,,WW=P,AUDIT=0,NREC
LFD 92
@EOF
@ . ***
@ . *** * HVTIP LIBRARY LOAD ******
@ . ***
@ . *** USE THE TPUR UTILITY TO COPY TRANSACTION PROGRAMS INTO
@ . *** THE HVTIP LIBRARY.
@ . ***
@ . *** BRING AN HVTIP LIBRARY THAT IS INITIALIZED AND CONTAINS
@ . *** AT LEAST ONE PROGRAM BANK ONLINE SO TRANSACTIONS CAN BE
@ . *** EXECUTED FROM THIS HVTIP LIBRARY.
@ . ***
Example 7–21. Runstream to Set Up, Compile, and Link—COBOL HVTIP ZOOM
@XQT,P TIP$*TIPRUN$.BOXER
ON RECOVERY
OFF SCHEDULE
@ . ***
@ASG,A QUAL*UCSTST.
@ . ***
@XQT,MUX TIP$*TIPRUN$.TPUR
CREATE,K 22,30
COPY,IVK 22,6,QUAL*UCSTST.MCBICP
COPY,IK 22,7,QUAL*UCSTST.MCBSUBX
COPY,IK 22,10,QUAL*UCSTST.MCBSUBA
LIST 22
LOAD,K 22
STATUS,K 22
@EOF
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
OFF RECOVERY
ON SCHEDULE
@ . ***
@ . ***
@ . EXAMPLE SETUP IS COMPLETE
Example 7–21. Runstream to Set Up, Compile, and Link—COBOL HVTIP ZOOM
@ . ***
@PDP,UC QUAL*UCSTST.MCBPKT/UCOB,.MCBPKT-UCOB
PDP 13R2 (960423 0108:39) 1997 Feb 20 Thu 1541:59
END PDP. Errors: 0 Fatal 0 Syntax 0 Warning
Lines: 278 Entry Points: 1 Time: 1.949 Storage: 7070/0/7070/0106210
@ . ***
@USE MASM$PF1.,SYS$LIB$*LINK.
I:002333 USE complete.
@ASG,A MASM$PF1.
I:002333 ASG complete.
@ . ***
@ . ***
@ . *** * ICP MCBICP ******
@ . *** COMPILE THE ICP "MCBICP" AND ASSEMBLE ITS HVCALLS
@ . *** TRANSFER WITH CANCEL AND CALL ELEMENT
@ . *** "HVCALLSDEF/MCBSUBXSUBA"
@ . ***
@UCOB QUAL*UCSTST.MCBICP/CALLID,.MCBICP/COMP,,,NO-OPTIONS
UCOB- 8R1 (970210) LSS- 10R1 (970209) 970220 15:42:00
SIZES: CODE(EM6): 347 DATA: 582 COMMON: 3
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@MASM,N QUAL*UCSTST.HVCALLSDEF/MCBSUBXSUBA,.HVCALLSDEF/MCBSUBXSUBA
MASM 6R2A (960423 0008:22) 1997 Feb 20 Thu 1542:08
END MASM - LINES: 347 TIME: 4.726 STORAGE: 29345/7931
@ . ***
@ . ***
@ . *** * MULTIPLE ENTRY POINT SUBPROGRAM MCBSUBA ******
@ . *** COMPILE THE MULTIPLE ENTRY POINT SUBPROGRAM "MCBSUBX" AND
@ . *** ASSEMBLE ITS JUMP VECTOR ELEMENT "JUMPVECTOR/MCBSUBA"
@ . ***
@ . *** THIS SUBPROGRAM CONTAINS NO MCB FUNCTIONS.
@ . ***
@UCOB QUAL*UCSTST.MCBSUBA,.MCBSUBA/COMP,,, SUBPROGRAM,NO-OPTIONS
UCOB- 8R1 (970210) LSS- 10R1 (970209) 970220 15:42:10
SIZES: CODE(EM6): 131 DATA: 384 COMMON: 3
END UCOB- 0 ERRORS(MAJOR) 0 ERRORS(MINOR)
@MASM,N QUAL*UCSTST.JUMPVECTOR/MCBSUBA,.JUMPVECTOR/MCBSUBA
MASM 6R2A (960423 0008:22) 1997 Feb 20 Thu 1542:14
ASSEMBLY CONTAINS WARNINGS: - FLAGS: U
END MASM - LINES: 258 TIME: 4.482 STORAGE: 29345/7924 WARNINGS: U(3)
@ . ***
@ . ***
@ . *** * SUBPROGRAM MCBSUBX ******
@ . *** COMPILE SUBPROGRAM "MCBSUBX"
@ . ***
@UCOB QUAL*UCSTST.MCBSUBX/NOCALLS,.MCBSUBX/COMP,,, SUBPROGRAM,NO-OPTIONS
UCOB- 8R1 (970210) LSS- 10R1 (970209) 970220 15:42:18
SIZES: CODE(EM6): 177 DATA: 267 COMMON: 3
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970220 1543:02
ON BTLOADING
ON STICKING
@ . ***
@ . ***
@ . *** ** HVTIP LIBRARY SETUP
@ . *** CATALOGS THE EXEC FILE THAT WILL HOLD THE
@ . *** HVTIP LIBRARY TIP FILE.
@ . ***
@CAT,P QUAL*HVTIPLIB22.,F/1000//1000
I:002333 CAT complete.
@ . ***
@ . ***
@ . *** HVTIP LIBRARY INFORMATION
@ . ***
@ . *** THE TIP FILE NUMBERS THAT CAN BE USED AS HVTIP LIBRARIES
@ . *** ARE DEFINED BY THE EXEC GENERATION.
@ . ***
@ . *** TPLIB NN - DEFINES THE STARTING TIP FILE NUMBER FOR
@ . *** HVTIP LIBRARIES
@ . *** HVTIP NN - DEFINES THE NUMBER OF HVTIP LIBRARIES FOR
@ . *** THIS SYSTEM
@ . ***
@ . *** HVTIP-LIBRARY-TIP-FILE-NUMBER - TPLIB = HVTIP-LIBRARY-NUMBER
@ . ***
@ . *** FOR EXAMPLE: TPLIB = 70
@ . *** HVTIP = 64
@ . *** HVTIP-LIBRARY-TIP-FILE-NUMBER = 92
@ . *** THEREFORE:
@ . *** 92 - 70 = 22 (HVTIP-LIBRARY-NUMBER)
@ . ***
@ . *** ** USES THE FREIPS UTILITY TO:
@ . ***
@ . *** 1. REGISTER THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 2. RESERVE THE HVTIP LIBRARY TIP FILE USED FOR THE
@ . *** TRANSACTION ZOOM.
@ . ***
@ . *** 3. LIST THE HVTIP LIBRARY TIP FILE THIS TEST USES FOR
@ . *** THE TRANSACTION ZOOM IN ORDER TO CONFIRM THE SETUP.
@ . ***
@TIP$*TIPRUN$.FREIPS,U
FREIPS 45R2 02/20/97 15:43:02 FS-LEVEL FS 003
TREG QUAL*HVTIPLIB22.,FIX
TP REGISTER STARTED 15:43:02 20 FEB 97
TP REGISTER FINISHED 15:43:04 20 FEB 97
RES 92,64000,28,,HVTIPLIB22,,,WW=P,AUDIT=0,NREC
TP RESERVE STARTED 15:43:04 20 FEB 97
TP RESERVE FINISHED 15:43:04 20 FEB 97
LFD 92
TIP FILE 92
DIR-ACCESS,LOCAL SIMPLX
NO AFTERLOOKS, NON-RECOVERABLE, WW, NO AUTO-ANSWER
RECORDS: 64000 SIZE: 28 APPLICATION GROUP: 0
FILE NAME HVTIPLIB22
PLACEMENT 0
LEG STATUS AVL-UP
END FREIPS
@ . ***
@ . *** * HVTIP LIBRARY LOAD ******
@ . ***
@ . *** USE THE TPUR UTILITY TO COPY TRANSACTION PROGRAMS INTO
@ . *** THE HVTIP LIBRARY.
@ . ***
@ . *** BRING AN HVTIP LIBRARY THAT IS INITIALIZED AND CONTAINS
@ . *** AT LEAST ONE PROGRAM BANK ONLINE SO TRANSACTIONS CAN BE
@ . *** EXECUTED FROM THIS HVTIP LIBRARY.
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970220 1543:04
ON RECOVERY
OFF SCHEDULE
@ . ***
@ASG,A QUAL*UCSTST.
W:122133 file is already assigned.
@ . ***
@XQT,MUX TIP$*TIPRUN$.TPUR
TPUR 45R2#0000001 970220 1543:04
CREATE,K 22,30
LIBRARY NUMBER: 22 NUMBER OF BANKS ALLOWED: 30
NEXT AVAILABLE RECORD: 7 LIBRARY CYCLE: MAIN
COPY,IVK 22,6,QUAL*UCSTST.MCBICP
COPY,IK 22,7,QUAL*UCSTST.MCBSUBX
COPY,IK 22,10,QUAL*UCSTST.MCBSUBA
BANK RTN LOAD STATUS BANK BANK TIP MEM LOWER START RECORD
NUMB COUNT INDICATORS SIZE TYPE GROUP# LIMIT ADDR NUMBER
@ . ***
@XQT,P TIP$*TIPRUN$.BOXER
BOXER 45R2#0000001 970220 1543:12
OFF RECOVERY
ON SCHEDULE
@ . ***
@ . ***
@ . EXAMPLE SETUP IS COMPLETE
MCBHVT
THIS IS MCBICP
INITIALIZATION COMPLETE
THIS IS MCBSUBX
Example 2
The following screen shows another execution of the HVTIP transaction described
previously. User input is bolded.
MCBEP1
THIS IS MCBICP
INITIALIZATION COMPLETE
RETURNING TO MCBICP
Example 3
The following screen shows another execution of the HVTIP transaction described
previously. User input is bolded.
MCBEP2
THIS IS MCBICP
INITIALIZATION COMPLETE
RETURNING TO MCBICP
Example 4
The following screen shows another execution of the HVTIP transaction described
previously. User input is bolded.
MCBEP3
THIS IS MCBICP
INITIALIZATION COMPLETE
RETURNING TO MCBICP
Extended mode hardware and UCS software provide the most powerful solution-
oriented working environment available today on OS 2200 systems. They are the hub
of all new software developed for these and future systems. All new user-developed
applications should be implemented using UCS. Existing basic mode applications
written in ACOB or FTN should slowly be upgraded to UCS.
This new environment does not prohibit use of existing non-UCS applications.
Programs using non-UCS programming can coexist harmoniously with programs using
UCS. The two environments can share both software and files. In fact, a single
application can consist of UCS and non-UCS programs. (Any one particular program,
however, must be all UCS or all non-UCS.)
To aid sites, this guide provides examples demonstrating how easy it is to implement
user-developed application programs in UCS (see Sections 3, 5, and 6). Each Unisys
software product also supplies its own programming reference manual or guide to
supply more detailed information on use of the product. A complete list of these
documents can be found in “About This Guide.”
A single program, however, must be all UCS or all non-UCS at the linking/collection
level: Any one particular user-written program cannot consist of some non-UCS
relocatable elements and some UCS object modules (for example, ACOB relocatable
elements and UCS COBOL object modules).
Since UCS and non-UCS programs can coexist so harmoniously, and even be part of
the same application, it is a good idea to upgrade to UCS when maintaining existing
applications, such as in the following circumstances:
• When new programs are added to an existing application
• When existing programs in an application require maintenance
The following subsections describe how resources, software, and files are shared by
the two programming environments.
The UCS high-level languages support a broad base of interfaces that are also
supported by the non-UCS programming languages. These include the following:
• UDS software and its database files
• PCIOS files
• Transaction processing support for TIP and HVTIP, using either MCB, DPS MCB, or
DPS COMPOOL
• Most non-message handling TIP primitives, including FCSS file handling
• Sort/Merge support
In most cases, UCS and non-UCS programs can share the interface software. The data
files can also be shared, as long as they contain no Fieldata. UCS software does not
support Fieldata.
Appendix A describes how to generate and install this software so that both
environments can make use of it.
The only restriction is that no Fieldata characters can exist in the data contained in
these files. UCS software does not support Fieldata.
Not only can UCS and non-UCS programs share the same UDS database files; they can
also share the same UDS software itself. Only one copy of the UDS software is
required on an 1100/90 or 2200 system for both environments. The capabilities of the
UDS software are equal for both environments.
In summary, UCS programs and non-UCS programs can simultaneously access the
same UDS database files, using the same UDS software.
UCS and non-UCS programs can access a PCIOS file directly or through SFS 2200
Table 8–2 specifies the supported PCIOS and SFS file access methods and
corresponding file organization for each UCS language.
For information on acceptable PCIOS formats, see the programming reference manual
for the UCS language in which the program is coded.
TIPUTILs are built to reflect the environment they will be supporting; each TIPUTIL
represents a particular environment. Therefore, a site may or may not have multiple
TIPUTILs, depending upon their transaction processing needs.
The TIPUTIL installed by SOLAR must be the one built for UCS transaction usage. This
TIPUTIL provides TIP utilities that can handle UCS transaction ZOOMs.
Other TIPUTILs can be built and manually copied from tape into the appropriate files
(that is, not installed by SOLAR). These would include the following:
• Non-UCS MCB TIPUTILs
• Non-UCS COMPOOL TIPUTILs
• Other UCS MCB TIPUTILs
MCB has been designed so that the same copy of the software can be simultaneously
accessed by both UCS and non-UCS transactions. The MCB capabilities are equivalent
in the two environments.
But a change has been made in the coding of MCB commands. The UCS version of
the MCB commands uses a simpler format that optionally identifies the message
buffer and multiple destination list as part of the MCB call The MCB entry points have
also been renamed.
In conjunction with these new command formats, UCS versions of the MCB packet
definition are provided for UCS COBOL, UCS FORTRAN, and UCS C. Refer to Section 5
for details.
Both UCS and non-UCS programs can simultaneously use the same copy of DPS 2200.
DPS 2200 provides the same programming interface for both UCS and non-UCS
programs. UCS and non-UCS programs that call DPS 2200 are coded exactly the same.
When using DPS 2200 for transaction processing, the site still has the choice of using
MCB or COMPOOL message buffering. Both are available in the UCS environment.
Not only can UCS programs and non-UCS programs share the same DPS 2200
software; they can also share the same form files and the same forms within those
files.
Both UCS and non-UCS transactions can share TIP FCSS files. UCS does not require
changes to the definition or access of these TIP files. Again, the only restriction is that
FCSS files accessed by UCS transactions cannot contain any Fieldata characters. UCS
software does not support Fieldata.
A user-developed application can consist of both UCS and non-UCS programs. The
only rule for user-written programs is that at the linking/collection level, any one
particular program must be all UCS or all non-UCS: Any one particular user-written
program cannot consist of some non-UCS relocatables and some UCS object modules.
A single application can even consist of some UCS transactions and some non-UCS
transactions. These applications are possible because transactions can
conversationally link or pass off across the UCS and non-UCS environments. This
means that a UCS transaction can conversationally link to a non-UCS transaction,
which can in turn conversationally link to a UCS transaction. The conversation can flow
in either direction between UCS and non-UCS transactions.
Pass-off messages can also span UCS and non-UCS environments. A UCS transaction
can pass off to a non-UCS transaction, which can pass off to a UCS transaction.
For both conversational links and pass-off messages, the message handling must use
all COMPOOL or all MCB in the same application group. This makes coexistence easy
in the TIP/HVTIP environment.
The only rule for user-written transactions is that any one particular transaction must
be all UCS or all non-UCS. In the HVTIP environment, this restriction is relaxed: An
extended mode transaction can have both extended mode subprograms (ZOOMs) and
basic mode subprograms (absolutes) (see 6.1.8).
One method that can be used to run a mixed-mode HVTIP application involves using
two initial control programs (an absolute and a ZOOM) with matching subprograms.
Subprogram
Absolutes
002378
Using this method, a transaction code (trancd) with associated data is entered, and the
following occurs:
• The ICP absolute is loaded.
• This ICP accesses a table that identifies whether each transaction code has been
implemented using ZOOMs or is still using absolutes.
• If not upgraded to ZOOMs, absolutes are used. The ICP absolute calls the correct
subprogram absolutes. All processing for the transaction takes place using
absolutes.
• If ZOOMs are implemented, the ICP absolute performs a PASSOFF to the ICP
ZOOM. The passoff message should reflect the trancd and all data, as though this
message was entered from a terminal. The ICP ZOOM calls the correct
subprogram ZOOMs. All processing for the transaction takes place using ZOOMs.
Note: This setup requires that message buffering be all COMPOOL or all MCB.
ZOOMs support either MCB message buffering using MCB functions or DPS 2200
functions, or COMPOOL message buffering through DPS.
Once all code is upgraded to ZOOMs, the absolute ICP, absolute subprograms, and the
lookup table can be discarded.
The SX 1100 operating environment can coexist with the OS 2200 operating
environment. In the same fashion, UCS C programs can coexist with SX 1100 C
programs; a site can continue to run SX 1100 C applications as before.
Once an organization installs UCS software, it can begin to upgrade non-UCS programs
and transactions to UCS, if beneficial. For example, in the following circumstances, it is
a good idea to convert an existing program to UCS:
• If maintenance is required on an existing program and it must be recoded and
recompiled anyway
• If the new features available in UCS and the extended mode architecture would
increase the performance or capability of an existing program
A site can gradually upgrade programs to UCS because UCS is designed to coexist
with the older, non-UCS environment. A site can upgrade some programs in an
application to UCS while others remain non-UCS programs. (See 1.4.)
Step Description
If programs are coded in one of the four languages that UCS supports and closely
conform to the standards, tools are available to simplify the upgrade of the source
code, thus reducing or eliminating any manual conversion.
Note: Most of the tools provided are in the form of keyword options on the UCS
compiler calls. The compilers have compatibility keyword options that resolve
differences between non-UCS and UCS versions of COBOL, FORTRAN, and C UCS
FORTRAN also has a compiler keyword option that actually converts older source
code into a format acceptable to UCS FORTRAN.
To ease the transition from ASCII COBOL (ACOB), UCS COBOL provides several
keyword options that perform conversion tasks as part of the compilation process.
Using these keyword options reduces the amount of coding changes, if any, required
to upgrade the program.
Table 8–4 describes the relevant keyword options. Based on the descriptions, use the
keyword option that best matches your site’s use of ASCII COBOL.
Several products that interface with UCS COBOL programs require use of the
compatibility keyword options to compile and execute properly:
• UDS DML
UDS DML programs require the COMPAT (but only if the subschema includes
items with USAGE COMP-1 or COMP-2) keyword option to resolve the use of the
ASCII COBOL USAGE clauses that occur in the record descriptions.
• DPS 2200
DPS 2200 programs and transactions that use predefined ASCII-COBOL-format
forms whose procedures were generated using SB3 software require the
COMPAT/FULL and NO-OPTIM keyword options to
− Resolve the ASCII COBOL USAGE clauses
− Provide proper data alignment
When using UDS DML with DPS 2200 in this situation, use the COMPAT/FULL and
NO-OPTIM keyword options to satisfy both products’ requirements.
DPS 2200 programs and transactions that use predefined ASCII-COBOL-format
forms whose procedures were generated using SB4 or later software require the
COMPAT keyword option to resolve the ASCII COBOL USAGE clauses.
• COBOL
Any COBOL programs that contain the ASCII COBOL USAGE clauses require, at a
minimum, the COMPAT keyword option.
Even with use of the compatibility keyword options, certain language features are
implemented differently in UCS COBOL than in ASCII COBOL. These changes can
potentially change the execution of a program upgraded from previous COBOL
standards. To find information on these differences, see the COBOL Compiler
Programming Reference Manual Volume 2. It includes information about the
following:
• Differences that occur because UCS COBOL is a new implementation of COBOL
• Features of ASCII COBOL that are not carried forward to UCS COBOL
• Changes in the 1985 American National Standard COBOL and substantive changes
made by the standards committee
• Language elements that are obsolete
Carefully read this material to determine how best to upgrade 1974 American National
Standard COBOL (ASCII COBOL) programs to UCS COBOL.
The UCS FORTRAN compiler has several tools that ease the upgrade of programs that
do not adhere to the 1978 American National Standard. Table 8–5 describes keyword
options that
• Resolve many of the differences that exist between the two implementations of
FORTRAN
• Actually convert archaic source code so that it conforms to the 1978 American
National Standard
CONVERT The CONVERT keyword option converts ASCII FORTRAN source code
that contains archaic syntax to a new version of the source code that
conforms to the current standard.
The UCS FORTRAN compiler accepts the nonstandard syntax and
flags the following items as archaic:
Syntax that the future Unisys FORTRAN 90 compiler might not
support. This includes ambiguous coding due to 31-character names
and poor coding techniques.
Syntax that the current standard defines differently.
There is a COMPILER statement option (STD=66) that causes the UCS FORTRAN
compiler to handle the following items using ASCII FORTRAN techniques:
• DO loops always execute once.
• The compiler allocates all character data, including array elements and members of
common blocks, on word boundaries.
Use the STD=66 option to resolve compatibility problems that occur during the
upgrade of older ASCII FORTRAN programs.
See the FORTRAN Compiler Programming Reference Manual Volume 2 for a detailed
description of these compiler keyword options and COMPILER statement options and
for information about how to use them. This manual also contains a summary of the
differences between ASCII FORTRAN and UCS FORTRAN, including the following
topics:
This manual also describes other miscellaneous differences between the two versions
of FORTRAN. Read this information carefully to help determine the resources needed
to upgrade programs to UCS FORTRAN.
When moving from SX 1100, some change in the way C programs access data and
interface with system facilities is necessary because the program’s execution no
longer involves the SX 1100 operating environment. C programs running in an SX 1100
environment are not dependent on the UNIXR operating system. Use the C
compatibility keyword option COMPAT when moving C programs from the SX 1100
environment to the OS 2200 environment. For information on COMPAT, see the C
Compiler Programming Reference Manual Volume 2.
UCS C manipulates ordinary OS 2200 system data format (SDF) files. These files are
compatible with SX 1100 only to the extent that SX 1100 can read and write SDF files.
No facility is provided for reading and writing files uniquely formatted for SX 1100.
Also, SX 1100 binary data files are not compatible with UCS C.
However, these programs continue to run in the non-UCS environment and coexist
with UCS programs.
You can upgrade these programs by rewriting them in one of the UCS languages: UCS
COBOL, UCS FORTRAN, or UCS C. Also, if these programs use PCIOS data files, a UCS
program or application can share their data.
Common ERs, such as EABT$, also have unique entry points that are directly
callable from UCS programs. For more information about the interface routines for
ERs, see the programming reference manual for the appropriate language. (For
UCS COBOL, UCS FORTRAN, and UCS C , this is Volume 2.)
• Consider the purpose and structure of the MASM program and determine if it is
more cost effective to rewrite the program in a high-level UCS language. High-
level languages such as C and FORTRAN now perform functions similar to MASM
subprograms.
• Upgrade assembly language programs to extended mode MASM if Unisys
documentation explicitly requires it. In these cases, complete examples of sample
MASM code are provided and explained, so the programmer need not have
MASM background.
You should consider several points before upgrading user libraries to the UCS
languages:
• UCS applications will execute only with subroutines and functions compiled with a
UCS compiler. If a subroutine or function is called by both UCS and non-UCS
programs, two versions of the routine must exist (an object module version and a
relocatable binary version).
• A separate non-UCS calling interface may need to be written for each non-UCS
language that calls a subroutine or function. However, only one entry point is
needed for those routines called by a UCS program. Before upgrading to the UCS
languages, determine if the calling sequence for each subroutine or function is
valid or needs to be adapted to the UCS standard calling sequence.
For information on interlanguage calls, see the programming reference manual for the
appropriate language. (For UCS COBOL, UCS FORTRAN, and UCS C, this is volume 2.)
Table 8–6 includes a list of basic mode ERs and the extended mode services that they
provide. The table also identifies the SB release level and UCS language supported for
each ER.
Table 8–6. Basic Mode ERs and Extended Mode Services for UCS
Languages
Basic
Mode Exec Extended Mode Initial
Request Service Release UCS Languages Supported
Table 8–6. Basic Mode ERs and Extended Mode Services for UCS
Languages
Basic
Mode Exec Extended Mode Initial
Request Service Release UCS Languages Supported
Table 8–6. Basic Mode ERs and Extended Mode Services for UCS
Languages
Basic
Mode Exec Extended Mode Initial
Request Service Release UCS Languages Supported
Table 8–6. Basic Mode ERs and Extended Mode Services for UCS
Languages
Basic
Mode Exec Extended Mode Initial
Request Service Release UCS Languages Supported
Table 8–6. Basic Mode ERs and Extended Mode Services for UCS
Languages
Basic
Mode Exec Extended Mode Initial
Request Service Release UCS Languages Supported
Table 8–6. Basic Mode ERs and Extended Mode Services for UCS
Languages
Basic
Mode Exec Extended Mode Initial
Request Service Release UCS Languages Supported
Notes:
1. There are several cautions, restrictions and concerns regarding the usage of the
UCSGENERAL$ versions of the basic mode ERs. Consult the appropriate
language programming reference manual for details on UCSGENERAL$
implementation and usage.
2. The RTS Multitasking implementation in this basic mode ER does not provide
the total capability of the Executive Request.
3. The implementation of the UCS COBOL LOC$ function in SB4R2 has made these
ERs available.
The following list shows services made available to UCS languages by the Service
Library (product SLIB). See the Service Library Programming Reference Manual
for details.
• Character Conversion
• Condition Word
• Element Type
• Internal Format
• Level ID
• Processor Setup
• SDF Input
• Storage Management
• Symbolic Read
• Symbolic Write
• Time and Date
UCS code and data banks cannot be packaged as common banks; instead, they must
be packaged as extended mode software subsystems in order to achieve sharing
capabilities similar to non-UCS common banked applications. Software subsystems
can be constructed only with UCS compiler-produced object modules.
In general, UCS programs do not have the ability to call common banks directly.
If shared banks are a necessary part of a non-UCS application being upgraded to UCS,
it will be necessary to replace common banks with software subsystems.
If shared banks are not required when moving to UCS, then nonshared object modules
are an option.
For detailed information about creating and installing software subsystems, refer to
the Linking System Subsystems Programming Guide.
The following subsections outline the changes needed to upgrade DMS 2200, RDMS
2200, and SFS 2200 programs to UCS.
For complete examples of UCS programs that access UDS databases, see 3.2.
The schema cannot use any of the new UCS COBOL USAGE clauses (BINARY-1,
BINARY, DISPLAY-2). Note that the new schemas written with the COBOL 85 syntax
and containing the SOURCE IS UCS clause, can use the new USAGE types.
All area names, record names, data item names, set names, and database data names
must be unique. For example, a schema cannot contain a record and an area with the
same name. Also, these names must be unique within the COBOL program.
The database procedures for a schema can be upgraded to UCS COBOL once all
application programs for that schema have been upgraded to UCS.
ASCII COBOL, ASCII FORTRAN, UCS COBOL, and UCS FORTRAN application programs
can use database procedures that are coded using ASCII COBOL or basic mode
MASM. Additionally, ASCII COBOL, UCS COBOL, DMU, and QLP application programs
can access UCS COBOL database procedures.
Subschema
Separate subschemas are required for UCS programs. These subschemas require one
of the following new host language clauses:
• HOST LANGUAGE IS UCS COBOL.
• HOST LANGUAGE IS UCS FORTRAN. These clauses generate the S$WORK
element as an object module.
UCS subschemas cannot contain any Fieldata characters. This requires that the
subschemas contain no COBOL REDEFINES clauses with USAGE COMP-4 or USAGE
DISP-1.
You cannot use the T option when processing UCS subschemas. This option converts
COBOL USAGE clauses from ASCII to Fieldata, and Fieldata to ASCII. Note that the
Subschema Data Definition Language (SDDL) processor produces no output and
issues a fatal error message if it discovers Fieldata data definitions while processing a
UCS subschema.
Note that the F option is no longer required on the SDDL processor call. SDDL
converts the record and data names descriptions to COBOL 85 compliant code. When
you create a UCS subschema that will be used by HVTIP transactions, the SDDL
processor call must use the C option if the subschema storage is COMMON.
Preprocessing
No preprocessing is required for UCS DML programs. DML commands are parsed by
the UCS COBOL and UCS FORTRAN compilers themselves.
Coding
You must recode the INVOKE statement to reflect the use of the UCS subschema.
For HVTIP transactions, the INVOKE statement must include the ENVIRONMENT IS
HVTIP clause if the subschema storage is COMMON.
Compiling
If the subschema file has a qualifier that is different from the project-id of the
compilation, you must identify the subschema file to the UCS compiler, before calling
the UCS compiler.
UCS COBOL DML programs do not require the COMPAT keyword option unless
COMP-1 or COMP-2 items are included in the subschema. When used, the COMPAT
keyword option converts these clauses to the correct UCS formats.
You can use the COMPAT/FULL keyword option instead, if it is required by other
interface products used in the program.
UCS FORTRAN DML programs do not require any special compiler keyword options.
The UCS compilers parse both the host language syntax and the DML syntax. They
produce an object module that contains the D$WORK element.
Linking
Before dynamically or statically linking a UCS DML program, you must identify the
DMS software belonging to the correct application group. Do this by using an @USE
statement with the following format:
@USE LINK$PF,SYS$LIB$*APP$n
where n represents the application group number. See Section 4 for information on
this process.
When dynamically linking a UCS DML program, you must copy the subschema object
module S$WORK to the @XQT file (HOME$) before execution, so the dynamic linker
can locate this object module.
When statically linking a UCS DML program, you must use an INCLUDE command that
specifies the subschema S$WORK object module.
In HVTIP, if you use the INDEX command in the static link, it must include the
subschema common block. See 6.2.1 for details and examples of the INDEX command.
Coding
No changes are required in the coding of Relational Data Manipulation Language
(RDML) programs.
If desired, you can convert ASCII COBOL programs that access RDMS 2200 databases
to the new embedded SQL interface available with UCS COBOL. You can also convert
ASCII FORTRAN programs that access RDMS 2200 databases to the new Module
Language SQL interface available with UCS FORTRAN. Also, for UCS programs that
use SQL (interpreted or embedded), you may want to specify the RDMS work area
size on the UCS version of the RSA$INIT routine.
Compiling
No special compiler keyword options are required for compilation.
Linking
Before dynamically or statically linking a UCS RDMS 2200 program, you must identify
the RDMS 2200 software belonging to the correct application group. Do this by using
an @USE statement with the following format:
@USE LINK$PF,SYS$LIB$*APP$n
File Definitions
No changes are required in the definition of SFS files for UCS COBOL and UCS
FORTRAN.
The Define File Processor (DFP) is required to define SFS files for UCS C.
Coding
No changes are required in the coding of SFS programs.
Compiling
UCS FORTRAN and UCS C require no special compiler keyword options for
compilations.
UCS COBOL requires the COMPAT keyword option, if the ASCII COBOL USAGE
clauses are used in the file definitions. You can use the COMPAT/FULL keyword option
instead, if it is required by other interface products used in the program.
Linking
Before dynamically or statically linking a UCS SFS 2200 program, you must identify the
SFS 2200 software belonging to the correct application group. Do this by using an
@USE statement with the following format:
@USE LINK$PF,SYS$LIB$*APP$n
No recoding is required when upgrading a non-UCS program that accesses PCIOS files
to UCS. When compiling UCS COBOL programs, you must use the COMPAT keyword
option if the ASCII COBOL USAGE clauses are used in the file definitions. You can use
the COMPAT/FULL keyword option instead, if it is required by other interface products
used in the program.
UCS programs cannot access files that contain Fieldata characters. You must convert
such files to a data format accepted by UCS; for example, ASCII.
UCS also does not support the following older formats of file types:
• PCIOS ISAM
• LION
• CFH
• FORMxx
• FORTRAN V
• ANSI-68 COBOL
If these older formats or Fieldata characters do exist, a site has two choices:
• Continue to maintain the existing programs and data as they are (that is, non-UCS)
• Upgrade programs and data to UCS, using the following method:
− Convert files by coding a non-UCS program that reads the data in from the old
file and writes it to a new file whose type is compatible with UCS.
The following are considerations when upgrading non-UCS DPS 2200 programs to UCS
DPS 2200 programs.
8.3.12.1.Forms
Predefined forms defined for non-UCS programs can be used by UCS programs
without change.
UCS COBOL provides the additional facility of storing the predefined forms procs in
the Unisys Repository Manager (UREP).
8.3.12.2. Coding
No changes are required in the coding of DPS 2200 programs.
8.3.12.3. Compiling
Programs being upgraded to UCS FORTRAN require no special compiler keyword
options for compilation.
Programs being upgraded to UCS COBOL require the COMPAT/FULL and the NO-
OPTIM keyword options if both of the following are true:
• Predefined forms are being used.
• Procs for the predefined forms were generated using SB3 or older software.
Programs being upgraded to UCS COBOL require the COMPAT keyword option if both
of the following are true:
• Predefined ASCII-COBOL-format forms are being used.
• Procs for the predefined forms were generated using SB4 software. You can use
the COMPAT/FULL keyword option instead if it is required by other interface
products used in the program.
Programs being upgraded to UCS COBOL require no special compiler keyword options
for compilation if both of the following are true:
• Predefined UCS-COBOL-format forms are being used (SB5R2 software or later).
• DPS procs for UCS COBOL are being used.
8.3.12.4. Linking
If a UCS program that accesses DPS 2200 is using dynamic linking or static linking and
the system default DPS 2200 software, nothing special is required before execution of
this program.
However, if alternate DPS 2200 software is being used, you must identify the DPS
2200 software belonging to the correct application group, before dynamically or
statically linking the UCS program. To do so, you must
1. Build a special library search chain.
2. Identify the library search chain by means of an @USE statement, before the
dynamic linking or static linking.
When statically linking, you can use the following INCLUDE command instead of using
a special library search chain to identify the alternate DPS 2200 software:
INCLUDE qual*dpsfile.UCS/INTERFACE,.EMCBEP$$DPS
This subsection describes differences between coding, compiling, linking, and setting
up the following:
• UCS TIP and HVTIP transactions
• Non-UCS TIP and HVTIP transactions
8.3.13.1. Coding
DPS 2200
DPS 2200 is fully supported for UCS transactions. UCS COBOL, UCS C, and UCS
FORTRAN interfaces to DPS 2200 are available. All upgrading considerations described
in 8.3.12 apply to upgrading non-UCS DPS 2200 transactions to UCS DPS 2200.
UCS DPS 2200 transactions can perform their message buffering by using either
COMPOOL or MCB.
If all of the following are true, DPS 2200 uses MCB message buffering:
• STATUS is set to J in the VALTAB entry.
• The MCB software is available.
• The MCB interface is configured in CMS 1100 for the $$OPEN being used.
In all other cases, DPS 2200 uses COMPOOL message buffering, provided that the
COMPOOL interface is configured in CMS 1100 for the $$OPEN being used.
MCB
The full set of MCB function calls is supported for UCS transactions. These functions
are available from programs written in UCS COBOL, UCS FORTRAN, and UCS C.
There has been a change in the MCB function calls for UCS COBOL and UCS
FORTRAN. Two optional parameters have been added:
• The message buffer
• The multiple destination list
This means the call to CLOCTE is no longer required; therefore, the call to the CLOCTE
entry point is not supported in UCS COBOL programs.
The MCB entry point names have changed. The old entry points are not supported by
UCS. Therefore, to upgrade existing non-UCS transactions using MCB functions to
UCS, you must perform some simple recoding of the MCB function calls.
For information on the new entry point names, see the MCB Programming Reference
Manual.
The MCB function definitions and packet definitions for UCS COBOL and UCS
FORTRAN are provided on the MCB release tape and in SYS$LIB*PROC$ in the
elements MCBDEF-UCOB and MCBDEF-UFTN. These definitions are found on the UCS
C release tape in the include file, and can be used by using the following statement:
#include <mcb.h>
KONS
KONS is not available to UCS transactions. No replacement is provided by Unisys.
Non-Message-Handling Primitives
UCS supports the following non-message-handling primitives:
• CONECT
• DISCON
• COMMIT
• ROLLBACK
• TIMABS
• TIMDEL
• TIMREL
• TIMUPA
• TIMUPR
• UOPAND
• UOPGET
• UOPTOR
• FCSS
The coding of these primitives has not changed. New names have been provided for
the UCS COBOL primitives in order to match the FORTRAN names. The older COBOL
names are still supported by UCS COBOL.
UDS Interfaces
The guidelines discussed in 8.3.9 describe the steps needed to upgrade the UDS
interfaces in UCS transactions.
If you choose to upgrade to UCS using an existing MASM routine, you must recode it
to match the UCS format and the use of extended mode MASM.
8.3.13.2. Compiling
For information on the compiling requirements for DPS 2200 programs, see 8.3.12. For
information on the compiling requirements for programs accessing UDS databases,
see 8.3.9. These same guidelines apply to UCS transactions.
When compiling UCS FORTRAN or UCS C transactions coded with MCB functions, no
special keyword options are required.
UCS COBOL transactions require the COMPAT keyword option if the ASCII COBOL
USAGE clauses are used in the transactions. You can use the COMPAT/FULL keyword
option instead if it is required by other interface products used in the program.
UCS COBOL HVTIP subprograms that do not employ the USING clause in the
PROCEDURE DIVISION require the SUBPROGRAM keyword option on the @UCOB
statement.
8.3.13.3. Linking
UCS transactions must be completely resolved, statically linked ZOOMs. You cannot
use dynamic linking or partial static linking to link a UCS transaction. For details on
functional and performance linking, see Sections 5 and 6.
8.3.13.4. Setup
TIP transactions require the use of SUPUR files. TIP online files cannot be used by UCS
transactions. To indicate the use of SUPUR files, you must set the STF parameter in
the VALTAB entry to zero (STF,0).
HVTIP transaction VALTAB entries remain the same. HVTIP libraries and the TPUR
utility are still used.
See 8.3.9 for details on accessing these files. UCS transactions can also access PCIOS
files, as long as security level requirements are met and the files contain no Fieldata
characters.
UCS also continues to support TIP FCSS files. The functions available to access these
files are the same as in non-UCS programming.
UCS transactions can access FCSS files defined in the non-UCS environment, as long
as they contain no Fieldata characters.
(In UCS, the HVTIP transfer interface has been renamed transfer-with-cancel.)
Table 8–7 describes non-UCS programming tools that aid the upgrade of code, files,
and data to formats acceptable to UCS.
Tool Description
ASCII COBOL Flagging The ASCII COBOL Flagging Compiler flags all syntax that
Compiler is not in the COBOL 1974 standard. It also flags all new
COBOL 1985 reserved words that need changing in the
program before upgrading. Compiling a COBOL
program with the flagging compiler indicates the extent
of conversion that is necessary. See the ASCII COBOL
Programming Reference Manual.
These preparations ensure that an organization will have the easiest transition to UCS.
If using TIPUTIL, build and install TIPUTIL that supports UCS as follows:
• Verify that the Operating System Group (OSG) software is installed.
• Perform a full generation:
• Answer MCB to communication interface question.
• Answer YES to UCS Programming Environment question.
• For additional SGSs, supply BDI number for the MCBBNK bank.
• Using SOLAR, install TIPUTIL that supports UCS.
If using DPS forms that are invoked from the repository, use the
APPLICATION/application-name UCS COBOL compiler keyword option.
• Note: These tasks apply when coding the static linking runstream for batch,
demand, and standard TIP transaction programs. Refer to Section 6 of this
guide (the Application Development Solutions Application Development
Programming Guide) for information on static linking HVTIP transaction
programs.
• Identify one of the following application group search chains:
@USE LINK$PF, SYS$LIB$*APP$n.
If using RDMS and not using DPS, increase the size of URTS$TABLES by the
total heap size displayed by the (RDMS) DEBUG DUMP SIZES using the
following formula:
SET SIZE = SIZE + rdms-size FOR URTS$TABLES
If using DPS and not using RDMS, increase the size of URTS$TABLES by the
size displayed by DPS HELPER using the following formula:
SET SIZE = SIZE + dps-helper-size FOR URTS$TABLES
• Merge banks and create a ZOOM using the following PROCESS command.
• Eliminate definitions that will not be used as entry points using the following
command:
DELETE ALL DEFINITIONS EXCEPT ....
The following list shows you what to do if you are using dynamic linking.
If using UDS and DMS from the standard UDS and DMS release tapes
• Verify that the Operating System Group (OSG) software is installed.
• Install UDS and DMS release tapes.
Check to see if the COMPAT compiler keyword option is required for any TIP
primitive procedures used.
• If using DMS
Check that no preprocessing step is performed. (No separate D$WORK
element may exist.)
Compile the programs using the UCS COBOL processor call:
o Assign subschema file prior to calling the UCS COBOL compiler.
o Place an @USE of the subschema file name on the subschema file prior to
calling the UCS COBOL compiler.
o Use COMPAT compiler keyword option (if using COMP-1 or COMP-2
items).
• If using DMS and the repository cross-reference storage
Use the following UCS COBOL compiler keyword options:
o APPLICATION/application-name
o UREP-XREP
Verify that the attribute DMS-LEVEL has the correct value (NONE, PARTIAL, or
COMPLETE.)
If using DMS
• INCLUDE the SDDL-produced S$WORK object module.
• Resolve the library references using the following RESOLVE command (for a
performance-oriented static link), which also excludes PADS:
RESOLVE ALL REFERENCES USING SYS$LIB$*EMOMRTS.,LCN
Merge banks and create a FAST LOAD ZOOM using the following PROCESS
command:
PROCESS FOR EXTENDED FAST LOAD
Eliminate definitions that will not be used as entry points using the following
command:
DELETE ALL DEFINITIONS EXCEPT ....
• Change the MCB function call entry point name from CMCB to MCB$ENT.
• Eliminate all calls to CLOCTE.
• Add the message buffer and/or multidestination list parameter to the appropriate
MCB function calls.
• Review the code for differences between ASCII COBOL and UCS COBOL.
Use COMPAT compiler keyword option.
Make changes by hand.
If using DMS
• Change the subschema name in the INVOKE statement of each program to match
the name given to the new UCS COBOL subschemas.
• Check that all schema area names, record names, data item names, set names,
and database data names are unique within the COBOL programs.
@USE LINK$PF,SYS$LIB$*APP$n.
• If using RDMS
Increase the size of URTS$TABLES to include the total heap size displayed by
the (RDMS) DEBUG DUMP SIZES command using the following formula:
SET SIZE = SIZE + rdms-size FOR URTS$TABLES
Merge banks and create a FAST LOAD ZOOM using the following PROCESS
command:
PROCESS FOR EXTENDED FAST LOAD
Eliminate definitions that will not be used as entry points using the following
command:
DELETE ALL DEFINITIONS EXCEPT ...
Shared subsystems allow access to code that exists outside of the TIP/HVTIP
transaction environment. (See the Linking System Subsystem Programming Guide
for detailed information on shared subsystems.) Code and selected data in a
subsystem can be application-level, meaning that it can be used concurrently by other
runs on the system. Access to code in the shared subsystem is supplied by gate
definitions and intercept routines supplied in a library that is installed with the
subsystem.
Shared subsystems can have local (unshared) data. If they have no local data, all code
and data are at application level and access is through fixed gates. (Calls to entry
points in the subsystem are resolved to fixed-gate constant definitions, much in the
same way that CBEP-type EQUs are used to resolve access to common banks in basic
mode.) These subsystems may be either chameleon or protected, and access to the
subsystem is simple and efficient.
There are three subsystem types that can have local unshared static data:
• Object module split chameleon fixed-gate subsystems
The subsystem creator must split the local data from the code using Y option
static links and make the local data object modules available to users in a library
file.
• Self-contained subsystems
These can be either chameleon or protected subsystems. Code and data may
exist in any combination of application, program, and activity levels. Access to
code in the subsystem is through intercept routines generated by SSDP when it
processes the SSDEF for the subsystem.
The load is therefore much faster and transaction sticking and RESTART are generally
not inhibited. Subsection 6.1.8 on mixed-mode HVTIP shows and HVTIP program using
an FLSS subsystem. The last portion of Example 6–31 sets up an FLSS subsystem.
If you do not want CREATE_BANK calls to be used to acquire heap banks into which to
load the FLSS segments, then your transaction will have to supply the heap banks. For
TIP transactions, the CREATE_BANK statements in the link of your transaction ZOOM
are all that is needed. For HVTIP transactions, the ICP VALTAB entries must be made
to supply extra banks to the transaction. The static link of the ICP must also designate
some of those banks as pooled banks, opening them up for use as heap banks for
FLSS subsystems. (The OUTPUT HVTIP2 statement must be used in the static link of
the ICP.)
The FLSS subsystem may also choose to use the HVTIP heap banks by having the
following statement in its SSDEF:
SHARE HEAP BANKS WITH OTHER SUBSYSTEMS INCLUDING HVTIP
Table 9–1 describes the differences between an FLSS object module and an HVTIP
ZOOM.
Code All application level; can have One code bank (BDI 4)
multiple banks per object loaded by the Exec;
module; can have basic mode contains the user code
code; all loaded by the and the template used in
dynamic linker on the first loading user local data.
reference to the subsystem;
one of the code banks
contains the template used in
loading user local data.
Data Local data is merged into a Local data is merged into
DSEG and multiple common a DSEG and multiple
segments; all data loaded into common segments; all
a heap by the HVTIP loader. data loaded into a heap by
the HVTIP loader.
Can have multiple application There is no application
level extended mode and level data available in an
basic mode banks, which are HVTIP ZOOM.
loaded by the dynamic linker
during the initial load of the
subsystem.
Heaps Uses the HVTIP heaps when Uses the HVTIP heaps as
called from HVTIP. Uses the supplied by the VALTAB
home subsystem heap(s) if entries. CREATE_BANK
they are supplied; otherwise, calls are performed if the
CREATE_BANK calls are VALTAB entries do not
performed. supply the required heap
BDIs.
The HVTIP loader loads The HVTIP loader loads
segments into a different segments into a different
heap bank than they were heap bank than they were
linked for if the desired heap linked for if the desired
is not available. heap is not available.
Intraobject Local common segments are Local common segment
module and shared between all object are shared between all
ZOOM crosstalk modules in a given subsystem HVTIP ZOOMs in an
for a given activity (task). Each execution thread. One
activity gets its own copy of activity is assumed.
common blocks.
Local common may also be
shared with other FLSS
subsystems if desired, and
even with the HVTIP
transaction when called from
HVTIP code. (Default is to not
share local common.)
Entry points Each object module can have One externally visible
as many externally-visible entry point per HVTIP
entry points as desired. No ZOOM is the default. If
jump vector needs to be you want more than one
created. entry, you must
• Create a jump-vector
object module using
the HV$VECTOR
MASM PROC and link
it to the HVTIP ZOOM
• Give each entry point
the correct offset in
the HV$CALL PROC
intercept used to
access the HVTIP
ZOOM.
Relinking Programs calling an FLSS do Programs calling an HVTIP
not have to relink with new ZOOM do not have to
intercepts unless the relink with new intercepts
subsystem owner has (from HV$CALL) unless
changed the gate BDI or the the HVTIP library owner
offsets of any intercepts used has moved any entry
by the program. points the program was
using from one HVTIP
library to another (or has
changed their bank
number).
The preceding table shows that FLSS object modules are much more flexible than
HVTIP ZOOMs, while retaining most of the performance benefits. (You can even have
PADS linked into the subsystem.) This is especially true if you have code bank size
problems with your HVTIP ZOOMs. You may want to move some of your code to
FLSS object modules because of this.
Table A–1. Data Definitions Supplied or Produced by Unisys for UCS Interface
Products
R S
RDMS 2200, static linking, 5-211 S$PROC, 3-55, 3-68, 5-54, 5-74
RDMSLOAD, 5-95 S$WORK, 3-55, 3-70, 3-71, 3-72, 5-54, 5-76
RDMUTL, 3-84, 5-95 schemas
RDT$FILE, 3-113, 5-114 batch/demand, 3-51, 5-51
references, resolving using LSCs, 3-16 example, 3-57, 5-57
Relational Data Management System (RDMS HVTIP, 6-182
2200) sharing by UCS and non UCS, 8-32
batch/demand examples, 3-120 TIP, 5-55
embedded SQL program, 5-121 SDD$$GROUP, 3-23
execution of runstream for interpreted SEARCH, 4-2
SQL program, 3-155 search order for resolving references, 3-17
introduction to, 3-86, 3-120 setting the size of HVTIP$$DBANK, 6-227
coding Shared File System (SFS 2200)
columns vs. program variables, 3-111 batch/demand examples, 3-169, 5-156,
embedded SQL, 3-94, 5-112 5-165
introduction to, 3-160, 3-169, 5-156, RESOLVE command USING clause, 3-18
5-165 search order for resolving
runstream for, 5-173 references, 3-18
coding batch/demand, 3-162, 5-161 SFS 2200 batch/demand, 3-165, 5-164
compiling batch/demand, 3-163, 5-162 TIP, 5-14
defining files and storage areas, 3-157, to application groups, 4-6
5-154 using library search chains, 3-16
description of, 3-46 with DPS 2200, 6-197
executing batch/demand programs, 3-167 with RDMS, improving HVTIP execution
file access methods, 8-5 time, 6-196
HVTIP coding, compiling, linking static linking, with RDMS 2200, 5-211
requirements, 6-189 STD=66 keyword option, 8-21
introduction to batch/demand, 3-156, storage areas
5-153 DMS 2200 HVTIP, 6-182
linking DMS 2200 TIP, 5-56
dynamic, 3-164 RDMS 2200, 3-84, 5-95
introduction to, 3-163, 5-163 SFS 2200, 3-157, 5-154
static, 3-165, 5-164 storage, HVTIP, 6-8
supported file access methods, 3-156, local, 6-7
5-153 passing parameters, 6-7
UCS and non UCS interfaces, 8-4 shared, 6-6
UCS interface, 5-2, 6-4 static and automatic, 6-8
UCS support for, 3-5 SUBPROGRAM keyword option, 3-8
upgrading applications to UCS, 8-35 subprogram storage, releasing, 6-178
sign off line, 2-8 subprograms
sign on line, 2-6 calling HVTIP, 6-20
Sort/Merge compiling, 5-12, 6-31
UCS and non UCS interfaces, 8-4 designating in HVTIP, 6-5
UCS support for, 3-5 HVTIP static linking, 6-38
space optimization, HVTIP, 6-205 performing CANCEL, 6-40
SQL, embedded, UCS interface only, 8-4 SUBPROGRAM keyword option, 3-8
SQL, interpreted, UCS and non UCS subschemas
interfaces, 8-4 batch/demand, 3-54, 5-53
SSDEF$, 3-16 during compilation, 3-67, 5-73
standard calling sequence, 1-5, 1-6, 1-34 HVTIP, 6-183
standard object modules, 1-19, 7-2 sharing by UCS and non UCS, 8-33
standards supported by UCS languages, 1-5 Subsystem Definition Processor
START$, 3-14 creating library search chains, 3-16, 4-2
static data base design, improving HVTIP DEFINE LSC command, 4-2
performance, 6-191 description of, 1-25
static linking SEARCH command, 4-2
batch/demand development, 3-15 subsystems
compared to dynamic linking, 1-16 extended mode, providing system
DMS 2200 batch/demand, 3-72, 5-76 security, 1-34
DPS 2200 batch/demand, 3-214 produced by SSDP, 1-25
HVTIP, 6-33 upgrading common banks, 8-31
HVTIP multiple entry points, 6-88, 6-89 SX 1100, 8-14, 8-21
LINK Processor, 1-18 syntax converter, for COBOL, 8-44
link vectors, 3-25 syntax parsing, restrictions using EXECUTE
mixed dynamic and static, 3-12 command, 3-103
object module types, 1-19 SYS$*DATA$.SSDEF$, 1-25, 3-16, 3-17, 4-3,
output, 3-20 4-8
RDMS 2200 batch/demand, 3-117 SYS$LIB$*APP$n.SSDEF$, 4-2, 4-11
T introduction, 5-1
static linking
for ICP, 5-14
tables, RDMS 2200, 3-84, 5-95
introduction to, 5-14
THREAD commands, multiple database
Transaction Processing (TIP)
models, 3-178, 5-183, 6-190
FCSS files, available to UCS and non
TIP
UCS, 8-4
(See also Transaction processing), 5-1
primitives available to UCS and non UCS
malloc space, 5-211
programs, 8-4
TIPMALLOC, 5-211
UCS and non UCS interfaces, 8-4
TIPUTILs, 8-7
transaction sequences, 5-10, 6-14
transaction codes, 6-14
transfer with cancel
transaction processing
example, 6-178
CALL identifier example, 7-28
releasing subprogram storage, 6-178
coding requirements for upgrading to
transfer with cancel interface
UCS, 8-38
(HV$XFR$CANCL), 6-21, 6-25
coexistence of UCS and non UCS, 8-11
restrictions lifted, 8-43
compiling requirements for upgrading to
UCS, 8-41
FCSS files, 8-10
handling TIP files in UCS, 8-42 U
KONS, 8-39
linking requirements for upgrading to UCS C
UCS, 8-41 coexistence with SX 1100, 8-14
must be ZOOMs, 1-23 designating main or subprograms, 3-8,
non message handling primitives 6-5
supported, 8-40 equivalent RDMS 2200 data types, 3-111
set up requirements for upgrading to file access method and organization, 8-5
UCS, 8-41 interfaces supported, 1-6
TIPUTILs, 8-7 interpreted SQL, 3-109
upgrading to UCS, 8-38 supported standard, 1-6
Transaction processing syntax for MCB call, 5-6, 6-12
basic information, 5-1 upgrading to, 8-21
coding using DFP to define SFS 2200 files, 3-158,
#include mcb.h, 5-7 5-154
DPS 2200, 5-3 UCS COBOL
INITIAL clause, 5-9 CALL identifier, 7-1
MCB, 5-5 CANCEL statement, HVTIP, 6-29, 6-36,
MCBDEF UCOB, 5-7 6-40
MCBDEF UFTN, 5-7 designating main or subprograms, 3-8,
non message handling primitives, 5-8 6-5
setting up transaction sequence, 5-10 embedded SQL, 3-94, 5-112
TIP libraries, 5-12 equivalent RDMS 2200 data types, 3-111
VALTAB, 5-10 file access method and organization, 8-5
compilation, 5-12 INITIAL clause, HVTIP, 6-28
DPS 2200, 5-3 INITIAL clause, TIP, 5-9
examples interfaces supported, 1-6
DPS 2200, 5-17 interpreted SQL, 3-109
introduction to, 5-17 MCBPKT UCOB routine, 7-45
MCB, 5-29 syntax for MCB call, 5-6, 6-11
general rules, 5-3 syntax for SFS 2200, 3-162, 5-161
generic example, 5-2 unsupported USAGE clauses, 3-51, 5-52
interface languages, (table), 5-2 upgrading to, 8-17
*78314077-009*
7831 4077–009