#!/bin/sh

#-----------------------------------------------------------------------
# Cryptlib for MVS
#
# Developed on OS/390 2.10.
#
# Allocate MVS data sets for the test files used by 'testlib'.
#-----------------------------------------------------------------------

# The volume and unit on which to allocate the test data sets.
VOLUME="UNIT(3390) VOL(STG001)"

# The data set types or low-level qualifiers for the test data sets.
POTYPES="CLBP15 CLBP12 CLBDER CLBPGP CLBGPG CLBPKR CLBSKR CLBP7S CLBCMP"
PSTYPES="CLBTEST CLBTESTA"

# The middle-level qualifier of the test data sets.
MLQ=CRYPTLIB

for i in $POTYPES; do
    tso "DEL $MLQ.$i"
done

for i in $PSTYPES; do
    tso "DEL $MLQ.$i"
done

for i in $POTYPES; do

    tso "ALLOC DA($MLQ.$i) NEW CATALOG RECFM(V B) LRECL(256) \
         BLKSIZE(27998) DSORG(PO) CYL SPACE(1,10) DIR(20) $VOLUME"
    if [ $? -ne 0 ]; then
        exit 1;
    fi

done

for i in $PSTYPES; do

    tso "ALLOC DA($MLQ.$i) NEW CATALOG RECFM(V B) LRECL(256) \
         BLKSIZE(27998) DSORG(PS) CYL SPACE(1,10) $VOLUME"
    if [ $? -ne 0 ]; then
        exit 1;
    fi

done
