Category : OS/2 Files
Archive   : OS2CMAPI.ZIP
Filename : SRPI.ME

 
Output of file : SRPI.ME contained in archive : OS2CMAPI.ZIP


Version 1.1 (c) Copyright International Business Machines Corp., 1988


SRPI SAMPLE PROGRAMS

The SRPI sample programs are provided as an example of how the SRPI
Send_Request interface verb can be used by a PC requester application
to invoke a server on the host. The function of the sample programs
is to request records from a customer records data set on the IBM host
computer. The IBM host computer sends the customer records to the
requester program for processing. If the customer's balance in the
record is positive, the record is sent back to the server. The server
puts the positive balance into an accounts receivable data set on the
IBM host computer. To support this function, a sample PC requester
program, a sample host server program and a sample host data file are
provided.

The sample programs are designed to work in the OS/2 protect mode,
with the Communications Manager of the OS/2 Extended Edition. Sample
program source code and the supporting files are provided for C,
PASCAL, and MASM languages. Since the sample programs are in source
form, you will need to go through additional steps to run these
programs.

RESTRICTIONS

1. The sample server is based on the sample server source program
documented in the "Programmer's Guide to the Server-Requester
Programming Interface for VM/System Product". The sample server
provided is used to run under VM/CMS environment only. For a
sample server that will run under MVS environment, refer to the
"TSO Extensions Programmer's Guide to the Server-Requester
Programming Interface for MVS/Extended Architecture" for more
information.

2. The balance field in the customer record is in binary format and
it is non-displayable on VM in the sample customer data set.

PREREQUISTES

To run a sample program, you must be familiar with the following
things:

1. OS/2 installation and command prompt

2. Communications Manager installation

3. Compiler for the desired language

4. VM/CMS operation and commands

INSTALLATION

1




Install OS/2 according to the OS/2 installation procedure. Then,
install the Communications Manager using its full function
installation procedure. The 3270 Emulation and File Transfer feature
groups of the Communications Manager need to be installed.
Installation of these features will copy the SRPI API structures,
macros and object files to the Communications Manager directory, which
is C:\CMLIB.

The compiler associated with the desired language also needs to be
installed using the installation procedure of that language compiler.
Refer to the following language sections for additional information.

NOTES

1. The instructions for typing at the OS/2 command prompt shows the
command line with the path for information only. For example,
[C:] is displayed, and you must not type it at the OS/2 command
prompt.

SAMPLE REQUESTER PROGRAMS

1. C LANGUAGE

a. INSTALL C COMPILER

Install the IBM C/2 Compiler Version 1.10 using the
installation procedure of the compiler. The INSTAID program is
used to install the compiler. Have the master diskette of the
compiler in drive A, and type the following at the OS/2
command prompt:

[C:\]instaid a:C11.pip [press Enter]

Follow the directions provided by the menus. Choose the
default directories and subdirectories.

b. C SAMPLE PROGRAM

The C sample requester program is called CSAMPL. Copy from
the SRPI_C directory on the sample program diskette the files
with the filename CSAMPL into directory C:\IBMC2. The files to be
copied are source code (.C extension), module definition file
(.DEF extension), make description file (no extension), and
link response file (.LRF extension).

All the INCLUDE files must reside in \IBMC2\INCLUDE directory.
Copy UUCCPRB.H from the Communications Manager directory
(CMLIB) into the \IBMC2\INCLUDE directory.

Copy SRPI_C.OBJ file from the Communications Manager directory
(CMLIB) into directory C:\IBMC2.

2



c. LIBRARY FILES FOR C SAMPLE PROGRAM

All the LIBRARY files must reside in \IBMC2\LIB directory. Copy
ACS.LIB from the Communications Manager directory (CMLIB) into
the \IBMC2\LIB directory and DOSCALLS.LIB from the OS/2 directory
(OS2) into the \IBMC2\LIB directory.

d. COMPILE/LINK C SAMPLE PROGRAM

During installation of the compiler, a file NEW-VARS.CMD is
created in your \IBMC2\BIN\SAMPLE directory. Change your current
directory to \IBMC2\BIN\SAMPLE. Type the following at the OS/2
command prompt to set up the environment for the compiler.

[C:\IBMC2\BIN\]new-vars [press Enter]

Change your current directory to C:\IBMC2

To compile and link the sample requester program, type the
following at the OS/2 command prompt:

[C:\IBMC2]make -r csampl [press Enter]

The executable file CSAMPL.EXE will be created.

2. PASCAL LANGUAGE

a. INSTALL PASCAL COMPILER

Install the IBM PASCAL/2 Compiler Version 1.10 using the
installation procedure of the compiler. The INSTAID program is
used to install the compiler. Have the master diskette of the
compiler in drive A, and type the following at the OS/2
command prompt:

[C:\]instaid [press enter]

Follow the directions provided by the menus. Choose the
default directories and subdirectories.

b. PASCAL SAMPLE PROGRAM

The PASCAL sample requester program is called PSAMPL. Copy
from the SRPI_P directory on the sample program diskette the
files with the filename PSAMPL into directory C:\PASCAL. The
files to be copied are source code (.PAS extension), module
definition file (.DEF extension), make description file (no
extension), and link response file (.LRF extension).

All the INCLUDE files must reside in \PASCAL\SRC directory.
Copy UUPCPRB.INC and UUPPROCS.INC files from the

3



Communications Manager directory (CMLIB) into the \PASCAL\SRC
directory.

Copy SRPI_P.OBJ file from the Communications Manager directory
(CMLIB) into directory C:\PASCAL.

c. LIBRARY FILES FOR PASCAL SAMPLE PROGRAM

All the LIBRARY files must reside in \PASCAL\LIB directory.
Copy ACS.LIB from the Communications Manager directory (CMLIB)
into the \PASCAL\LIB directory and DOSCALLS.LIB from the OS/2
directory (OS2) into the \PASCAL\LIB directory.

d. COMPILE/LINK PASCAL SAMPLE PROGRAM

During installation of the compiler, a file PASCENVR.CMD is
created in your \PASCAL\BIN directory. Change your current
directory to \PASCAL\BIN. Type the following at the OS/2
command prompt to set up the environment for the compiler.

[C:\PASCAL\BIN]pascenvr [press Enter]

Change your current directory to C:\PASCAL

To compile and link the sample requester program, type the
following at the OS/2 command prompt:

[C:\PASCAL]make psampl [press Enter]

The executable file PSAMPL will be created.

3. MACRO ASSEMBLER

a. INSTALL MACRO ASSEMBLER

Install the IBM Macro Assembler/2 Version 1.10 using the
installation procedure of the assembler. The INSTAID program
is used to install the assembler. Have the master diskette of
the assembler in drive A, and type the following at the OS/2
command prompt:

[C:\]instaid [press Enter]

Follow the directions provided by the menus. Choose the
default directories and subdirectories.

During installation of the assembler, the INSTAID program will
have created a new directory \MASM\BIN.

b. ASSEMBLER SAMPLE PROGRAM

4



The MASM sample requester program is called MSAMPL. Copy from
the SRPI_M directory on the sample program diskette the files
with the filename MSAMPL into directory C:\MASM\BIN. The
files to be copied are source code (.ASM extension), module
definition file (.DEF extension), make description file (no
extension), and link response file (.LRF extension).

All the INCLUDE files must reside in \MASM\BIN directory.
Copy UUMCPRB.INC and UUMINFAC.MAC files from the
Communications Manager directory (CMLIB) into the \MASM\BIN
directory.

c. LIBRARY FILES FOR ASSEMBLER SAMPLE PROGRAM

All the LIBRARY files must reside in \MASM\BIN directory.
Copy ACS.LIB from the Communications Manager directory (CMLIB)
into the \MASM\BIN directory and DOSCALLS.LIB from the OS/2
directory (OS2) into the \MASM\BIN directory.

d. ASSEMBLE/LINK ASSEMBLER SAMPLE PROGRAM

Change your current directory to C:\MASM\BIN.

To assemble and link the sample requester program, type the
following at the OS/2 command prompt:

[C:\MASM\BIN]make msampl [press Enter]

The executable file MSAMPL.EXE will be created.

HARDWARE REQUIREMENTS

A 3270 terminal emulation (DFT) connection to an IBM host computer via
an SNA controller from an IBM Personal Computer AT using the 3270
Connection Adapter or from an PS/2 using The IBM Connection adapter
(DFT/DCA).

NOTE: For SDLC Communications hardware requirements refer to the
System Administrator's Guide.

CONFIG.SYS CHANGES

To run the SRPI sample program, you have to change your CONFIG.SYS
file to add:

DEVICE=C:\CMLIB\DFTDD.SYS

NOTE: For SDLC connection, specify DEVICE = C:\CMLIB\SDLCDD.SYS in
your CONFIG.SYS file.

Now that you have updated the CONFIG.SYS file, you need to restart
your system for the changes to take effect.

5




[Press Alt + Ctrl + Del]

CONFIGURATION STEPS

The following instructions will guide you through the configuration
process, panel by panel, until complete. This will configure an OS/2
Extended Edition system for the following features to run the SRPI
sample programs:

1. 3270 terminal emulation (DFT) SNA connection

2. Server-Requester Programming Interface (SRPI) profiles

NOTE: For SDLC Communications configuration refer to the System
Administrator's Guide.

Create a sample configuration file for the SRPI sample program using
the configuration services in Communications Manager.

On the PC that will run the sample program, copy the system-supplied
configuration file, ACSCFG.CFG, to SRPISMPL.CFG in the C:\CMLIB
directory.

Start the Communications Manager using SRPISMPL as the startup
configuration file, type the following at the OS/2 command prompt:

[C:\CMLIB]cm srpismpl [press Enter]

Beginning at the "Communications Manager Main Menu" follow the
instructions below.

Press F10
Select "Advanced" from action bar
Select "Configuration"

"Specify Configuration File Name" [SRPISMPL] panel displayed
ENTER

"Communication Configuration Menu" panel displayed
Select "Workstation profile"

"Communication Configuration Menu" panel displayed
Select "Change"

"Change Workstation Profile" panel displayed
Specify "Machine type-model number"
Specify "IBM plant of manufacture-machine sequence number"
ENTER

6



"Communication Configuration Menu" panel displayed
Select "3270 feature profiles"

"3270 Feature Configuration" panel displayed
Select "3270 terminal emulation profile..."

"Profile Operations" pop-up panel displayed
Select "Create"

"Create/Change 3270 Emulation Profiles" panel displayed
Select "Connection..."
ENTER

"Select DLC Type" pop-up panel displayed
Select "DFT"
ENTER

"Create/Change DFT Connection Data" panel displayed
Select "Yes"
Select "3270 Connection"
ENTER

"Create/Change 3270 Emulation Profiles" panel displayed
Select "Logical terminal..."
ENTER

"Specify Session ID/LU Name" pop-up panel displayed
Specify "Session ID/LU name" to be "TEST"
ENTER

"Create/Change Logical 3270 Display Terminal" panel displayed
Specify "Comment" to be "This is a sample logical terminal"
Select "DFT..."
Select "3278/79 mod 2 (25 x 80)"
Select "25 x 80"
ENTER

"Specify DFT LT Data" pop-up panel displayed
ENTER

"Create/Change 3270 Emulation Profiles" panel displayed
ESCAPE

"3270 Feature Configuration" panel displayed
ESCAPE

"Communication Configuration Menu" panel displayed
Select "Server-Requester Programming
Interface profile (SRPI)..."

"Profile Operations" pop-up panel displayed
Select "Create"


7



"Create Server Profile" panel displayed
Specify "Server alias" to be "IBMABASE"
Specify "Comment" to be "This is a sample server"
Specify "Server Name" to be "IBMABASE"
Specify "3270 session ID" to be "TEST"
ENTER

"Communication Configuration Menu" panel displayed

Press F10
Select "Verify" from action bar
Select "Run Verify"

The following message should appear:
"Verification of the configuration file is complete.
No errors occured... "
ENTER

Press F10
Select "Exit" from action bar
Select "Exit Communication Configuration"

"Communications Manager Main Menu" panel displayed

Before running the sample SRPI program, exit and restart the
Communications Manager using SRPISMPL as the configuration file. This
will allow the changes to take affect.

INSTALL SAMPLE SRPI SERVER

To set up the sample server environment, two files are needed on the
IBM host computer:

IBMABASE MODULE (the sample server)
INPUT FILE (the sample customer data set)

The following instructions will guide you to properly install the SRPI
sample server on the host.

From the "Communications Manager Main Menu", start the 3270 emulation
feature and log on to the specified session. Create a new screen
group from the Program Selector menu on the PC. At the OS/2 command
prompt, enter the following commands to upload the three host sample
files from the diskette:

SEND A:IBMABASE.ASM TEST: IBMABASE ASSEMBLE A (ASCII CRLF RECFM F
SEND A:ALGABASE.EXC TEST: ALGABASE EXEC A (ASCII CRLF
SEND A:INPUT.FIL TEST: INPUT FILE A (LRECL 109

Note: If the above files are not located on a diskette in drive A,
then enter the correct path inplace of the A:.

After the file transfer completes, switch to the same 3270 session and
type ALGABASE at the VM/CMS command line to assemble and link. This

8



will generate the executable sample server file with the name of
IBMABASE MODULE.

RUNNING SRPI REQUESTER AND SERVER SAMPLE PROGRAMS

Create a new directory SAMPLE on the PC where your requester sample
program will reside. For C language, copy the file CSAMPL.EXE from
| C:\IBMC2 to C:\SAMPLE subdirectory. For PASCAL, copy the file PSAMPL.EXE
from C:\PASCAL to C:\SAMPLE subdirectory. For MASM, copy the file
MSAMPL.EXE from C:\MASM\BIN to C:\SAMPLE subdirectory.

Enter CMSSERV from the CMS command line in the 3270 session you just
started. The IBM Enhanced Connectivity Facilities screen appears.
Switch to an OS/2 screen group and change the current directory to
SAMPLE. Execute the sample requester program. When the program
completes, switch back to the 3270 session with CMSSERV screen. Press
PF3 key to end the communication between CMSSERV and your PC. Verify
that there are two files generated in your 3270 session as a result of
the SRPI requester execution. The names of these two files are OUTPUT
FILE and LOG FILE.

The content of the OUTPUT FILE is listed below:

Barttwell, Jim 300 Top Bend Austin Texas 78759 1000-2000-3020

The content of the LOG FILE is listed below:

CUSTOMER RECORDS READ ***
Ahab, John 1000 High Circle Austin Texas 78759 1000-2000-3000
ADMIN

CUSTOMER RECORDS READ ***
Black, Edward 2000 Big Top Road Austin Texas 78759 1000-2000-3010
ADMIN

CUSTOMER RECORDS READ ***
Barttwell, Jim 3000 Top Bend Austin Texas 78759 1000-2000-3020
ADMIN

CUSTOMER RECORDS UPDATED
Barttwell, Jim 3000 Top Bend Austin Texas 78759 1000-2000-3020
Barttwell, Jim 3000 Top Bend Austin Texas 78759 1000-2000-3020
ADMIN

WSCOMM RECEIVED BY SERVER



9


  3 Responses to “Category : OS/2 Files
Archive   : OS2CMAPI.ZIP
Filename : SRPI.ME

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/