SATAN MVS legacies
| GSI | Biophysics | SATAN long write-up |

SATAN MVS legacies

This document deals with the relics of SATAN on GSI's former MVS mainframe computer, in particular

Recycling old analysis programs

Unfortunately there's no way to reuse old analysis programs directly without modifications. The main reason is that the "old" SATAN used PL/I as base language, whereas the UNIX version uses C. You will rarely find PL/I compilers on UNIX computers, although there's an IBM product for AIX, but probably not for other UNIXes. As far as the author's knowledge is concerned, there is no PL/I->C converter software available (please leave me a note if I'm wrong). So you have to do the hard work by hand. The following table gives the correspondence of some often used constructs.
PL/I                                        C

DCL ( i_e(4), I_PosXL(3) ) BIN FIXED(15);   short i_e[4], I_PosXL[3];
DCL ( r_posfactor init(0.03) ) dec float(6) float r_posfactor =0.03;
DCL ( ABS, SQRT, CHAR ) BUILTIN:            #include <math.h>
DCL (i,j,k,l,m) BIN FIXED(31);              long i,j,k,l,m;

DCL (B_Pos_X(3)) BIT(1) ALIGNED;            int B_POS_X[3]; 
B_Pos_X(i) = '0'B;                          B_Pos_X[i-1] = 0;

DO i = 1 TO 3;                              for( i=1; i<=3; i++ ) { 
...                                         ...
END;                                        }

IF I_Posxl ^= 0 THEN ...;                   if ( I_posxl != 0 ) ...; 

IF II ^= 0 & JJ < 4090 THEN DO;             if ( (II!=0) && (JJ<4090) ) { 
...                                         ...   
END;                                        } 

FLOOR(xx);                                  floor(xx); 

Note that, except
macros , C must be coded in lower case characters and variable names are case sensitive, that is i_Energy and I_ENERGY are different variables. You might use a case-insensitive text editor (e.g.nedit) to change variables to common spelling.

The most nasty difference, however, is the different handling of arrays, which in C always start with index '0'. Either you diminish all array indices by 1, or you declare the C array with an additional element:

PL/I                                        C

DCL Array(3) DEC FLOAT(16);                 double Array[3];
Array(1) = ...;                             Array[0] = ...;
Array(2) = ...;                             Array[1] = ...;
Array(3) = ...;                             Array[2] = ...; 

DCL Array(3) DEC FLOAT(16);                 double Array[4];
Array(1) = ...;                             Array[1] = ...;
Array(2) = ...;                             Array[2] = ...;
Array(3) = ...;                             Array[3] = ...; 

The second method may be preferred if you have full control over the array length, you must use the first one if the array is 'inherited' from some other program. Arrays of analyzers and global parameters are corrected for automatically.

Another difference is the access to global and event parameters, which needs extra macros ( $GLOPAR() and $EVTPAR() ) in the C version as opposed to PL/I:

PL/I                                        C

$PARDCL( xx(2) ) TYPE(4);                   $PARDCL( xx(2) ) TYPE(float);

$EVENT( par(2) );                           $EVENT( par(2) ); 

yy = xx(2) * par(1);                        yy = $GLOPAR(xx(2)) * $EVTPAR(par(1)); 

A complete real-world example of an ancient analysis program is available, with the original PL/I version and the C version.

Retrieving old SATAN analyzer data dumped on MVS VSAM datasets

The SATAN VSAM libraries containing SATAN
data elements (analyzers, calibrations, linearizations, ... ) have been transferred as-is from the old MVS tape library to the new ADSM tape library on AIX. Additionally they have been converted to GNU dbm files and can thus be handled by the SATAN on AIX package.
On MVS VSAM libraries were identified by the user ID <mvsuid> and a unique <library> name. The correspondence is as follows:
MVS                           ADSM/AIX 
                              file                  archive  path
'RS0V.$<mvsuid>.<library>'    <mvsuid>.<library>    rs0v     gdbm
                              <mvsuid>.<library>.v  rs0v     vsam
Assume you're the ex-MVS user 'x855' who wants to get back data from the standard VSAM library 'satan'. The fastest way to get back your analyzer data is as follows:
  1. On AIX issue the shell command
       adsmcli retr x855.satan rs0v gdbm 
  2. On AIX enter the standard SATAN:
  3. In SATAN fetch the analyzer data:
    afe * * / lib(x855.satan)
  4. You might now process your analyzer in the old MVS SATAN fashion. Alternatively, you might export it in gd format:
    aexport spect list /gd
    will create the gd-file spect.list .

Normally it should not be necessary to touch the original VSAM datasets transferred to the AIX tape library. If it should be necessary though, here is an example how it goes:

  1. On AIX issue the shell command
       adsmcli retr x855.satan.v rs0v vsam 
  2. On AIX invoke the conversion utility (it takes some time, be patient):
       vs2gdbm x855.satan.v x855.satan
If nothing goes wrong, x855.satan will be your freshly converted AIX analyzer library.
| GSI | Biophysics | SATAN long write-up |

Last updated:, 3-Aug-1999

Impressum Data privacy protection