What/How it runs cron 4:40AM daily /lawson/law/prod/usrscripts/turnover.pl input parm 0 ($env-prod or test) refers to oracle to connect to input parm 1 ($date - assumes today if not there) YYYYMMDD format you have to run as lawson, su - lawson -c /lawson/law/prod/usrscripts/turnover.pl prod >> /tmp/turnover.log 2>&1 to manually catchup sign onto lid as root su - lawson -c /lawson/law/prod/usrscripts/turnover.pl prod 20150625 Parent process none Child process Tammie manually runs crystal reports Input system/files Lawson, Oracle dbase tables, pulls previous month's data Output system/files Lawson, Oracle dbase tables, TURNOVER Automation none Hard Coding perl path - has to be Oracle's version of perl, not AIX version, and permissions have to be correct hard coded oracle signons input parm 0 (ENV-prod or test) hard codes host, sid, and service Contacts Jonas Bull who doesn't work here anymore DOWNTIME can run early or late that day by just runinng it as is or run anyday for whatever date got missed by putting the date for the second input parm notes before (changes for harcoding) #!/u01/app/oracle/OraHome_11g/perl/bin/perl my $dbuser='system'; my $dbpass='?????'; my $dbhost='lawdb'; if ($env eq 'test'){ $dbpass='?????'; $dbhost='lawtdb'; } my $sid='lawprod11g.fghnet.com'; if ($env eq 'test'){ $sid='lawtest11g.fghnet.com';} >-< after #!/lawson/Oracle/app/oracle/product/12.1.0/client_1/perl/bin/perl (had oracle perl unix permission problems too!) my $dbuser='system'; my $dbpass='?????'; my $dbhost='infordb'; if ($env eq 'test'){ $dbpass='?????'; $dbhost='infortdb'; } my $sid='lawprod.fghnet.com'; if ($env eq 'test'){ $sid='lawtest.fghnet.com';} adding the environment doesn't work cause prod is hard coded down further and blows up sub auth_fte_pos{ my $q="select b.auth_fte from prod.pabudget b where b.company=10 and b.position='$_[0]' and b.effect_date= (select max(effect_date) from prod.pabudget changed to, so it would work sub auth_fte_pos{ my $q="select b.auth_fte from $env.pabudget b where b.company=10 and b.position='$_[0]' and b.effect_date= (select max(effect_date) from $env.pabudget Took out some confusing hardcodeing that was not working anyway! #################### my $beginday=$year.$mon.$first; $beginday='20131203'; my $prevbegin=$prevyear.$prevmon.$first; my $prevlast=$prevyear.$prevmon.$prevlast; my $endday=$year.$mon.$last; $endday='20131114'; my @dates=($beginday..$endday); #foreach $date (@dates){ print $date."\n"; my $xfers=xfers($date); my $terms=terms($date); my $ftes=ftes($date); #} ################### #################### my $beginday=$year.$mon.$first; my $prevbegin=$prevyear.$prevmon.$first; my $prevlast=$prevyear.$prevmon.$prevlast; my $endday=$year.$mon.$last; my @dates=($beginday..$endday); print $date."\n"; my $xfers=xfers($date); my $terms=terms($date); my $ftes=ftes($date); ###################