#!/usr/bin/perl

#######################################################################
#
# runstats_rsas.pl
#
# Creates a new sms.log file that gives cycle times to the rsas job names
#
#######################################################################

$infil = $ARGV[0];
$outfil = $ARGV[1];

###print "\$infil = $infil\n";
###print "\$outfil = $outfil\n";

#
# Read in input file, search for rsas and modify the entry with the
# hour the job ran.
#
open( INPUT, "$infil" );
open( OUT, ">$outfil" );
select ( OUT );
while( <INPUT> ) {
    chop;
    #
    # Parse line using whitespace as delimiter
    #
    ( $dum1, $time, $date, $jid ) = split( /\s+/ );
    if ( $jid =~ rsas ) {
	( $dum2, $dum3 ) = split( /\[/, $time );
	( $hour, $dum4, $dum5 ) = split( /\:/, $dum3 );
	$jid = "${jid}_${hour}";
    }
    print "$dum1 $time $date $jid\n";
}
close INPUT;
close OUT;
#


