IBM Support

Start PC Command does not work in Host Access Transformation Services

Troubleshooting


Problem

This technote states IBM Rational Host Access Transformation Services does not work with the Start PC Command (STRPCCMD) by default. A solution is provided.

Symptom

When STRPCCMD is used on the host screen, Rational Host Access Transformation Services does not run the PC command like a standard emulator.

The Start PC Command enables an application to be launched on a personal computer that is attached to the host iSeries system. Since Rational Host Access Transformation Services users are not directly connected to the iSeries system, these commands are not sent to the local workstation. Rational Host Access Transformation Services does not have the ability to process the STRPCCMD. Rational Host Access Transformation Services has no method to run commands or programs on the user's workstation from a browser.

Cause

Rational Host Access Transformation Services is not an emulator. The Start PC Command (STRPCCMD) requires the emulator to process this command in the 5250 datastream and send the appropriate system command to the workstation to perform the function. Rational Host Access Transformation Services generates Web pages in the browser and does not have any native code installed on the workstation that would have the ability to issue commands to the local system. Security settings in the browser prevent Web pages from running code on a user's system.

Resolving The Problem

Rational Host Access Transformation Services does not support the Start PC Command (STRPCCMD). Developers who want to use this type of functionality can customize their Rational Host Access Transformation Services application and implement similar functions for the user. For example, if the STRPCCMD function is used to start a Web browser and pass in information from the host screen in the URL, this can be simulated in the Rational Host Access Transformation Services transformation in the following way:

Example usage of STRPCCMD:


PGM        PARM(&URL)                                    
                                                          
DCL        VAR(&URL) TYPE(*CHAR) LEN(102)                
DCL        VAR(&STRCMD) TYPE(*CHAR) LEN(123)             
                                                         
STRPCO     PCTA(*NO)                                     
MONMSG     MSGID(IWS4010)                                
                                                         
CHGVAR     VAR(&STRCMD) VALUE('START IEXPLORE.EXE ' || + 
             &URL)                                       
DMPCLPGM                                                  
STRPCCMD   PCCMD(&STRCMD) PAUSE(*NO)                     
                                                         
ENDPGM

Example code in Rational Host Access Transformation Services transformation:


<%
HostScreen hs = (HostScreen)((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getHostScreen();

String rtcorp = hs.getFieldAtPos(4,28).getFieldString().trim();
String rtloc = hs.getFieldAtPos(4,30).getFieldString().trim();
String rtinv = hs.getFieldAtPos(4,33).getFieldString().trim();
%>

 <a href="http://www.yourhost.com/r.aspx?rId=7&B=<%=rtcorp + rtloc %>&I=<%=rtinv %>" class="HATSLINK" TARGET=_BLANK>Show Report</a>

The code above can be placed inside of the <HATS:Form> tag in the transformation. The href tag should be inserted in the position where the link should be displayed in the HTML code.

[{"Product":{"code":"SSXKAY","label":"IBM Host Access Transformation Services"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"General Information","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1;7.5","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
02 August 2018

UID

swg21382108