[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] 24x7 Script Archive


Verifying overnight data feed

// Check data files than arrived erlier.
Dim file_date, date
Dim file_time, time
Dim today, date
Dim now, time
Dim not_found, boolean
Dim file_OK, boolean
Dim date_OK, boolean
Dim time_OK, boolean
Dim file_name, string

Today( today )
Now( now )

CHECK_ACCOUNTS:
// Get date/time for Accounts
Set( file_name, "j:\data\account.dat" )
NotFileExists( file_name, not_found )
IfThen( not_found, BAD_FILE )
FileDate( file_name, file_date )
FileTime( file_name, file_time )

// Check if it is file_OK
IsEqual( file_date, today, date_OK )
IsTimeBetween( file_time, 00:00:00, now, time_OK )
And( date_OK, time_OK, file_OK )
if( file_OK, CHECK_HOLDINGS, BAD_FILE )

CHECK_HOLDINGS:
// Get date/time for Holdings
Set( file_name, "j:\data\holding.dat" )
NotFileExists( file_name, not_found )
IfThen( not_found, BAD_FILE )
FileDate( file_name, file_date )
FileTime( file_name, file_time )

// Check if it is file_OK
IsEqual( file_date, today, date_OK )
IsTimeBetween( file_time, 00:00:00, now, time_OK )
And( date_OK, time_OK, file_OK )
if( file_OK, CHECK_SECURITIES, BAD_FILE )

CHECK_SECURITIES:
// Get date/time for Securitites
Set( file_name, "j:\data\secirity.dat" )
NotFileExists( file_name, not_found )
IfThen( not_found, BAD_FILE )
FileDate( file_name, file_date )
FileTime( file_name, file_time )

// Check if it is file_OK
IsEqual( file_date, today, date_OK )
IsTimeBetween( file_time, 00:00:00, now, time_OK )
And( date_OK, time_OK, file_OK )
if( file_OK, DONE, BAD_FILE )

BAD_FILE:
// Inform operation personal about bad file
MailSend( "Exchange Settings", "pswrd", "david@mycompany.com", file_name, "Overnight feed failed. File specified in the subject was not updated!" )
MailSend( "Exchange Settings", "pswrd", "joe@mycompany.com", file_name, "Overnight feed failed. File specified in the subject was not updated!" )

DONE: