In earlier articles I have published a number of commands that offer green screen alternatives to the System i Navigator NetServer facilities. The NetServer component allows Windows PCs to access shared directory paths and shared output queues on your System i. The commands presented so far offered CL command interfaces to work with server share functions (WRKSVRSHR) as well as disabled NetServer users (WRKNETUSR). I've provided links at the end of this article pointing you to both IBM's current NetServer documentation as well as the aforementioned articles.
Today I add to the collection of NetServer tools in the form of the Work with Server Sessions (WRKSVRSSN) and the End Server Session commands (ENDSVRSSN). The Work with Server Sessions command lists all currently active NetServer sessions, based on the input parameters specified:
Work with Server Sessions (WRKSVRSSN)
Type choices, press Enter.
Workstation . . . . . . . . . . *ALL____
User profile . . . . . . . . . . *ALL____ Character value, *ALL
Output . . . . . . . . . . . . . *_______ *, *PRINT
You can direct the output to either a printed list or a work with-panel offering the following options:
Work with Server Sessions WYNDHAMW
01-03-09 17:34:28
Workstation . . . *ALL____ Position to . . . ________
User . . . . . . . *ALL____
Type options, press Enter.
4=End session 5=Display session data 8=Work with user system jobs
Opt Workstation User Connections Open files Sessions
__ 10.248.70.249 MIKEO 1 1 1
__ 10.248.71.12 DRIEHL 1 1 1
__ 10.248.88.118 CARSTEN 2 3 2
Bottom
Parameters or command
===> __________________________________________________________________
F3=Exit F4=Prompt F5=Refresh F7=Work with netserver users
F8=Work with server shares F11=Display time F12=Cancel F24=More keys
Option 4 allows you to end the server session using the new ENDSVRSSN command - a confirmation panel is shown first though - while option 5 allows you to display all server session details in one view. Option 8 executes another previously published command named Work with Jobs, which is capable of listing all active jobs which currently run under a given current user profile. This enables you to quite easily track down the server job providing access to the shared resource, and investigate for example file locks, job attributes or connection status. Print server jobs are named QNPSERVS and run in the QUSRWRK subsystem while file share jobs are named QZLSFILE or QZLSFILET and run in the QSERVER subsystem.
Function key F7 provides quick access to the WRKNETUSR command and function key F8 executes the WRKSVRSHR command. Use function key F11 to toggle between idle time and connection statistics information in the list panel. Both command and work with-panel is documented by means of the online help text panel group included with the utility. Running the ENDSVRSSN command from a command line presents the following command prompt:
End Server Session (ENDSVRSSN)
Type choices, press Enter.
Workstation . . . . . . . . . . ___________________
Again you'll find a help text panel group to fill you in with all details. While I was testing the ENDSVRSSN command it turned out that while the command's underlying API performed its duties successfully, it still returned an error message, indicating that a severe problem was encountered and that the operation had failed. My research of the problem lead to the discovery of an APAR and a PTF, that have been issued to correct the problem for release 5.4 and 6.1, respectively. Since none of the PTFs have been included in CUM packages, you'll have to specifically order and install the one applying to your release, to prevent the faulty error message from appearing. The command will work either way, though. You'll find a link to the APAR below.
The following sources provide the WRKSVRSSN and ENDSVRSSN commands:
CBX986 -- RPGLE -- Work with Server Sessions - CPP CBX986E -- RPGLE -- Work with Server Sessions - UIM Exit Program CBX986H -- PNLGRP -- Work with Server Sessions - Help CBX986P -- PNLGRP -- Work with Server Sessions - Panel Group CBX986V -- RPGLE -- Work with Server Sessions - VCP CBX986X -- CMD -- Work with Server Sessions CBX987 -- RPGLE -- End Server Session - CPP CBX987H -- PNLGRP -- End Server Session - Help CBX987V -- RPGLE -- End Server Session - VCP CBX987X -- CMD -- End Server Session CBX986M -- CLP -- Server Session Commands - Build commands
To create all above objects, compile and run CBX986M, following the instructions in the source header. As always, you'll also find compilation instructions in the respective source headers.
Download the zip file containing the program code.
APAR MA37470: Message CPFB682 issued when ending NetServer Session
Work with Jobs (WRKJOBS) command
Work with Server Shares (WRKSVRSHR) command
Display Server Share (DSPSVRSHR) command
Change Server Share (CHGSVRSHR) command
Remove Server Share (RMVSVRSHR) command
Add Server Share command (ADDSVRSHR)
Work with Disabled NetServer Users (WRKNETUSR) command