I am using C for obvious reason. I know it. I also know half a dozen other languages (starting from Fortran, PL/I and Assembler), and RPG is not among them. I don't see much reason to study one more language just to slove this problem.
Actually I started already rewriting API-s to use user space and thje results are very very good.
I of course agree with Simon, when he says, that if adding a printf makes program work, there is a memory problem somewhere. But the same applies to debug mode. But this does not make me happy :-)
So I saw switching to user space as a possible solution - and it happened to be pretty straightforward and efficient...
e.com]On Behalf Of Ted Slate
Sent: Monday, May 12, 2008 3:29 PM
Subject: Re: [C400-L] File left open in QZRCSRVS job
Try sending scope message (QMHSNDSM) API. If your program
crashes you can perform cleanup routines. Also, check for
the record lock timeout values, so even if the program
crashes no one lock can keep others in a stalemate. Finally,
if that's the only reason you're using C for this, you might
consider RPG and SQL. I rarely use C for strict DB file
handling, it's not worth the trouble with SQL and RPG around.
I don't see where a file open is an issue unless it's an
exclusive lock. If the file is in QTEMP there's no reason to
hold an exclusive lock(if you are) which would solve the
However, I noticed you stated that a user space is an option.
Then you could use a stream file (flat file). Again, same
thing just don't open it exclusive and if the program bombs
you can re-create it repeatedly with no locks. It is
possible that the record handling code is causing storage
issues as suggested so maybe removing that code or moving it
to RPG may help.
But aside from all that, I would use queues for what you're
doing it's a much more elegant solution and very robust on
the i. It doesn't make sense to use files or user spaces for
message passing and IPC.
Stay in touch when you're away with Windows Live Messenger.
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives