As I recall, whenever you desire to issue OVRxxxx commands specified as
OVRSCOPE(*CALLLVL), if you issue the override from a subprocedure, then
when you exit that subproc, the override disappears.... To get effect,
you must issue the override from the same call-level of the program that
opens the resource. In the case of calling QCMDEXC, that API can see
that you are issuing an override, and "Adjusts" the calllevel so that
the override is placed at your program, and not at the QCMDEXC entry.
I sometimes get lazy and use the system api, but the only way to apply
an override using system is to OVRSCOPE(*JOB) or
OVRSCOPE(*ACTGRPDFN).... Not my preference in most cases.....
Hth,
Eric DeLong
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Kurt Anderson
Sent: Friday, February 20, 2009 4:42 PM
To: RPG programming on the IBM i / System i
Subject: RE: ovrprtf inside a RPG service program
From what I recall, I've never had an issue calling QCmdExc from a
subprocedure (though I may have not done an override). I have QCmdExc
wrapped up in a procedure so I can (in one place) grab the error message
if the command failed to execute and write it and the CPF to an error
log.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of DeLong, Eric
Sent: Friday, February 20, 2009 4:13 PM
To: RPG programming on the IBM i / System i
Subject: RE: ovrprtf inside a RPG service program
How are you issuing the OVRPRTF command from RPG? You should use
QCMDEXC from the main program body, and not from a subprocedure. Do not
use system api (from the C runtime), as this does not "fix" the
call-level problem. QCMDEXC has some magic that adjusts the call-level
so that it appears that the override was enabled for your RPG program.
The other approach is to use the big hammer, and issue the override to
CALLVL(*JOB), which is a bit heavy for my taste....
Hth,
Eric DeLong
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Nick Arndt
Sent: Friday, February 20, 2009 3:43 PM
To: RPG programming on the IBM i / System i
Subject: Re: ovrprtf inside a RPG service program
The flow is as follows:
override
open
write records
close
delete override
On Fri, Feb 20, 2009 at 3:37 PM, Kurt Anderson
<kurt.anderson@xxxxxxxxxxxxxx
wrote:
Silly question, but you're not doing the following are you?
1. Override
2. Open
3. Delete override.
4. Close
5. Open
6. Write to the file
In my day I've seen print files closed in order to create multiple
spool files - if that's what you're doing make sure the override isn't
deleted so future opens still use it.
Grabbing at straws here. From all the information you've given us, it
sounds to me that the ovrprtf should work.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Nick Arndt
Sent: Friday, February 20, 2009 2:08 PM
To: RPG programming on the AS400 / iSeries
Subject: ovrprtf inside a RPG service program
Hi all,
I have a situation where I need to execute an ovrprtf from with in a
service program running in batch. The following OVRPRTF command
doesent seem to take effect at all:
OVRPRTF FILE(FILLRECDOC) OUTQ(I9FORM) SAVE(*YES)
I thought that was because I am running this in a service program so I
added the keywords OVRSCOPE(*CALLLVL) OPNSCOPE(*ACTGRPDFN)
and I get the following messages
Keyword OPNSCOPE not valid for this command Keyword OVRSCOPE not valid
for this command
The activation group for the service program is *CALLER
Any help would be appreciated.
Thanks
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.