Check if a job is running on an AS/400

madhouse

Registered User.
Local time
Today, 22:49
Joined
Jul 3, 2002
Messages
65
My question is quite simple....not sure whether the answer is the same.

Basically I have a job that runs overnight on our AS/400, then in the morning I run a function in MS Access that imports a number of files into the database. At the moment I manually check to make sure the job has finished on the AS/400 before running the import function. But what I plan to do is move the Access database onto a Windows server so that all staff in my department can use it. This means I need some way of having Access check to see if the job is completed or not before automatically running the import function. Does anyone know of an easy (or not so easy) of accomplishing this task? Alternatively has anyone got any other suggestions?
 
Does your o/n process output a file for the import into Access?

If so, this is what i use

Code:
Sub FileLastModified(filespec) 'finds the last modified date of a file

Dim fs, f, s
Dim strMsg As String

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)

If f.DateLastModified <> DATE Then ' edit as appropriate

    s = (filespec) & vbCrLf & vbCrLf
    s = s & "Last Modified: " & f.DateLastModified
    s = s & ".  Do you want to continue with import?"
    strMsg = MsgBox(s, vbYesNo, "File Access Info")
    
    If strMsg = vbNo Then Exit Sub
    
  ' else continue with the import...
    
End If

Set fs = Nothing
Set f = Nothing

End Sub
 

Users who are viewing this thread

Back
Top Bottom