while (my @info = $sql_act_tran_ledg->fetchrow_array()) { my $trandate = $info[0]; my $accounttype = $info[1]; my $location = $info[2]; my $node_sid = $info[3]; my $reasontype = $info[4]; my $reasonmsg = $info[5]; my $date = substr($trandate,0,8); if ($last_location == 0) { $last_location = $location; } if ($location == $last_location) { $index = $index + 1; } else { $index = 0; } $activity_tran_ledg{$location}{$index}{"index"} = $index; $activity_tran_ledg{$location}{$index}{"trandate"} = $trandate; $activity_tran_ledg{$location}{$index}{"accounttype"} = $accountty +pe; $activity_tran_ledg{$location}{$index}{"location"} = $location; $activity_tran_ledg{$location}{$index}{"node_sid"} = $node_sid; $activity_tran_ledg{$location}{$index}{"reasontype"} = $reasontype +; $activity_tran_ledg{$location}{$index}{"reasonmsg"} = $reasonmsg; $last_location = $location; }
[download]
for my $location ( sort keys %activity_tran_ledg ) { for my $index (sort keys %{$activity_tran_ledg->{ $location }} ) { my $i1 = $index+1; if (exists $activity_tran_ledg{$location}{$index+1}{"index"}) +{ my $test = $activity_tran_ledg{$location}{$index}{"trandat +e"} - $activity_tran_ledg{$location}{$index+1}{"trandate"}; if ($activity_tran_ledg{$location}{$index}{"trandate"} - $ +activity_tran_ledg{$location}{$index+1}{"trandate"} <= 1) { # 1 second difference print "[",__LINE__,"] LOC [$location] I [$index] TDI [ +$activity_tran_ledg{$location}{$index}{trandate}] I1 [$i1] TDI1 [$act +ivity_tran_ledg{$location}{$i1}{trandate}] TEST [$test]\n"; if ((($activity_tran_ledg{$location}{$index}{"reasonms +g"} eq "Scheduled Unlock") and ($activity_tran_ledg{$location}{$i1}{" +reasonmsg"} eq "Scheduled Lock Sent")) or (($activity_tran_ledg{$location}{$index}{"reasonms +g"} eq "Scheduled Lock") and ($activity_tran_ledg{$location}{$i1}{"re +asonmsg"} eq "Scheduled Unlock Sent"))) { print "[",__LINE__,"] *** LOC [$location] I [$inde +x] RMI [$activity_tran_ledg{$location}{$index}{reasonmsg}] I1 [$i1] R +MI1 [$activity_tran_ledg{$location}{$i1}{reasonmsg}]\n"; } } } else { } } }
[download]