#!/usr/bin/perl -w
#
#  Remove, then create unique dasd for mvs3380+3390+3375-0009
#
# ------------------------------------------------------------ CONFIG ME -------------

my $newpage = "pagj";
my $newver = "09";

my $pagpath = "/herc2/mvs/dasd/";
my $respath = "/herc3/mvs/dasd/";
my $ctlpath = "/herc2/mvs/3390/misc/";
my $dasdload = "dasdload $ctlpath";

# ------------------------------------------------------------------------------------

chdir $ctlpath or die "cannot chdir to CTL path $ctlpath\n";
#  While we're at it, remove various editor backup files
system "rm *~";

chdir $respath or die "cannot chdir to SYSRES path $respath\n";
system "rm mvs5$newver.3350 loc5$newver.3350 mvs8$newver.3380 mvs9$newver.3390";
system "$dasdload" . "mvs7$newver.ctl mvs7$newver.3375";
system "$dasdload" . "mvs8$newver.ctl mvs8$newver.3380";
system "$dasdload" . "mvs9$newver.ctl mvs9$newver.3390";
system "$dasdload" . "mvs5$newver.ctl mvs5$newver.3350";
system "$dasdload" . "loc5$newver.ctl loc5$newver.3350";

chdir $pagpath or die "cannot chdir to PAGE path $pagpath\n";
system "rm $newpage" . "0*.3330";
system "$dasdload" . "$newpage" . "01.ctl $newpage" . "01.3330";
system "$dasdload" . "$newpage" . "02.ctl $newpage" . "02.3330";
system "$dasdload" . "$newpage" . "03.ctl $newpage" . "03.3330";

system "ls /herc1/mvs/dasd /herc2/mvs/dasd /herc3/mvs/dasd -al";
system "df -h";

