I have an intermittent problem with my background process. The process
creates 2 sequential files, one is a log file and the other is an error
file, both are keyed by the date in the file name. Most of the time the
process runs with no problems, terminates and then starts a new phantom
job for the next days processing. Occasionally, the creation of the
sequential log file experiences an error and although this isn't a good
thing, you would think that the next days log file probably wouldn't
have a problem. Unfortunately, that's not the case. Subsequent days
processes also have trouble creating the log file. But, if you run the
process manually, the log file is created with no problem.

I have not been able to identify what the cause of the problem is. Here
are the main code snippets and the program error being displayed. Do you
see a problem with my logic? I know my understanding of the Create and
Status commands are limited, so there might be something I should be
doing differently with those. Is there some additional logic that I can
add to provide more information on the real cause of the error? Also, is
there a better way to verify that a file handle has been assigned, other
than my checking if the file handle variable is not numeric?

Main Calling Code:
*
AIXLOG = DIR_NAME:'GMS':GMSDT:'.LOG'
FOLOG = C.CREAT(AIXLOG,S$IRWXU + S$IROTH + S$IRGRP)
IF NUM(FOLOG) THEN
CRT 'Error Creating Log file, ':AIXLOG
CRT 'Error number - ':FOLOG
CRT 'Terminating process.'
STOP
END
*
C.CREAT Function
FUNCTION C.CREAT(PATH, FLAGS)
OPENSEQ PATH TO F.HANDLE THEN
WEOFSEQ F.HANDLE ON ERROR
CRT 'WEOFSEQ IN C.CREAT Failed for path ':PATH
END
END ELSE
CREATE F.HANDLE ELSE
F.HANDLE = STATUS()
END
END
RETURN(F.HANDLE)

Error message from Phantom log
Window set for 09:00:00am to 09:15:00am
PROCESSING FILES AT 09:00:05am ON 04-14-2010
Error Creating Log file, \\server042ia\logs\GMS041210.LOG
Error number - 2
Terminating process.

Any ideas or similar problems? Thanks for your help.

Curt Stewart
TRI-SYS Consulting


_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to