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

 
Output of file : HAPI.ME contained in archive : OS2CMAPI.ZIP
Version 1.1 (c) Copyright International Business Machines Corp., 1988


EHLLAPI SAMPLE PROGRAMS

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

The sample programs request EHLLAPI configuration information and HOST
session information. The sample programs then attempt to send the
string "3270 EHLLAPI" to one of the started sessions. An EHLLAPI
search function will be called to search for the string. Last, the
first 1920 characters of the host session screen will be displayed.

Also provided on the sample program diskette is the Program Sampler
executable file. This Program Sampler (HLLSAMP.EXE) lets you
experiment with various EHLLAPI functions. See "Running the Program
Sampler" in the EHLLAPI Programming Guide.

RESTRICTIONS

1. The Communications Manager must be loaded with at least one 3270
session started.

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

INSTALLATION

Install OS/2 and Communications Manager according to instructions in
"IBM Operating System/2 Extended Edition Version 1.1 Getting Started".

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



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

1. C LANGUAGE

a. INSTALL C COMPILER

Install the IBM C/2 Compiler Version 1.1 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. Choose "No" when
prompted whether to set up the environment immediately. The
compiler is installed at this point.

b. C SAMPLE PROGRAM


The C sample EHLLAPI program is called HSMPLC. Copy from the
HAPI_C directory on the sample program diskette the files with
the filename HSMPLC 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 HAPI_C.H from the Communications Manager directory
(CMLIB) into the \IBMC2\INCLUDE directory.

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

c. LIBRARY FILES FOR C SAMPLE PROGRAM

All the LIBRARY files must reside in \IBMC2\LIB directory.
Copy 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 directory. Change your current
directory to \IBMC2\BIN. Type the following at the OS/2
command prompt to set up the environment for the compiler.

2



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

Change your current directory to C:\IBMC2

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

[C:\IBMC2]make hsmplc /r [press Enter]

The executable file HSMPLC.EXE will be created.

2. PASCAL LANGUAGE

a. INSTALL PASCAL COMPILER

Install the IBM PASCAL/2 Compiler Version 1.0 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:PASCAL.pip [press enter]

Follow the directions provided by the menus. Choose the
default directories and subdirectories. At the "Select Math
Library" menu, select "2. Emulator math library".

b. PASCAL SAMPLE PROGRAM

The PASCAL sample EHLLAPI program is called HSMPLP. Copy from
the HAPI_P directory on the sample program diskette the files
with the filename HSMPLP 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 HAPI_P.INC file from the Communications Manager directory
(CMLIB) into the \PASCAL\SRC directory.

Copy PHLLPAS.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 DOSCALLS.LIB from the OS/2 directory (OS2) into the
\PASCAL\LIB directory.

d. COMPILE/LINK PASCAL SAMPLE PROGRAM


3



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 EHLLAPI program, type the
following at the OS/2 command prompt:

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

The executable file HSMPLP will be created.

3. MACRO ASSEMBLER

a. INSTALL MACRO ASSEMBLER

Install the IBM Macro Assembler/2 Version 1.0 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 a:MASM.pip [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

The MASM sample EHLLAPI program is called HSMPLM. Copy from
the HAPI_M directory on the sample program diskette the files
with the filename HSMPLM 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 HAPI_M.INC from the Communications Manager directory
(CMLIB) into the \MASM\BIN directory.

Copy PHLLMASM.OBJ from the Communications Manager directory
(CMLIB) into the \MASM\BIN directory.

c. LIBRARY FILES FOR ASSEMBLER SAMPLE PROGRAM

4



All the LIBRARY files must reside in \MASM\BIN directory.
Copy 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 EHLLAPI program, type the
following at the OS/2 command prompt:

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

The executable file HSMPLM.EXE will be created.

4. COBOL LANGUAGE

a. INSTALL COBOL COMPILER

Install the IBM COBOL/2 Compiler Version 1.0 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:COBOL.pip [press enter]

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

b. COBOL SAMPLE PROGRAM

The COBOL sample EHLLAPI program is called HSMPLCBL. Copy
from the HAPI_CBL directory on the sample program diskette the
files with the filename HSMPLCBL into directory C:\PCOBOL.
The files to be copied are source code (.CBL extension),
module definition file (.DEF extension), and link response
file (.LRF extension). Copy the batch file (HSMPLCBB.CMD)
from the HAPI_CBL directory into directory C:\PCOBOL.

All the INCLUDE files must reside in \PCOBOL directory. Copy
HAPI_CBL.INC file from the Communications Manager directory
(CMLIB) into the \PCOBOL directory.

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

c. LIBRARY FILES FOR COBOL SAMPLE PROGRAM

All the LIBRARY files must reside in \PCOBOL directory. Copy
DOSCALLS.LIB from the OS/2 directory (OS2) into the \PCOBOL
directory.

5



d. COMPILE/LINK COBOL SAMPLE PROGRAM

Change your current directory to C:\PCOBOL

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

[C:\PCOBOL]hsmplcbb [press Enter]

The executable file HSMPLPCBL will be created.

5. BASIC LANGUAGE

a. INSTALL BASIC COMPILER

Install the IBM BASIC Compiler/2 Version 1.0 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:BASCOM.pip [press enter]

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

b. BASIC SAMPLE PROGRAM

The BASIC sample EHLLAPI program is called HSMPLBAS. Copy
from the HAPI_BAS directory on the sample program diskette the
files with the filename HSMPLBAS into directory C:\BASCOM\BIN.
The files to be copied are source code (.BAS extension),

module definition file (.DEF extension), and link response
file (.LRF extension). Copy the batch file (HSMPLBSB.CMD)
from the HAPI_BAS directory into directory C:\BASCOM\BIN.

All the INCLUDE files must reside in \BASCOM\BIN directory.
Copy HAPI_BAS.INC file from the Communications Manager
directory (CMLIB) into the \BASCOM\BIN directory.

Copy PHLLCBAS.OBJ file from the Communications Manager
directory (CMLIB) into directory C:\BASCOM\BIN.

c. LIBRARY FILES FOR BASIC SAMPLE PROGRAM

All the LIBRARY files must reside in \BASCOM\LIB directory.
Copy DOSCALLS.LIB from the OS/2 directory (OS2) into the
\BASCOM\LIB directory.

d. COMPILE/LINK BASIC SAMPLE PROGRAM


6



Change your current directory to \BASCOM\BIN. Type the
following at the OS/2 command prompt to set up the environment
for the compiler.

[C:\BASCOM\BIN]set LIB=C:\BASCOM\LIB [press Enter]

Change your current directory to C:\BASCOM\BIN

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

[C:\BASCOM\BIN]hsmplbsb [press Enter]

The executable file HSMPLBAS will be created.

CONFIGURATION STEPS

EHLLAPI supports the following connections of the Communications
Manager:

1. 3270 terminal emulation (DFT) SNA connection

2. 3270 terminal emulation (DFT) NON SNA connection

3. 3270 terminal emulation (SDLC)

4. 3270 terminal emulation (IBM Token-Ring Network)

For configuring and starting Communications Manager with 3270 terminal
emulation connections above, refer to the "IBM Operating System/2
Extended Edition Version 1.1 User's Guide" and "IBM Operating System/2
Extended Edition Version 1.1 System Administrator's Guide for
Communications".

RUNNING EHLLAPI SAMPLE PROGRAMS

Create a new directory SAMPLE on the Workstation where your EHLLAPI
sample program will reside. For C language, copy the file HSMPLC.EXE
from C:\IBMC2 to C:\SAMPLE subdirectory. For PASCAL, copy the file
HSMPLP.EXE from C:\PASCAL to C:\SAMPLE subdirectory. For MASM, copy
the file HSMPLM.EXE from C:\MASM\BIN to C:\SAMPLE subdirectory. For
COBOL, copy the file HSMPLCBL.EXE from C:\PCOBOL to C:\SAMPLE
subdirectory. For BASIC, copy the file HSMPLBAS.EXE from
C:\BASCOM\BIN to C:\SAMPLE subdirectory.

From the "Communications Manager Main Menu", start the 3270 terminal
emulation feature. Switch to an OS/2 screen group and change the
current directory to SAMPLE. Execute the sample EHLLAPI program. The
sample program will prompt you to press ENTER at certian points within
the program execution.

7


  3 Responses to “Category : OS/2 Files
Archive   : OS2CMAPI.ZIP
Filename : HAPI.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/