[Access to Wang masthead]

The MWSEDIT Procedure

Controlling workstation personalities

From "VS Procedure",  Access 87, June 1987
  [ Prior Article ]     [ Return to the Catalog of articles ]     [ Next Article ]  

The MESSAGE procedure I mentioned last month has been temporarily postponed due to possible differences of operation within different operating systems. I hope to clear up these issues and feature it soon. In the meanwhile, I have put together a utility to maintain a large numbers of workstation "personalities" using Wang's Multistation (MWS) utility. First, though, some background on MWS for those unfamiliar with this powerful utility.

What is a Multistation?

Wang's Multistation utility is designed to allow a single workstation to run several jobs simultaneously. When properly set up, a single user workstation can perform as if it were two, three, or four workstations, shifting from one "window" to another at will. In addition, MWS also allows personalized control of the workstation attributes and automation of repetitive keystrokes through use of the GLOSSARY language. A growing number of users have discovered the power and use Multistation even when only one window is available.

Multistation requires the user terminal to be configured as a special device (2256MWS or 4230MWS), rather than the usual 2256C or 4230 device number. When a user log onto the system on a Multistation, the system searches for a personality file that matches the user's ID; if found, this microcode is loaded into the workstation. If no personality file is found, a default file ('@STD') is loaded instead; thus, a user-specific personality usually requires a separate personality file for each user.

Workstation attributes and other aspects of the MWS workstation are normally controlled through the MWS personality editor, PERSON. Using PERSON, users can edit their workstation's personality. PERSON becomes inconvenient, however, when a system administrator must maintain a large number of individual microcode files for a number of users. This month's procedure aids in that task by allowing easy modification of the workstation attributes for an entire library of personality files.

Design goals and operation of MWSEDIT

The design goals for MWSEDIT were:

1. Allow easy maintenance and modification of the workstation attributes for existing "personalities".

2. Speed creation of new MWS files by copying existing versions.

3. Create a generic routine that might be modified to maintain other aspects of MWS files.

MWSEDIT is based largely on the WORKBNCH procedure featured in the December 1986 column. Like WORKBNCH, it locates all files matching the selection criteria (in this case, all files in a library) and presents them in menu form for selection. Unlike WORKBNCH, it uses the READVTOC subroutine rather than FIND to locate these file names. The procedure is shown in Figure 1.

The library to be edited is assumed to be 'MWS' on the system volume, as this is the normal location for Multistation files. Changes to this standard would require modifications to the contents of &FLIB and &FVOL; both are declared at the top of the procedure to help in this process.

The files in the MWS library are displayed in groups of twenty (see Figure 2); pressing (RETURN) brings up the next twenty, Note that the files are in VTOC order, not alphabetical. To select a file, the user tabs to the desired file name and presses the appropriate PF key.

If the EDIT option is selected, MWSEDIT determines the name of the file and displays the workstation attribute options menu (see Figure 3). Control then passes to CREATE, which creates a new version of the personality with the edited workstation attributes inserted at the proper place in the personality file. Finally, the original file is scratched and the work version inserted in its place.

The COPY option duplicates the selected microcode file, then calls @EDIT to set up the workstation attributes for the new file. Note that the output file name defaults to the input name.

Some of the finer points of the procedure:

1. The control section of the procedure is contained within the steps through @16, with subroutines to handle the details. This makes the logic more easily understood.

2. The @EDIT section uses the &VERIFY built-in function to validate responses to the items.

3. CREATE is used to prepare a near copy of the microcode file, substituting the eight characters related to workstation attributes. If this file is created successfully, the old file is scratched and the new file renamed into its place.

4. For simplicity, the @COPY option displays the file output screen with the input file name as the default. The user must change the file to another name. Note the CANCEL EXIT clause; this ensures that the procedure will abort if COPY is cancelled abnormally.

Variations and other items

Variations on MWSEDIT might include increasing the number of files to be displayed or adding an option to edit a different library. File name verification and other error checking might be valuable additions. More ambitious users might locate and edit other patch points in the personality file, such as the character set, uppercase foldover chart, accent combination table, or key layout. More advanced explorers might also learn how to control glossary interactions or window configuration. If you have any other approaches I'd like to hear from you.

By the way, a very functional addition to last month's start procedure system would be the name of the personality file to be loaded. This might be done by expanding the holding variable, &SETMAP, and assigning the MWS personality file to be loaded. Using this approach, it would be simple to assign a single personality file to a class of user.

I have concentrated in the last few months on items of interest to the systems administrator; next month's column will continue in that vein with a procedure that amasses data on the files in a library and allows you to select files from that data. See you next month.


Figure 1: The MWSEDIT Procedure


     PROCEDURE MWSEDIT

**********************************************************************
*
*           MWSEDIT - Editor for Multistation personalities
*
*    This procedure was featured in the June 1987 ACCESS 87.  It
*    allows modification of the workstation attributes of a large
*    number of Multistation personalities.
*
*    Modify to your own needs by changing the input library and volume
*    (&FLIB and &FVOL) to the one used by your system; the initial
*    setting is for MWS on the system volume.  The procedure extracts
*    the names of files in that library and presents them 20 at a time.
*    Note that the files are in VTOC order, not alphbetical.
*
*    Due to the procedure's use of the &VERIFY and CALL built-in
*    functions, the user must have release 3.00.10 of the Procedure
*    interpreter (e.g. operating system 6.40 or better).
*
*    Written by Dennis S. Barnes
*
**********************************************************************

     DECLARE &FLIB       STRING (08)         INITIAL "MWS     "
     DECLARE &FVOL       STRING (06)
     DECLARE &FSTART     INTEGER
     DECLARE &FRCVR      STRING (160)        [ Holds 20 files ]
     DECLARE &FFILES     INTEGER
     DECLARE &RC         INTEGER

     DECLARE &KEY, &ROW, &COL      INTEGER
     DECLARE &RUNSTEP    STRING (03) INITIAL "@  "
     DECLARE &MESSAGE    STRING (78)

* This variable is the offset from the row position displayed on the
* selection screen.
     DECLARE &OFFSET     INTEGER             INITIAL 13

     DECLARE &P          INTEGER
     DECLARE &INFIL      STRING (08)

* Initial values for workstation attributes; reset if desired
     DECLARE &ITEM       STRING (08)         INITIAL "YYYNYNNN"
     DECLARE &VERNUMB    INTEGER


S00: ASSIGN &FSTART      = -19     [ Start-up value; yields '1' ]
     ASSIGN &FRCVR       = " "     [ Clear file name holder     ]
     EXTRACT &FVOL       = SYSVOL

* Get next 20 files; return to start if no more files
S01: CALL @SEARCH
     IF &FRCVR = " "     GOTO S00

S02: PROMPT              PFKEY     = &RUNSTEP (2,2),
                         CURROW    = &ROW, CURCOL    = &COL
     CENTER BRIGHT LINE  "Personality Editor";;
     CENTER      "TAB to the file desired and press a key to perform";
     CENTER LINE "           any of the following tasks:            ";;
     CENTER      "<07> Edit personality     <13> Copy personality   ";;
     CENTER      " Press (RETURN) to see the next 20 files";
     CENTER      " Press PF16     to exit MWSEDIT         ";;
     CENTER TAB " ", &FRCVR(001,8), " ", TAB " ", &FRCVR(041,8), " ",
            TAB " ", &FRCVR(081,8), " ", TAB " ", &FRCVR(121,8);
     CENTER TAB " ", &FRCVR(009,8), " ", TAB " ", &FRCVR(049,8), " ",
            TAB " ", &FRCVR(089,8), " ", TAB " ", &FRCVR(129,8);
     CENTER TAB " ", &FRCVR(017,8), " ", TAB " ", &FRCVR(057,8), " ",
            TAB " ", &FRCVR(097,8), " ", TAB " ", &FRCVR(137,8);
     CENTER TAB " ", &FRCVR(025,8), " ", TAB " ", &FRCVR(065,8), " ",
            TAB " ", &FRCVR(105,8), " ", TAB " ", &FRCVR(145,8);
     CENTER TAB " ", &FRCVR(033,8), " ", TAB " ", &FRCVR(073,8), " ",
            TAB " ", &FRCVR(113,8), " ", TAB " ", &FRCVR(153,8);;

* If proper PF key pressed, goes directly to that section; otherwise,
* loops back to selection screen
     IF &LABEL (&RUNSTEP)          GOTO &RUNSTEP
     GOTO S02


@0:  GOTO S01

@7:  CALL @GETFILE
     IF &INFIL <> " "    CALL @EDIT
     GOTO S02

@13: CALL @GETFILE
     IF &INFIL <> " "    CALL @COPY
     GOTO S02

@16: RETURN

**********************************************************************
*                        Subroutines follow                          *
**********************************************************************

@SEARCH:
     ASSIGN &FSTART      = &FSTART + 20
     ASSIGN &FRCVR       = " "

     RUN READVTOC IN USERSUBS      USING "F",       &FLIB,
                                         &FVOL,     &FSTART,
                                         20,        &FRCVR,
                                         &RC,       &FFILES
     END

**********************************************************************

@GETFILE:
     ASSIGN &P           = ((&ROW - &OFFSET) * 8) - 7
     IF &COL > 27        ASSIGN &P = &P + 40
     IF &COL > 40        ASSIGN &P = &P + 40
     IF &COL > 53        ASSIGN &P = &P + 40

     ASSIGN &INFIL       = &FRCVR(&P,8)
     END

**********************************************************************

@EDIT:
     ASSIGN &MESSAGE     = " "

E01: PROMPT              PFKEY     = &KEY
     CENTER BRIGHT LINE  "Personality Editor";;
     CENTER              "Currently editing", BRIGHT &INFIL(1,*);;
     CENTER "Edit the following parameters & press (RETURN) to save";
     CENTER "OR  press PF16 to exit without modification.";;
     CENTER              UPPER &ITEM(1,1),
       "Blinker      Make blinking fields blink, not just bright";
     CENTER              UPPER &ITEM(2,1),
       "Clicker      Click with each keystroke                  ";
     CENTER              UPPER &ITEM(3,1),
       "Beeper       Beep at errors                             ";
     CENTER              UPPER &ITEM(4,1),
       "Auto tab-in  TAB to next unprotected field before typing";
     CENTER              UPPER &ITEM(5,1),
       "Auto tab-out TAB to next unprotected field after typing ";
     CENTER              UPPER &ITEM(6,1),
       "Status       Display workstation status                 ";
     CENTER              UPPER &ITEM(7,1),
       "Cursor-wrap  At screen edges, wrap the cursor around    ";
     CENTER              UPPER &ITEM(8,1),
       "Type-ahead   Accept keystrokes even if keyboard locked  ";;
     CENTER BRIGHT       &MESSAGE(1,*);;

     IF &KEY = 16        END

     ASSIGN &VERNUMB     = &VERIFY(&ITEM,"YN")
     IF &VERNUMB = 0     GOTO E02           [ Entries are valid ]

     ASSIGN &MESSAGE     =
       "Entries must be 'Y' or 'N' - please correct"
     GOTO E01

* Workstation attributes edited; create new personality file with
* revised attributes
E02: RUN CREATE [ in library on volume ]
     ENTER OUTPUT        FILE      = MWSWORK, LIBRARY   = &FLIB,
                         VOLUME    = &FVOL,   TYPE      = C,
                         RECSIZE   = 2048,    COMPRESS  = NO,
                         RECORDS   = 2
     ENTER INPUT         02
     ENTER PAD           POSITION  = 1,       LENGTH    = 2048
     ENTER INPUT         FILE      = &INFIL,  LIBRARY   = &FLIB,
                         VOLUME    = &FVOL
     ENTER FILE          INPOS     = 1,       OUTPOS    = 1,
                         LENGTH    = 256,     START     = 1,
                         END       = 1
     ENTER INPUT         01
     ENTER LITERAL       STRING    = &ITEM,   POSITION  = 257,
                         LENGTH    = 8
     ENTER INPUT         FILE      = &INFIL,  LIBRARY   = &FLIB,
                         VOLUME    = &FVOL
     ENTER FILE          INPOS     = 265,     OUTPOS    = 265,
                         LENGTH    = 1784,    START     = 1,
                         END       = 1
     ENTER INPUT         16
     ENTER INPUT         FILE      = &INFIL,  LIBRARY   = &FLIB,
                         VOLUME    = &FVOL
     ENTER FILE          START     = 2,       END       = 2
     ENTER INPUT         16
     ENTER INPUT         16
     ENTER EOJ           16

     IF E02 = 0         GOTO E03

     PROMPT              ALARM     = YES
     CENTER              "CREATE ERROR!!";;
     CENTER              "No file was created";;
     GOTO S02

* New personality created; scratch original copy
E03: SCRATCH &INFIL  IN &FLIB ON &FVOL
     RENAME  MWSWORK IN &FLIB ON &FVOL       TO &INFIL
     END

**********************************************************************

@COPY:
     RUN COPY [ in library on volume ]
     CANCEL EXIT         IS @16
     ENTER INPUT         FILE      = &INFIL,  LIBRARY   = &FLIB,
                         VOLUME    = &FVOL
     ENTER OPTIONS
O1:  DISPLAY OUTPUT      FILE      = &INFIL,  LIBRARY   = &FLIB,
                         VOLUME    = &FVOL
     ENTER EOJ           16

     ASSIGN &INFIL       = (O1.FILE)
     CALL @EDIT

     END

Figure 2: Personality Editor - Main Screen





                               Personality Editor

               TAB to the file desired and press a key to perform
                          any of the following tasks:

               <07> Edit personality     <13> Copy personality

                     Press (RETURN) to see the next 20 files
                     Press PF16     to exit MWSEDIT

               *  @STD      *  @STDFILE  *  DSBTEST   *
               *  @ALL      *  DSBSAVE   *            *
               *  @WISCII   *  ADASTEST  *            *
               *  KSF       *  JMP       *            *
               *  DSB       *  DSBOLD    *            *





                                                                                

Figure 3: Personality Editor - Detail Screen




                               Personality Editor

                            Currently editing DSBTEST

             Edit the following parameters & press (RETURN) to save
                  OR  press PF16 to exit without modification.

           N Blinker      Make blinking fields blink, not just bright
           Y Clicker      Click with each keystroke
           Y Beeper       Beep at errors
           N Auto tab-in  TAB to next unprotected field before typing
           Y Auto tab-out TAB to next unprotected field after typing
           N Status       Display workstation status
           N Cursor-wrap  At screen edges, wrap the cursor around
           N Type-ahead   Accept keystrokes even if keyboard locked






                                                                                

  [ Prior Article ]     [ Return to the Catalog of articles ]     [ Next Article ]  


Copyright © 1987 Dennis S. Barnes
Reprints of this article are permitted without notification if the source of the information is clearly identified