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: - Inefficient - 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); Where:
Listed below are most commonly used PCS APIs and their prototype: 1. pcsConnectSession BOOL WINAPI pcsConnectSession(char cShortSessionID) 2. pcsDisconnectSession BOOL WINAPI pcsDisconnectSession(char cShortSessionID) 3. pcsQueryConnectionInfo BOOL WINAPI pcsQueryConnectionInfo(char cShortSessionID, CONNECTIONINFO *ConnectionInfo) 4. pcsStartSession ULONG WINAPI pcsStartSession(PSZ lpProfile, char cShortSessionID, USHORT fuCmdShow) 5. pcsStopSession BOOL WINAPI pcsStopSession(char cShortSessionID, USHORT fuSaveProfile) 6. pcsQuerySessionList 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): A. Declarations
B. Entry Function
C. ConnectPCOMMSession
D. LaunchPCOMM Function
E. Stop PCOMM Session
Download the Sample code: Attached is an excel sample that can be used to test PCSAPI calls. ![]()
Contact:
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.
23 Comments
Rich Little
4/16/2018 05:22:27 pm
Does this work with the new (ish) Java-based ACS emulator?
Reply
Avinash Sable
4/18/2018 02:37:52 am
Hi Rich,
Reply
Rich
4/18/2018 12:22:32 pm
So it looks like I need to have HOD installed if I want to go with either the Bridge or HOD Session API's. Is that correct?
Avinash Sable
4/19/2018 05:02:36 am
Hello Rich, 9/28/2018 06:44:04 am
An online MBA degree is an uncommon chance to encourage your livelihood and land the position you require. In any case, such countless today experience issues with gaining the egree and visit website to get more data. Swing to capable article forming destinations if you need a specialist and apt support and would lean toward not to get wonderfully left.
Reply
Budi Setiawan
8/23/2019 07:51:36 am
I was trying to run it under Excel for Office 365 on Windows 10. Changed the code as below
Reply
Rich Little
3/8/2020 04:13:33 pm
As of your post, VBA for Excel 64-bit is incompatible with EHLLAPI 32-bit. Examples given here are for Excel 32-bit only. VB.Net programs will work but not VBA.
Reply
Raiders52(Al)
2/17/2020 09:55:15 pm
I am looking for someone who has experience integrating Excel VBA calls (and passing Variables) to the AS400 Macros which has been recorded in the new Windows 10 iAccess Client scripting language "HAScript". I have been searching for weeks and have not found anyone with this experience. I have built many Excel VBA automation scripts making calls to the old iAccess Client Ver. 7.1 AS400 macros recorded in vbscript. Any help would be greatly appreciated.
Reply
StefanoP
3/5/2020 04:14:41 pm
Hello Raider52,
Reply
Rich Little
3/8/2020 05:36:24 am
Hi Stefano,
Saravanan
8/29/2020 04:26:41 pm
Hi Raiders,
Reply
Raider52
8/29/2020 06:10:27 pm
Hello Saravanan:
StefanoP
9/2/2020 04:11:21 am
Hi Saravanan,
Raiders52
9/7/2020 11:16:06 pm
Hello StefanoP
Raiders52(Al)
3/5/2020 08:51:41 pm
Hello StefanoP
Reply
Rich Little
3/8/2020 05:46:00 am
Don't struggle. Make sure you've got the prerequisites covered. Here's a link to a Zip that contains a working Excel Macro Workbook and a PDF outlining the prerequisites required to run VB.Net and VBA in the new Java-based IBM Access Client.
Reply
Rich Little
3/8/2020 04:16:24 pm
My previous comment is for 32-bit Excel. We're still researching how to make it work with Excel 64-bit.
Reply
StefanoP
3/9/2020 07:23:09 pm
Hi Rich Little,
StefanoP
4/14/2020 10:03:58 am
Hello
Reply
saha
6/29/2020 11:54:11 am
Hi,
Reply
StefanoP
9/19/2020 11:34:01 am
Hello Raiders52,
Reply
Nice article, I found this sample very handy I wonder know how to implement a couple things:
Reply
StefanoP
12/8/2020 09:33:37 am
Hello Dan, I agree with you. It was very hard to substitute the PCOMM with xml instructions for a complex program realized in Visual Basic. Especially because of the poor IBM documentation and lack of examples.
Reply
Leave a Reply. |