MUSIC/SP Kermit 4.3.n Installation Instructions
                     (1994 December)
 
Get the necessary files from the Kermit distribution tape or from BITNET
KERMSRV or elsewhere.  Note that many of the files are generic for
Kermit-370 and may already be available from a local CMS or TSO site.  As
distributed by Columbia, the files are named as follows, all with prefix
IKM or IK0 (I K Zero):
 
   IKMAUX.CMD  Sample EXEC's KERMAIL, etc.
   IKMGUP.ASM  Assembler source for MUSIC-specific part of GUPI
   IKMKER.BWR  A "beware" file, listing known bugs and problems
   IKMKER.DOC  MUSIC Kermit User Guide, plain text
   IKMKER.HLP  Kermit-MUSIC short help file
   IKMKER.INS  Kermit-MUSIC installation instructions (this file)
   IKMKER.NUP  Test updates for MUSIC variant of Kermit-370
   IKMKER.UPD  Updates for MUSIC variant of Kermit-370
   IKMMAC.ASM  Assembler source for MUSIC-specific macros
   IKMUTL.ASM  Assembler source for MUSIC-specific routines
   IK0CMD.ASM  Assembler source for command handler
   IK0COM.ASM  Assembler source for global code
   IK0DEF.ASM  Assembler source for parameter definitions
   IK0DOC.ASM  Assembler source with brief history
   IK0GUP.ASM  Assembler source for generic update program GUPI
   IK0KAN.ASM  Assembler source for Kanji character translation
   IK0MAC.ASM  Assembler source for generic Kermit macros
   IK0MAI.ASM  Assembler source for storage initialization
   IK0PRO.ASM  Assembler source for generic routines
 
The following files are not necessary for installation, but may be of
some interest.
 
   IKCACT.ASM  Assembler source for optional accounting exit routine
   IKMHDR.MSS  Scribe source for producing IKMKER.DOC
   IKMKER.ANN  Text of Kermit-MUSIC announcement for the current version
   IKMKER.LPT  Line-printer (paginated) equivalent of IKMKER.DOC
   IKMKER.MSS  Scribe source for MUSIC part of IKMKER.DOC
   IKMKER.PS   PostScript equivalent of IKMKER.DOC
   IK0AAA.HLP  Kermit-370 implementation notes, supported environments
   IK0CON.HLP  Notes on supporting other terminal controllers
   IK0KER.ANN  Text of generic Kermit-370 4.3 announcement
   IK0KER.MSS  Scribe source for generic part of IKMKER.DOC
   IK0KER.UPD  Update history for Kermit-370
   IK0POR.HLP  Notes on porting Kermit-370 to other systems
   IK0VCS.PKT  Czech-language version of Kermit-370 source (updates)
   IK0VDE.PKT  German-language version of Kermit-370 source (updates)
   IK0VER.FOR  Comparison program for generating update files
   IK0VES.PKT  Spanish-language version of Kermit-370 source (updates)
   IK0VFI.PKT  Finnish-language version of Kermit-370 source (updates)
   IK0VFR.PKT  French-language version of Kermit-370 source (updates)
   IK0VIT.PKT  Italian-language version of Kermit-370 source (updates)
   IK0VNL.PKT  Dutch-language version of Kermit-370 source (updates)
   IK0VPL.PKT  Polish-language version of Kermit-370 source (updates)
   IK0VPT.PKT  Portuguese-language version of Kermit-370 source (updates)
   IK0VRU.PKT  Russian-language version of Kermit-370 source (updates)
 
Kermit-MUSIC installation consists of a a few simple steps.  It is
recommended that the process normally be carried out in the $KRM code,
but any code with sufficient privileges will suffice for making a
"personal" Kermit.  Specifically, the account must have "LSCAN" (so that
the assembler can find system macros) and "DEFTIME(NL)" (so that the
default service unit limit can be exceeded).  A Kermit for use by
non-privileged users must be installed under $KRM.  The process requires
that you clip the REXX exec called IKMINS from the end of this file and
execute it in a directory containing all the Kermit distribution files
with names exactly as obtained from Columbia.  There is no need to
rename source files from "ASM" to "S", for example.  IKMINS asks a few
questions as it goes, but it suggests default answers in every case, and
repeatedly hitting ENTER normally gives the correct results.  You can
quit at a prompt by entering "STOP".  The final products of installation
are files KERMIT.LMOD, KERMIT, and SYSTEM.KERMHELP.  These files are
respectively the executable program, the executor, and the help file.
If the last two did not already exist as public files in another
directory, they are established as such by this procedure; otherwise,
the new ones simply remain private.  If any needed files are missing, or
any step fails, IKMINS halts and complains about the problem.
 
One intermediate product of Kermit installation is GUPI (Generic Update
Program), which applies updates to the base code, and which can be used
as a tool for updating other software as well.  GUPI supports the same
update syntax as the CMS UPDATE utility.  See step 4 below for an
executor file to make GUPI available as a general update utility.  The
syntax for execution is simply "GUPI <base> <updates> <output>", where
the bracketed lower-case words represent file names.
 
The updates for Kermit come from as many as three places: IKMKER.UPD
(the required official updates), IKMKER.NUP (the optional current test
version), and KERMIT.LOCAL (optional local mods).  If either optional
file doesn't exist, IKMINS reports that the corresponding category of
updates won't be applied, and then goes on.  Installation can readily be
halted if a file is missing by accident.
 
The sources for Kermit and GUPI are in many pieces, some generic for
Kermit-370 and some specific to MUSIC.  All the necessary pieces are
sequenced in columns 73-80 so that the numbers form a strictly
increasing sequence when the pieces are correctly "pasted" together.  It
is important to preserve the original sequence numbers so that updates,
if any, can be applied to the source.
 
The steps performed in installation (most are automatic):
 
1. Collect the files from the Kermit distribution into the desired
   directory on a suitably privileged account.
 
2. Assemble the Generic Update Program GUPI.  This program is required
   to apply updates to the Kermit-MUSIC source.  (automatic)
 
3. Link the object deck created by the previous step, producing
   GUPI.LMOD.  (automatic)
 
4. Create the GUPI executor file if you want to use GUPI as a general
   utility.  The following will suffice.
 
      /SYS NOPRINT,REGION=1024
      /LOAD XMON
      GUPI N($KRM:GUPI.LMOD)
 
5. Build the base Kermit source so that you can apply modifications over
   it.  Merge the source files in the order IK0DOC, IK0MAC, IKMMAC,
   IK0DEF, IK0MAI, IK0COM, IK0CMD, IK0KAN, IKMUTL, IK0PRO, and save the
   result as KERMIT.BASE.S.  (automatic)  IK0KAN is optional.  Including
   it adds about 32 Kbytes to the Kermit program.
 
6. Apply the updates using GUPI.  Note: this operation requires a region
   of at least 1024K.  (automatic)
 
7. Assemble the Kermit source.  (automatic)
 
8. Link the object deck created by the previous step together with
   system subroutines.  (automatic)
 
9. Create the Kermit executor file to permit running the KERMIT
   program with the proper system parameters.  The file MUST be saved
   as a PUBL,XO file so that the program privileges are assigned
   properly by the system.  (automatic)
 
10. Kermit-MUSIC requires the LSCAN privilege, since it does a save
    library scan directly.  You must modify either the system module
    LOOKUP or the macro invoked by LOOKUP called $MCM:USERTBL.M.  Add
    the line
 
          FILNAM '$KRM:KERMIT',(LSCAN,0)
 
    to either of the two files.  Reassemble the module LOOKUP and make
    sure that the new object deck is used when rebuilding the nucleus.
    If you do not give Kermit this privilege, the program will abend on
    user codes that do not have LSCAN.
 
11. Copy the file IKMKER.HLP to the MUSIC file $KRM:SYSTEM.KERMHELP
    and save it as a PUBLIC file.  This file is displayed when the
    HELP subcommand is issued to Kermit-MUSIC.  (automatic)
 
12. Install any desired auxilliary commands from IKMAUX CMD.  These are
    sample EXEC's and may need to be tailored to your site.
 
 
                   * * Performance tuning * *
 
Kermit-MUSIC, like other Kermits, can transfer files with a minimum of
tuning at installation.  However, getting the best performance may
require further efforts.  For example, the 80-byte default packet size
is "safe" but is probably not the optimum.  The largest usable size must
be determined at each site for each type of connection, and in each
direction of transfer.  The largest size for uploads can be made the
default by inserting a SET RECEIVE PACKET subcommand into the system
initialization file SYSTEM.KERMINI.  The download packet limit must be
set in the micro Kermit.  Another means of improving performance is to
determine which control characters can be transmitted "as is" and avoid
quoting them via the SET CONTROL-CHAR UNPREF subcommand.  Regardless of
the settings, Kermit-MUSIC always prefixes the SEND start-of-packet and
end-of-line, the handshake, and XOFF, but there may be other unsafe
control characters.  These must be determined empirically.  There is a
subcommand to simplify saving the the result of such experiments: GIVE
CON stores the subcommands needed to achieve the current control
character table arrangement into a file.
 
 
                   * * Alternate Languages * *
 
Kermit-370 now can be installed in a variety of languages.  The messages
within Kermit have been gathered into a few places in the code, and they
can all be replaced during installation with those of a chosen language.
The replacements are contained in distribution files with names like
ik0vXX.pkt, where "XX" is the two-letter language code according to ISO
639.  These files contain the messages in an encoded form using only the
character repertoire of ASCII, so that even the extended characters can
pass successfully through a variety of transmission mechanisms.
 
Here are the instructions for applying the changes:
 
1. Use Kermit itself to decode the language-specific update file into
   the proper IBM code page.  To do this, start Kermit (4.2.6 or
   higher) and then select the desired code page, e.g.,
 
         SET FILE CHARACTER-SET CP500
 
   Then tell Kermit to use ik0vXX.pkt, via
 
         SIMULATE IK0Vxx.PKT
         RECEIVE
 
   Kermit will then quickly decode and (attempt to) store the file with
   the name ik0vXX.upd.  If you already have a file of that name, the
   FILE COLLISION setting will determine what happens (overwrite the
   original, pick a new name for the new file, or whatever).
 
2. ik0vXX.upd contains the updates for all four major variants of
   Kermit-370, and you must edit the file to extract the generic and
   MUSIC-specific parts.
 
3. Concatenate the MUSIC and generic parts of ik0vXX.upd to KERMIT.LOCAL
   and re-install.
 
                    * * Accounting Routine * *
 
If you wish to use the optional accounting exit routine with Kermit,
you must create the object for it and load it with Kermit.  These steps
are performed automatically if a file called IKMACT.ASM exists in the
installation directory and if the installer gives approval to IKMINS.
The sample currently available was written for CMS and must be adapted
to run under MUSIC.  Any user who does so is urged to contribute the
MUSIC version for inclusion in the Kermit distribution under the name
IKMACT.ASM.  Even when such a MUSIC-specific sample is available, you
should examine the source and customize it to your installation's needs
before using it.
 
                       * * Configuration * *
 
The IBM mainframe and its communications front end (3705, 7171, etc.)
usually require that parity be used by any asynchronous ASCII device
that wishes to communicate with it.  Exactly which kind of parity is
site-dependent.  At Columbia, the 3705 requires Mark parity, and the
7171 requires Even parity.  Make sure your users know to use the
appropriate parity setting, as well as any other settings required for
IBM mainframe communication (see p.36-39 of the Kermit book).
 
For linemode transfers, the ASCII/EBCDIC translation in the front end is
a key factor.  Kermit-MUSIC uses an ASCII/EBCDIC translation table which
conforms to the one given in the IBM System/370 Reference Summary.  If
your site's translation table is incompatible with the one Kermit uses,
then enter the appropriate SET ATOE/ETOA/TATOE/TETOA subcommands in the
SYSTEM KERMINI file.  As long as the system tables are invertible with
respect to the printable ASCII characters (even if the A-to-E and E-to-A
tables are not the inverses of each other), the SET subcommands can
compensate.  However, if your system's ASCII/EBCDIC tables are not
invertible, Kermit will not and cannot work; you must change your
system's tables.  Refer to the generic Kermit-370 chapter of the User's
Guide for a step-by-step customization procedure (see the section on
translation tables).
 
Kermit-MUSIC operation is possible for many types of protocol converters;
it requires only that the converter have some kind of transparent mode.
Be sure the converter is configured so that the graphics or transparent
mode, whatever it is called, is enabled.  See IK0AAA.HLP for a list of
front ends that are known to work and for a collection of notes and
special warnings about some of them.  Some further installation details
follow for specific devices.
 
When MUSIC Kermit is to be used with a 7171, make sure the 7171 is set up
with its "keyboard lock delay" parameter set to 0.  Otherwise, the
"terminal" will hang whenever MUSIC Kermit clears the screen.  This
happens consistently when the parameter is set to 10, and not at all
when set to 0.  For numbers in between, the higher the number, the more
it happens.
 
There is another problem in the 7171 that can cause Kermit file
transfers to abort after a flurry of retransmissions if XON/XOFF flow
control is used by the receiving Kermit, or even by hardware in between
the 7171 and the receiver.  To prevent this problem, set the 7171 flags
so that XOFF is not a valid terminator of a transparent read.  See page
4-20 of "IBM 7171 Reference Manual and Programming Guide" (IBM
publication number GA27-0021).
 
Kermit operation through a Renex protocol converter generally requires
that type-ahead be turned off.
 
Kermit operation is possible through an IBM 3708 front end in two
different configurations.  In the first, the terminal line must be set
for either "protocol enveloping" or "dynamic" mode, and a session must
be set for line-at-a-time operation for Kermit to work.  Other important
details of the terminal configuration are: (1) the terminal must be
specified as a TWX device, (2) the SSCP format should be set to USSNTO,
(3) the terminal type ID should be set to 05, (4) the line should be set
for 8, or possibly 7, data bits and 1 stop bit, (5) there should be no
"read prompt", and (6) the so-called "alternate" translation table
(number 3) should be selected.  Kermit-MUSIC may also need to be
configured because some models of the 3708 (or some environments) do not
pass the normal packet character SOH (code 1, CTRL-A).  A suitable
substitute is HT (code 9, CTRL-I).  Alternatively, or additionally, it
may help to set the 3708 "interface type" to 0.
 
The second possible 3708 configuration is "protocol conversion" mode and
makes use of the FULLSCREEN type in Kermit, which is also suitable for
many other kinds of protocol converter.  The basic setup consists of the
following Kermit subcommands.
 
     .... mainframe .....        ....... PC .........
     SET CONTROLLER FULL         set send start 62
     SET RECEIVE START 62        set receive start 62
     SET SEND START 62           set block b
     SET BLOCK B                 set handshake none
     SET HANDSHAKE 0
 
The 62's (Greater-than sign) may be replaced by some other decimal code
for a printable character.  For best results, choose a character that
seldom appears in the files you will be transferring.  In particular,
avoid the Control, Eighth-bit, and Repeat prefixes.  Packet sizes are
automatically restricted by Kermit-MUSIC, so you needn't set them unless
conditions require packets shorter than the default (77).  Flow control
may be needed to keep up with the data rate on some equipment.  The
block check type should be set to "B" only if the protocol converter is
overzealous in optimizing the data stream -- there are hazards in using
any type other than "1" because of all the packet echoing.  Refer to
IK0AAA.HLP for such details.  Note that the translation of characters
imposes the same setup requirements on FULLSCREEN mode as on the
traditional TTY mode (linemode).  See the user's guide (IKMKER.DOC).
 
Kermit-MUSIC supports file transfers through the IBM 3174 AEA with B2
microcode, but support is restricted to terminals with the ASCII
Graphics capability in three ways that may require compensating
installation:
 
a) The terminal type must be defined in the 3174 to support graphics
   (only the built-in VT241 and Tektronix 4205 types plus suitable
   user-defined terminal types).  IBM's AEA Reference describes how
   to set up terminal tables.
 
b) The line must be defined without a Host Addressable Printer.
 
c) If the 3174 is owned by VTAM, the connection must be made with a
   logmode that allows the Read Partition Query (such as M2SDLCQ).
 
-------- cut here for IKMINS (invoke for easy installation) ---------
/INCL REXX
/*---------------------------------------------------------------------
                I K M I N S
 Complete Kermit installation EXEC
   J.F.Chandler - 1994 Oct 20 with updates through November
 For an explanation of the operations in this EXEC, see IKMKER.INS and
 IKMKER.BWR in the Kermit distribution.  Obtain the distribution files
 (step 1 in "INS") before running this EXEC.  Installation requires
 about 6MB of disk work space and privileges LSCAN DEFTIME(NL).
 
 Optional customization: to create a PRINT file of the update details
 and assemblies, change the definition of fl.PRKEEP from NO to YES.  In
 the standard version of this EXEC, the print files are purged unless
 there are errors in the installation.
 
 Optional customization: to use extra options on the assembly step(s),
 insert them into the definition of fl.ASMOPTS.  These will be passed
 to the assembler "as is".  Also, set fl.LMDRCL to the desired value
 for the record length of LMOD's produced by this command.
 -------------------------------------------------------------------*/
Signal on NOVALUE
 
/*------------ Initialize some variables (set defaults) */
edt.1 = '/SYS REG=640'
edt.2 = '/FILE 1 UDS(&&TEMP) NREC(15000) DEF BUFNO(0)'
edt.3 = '/INC *COM:EDITOR'
edt.0 = 3
 
fl.PRKEEP = 'NO'    /* If YES, keep listing files, even if no error */
fl.ASMCMD = ''      /* Name of assembler (get from SYSASM if null) */
fl.ASMOPTS = ''     /* Extra assembler options */
fl.LMDRCL = 64      /* Length for linked programs */
 
/*  All these options are verified with the installer */
fl.BASE = 'YES'     /* Recreate merged base source */
fl.KANJ = 'NO'      /* Include Kanji support in base */
fl.CLOB = 'YES'     /* Replace current Kermit source */
fl.LCL  = 'NO'      /* Include local updates (becomes YES if exist) */
fl.NUP  = 'NO'      /* Include test updates (becomes YES if exist) */
fl.ACT  = 'NO'      /* Include accounting exit */
 
/*--------------- Get name of preferred assembler */
If fl.ASMCMD = '' Then Do
   fl.ASMCMD = 'ASM'     /* "Normal" name */
 
   'MUSIO READ  *COM:SYSASM ALL'
   'MUSIO CLOSE *COM:SYSASM ALL'
 
   nrec = Queued()
   Do i=1 To nrec
      Pull verb name .
      If verb = '/LOAD' Then fl.ASMCMD = name
      End
   End
 
/*------------------------------- Announce and confirm options */
'CLS'
Say "IKMINS installs Kermit in the current directory using distribution"
Say "sources and updates (assumed to be present)."
Say "This procedure will use '"fl.ASMCMD"' for assemblies."
Say ""
Say "To halt installation, enter 'STOP' at any prompt..."
Say ""
Say "Before installing, search 'IKMKER.BWR' for relevant optional mods.  Local"
Say "updates should be bundled into 'KERMIT.LOCAL'."
Say ""
 
kills = ''
 
/*----------- ************ S T E P   INS 2 */
/*---------- Merge all required source files to make GUPI.S */
Call CHECK 'GUPI.LMOD','NO'
 
If checkrc<>0 Then Do
   Say 'Installing GUPI...'
   Call CHECK 'GUPI.BASE.S','NO'
   If checkrc = 0 Then 'PURGE GUPI.BASE.S'
   gupcmps = 'IK0MAC IKMMAC IKMGUP IK0GUP'
   Do i = 1 To Words(gupcmps)
      Call CHECK Word(gupcmps,i)'.ASM','YES'
      End i
   Call CHECK 'GUPI.S','NO'
   grc = checkrc
 
   Queue '/PARM GUPI.S NEW 80 FC'
   Do i = 1 To edt.0 ;  Queue edt.i ;  End
   Do i = 1 To Words(gupcmps)
      Queue 'MERGE' Word(gupcmps,i)'.ASM'
      End i
   Queue 'TOP'
   Queue 'CASE R'
   Queue 'C /COPY  //*FC10'
   If grc = 0 Then Queue 'PURGE GUPI.S'
   Queue 'FILE'
 
   Call DOIT 'EXEC','merging GUPI'
/*----------------------------------- Assemble GUPI */
   name = 'GUPI'
   Call ASM
 
/*----------- ************ S T E P   INS 3 */
/* ------------------------------- Link-Edit GUPI */
   loads = 'GUPI'
   Call LKED
/*-------------------------------- Bootstrap GUPI if necessary */
   Call CHECK 'IKMGUP.UPD','NO'
   If checkrc = 0 Then Do
      Say 'Updating GUPI...'
      'RENAME GUPI.S GUPI.BASE.S'
      Call GUPI 'GUPI.BASE.S','IKMGUP.UPD','GUPI.S'
      Call ASM
      Call LKED
      End
   End
 
/*--------------------------- Make sure files are present */
Call CHECK 'IKMKER.BWR','YES'
Call CHECK 'IKMKER.HLP','YES'
Call CHECK 'KERMIT.S','NO'
urc = checkrc
Call CHECK 'KERMIT.BASE.S','NO'
brc = checkrc
If urc = 0 Then Call ASK 'CLOB','Updated source already exists - replace it'
If fl.CLOB = 'YES' & brc = 0 Then,
   Call ASK 'BASE','Base source already exists - redo it'
 
If urc = 0 Then Say '70'x
 
If fl.CLOB = 'YES' Then Do
   Call CHECK 'IKMKER.UPD','YES'
   updcmps = 'IKMKER.UPD'
   Call CHECK 'IKMKER.NUP','NO'
   If checkrc = 0 Then Do
      fl.NUP  = 'YES'
      Call ASK 'NUP','Use updates from IKMKER.NUP'
      If fl.NUP = 'YES' Then updcmps = updcmps||' IKMKER.NUP'
      End
   Else Say 'No test updates will be applied'
   Call CHECK 'KERMIT.LOCAL','NO'
   If checkrc = 0 Then Do
      fl.LCL  = 'YES'
      Call ASK 'LCL','Any local updates to apply'
      If fl.LCL = 'YES' Then updcmps = updcmps||' KERMIT.LOCAL'
      End
   Else Say 'No local updates will be applied'
 
   Call ASK 'KANJ','Include Kanji support'
   p1 = 'IK0DOC IK0MAC IKMMAC IK0DEF IK0MAI IK0COM IK0CMD IKMUTL'
   srccmps = p1 'IK0PRO'
   If fl.KANJ = 'YES' Then srccmps = p1 'IK0KAN IK0PRO'
   Do i = 1 To Words(srccmps)
     Call CHECK Word(srccmps,i)'.ASM','YES'
     End i
   Say '70'x
   End
 
/*----------------------------------- Make optional accounting exit */
Call CHECK 'IKMACT.ASM','NO'
If checkrc = 0 Then Do
   fl.ACT = 'YES'
   Call ASK 'ACT','Include optional accounting exit'
   End
If fl.ACT = 'YES' Then Do
   Call CHECK 'IKMACT.UPD','NO'
   If checkrc = 0 Then Do
      Say 'Updating KACCT...'
      Call GUPI 'IKMACT.ASM','IKMACT.UPD','KACCT.S'
      End
   Else Do
      Call CHECK 'KACCT.S','NO'
      Queue '/PARM KACCT.S NEW 80 fc'
      Do i = 1 To edt.0 ;  Queue edt.i ;  End
      Queue 'MERGE IKMACT.ASM'
      If checkrc = 0 Then Queue 'PURGE KACCT.S'
      Queue 'FILE KACCT.S'
 
      Call DOIT 'EXEC','copying KACCT'
      End
   End
 
/*----------- ************ S T E P   INS 5 */
 
/*----------------------------------- Make base source(s) */
If fl.CLOB = 'YES' Then Do
   If fl.BASE = 'YES' Then Do
      Say 'Merging base source...'
      Queue '/FILE 7 N(KERMIT.BASE.S) NEW(REPL) LR(80) SP(700)'
      Queue '/INCL *COM:UTIL'
      Queue '$NOLIST'
      Queue '$PUNCH'
      Queue '$NOCTL'
      Do i = 1 to Words(srccmps)
         Queue '/INCL' Word(srccmps,i)'.ASM'
         End i
 
      Call DOIT 'EXEC','merging'
      End
 
   Say 'Merging updates...'
   Queue '/FILE 7 N(KERMIT.UPD) NEW(REPL) LR(80) RECFM(VC) SP(100)'
   Queue '/INCL *COM:UTIL'
   Queue '$NOLIST'
   Queue '$PUNCH'
   Queue '$NOCTL'
   Do i = 1 to Words(updcmps)
      Queue '/INCL' Word(updcmps,i)
      End i
 
   Call DOIT 'EXEC','merging updates'
   kills = kills 'KERMIT.UPD'
   End
 
/*----------- ************ S T E P   INS 11 */
 
/*-------------------------------------- Make help file */
Call CHECK 'SYSTEM.KERMHELP','NO'
Queue '/PARM SYSTEM.KERMHELP NEW'
Do i = 1 To edt.0 ;  Queue edt.i ;  End
Queue 'MERGE IKMKER.HLP'
If checkrc = 0 Then Queue 'PURGE SYSTEM.KERMHELP'
Queue 'FILE * PUBL'
Queue 'FILE'
 
Call DOIT 'EXEC','copying help'
/*----------- ************ S T E P   INS 6 */
 
/*-------------------------------------- Apply updates */
If fl.CLOB = 'YES' Then Do
   Say 'Updating Kermit source...'
   Call GUPI 'KERMIT.BASE.S','KERMIT.UPD','KERMIT.S'
   End
 
/*----------- ************ S T E P   INS 7 */
 
/*-------------------------------------------- Assemble Kermit */
Say 'Assembling...'
name = 'KERMIT'
Call ASM
loads = 'KERMIT'
If fl.ACT = 'YES' Then Do
  loads = loads||' KACCT'
  name = 'KACCT'
  Call ASM
  End
 
/*----------- ************ S T E P   INS 8 */
 
Say 'Linking Kermit ...'
name = 'KERMIT'
Call LKED
 
/*----------- ************ S T E P   INS 9 */
 
/*-------------------------------------- Make executor */
Call CHECK 'KERMIT','NO'
If checkrc <> 0 Then Do
   Queue '/PARM KERMIT NEW'
   Do i = 1 To edt.0 ;  Queue edt.i ;  End
   Queue 'I /SYS NOPRINT,REGION=384'
   Queue 'I /LOAD XMON'
   Queue 'I KERMIT N($KRM:KERMIT.LMOD)'
   Queue 'FILE * PUBL XO'
   Queue 'R KERMIT N(KERMIT.LMOD)'
   Queue 'FILE'
 
   Call DOIT 'EXEC','making executor'
   End
 
/*---------------------------------- Purge the intermediate stuff */
If fl.PRKEEP = 'NO' Then Do i = 1 To Words(kills)
   'PURGE' Word(kills,i)
   End i
 
Exit
 
/*---------------------------------------------------------------- */
/*----------------------------------- Confirm existence of a file */
CHECK: Procedure Expose checkrc
Parse Arg name,insist
filename = '.\'||name
Call MFACT 'CHECKRC','EXTRACT.','FILENAME'
If checkrc <> 0 & insist='YES' Then Do
   Say 'File' name 'not found.'
   Signal DONE
   End
Return
/*-------------------------------- Ask for possible override (yes/no) */
ASK: Procedure expose fl.
Parse Arg a1,msg
defmsg = '(default:' fl.a1')?'
x = 0
Do While x = 0
  Say msg defmsg
  Parse Upper Pull newval
  x =        Find('.  .Y .YES .N .NO .STOP', '.'||newval)
  End
If newval = 'STOP' Then Signal QUIT
fl.a1 = Word(fl.a1||' YES YES NO  NO',x)
Return
/*----------------------------------- Assemble */
ASM: Procedure Expose fl. name kills
Queue '/FILE SYSPRINT N('name'.LST) NEW(REPL) LR(121) SP(600)'
Queue '/FILE SYSPUNCH N('name'.OBJ) NEW(REPL) SP(100)'
Queue '/FILE SYSLIB PDS($MCM:*.M,$MCU:*.M)'
Queue '/FILE SYSUT1 N(&&TEMP) NEW DELETE RECFM(V) SP(600)'
Queue '/FILE SYSUT2 N(&&TEMP) NEW DELETE RECFM(V) SP(600)'
Queue '/FILE SYSUT3 N(&&TEMP) NEW DELETE RECFM(V) SP(600)'
Queue '/SYS REG=2048,TIME=MAX'
Queue '/LOAD' fl.ASMCMD
Queue '/JOB NOGO'
Queue '/OPT XREF,DECK,LIST,'fl.ASMOPTS
Queue '/INC' name'.S'
 
Call DOIT 'EXEC','assembling '||name
kills = kills name'.LST'
Return
/*----------------------------------- Link edit */
LKED: Procedure Expose fl. name loads kills
Queue '/FILE 6    N('name'.MAP)  NEW(REPL) LR(121)'
Queue '/FILE LMOD N('name'.LMOD) NEW(REPL) RECFM(F) LRECL('fl.LMDRCL') SHR'
Queue '/LOAD LKED'
Queue '/JOB MAP,NOGO,PRINT,STATS,NAME='name',MODE=OS'
Queue '.ORG 4A00'
Do i = 1 To Words(loads)
  Queue '/INC' Word(loads,i)||'.OBJ'
  End i
 
Call DOIT 'EXEC','link-editing '||name
kills = kills name'.MAP'
Return
/*----------------------------------- Apply GUPI */
GUPI: Procedure Expose fl.
Parse Arg old,upd,new
parms = old upd new
Queue '/PARM' parms
Queue '/SYS NOPRINT,REGION=2048'
Queue '/FILE LMOD N(GUPI.LMOD)'
Queue '/LOAD XMON'
Queue 'GUPI'
 
Call DOIT 'EXEC','updating'
Return
 
DOIT: Procedure
Parse Arg cmd,oprn
cmd
If rc <> 0 Then Do
   Say ' Error' rc 'in' oprn
   Signal DONE
   End
Return
/*----------------------------------- Error exits */
QUIT: Say 'Stopping...'
DONE: Exit 100
NOVALUE: Say 'No value in line' sigl':' Sourceline(sigl)
      Exit 100
