IBM Personal Communications provides an emulator interface to communicate with IBM Mainframe/AS400/VT sessions. This is used for reading & updating host data and interfacing host with other applications. Performing manual tasks on emulator screen increases in transaction and becomes repetitive, this over a long term would have issues:
- Redundant and hence error prone
- Time consuming and thus expensive
IBM Personal Communications exposes many Application Programming Interfaces (APIs) to empower the user to automate commonly performed tasks. Different APIs are provided with a specific set of functions, which can be used for different purposes and provide different programming interface based on the user’s requirement. Different APIs support programming languages such as, Visual Basic for Applications (and thus supports MS Office applications), C/C++, C#, Java, LotusScript, REXX, etc.
The list of API set provided by PCOMM and their functions:
A. Personal Communications Session API (PCSAPI): PCOMM sessions management.
B. Emulator High Level Language API (EHLLAPI): Workstation application <> Host management once session is established.
C. IBM Personal Communications Host Access Class Library (HACL): Workstation application <> Host management once session is established.
D. Dynamic Data Exchange (DDE): Host-Client data exchange management.
E. Server-Requestor Programming Interface (SRPI): Provides access to IBM Enhanced Connectivity Facility (ECF) providing the tools to write SRPI requester programs
In this blog we will explore more about PCS APIs.
PCS Session APIs have the capability to launch, open session, close, connect, disconnect the PCOMM session. As the EHLLAPI APIs are tightly coupled with IBM EHLLAPI communication standard (TN3270 and TN5250 protocol), they do not have session management API’s. PCOMM Session APIs also provide functions to setup printer, page, query workstation profile/session list/Emulator Status. These API’s can be used in conjunction with EHLLAPI/HACL API’s to complete the automation cycle.
Function Calling convention
PCOMM Session APIs follow a simple prototype for all functions to keep the programming straightforward. As mentioned above these API’s can be accessed and programmed using multiple programming languages (VBA, C/C++, C#, etc).
Function Type Function Name (Arguments);
Listed below are most commonly used PCS APIs and their prototype:
BOOL WINAPI pcsConnectSession(char cShortSessionID)
BOOL WINAPI pcsDisconnectSession(char cShortSessionID)
BOOL WINAPI pcsQueryConnectionInfo(char cShortSessionID, CONNECTIONINFO *ConnectionInfo)
ULONG WINAPI pcsStartSession(PSZ lpProfile, char cShortSessionID, USHORT fuCmdShow)
BOOL WINAPI pcsStopSession(char cShortSessionID, USHORT fuSaveProfile)
ULONG WINAPI pcsQuerySessionList(ULONG Count, SESSINFO *SessionList)
For more information about these API, please click here
Macro Execution Block Diagram:
Following diagram depicts the High-level view of the PCOMM’s API-Macro Engine-IBM Host flow.
Code Snipped VBA code (in Excel Application):
B. Entry Function
D. LaunchPCOMM Function
E. Stop PCOMM Session
Download the Sample code:
Attached is an excel sample that can be used to test PCSAPI calls.
For further information on automation in IBM PCOMM/HOD, contact zServices@hcl.com
Or write to HCL-HI-LabServices@hcl.com to get more information on Services offerings or Technical details.
Lead - Lab Services, IBM HACP & HATS