

>>>>>>>>>>>>>>>>>>>>>>>>> IBM EXECUTION PROCEDURES <<<<<<<<<<<<<<<<<<<<<<<<<

 Two procedures are provided to assign files and execute the XTAL system
 for IBM VM/CMS and MVS operating systems.


     For further assistance with IBM installations contact:

     PROCEDURE 1:

        Prof Geoff King
        Kristallografie
        University of Leuven
        B-3001 Heverlee
        BELGIUM
        email: fgeea01@blekul11.bitnet
        Tel:   (32) + 16 + 201015 ext. 3582
        Fax:   (32) + 16 + 201368

    PROCEDURE 2:

        Dr. Lassi Hiltunen
        Helsinki University of Technology
        Analytical Chemistry
        Kemistintie 1
        SF-02150 Espoo 15
        FINLAND
        email: eke-lh@finhut.bitnet

-----------------------------------------------------------------------------

                            PROCEDURE 1


                    Steps in XTAL 3.0 installation
                      IBM  MVS operating system
                    -----------------------------
                           By Geoff King             


To execute the REXX procedure given below the user simply enters the command:

XTAL30 <compid>

                   where <compid> is the compound identification code.



Here is the console listing as it appears to the user.........


1Ready;
 xtal30 cinobu noprt
 10 cylinders are being formatted as disk E
 20 records will be allocated to each file
 DMSSTT002E File CINOBU XTALBDF A not found
 There is no file CINOBU  bdf a
 You must begin with STARTX
 DMSSTT002E File CINOBUIN DATA A not found
 There is no file CINOBUin data a
 You must input your data from the terminal
 DMSLIO740I Execution begins...
 Output saved as CINOBU listing a
 DMSCPY002E INPUT file AA0 BDF E not found
 DMSSTT002E File PCH DATA E not found
 DASD 202  DETACHED
 Ready;


-----------------------------------------------------------------------------


Here is the REXX procedure........

/*            Make temporary disk and run xtal2.6                     */
/*     Version of 08.06.89           G.S.D. King                      */
/*     Any comments or suggestions should be sent to                  */
/*          FGEEA01   cc1.kuleuven.ac.be                              */
/*                                                                    */
/*  The procedure is invoked by the CMS command:                      */
/*   XTAL30 <compid> <options(see notes1-3)>                          */
/*                                                                    */
/* NOTES:                                                             */
/* 1. 10 cylinders will normally be allocated for temporary files     */
/*     unless CYLS <ncyls> is given in the command line when <ncyls>  */
/*     cylinders will be allocated                                    */
/* 2. 20 11476 byte records will be allocated to each temporary file  */
/*     unless NRECS <nrecs> is given in the command line when <nrecs> */
/*     records will be allocated.                                     */
/* 3. The output will be printed unless NOPRT is given in the         */
/*     command line when it will be saved on disk A                   */
/* 4. The error file must have file name XTALERR and file type DATA   */
/*     and be on an accessed disk                                     */
/* 5. If there is an existing bdf it must have the compound           */
/*     identification (cid) as file name and BDF as file type         */
/*     and be on the A-disk                                           */
/* 6. Input data will be taken from file cidIN DATA A if this exists  */
/*     otherwise from the terminal                                    */
/* 7. No check is at present made on whether the user disposes of     */
/*     sufficient virtual storage. This can easily be added when the  */
/*     storage requirements of XTAL2.6 are known.                     */
/*                                                                    */
trace o
parse upper arg cid args
if cid = 'CYLS' ! cid = 'NRECS' ! cid = 'NOPRT' then do
  args = cid args
  cid = ''
end
  do while cid = ''
  say 'Type compound identifier(max 6 characters)'
  pull cid
end
cid = substr(cid,1,6)
if index(args,'CYLS') ^= 0 then do
  parse var args 'CYLS' cyls .
  if datatype(cyls,N) ^= 1 then do
    say 'CYLS argument is not numerical'
    return 16
  end
end
else cyls = 10
if index(args,'NRECS') ^= 0 then do
  parse var args 'NRECS' nrecs .
  if datatype(nrecs,N) ^= 1 then do
    say 'NRECS argument is not numerical'
    return 16
  end
end
else nrecs = 20
desbuf
'EXECIO * CP (STRING' q dasd
used = ''
do while queued() > 0
  pull . cuu unitt .
  if queued() = 1 then unit = 'T'!!unitt
  used = used cuu
end
newcuu = 200
do while pos(newcuu,used) ^= 0
  newcuu = newcuu+1
end
/*   We have a description, find an unused mode                       */
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
do mode = 1 to 26 until na = 'NOT ACCESSED'
 'query disk' substr(alpha,mode,1) '( lifo'
  pull . . na
end
if mode = 27 then do
  say 'Quitting, all disks in use'
  exit
                  end
fm = substr(alpha,mode,1)
say cyls 'cylinders are being formatted as disk' fm
/*   Obtain disk and format it                                        */
'EXECIO 0 CP (STRING' define unit as newcuu cyl cyls
push "TEMP"
push "YES"
'set cmstype ht'
'format' newcuu fm '(blksize 4K'
'set cmstype rt'
say nrecs 'records will be allocated to each file'
/*       Prepare files                                                */
'fi * clear'
/*          Is there an existing bdf on disk A?                       */
/*          If not, warn the user                                     */
'state' cid ' xtalbdf a'
if rc = 0 then 'copy' cid 'xtalbdf a aa1 bdf' fm
          else do
 say 'There is no file' cid ' bdf a'
 say 'You must begin with STARTX'
               end
/*          Is the input data on disk                                 */
'state' cid!!'in data a'
if rc = 0 then 'fi 5 DISK' cid!!'in data a'
          else do
    say 'There is no file' cid!!'in data a'
    say 'You must input your data from the terminal'
    'fi 5 terminal'
               end
'fi 6       DISK xtal listing' fm '(recfm va lrecl 133'
'fi XTALAUX DISK aux xtaltemp' fm '(recfm f lrecl 80'
'fi XTALPCH DISK pch data' fm '(recfm f lrecl 80'
'fi XTALSCF DISK scf xtaltemp' fm '(recfm f lrecl 80'
'fi XTALSHX DISK shx xtaltemp' fm '(recfm f lrecl 80'
'fi XTAL000 DISK a00 bdf' fm '(xtent' nrecs
'fi XTALAA1 DISK aa1 bdf' fm '(xtent' nrecs
'fi XTALAA2 DISK aa2 bdf' fm '(xtent' nrecs
'fi XTALXX1 DISK xx1 bdf' fm '(xtent' nrecs
'fi XTALXX2 DISK xx2 bdf' fm '(xtent' nrecs
'fi XTALABS DISK abs bdf' fm '(xtent' nrecs
'fi XTALBLA DISK bla bdf' fm '(xtent' nrecs
'fi XTALCMX DISK cmx bdf' fm '(xtent' nrecs
'fi XTALCON DISK con bdf' fm '(xtent' nrecs
'fi XTALINV DISK con bdf' fm '(xtent' nrecs
'fi XTALMA1 DISK ma1 bdf' fm '(xtent' nrecs
'fi XTALMA2 DISK ma2 bdf' fm '(xtent' nrecs
'fi XTALMAG DISK mag bdf' fm '(xtent' nrecs
'fi XTALMAP DISK map bdf' fm '(xtent' nrecs
'fi XTALCON DISK con bdf' fm '(xtent' nrecs
'fi XTALME1 DISK me1 bdf' fm '(xtent' nrecs
'fi XTALME2 DISK me2 bdf' fm '(xtent' nrecs
'fi XTALMED DISK med bdf' fm '(xtent' nrecs
'fi XTALMEM DISK mem bdf' fm '(xtent' nrecs
'fi XTALMER DISK mer bdf' fm '(xtent' nrecs
'fi XTALNWM DISK con bdf' fm '(xtent' nrecs
'fi XTALORT DISK con bdf' fm '(xtent' nrecs
'fi XTALPAR DISK con bdf' fm '(xtent' nrecs
'fi XTALSLA DISK con bdf' fm '(xtent' nrecs
'fi XTALERR DISK  xtalerr data *'
'global TXTLIB vsf2fort'
'global LOADLIB vsf2load'/* for no overlay mode   */
/*             EITHER                */
'loadmod XTAL30'         /* for no overlay mode   */
'start'                  /* for no overlay mode   */
/*             OR                    */
/* 'global LOADLIB xtal30 vsf2load'*//* without programme in overlay */
/* 'osrun XTAL30'    */            /* with programme in overlay  */
xtalrc = rc
if index(args,'NOPRT') = 0 then 'print xtal listing' fm
else do
  'copy xtal listing' fm cid 'listing a (replace'
  if rc = 0 then say 'Output saved as' cid 'listing a'
end
/*  Save files                                                        */
'copy aa0 bdf' fm cid 'xtalbdf a (replace'
if rc = 0 then say 'BDF saved as' cid 'xtalbdf a'
'state pch data' fm
if rc = 0 then do
  'copy pch data' fm cid!!'ot data a (replace'
  if rc = 0 then say '"Punch" output saved as' cid!!'ot data a'
end
/*     If all is well scrap the temporary disk                        */
desbuf
if xtalrc = 0 then 'release' fm '(det'
return xtalrc


-----------------------------------------------------------------------------


                          PROCEDURE 2



                    Steps in XTAL 3.0 installation
                    IBM  VM/CMS operating system
                    -----------------------------
                         By Lassi Hiltunen


Throughout in the XTAL installation and running XTAL the names MINIDISK
and TEMPORARY MINIDISK will be used. MINIDISK is the basic mass storage
device in an IBM VM/CMS operating system. After login to the system the
user has at least one disk available. The disks are labelled from A to Z.
To find out which disks actually exist issue the op system command
'query disk'
The information printed will tell which disk names are in use
and which   virtual addresses they occupy. Normally the 'A' - disk is
assigned to address 191. The output from disk query allso tells the type
of mass storage device( in the following example '3380'). Temporary disks
are needed for temporary work - they diasappear when you log off, so the
user should copy any important temporary files to a permanent
 (usually A-) disk.

How to make a temporary MINIDISK  name  C on a 3380 disk system,
size 50 cylinders, having a virtual address 234?
(Check from the 'query disk'output that vaddr 234 is not occupaid)

Give following commands:

        def t3380 234 50
        format 234 C
        answer 'YES'
        answer with any string for the disk label

After some time the system will respond '50 cylinders formatted '
If your installation does not allow 50 cylinders, try some
smaller value, and if you compile all the programs, 50 is not enough.


-------------------------------------------------------------
 XTAL 3.0 installation on VM/CMS system
   - knowledge on making REXX - programs is essential
-------------------------------------------------------------
Have the tape loaded. What and how may depend on installation.
In Helsinki the operator is asked for doing this. After this
there is a message "TAPE 181 ATTACHED" at terminal.
-------------------------------------------------------------
Create a REXX exec program for copying the distribution tape
The following program transfers the three first files on tape
to  MINIDISK  C:

/* This program copies the distribution tape  to C - minidisk*/
/* The file names will be  t1 temp C  , t2 temp C, and t3 temp C*/
makebuf
juuso = 1
'fi inmove tap1 (lrecl 80 recfm fb blksize 3600'
do until juuso = 5
   'fi outmove disk t'juuso ' temp c (lrecl 80 recfm fb '
   say 'file' juuso ' is being copied    '
   'movefile'
   say ' return code is ' rc
   juuso = juuso + 1
end
dropbuf
say ' d o n e | '


---------------------------------------------
ASCII to EBCDIC conversion.
---------------------------------------------
The distribution tape is in ASCII. The files on your MINIDISK
(C - disk in this example) have to be converted to IBM EBCDIC
characters.
There is probably a routine at your site for doing this, use IT. In the last
case you can give the whole conversion table and use the
copyfile routine. Check carefully the character set produced.
The character set displayed may differ from installation to installation
and between different terminals. This is true in Helsinki anyway.

-----------------------------------------------

Skip this section if you can get your data to EBCDIC by a local routine|
Note: This works in HELSINKI - no guarantee is given it would
      do it elsewhere. Use it as last method. - Some characters are
      most likely wrong for YOU.
This means lot of typing exactly how it is written here.The conversion
table consists of pairs of hexadecimal characters, the second of
a pair replacing the first one. The list is in the order of XTAL character
set, starting from hex 20 (= space) which would become hex 40 in EBCDIC
etc.
This program assumes that there are the previous three files on C - DISK


/* convert XTAL- system ASCII tape files to finnish EBCDIC */
/* Lassi Hiltunen 23.5.1990 */
makebuf
juuso = 1
do until juuso = 4
   say ' file t'juuso 'temp conversion begins'
 queue "20 40 21 4F 22 7F 23 4A 24 5A 25 6C 26 50 27 7D 28 4D ++"
 queue "29 5D 2A 5C 2B 4E 2C 6B 2D 60 2E 4B 2F 61 30 F0 31 F1 ++"
 queue "32 F2 33 F3 34 F4 35 F5 36 F6 37 F7 38 F8 39 F9 3A 7A ++"
 queue "3B 5E 3C 4C 3D 7E 3E 6E 3F 6F 40 E0 41 C1 42 C2 43 C3 ++"
 queue "44 C4 45 C5 46 C6 47 C7 48 C8 49 C9 4A D1 4B D2 4C D3 ++"
 queue "4D D4 4E D5 4F D6 50 D7 51 D8 52 D9 53 E2 54 E3 55 E4 ++"
 queue "56 E5 57 E6 58 E7 59 E8 5A E9 5B 7B 5C 7C 5D 5B 5E 5F ++"
 queue "5F 6D 60 79 61 81 62 82 63 83 64 84 65 85 66 86 67 87 ++"
 queue "68 88 69 89 6A 91 6B 92 6C 93 6D 94 6E 95 6F 96 70 97 ++"
 queue "71 98 72 99 73 A2 74 A3 75 A4 76 A5 77 A6 78 A7 79 A8 ++"
 queue "7A A9 7B C0 7C 6A 7D D0 7E A1 "
   'copyfile t'juuso 'temp c(trans noprompt'
   juuso = juuso+1
end
dropbuf

--------------------------------------------------
Now you have your data in EBCDIC. Take a look at files t1 temp c
and t2 temp C. If they are readable you may continue. If they are not
readable with the editor program, something went wrong.
Rename the file t2 temp c to XSEL FORTRAN C
The XSEL program has to be edited for file naming in VM/CMS
to be successful.
Remove line  41  (statement    NAME=IPBUF(9:20) )
add the following lines starting at line 41:

C     NAME=IPBUF(9:20)   (this was the original line)
      IEAU=0
      DO 4711 I=9,15
      IF(IPBUF(I:I).EQ.'.') THEN
      IEAU=I-1
      ENDIF
4711  CONTINUE
      IF(IEAU.NE.0) THEN
      NAME=IPBUF(9:IEAU)
      ELSE
      NAME=IPBUF(9:15)
      ENDIF

The next line will be as it was (  READ(IPBUF,'(68X,I6)') ILIN )
The change above will replace the  the original filename by a string
suitable for external file definition

--------------------------------------------------
Compile the program xsel. In Helsinki we use the FORTVS2 compiler,

'Fortvs2  xsel(opt(3))'

Look for typing errors in the correction above. The compiler will notify
on blank lines after the source code. Don't mind that.
Load the program :
'load  xsel'
Generate a module from it
'genmod xsel'
 - you will get XSEL MODULE on A -disk
-------------------------------------------
Testing XSEL
------------
If the XTAB file still exist as t1 temp C, copy it to 'XTAB  XTAL30 A'
If there is enough file space you may copy the XLIB file too, you will
be asked for the name later
edit the file XTAB XTAL A: - put yes answer on rfpibm.f
                 put blank answer on rfpunx.f

  ---| IMPORTANT:change the listing file names p6122.l, saly.l, diam.l &
                 ags4.l to p612X.l, salX.l, diaX.l and agsX.l. Be careful
  ----           not to change the length of line or positions on line.

                 put yes answer on CONTRS for testing p6122
                 put yes on chrtab
The last is important - for checking the character conversion ASCII-EBCDIC

Write the following REXX program - it will make filedef's and run XSEL
- use editor (XEDIT) and create a file having fmode 'EXEC', execute
  it the usual way, typing the filename.
NOTE: If you are running this program a second time and you want have
some new files instead of a dummy program, then the old dummies have
to be deleted first|

/* XTAL30 unpacking  */
/* XTAB XTAL30 A expected as source of information */
'state xtab xtal30 A'
if rc ~= 0 then do
   say "XTAB file not found"
   exit
end
say '********************************'
say '*  XTAL 3.0 unpacking starts  *'
say '********************************'
j=1
do forever
      'execio 1 diskr xtab xtal30 a'
       if rc ~= 0 then leave
       pull  xtab.j
       j=j+1
end
num=j
say ' There were 'num' lines in file XTAB'
say 'Enter MINIDISK letter for XTAL files | '
pull fm
say 'Enter filename filetype filemode for XLIB file |'
pull fn ft m
state fn ft m
     if rc ~= 0 then do
     say ' try again  with better luck '
     exit
     end
'filedef XLIB disk ' fn ft m
j=1
LP:
do until substr(xtab.j,1,1)='<'
  j=j+1
end
if substr(xtab.j,9,1)=' ' then signal FIN
     k=11
     do until k=18
        if substr(xtab.j,k,1)='.' then do
             len=k-9
             fn=substr(xtab.j,9,len)
             ft=substr(xtab.j,k+1,1)
             'filedef 'fn' disk 'fn' 'ft' 'fm
             signal lp
        end
        if substr(xtab.j,k,1)=' '  then do
            len=k-9
            fn=substr(xtab.j,9,len)
            'filedef 'fn' disk 'fn' d 'fm
            signal lp
        end
     k=k+1
end
FIN:
say ' Starting to execute XSEL '
'filedef XTAB disk xtab xtal30 a'
'xsel'
/* program ends here */
--------------------------------
The program xsel produces XTAL program files to the MINIDISK you
wanted, the actual files that have been specified by the 'y' letter
in XTAB - file (XTAB XTAL30 A in this example)
Take a look at file  :  chrtab d c (if your files are on C - disk)
Check the character set - XTAL may work with a bad chacter set too,
if in doubt, adjust the ASCII to EBCDIC conversion. Any changes have
to be made to all of the tape files,  -- the procedure has to be done
again from the beginning.
(Left or Right)parenthesis - if they are mixed up in chrtab -
it's probably right

--------------------------------
When you have finished unpacking the XLIB file, make copies on some
important files on permanent disk space. Copy rfpibm  f  C to
rfp fortran A. Compile the program using 'charlen(32000)' qualifier:
'fortvs2 rfp (opt(3) charlen(32000))'
any compilation errors are most likely indicating a problem in the
previous ASCII to EBCDIC conversion.
Prepare a module from rfp the usual way:
'load rfp'
'genmod rfp'
- and there will be file 'RFP MODULE' on A - disk.
-- your ratmac processor.
-----------------------------------
Permanent copies are needed also from files:
XMACRO   d    C
XERROR   d    C
CIFMAP   d    C    for   CIFIO  program
CIFREQ   d    C    for   CIFIO  program
PROFDB   d    C    for   CHARGE and PARTN programs
XTALDB   d    C    for   PREPX
- so copy the necessary ones to following file names:
(note the funny filename 'FILE', which means that you don't need
 filedef comands for those files)
XMACRO  XTAL30 A
FILE  XERROR  A
FILE  CIFMAP    A
FILE  CIFREQ    A
FILE  PROFDB    A
FILE  XTALDB    A

------------------------------------------------
TEST RFP - processor
edit XMACRO XTAL30 A, change the machine: macro to IBM
define files as follows:
'filedef rfprat disk rft r C'
'filedef rfpftn disk rft fortran C'
'filedef rfplst disk rfp listing C'
'filedef rfpmes terminal'
'filedef xmacro disk xmarco xtal30 A'
run the processor by typing 'RFP' and see what hapens
if there were no errors - try compiling the output file rft fortran c:
'FORTVS2 RFT(opt(3) charlen(32000))'
make similar tests for some of the programs. There should not be errors
in RFP or FORTRAN compilation
-------------------------------------------
If you have XTAL updates you might want to make up the RFU - program.
Change first the machine specification to IBM in file RFU R C, then
define files for RFP and run it
-------------------------------------------
Apply the updates before compiling the whole XTAL.
The compilation time for all the XTAL 3.0 files was 380 seconds
and it took about 4 hours real time in IBM 3090/200.

before trying to produce an executable XTAL program check your
file: PROFILE EXEC A
there should be a line saying 'set ldrtbls 20'
even this may not be enough for some graphics terminal drivers
so if you get message 'loader table overflow' increase this parameter
-------------------------------------------------------------
Linking loading and running XTAL
---------------------------------
Load the XTAL program files by a REXX program or write yourself
the necessary load and include commands.
Then make a module by a 'GENMOD' command.
/**/
'load aa1 aa2 ab ad al am ar as at bf bn bt by cd cf cg cn cq cr cv dd eb'
'include fb fc fd fe fg fo fr fs ft ge gs gt kb lc lf ls mb me mf mh mi ml'
'include mn mo mp mr mu ni nm or pc pd pe pf pg ph pi pn pp ps pt px qf qn'
'include rb rc re rm rs rv rw sc sh si sl sm sr sx vf vu'
----
if you dont want a permanent copy from XTAL on A - disk  write
GENMOD XTAL MODULE C  - for having it on C - disk.
-----------
Run the test jobs.
If you don't make any filedef's you will see new files appear on the A - disk
like:  name      type   FM
      FILE     XTALXX1  A1 F      11472         50        141  8/24/90 1
      FILE     XTALPCH  A1 F         80         58          2  8/24/90 1
      FILE     XTALXX2  A1 F      11472         50        141  8/24/90 1
      FILE     XTALPEK  A1 F      11472         50        141  8/24/90 1
      FILE     XTALAA2  A1 F      11472         50        141  8/24/90 1
      FILE     XTALMAP  A1 F      11472         50        141  8/24/90 1
      FILE     XTALINV  A1 F      11472         50        141  8/24/90 1
      FILE     XTALAA1  A1 F      11472         50        141  8/24/90 1
      FILE     XTALCON  A1 F      11472         50        141  8/24/90 1
If you dont want to have these files on A - disk  you need FILEDEFS
like:
filedef XTALAA1 DISK P6122 AA1 C
filedef XTALMAP DISK P6122 MAP C(XTENT 100
(the last for a big fourier map)
etc.
------
the line input and output  are expected from terminal
- - to change these something else you need FILEDEF's like
filedef 5 disk p6122 D C
filedef 6 disk p6122 listing C
------
the p6122 test will run up to last VUFILE . The test data has to
be split at this point and the run continued saparately from the point on
delete files XTALXX1 and XTALXX2 and define line input to XTAL for the rest
of the p6122 test file.
-------
To execute SALY test you need a quite special FILEDEF:
filedef XTALXX0 disk saly xx0 c(lrecl 36 xtent 10000
SALY will run 11.3 seconds in IBM 3090
---------------------
DIAM test case will also need a special filedef:
filedef XTALXX0 disk diam xx0 c(lrecl 24 xtent 10000
(assuming again C - disk for scratch  files, note the different record
length|| To find out the record length for a filedef I usually first run
the program to maximum record error(record 51 out of range) then have a look
by a FILELIST command and see the record length from listing.
---------------------
DIAM runs about 34 seconds in IBM3090/200
-----------------------------------
AGS4 needs similar FILEDEF to DIAM case:
filedef XTALXX0 disk ags4 xx0 c(lrecl 24 xtent 10000
About 7.5 seconds were needed to run ags4 test
------------------------------------------------
Good luck for anyone trying this out.
----------------------------------------

