psco (PeopleSoft-CCC/Harvest checkout)
The PeopleSoft checkout Perl script is used by developers to modify their batch interface programs (batch programs that interface between the PeopleSoft system and the mainframe). The SCM tool that this script interacts with is CCC/Harvest.
#!/usr/local/bin/perl
#*************************************************************************
#* Script Name: psco
#* Creation Date: 2/11/99
#* Location: /usr/local/bin
#* Calling Routine: NONE
#* Input Parameters: NONE
#* Associated Files: listpackages.sql
#* Description: Checks out items from Harvest repository.
#*
#* Change Log
#* Name Date Change
#* --------------- ------ ------------------------------------------------
#* Paul McKinney 2/11/99 Creation
#*
#*************************************************************************
#********************************************************************
#* MAINLINE
#*
#* -set base directory where files will be checked in to
#* -clear screen
#* -call subroutine to have user select package
#* -call subroutine to have user select item to checkout
#* -call subroutine to checkout Harvest item
#********************************************************************
$sqlpath="/usr/local/bin";
$repository="ISAS";
system("clear");
&select_environment;
&select_package;
while (1) {
&select_item;
&select_checkout_mode;
&checkout_item;
}
#********************************************************************
#* select_environment
#*
#********************************************************************
sub select_environment {
print "Check Out\n\n";
print "1) PS-Sybase v7.5 Baseline\n";
print "2) PS-Sybase v7.5 with ISAS Mods\n";
print "3) PS-Sybase v7 Baseline\n";
print "4) PS-Sybase v7 with ISAS Mods\n\n";
print "5) PS-Oracle v7.5 Baseline\n";
print "6) PS-Oracle v7.5 with ISAS Mods\n";
print "7) PS-Oracle v7 Baseline\n";
print "8) PS-Oracle v7 with ISAS Mods\n\n";
print "Select an environment: ";
$selection = <STDIN>;
chop($selection);
if($selection eq "1") {
$environmentname = "PS-Sybase v7.5 Baseline";
$envbase="/psoftSYD/ps75/syb/dev";
$statename = "Receive";
} elsif ($selection eq "2") {
$environmentname = "PS-Sybase v7.5 with ISAS Mods";
$envbase="/psoftSYD/ps75/syb/dev";
$statename = "Development";
} elsif ($selection eq "3") {
$environmentname = "PS-Sybase v7 Baseline";
$envbase="/psoftSYD/ps70/syb/dev";
$statename = "Receive";
} elsif ($selection eq "4") {
$environmentname = "PS-Sybase v7 with ISAS Mods";
$envbase="/psoftSYD/ps70/syb/dev";
$statename = "Development";
} elsif ($selection eq "5") {
$environmentname = "PS-Oracle v7.5 Baseline";
$envbase="/psoftSYD/ps60/ora/dev";
$statename = "Receive";
} elsif ($selection eq "6") {
$environmentname = "PS-Oracle v7.5 with ISAS Mods";
$envbase="/psoftSYD/ps60/ora/dev";
$statename = "Development";
} elsif ($selection eq "7") {
$environmentname = "PS-Oracle v7 Baseline";
$envbase="/psoftSYD/ps70/ora/dev";
$statename = "Receive";
} elsif ($selection eq "8") {
$environmentname = "PS-Oracle v7 with ISAS Mods";
$envbase="/psoftSYD/ps70/ora/dev";
$statename = "Development";
} else {
exit;
}
}
#********************************************************************
#* select_package
#*
#* -call harvest hsql program to list packages
#* -while there are more packages
#* store package names in an array
#* -get input from user
#* -if selection equal "q" then exit
#* -based on user selection store package name
#********************************************************************
sub select_package {
print "\nAny changes must be associated with a package.\n";
print "Retrieving packages...\n\n";
open(CMD, "cat $sqlpath/listpackages.sql | sed \"s/\\[environmentname\\]/$environmentname/g\" | sed \"s/\\[statename\\]/$statename/g\" | /tools/Harvest/bin/hsql -t -s -nh |");
$i = 1;
while (<CMD>) {
@packages = (@packages, $_);
print "$i) $_";
++$i;
}
close(CMD);
print "q) Quit\n\n";
print "Select a package: ";
$selection = <STDIN>;
chop($selection);
if ($selection eq "q") {
exit;
}
print "\n";
$packagename = $packages[$selection - 1];
chop($packagename);
}
#********************************************************************
#* select_item
#*
#********************************************************************
sub select_item {
print "Item name to check out: ";
$selection = <STDIN>;
chop($selection);
if ($selection eq "") {
exit;
}
print "\n\n";
$module = $selection;
}
#********************************************************************
#* select_checkout_mode
#*
#********************************************************************
sub select_checkout_mode {
print "1) Update\n";
print "2) Browse\n";
print "3) Reserve Only\n\n";
print "Select check out mode: ";
$selection = <STDIN>;
chop($selection);
if($selection eq "1") {
$checkout_mode = "-up";
} elsif ($selection eq "2") {
$checkout_mode = "-br";
} elsif ($selection eq "3") {
$checkout_mode = "-ro";
} else {
exit;
}
}
#********************************************************************
#* Checkout
#*
#********************************************************************
sub checkout_item {
system("/tools/Harvest/bin/hco $checkout_mode -en \"$environmentname\" -st \"$statename\" -pn \"Check Out\" -p \"$packagename\" -vp \"/$repository/\" -op as -r -s $module");
}