STRCPYSCN: The Poor Man’s 5250 Remote Control Program
May 17, 2006 Hey, Joe
When I perform technical support for some remote 5250 users, I don’t always have the ability to remotely log on to their PC and troubleshoot the problem. There are also times when I can’t or don’t want to go through the trouble of starting a GoToMyPC session with the user machine. Do i5 and iSeries boxes provide any native capabilities for working with another user’s 5250 session? –Bob While I’m a big fan of remotely logging on to user PCs, I do realize that it’s not always possible to take over a PC running a 5250 session when user machines may be hiding behind various firewalls spanning a single building, a single city, or the entire world. In those cases, where you really need to see what a 5250 user is doing, it’s handy to know about the Start Copy Screen (STRCPYSCN) and End Copy Screen (ENDCPYSCN) commands. STRCPYSCN is a simple little command that allows you to view or capture all the screen output from an active 5250 session. So if you’re in New York and your supported user is in Toronto, and you are both running on the same i5 partition, you can easily see what he’s doing on his 5250 session by running the following command on your green-screen session. STRCPYSCN SRCDEV(job_name) OUTDEV(*REQUESTER) where job_name is the job name of the 5250 device session that you want to view. After STRCPYSCN starts, i5/OS will show the following break message on the 5250 target screen that you are asking to monitor. Type reply (if required), press Enter. From . . . : JOE 05/10/06 20:53:47 Cause . . . . . : Start copy screen has been requested with output to job_name. Reply C to prevent copy screen or G to allow it. (C G) Reply . . . This message asks your target user for permission to monitor their session. If the user types in ‘C’, permission is denied and the command ends on your requesting session. If the user types in ‘G’, permission is granted and copies of the target session’s 5250 screens will automatically be forwarded to your session, allowing you to follow along as your target user performs various i5/OS and menu commands. There are a few things to be aware of, however, when running STRCPYSCN over a remote user’s terminal session. First, your keyboard will be locked up during STRCPYSCN processing, and you will not be able to run any commands on either your target 5250 session or on your own session. STRCPYSCN essentially takes over your terminal so that you can only see what your target user is seeing; there isn’t much latitude for independent action on your viewing system. In addition, the forwarded screen captures on your viewing machine will always be one screen behind those on your target machine. So the user will always have to be working one screen ahead in order for you to view the functions that you want to see. One nice way to get around this is by having your target user press the F5 key on screens that have a F5=Refresh option, and STRCPYSCN will show you the previously unrefreshed screen, which should mostly contain the same information as the screen that the user is currently viewing. When you’re ready to end the user’s STRCPYSCN session, simply ask the user to run the following End Copy Screen command (ENDCPYSCN) from their desktop. ENDCPYSCN And this will end target screen forwarding to your viewing machine, leaving you free to run commands again on your 5250 session. STRCPYSCN is also good for capturing successive 5250 screens and writing them to an i5/OS or OS/400 file that can be viewed by, FTPed to, or emailed to another person for problem diagnosis. In the file capture scenario, there will be no viewing machine, only a target machine that is copying its screen shots to an output file. To set up this capability, you must run the following STRCPYSCN command on your target machine. STRCPYSCN SRCDEV(*REQUESTER) OUTDEV(*NONE) OUTFILE(library/file_name) In this scenario, all screens on the target machine are automatically forwarded to a system file, which can be viewed by or sent to another user for analysis. When you run the ENDCPYSCN command, your session will stop copying screens to its output file and it will close the file. That file can then be used by any other user on your i5 box. While STRCPYSCN is not as elegant as other PC remote control programs, it serves the purpose of providing a quick and dirty way to troubleshoot 5250 green-screen problems without having any additional software loaded on the target machine. Besides helping troubleshooting, STRCPYSCN can also be used for demonstrating software functionality. HTH –Joe |