CCARCSE Nightly Job

This job runs on NCRWKIT112988 (production script server) at 11:30 PM (23:00) every weeknight. This job runs a stored procedure that feeds the CAWIS application and then creates a series of data files using a bat file which runs an Excel macro. The bat file then copies the files to their destinations.

The CCARCSE_NIGHTLY_JOB.bat (in Green below) used to run on a Unix box and was prone to failing because the Unix jobs got no attention from DSD and were often brought offline.  It was re-written but no in an Oracle Scheduled Job because a giant text file is created as part of this job and then copied to the web and other directories. 

The Excel program (CCARCSE_Nightly_Job_replacing_Unix_III.xlsm) runs a macro as it opens up.  The macro will then run the program and do all the nightly processing.  In order to open up excel and not run the macro, Open Excel, then go to file/open and with the shift button down, open up the file on NCRWKIT112988.  You will be able to edit it without it executing.  This job prepares all the text files required for the following:

(a)  the CCARCSE Register Web download

Current settings for the CCARCSD ZIP file:

BAT file (CCARCSE_NIGHTLY_JOB.BAT) is automatically executed daily on the server NCRWKIT112988 from the location C:\RS-CDRIVE\. Thereafter, the CCARCSD ZIP file is placed in the following locations:

Source : \\wwwdatatest\wwwdocs\CCARCS\

Destination : \\tcwwwmaster\e$\Data\wwwappsroot\Saf-Sec-Sur\2\CCARCS-RIACC\download\

 (On December 24th 2021, a problem occurred which caused the CCARCSD ZIP file not to be updated until December 31st 2021. The problem was related to MS Excel. MS Excel seems to have been stuck while executing the .BAT file previously with several recoverable documents existing on the left-hand side area. All of the open Excel documents were closed and .BAT file was executed and ran successfully)

(b) TC statistics

(c) the International Register

(d) DND – Search and Rescue

NOTES 

/*
Kurt Martin – 2022-05-10
As per PBI-168150 “CCARCS - Downloadable Registry package contains an unknown file type”,  adjustments were made to eliminate the file
CARSLAY.OUT  because of its unknown extension/file type
from the zip file CCARCSDB.ZIP.
3 files were copied for backup
CARSLAY.OUT  (a static text file dated 2018, that provides a layout of the data files)
CCARCSE_NIGHTLY_JOB.bat
CCARCSE_NIGHTLY_JOB_WO_EXCEL.bat
The original BAT files were prefixed with an “X”
ALL references to CARSLAY.OUT were replaced with  CARSLAYOUT.TXT in each original BAT file. The original CARSLAY.OUT was renamed  CARSLAYOUT.TXT
Job verified working on 2022-05-09.
RS’s original text remains below, unchanged.
Note : the directory \\tc4s0f\groups\AC\ACA\ACAShared\CCARCS\
Does not seem to exist
*/
REM Russ, October 31, 2018
REM The work is now being done by the script server, not the Unix job
REM -----------------------------------------------------------------------------------------------------------
cd\rs-cdrive
REM
CCARCSE_Nightly_Job_replacing_Unix_III.xlsm
copy c:\rs-cdrive\ccarcsdb.zip c:\rs-cdrive\ccarcsdb.old.zip
REM These four statements are no longer required
REM copy \\tc4s0f\CCARCS\ccarcsdb.zip ccarcsdb.zip
REM copy \\tc4s0f\CCARCS\carslay.out carslay.out
REM copy \\tc4s0f\CCARCS\carscurr.txt carscurr.txt
REM copy \\tc4s0f\CCARCS\carsownr.txt carsownr.txt
zip \\tc4s0f\groups\AC\ACA\ACASha~1\CCARCS\ccarcsdb.zip carslay.out
zip \\tc4s0f\groups\AC\ACA\ACASha~1\CCARCS\ccarcsdb.zip carscurr.txt
zip \\tc4s0f\groups\AC\ACA\ACASha~1\CCARCS\ccarcsdb.zip carsownr.txt
ECHO The zips to the web seem to fail on the Windows 7 box through the scheduler, so I'm going to zip here and then copy to the web
DEL c:\rs-cdrive\ccarcsdb.zip
DEL c:\rs-cdrive\ccarcsdb.deb
zip ccarcsdb.zip carslay.out
zip ccarcsdb.zip carscurr.txt
zip ccarcsdb.zip carsownr.txt
copy c:\rs-cdrive\ccarcsdb.zip \\wwwdatatest\wwwdocs\CCARCS
REM \\wwwdatatest\wwwdocs\CCARCS\ccarcsdb.zip carslay.out
REM \\wwwdatatest\wwwdocs\CCARCS\ccarcsdb.zip carscurr.txt
REM \\wwwdatatest\wwwdocs\CCARCS\ccarcsdb.zip carsownr.txt
ECHO Now to copy the search and rescue files
REM Russ, April 13, new file carssar_all_marks.txt used to be carscurr.txt, but carscurr.txt no longer contains owners that only own expired marks
REM this file will be called carssar_all_marks.txt
zip ccarsar1.zip carssar_all_marks.txt
zip ccarsar2.zip carssar.txt
copy ccarsar1.zip "\\ncrfs07\ccarcs\CCARCS_V2\Search And Rescue\"
copy ccarsar2.zip "\\ncrfs07\ccarcs\CCARCS_V2\Search And Rescue\"
ECHO Now to copy the international registry files
zip carsintr.zip carsintr.txt
copy carsintr.zip \\ncrfs07\ccarcs\CCARCS_V2\International_Register\
ECHO EVENT IS DONE
:EXIT
ECHO Aborted
copy c:\rs-cdrive\ccarcsdb.zip c:\rs-cdrive\ccarcsdb.deb
The excel code is in CCARCSE_Nightly_Job_replacing_Unix_III.xlsm.