#!/bin/sh
PATH=.:$PATH

#
# Run Disk enabled IBSYS Job using tape as input. Operator enabled.
#
if [ "$1" = "" -o "$2" = "" ];then
   echo "usage: runibsysd program listing [s709options]"
   exit 1
fi
rm -f punch.* print.* sysou1.* sys*.bin $2
#
# Make sysin tape.
#
gendate >sysin.txt
cat $1 >>sysin.txt
cat eof.dat >>sysin.txt
cat ibsys.ctl >>sysin.txt
txt2bcd sysin 
#
txt2bcd ibsys.ctl reader.bcd 80 80
bcd2cbn reader
#
# Run IBSYS
#
s709 -cibsys2d.cmd -m7094 $3 r=reader p=print u=punch \
	a1r=ASYS1D.BIN a2=sysin.bcd  \
	a3=sysut1.bin  a4=sysut3.bin  a5=sysck2.bin \
        b1=sysou1.bcd b2=syspp1.bin b3=sysut2.bin b4=sysut4.bin \
	dd00=IBSYS1.DSK dd01=IBSYS2.DSK dd02=IBSYS3.DSK 
#
# Convert printed output
#
bcd2txt -p sysou1.bcd $2
rm -f reader.* print.bcd sysou1.* sysin.* 
