The first thing to do would be keep the job active and let it handle
all requests.

Regards to clearing/creating your QTEMP file, always chose the option
that generates the fewest exceptions.  So if some step is called
multiple times such that most of the time the QTEMP file exists, but
the first time it does not, then I would use the following code:

MONMSG CPF3142 DO(CRTDUPOBJ xxxx)  /* File Not Found */

This way, most of the time it is just the clrpfm that is executed.

Regarding deleting all the records after the work unit and then doing
CLRPFM, that is an extra step.

I can't say for certain, but I would expect the single CLRPFM to be
faster than deleteing individual records (especially if access paths
are involved).  So I would NOT delete the records as you send them
back, and just do the CLRPFM.  This has the added benefit that by
opening in read-only mode, you allow better blocking to take place.

Bob Crothers
Cornerstone Communications

-----Original Message-----
From: []On
Behalf Of Eugene Astanovsky
Sent: Friday, December 14, 2001 9:48 AM
Subject: [C400-L] Optimization question

Can someone give me an advise on hour to achieve maximum perfomance in
following case.

I have a program, that is actually an API, called from PC via Client
This program is "seen" in WRKACTJOB under WRKSYS/QZRCSRVS. Program is
frequently and I have to maximize its speed.
For its operation it requires a temporary PF, which is created in QTEMP
the program.
What I do now in my C program is :
Program fills file with data, then sends data away, clearing this file
data is transferred.
When program ends it's job, file is empty, as I delete each record
sending it.

I looked at the job log, and each time it says :

Object HZY041 in QTEMP type *FILE already exists.

Now as performance is a bottleneck, I have several choices.
1. Leave it as is and find for a solutions somewhere else - I do not
know if
this is a performance issue :-(
2. Delete file as soon as it is empty - then I probably will not get
error message, but will have to create it for each call.
3. Check, if file exist before creating it and make CRTDUPOBJ only if
file does not exist.

My question is which of the choices is the best? And if the best is
then what is the most efficient way to check the existence of the file?

Any suggestions will be highly appreciated.

Jevgeni Astanovski.

This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email:
To subscribe, unsubscribe, or change list options,
or email:
Before posting, please take a moment to review the archives

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].