View Full Version : OVRPRTF Scoping
01-01-1995, 02:00 AM
What I want to do is call an RPG program (through a command interface) that does some work, then does an OVRPRTF with OVRSCOPE(*CALLLVL) by using QCMDEXC. The problem is that if I do this all in this RPG, once the RPG returns to its caller, the override is no longer available becuase I have jumped down a call level. I am aware that I could use OVRSCOPE(*JOB) to scope it to the entire job, but then I run into some other problems (which would be complicated to explain). My goal here is the accomplish all of this within the RPG, have the override scoped to *CALLLVL, and still be available once the RPG returns. If OVRPRTF had an option of *PRV for the OVRSCOPE parameter this would be perfect, but since they don't does anyone else have any ideas?
11-02-2000, 08:55 AM
Use QCMDCHK instead of QCMDEXC around the first OVRPRTF at call stack level 2, then relay the QCMDCHK result into a second OVRPRTF at call stack level 1.
11-02-2000, 01:20 PM
Randy, This is an area where RPGIV has some advantages becaues you can scope the overide to an activation group. David Morris
11-03-2000, 04:09 AM
Could you be a bit more specific. I have never used the QCMDCHK API, how can it help me. Also, when you say relay the OVRPRTF to call level 1, what do you mean by relay?
11-03-2000, 05:33 AM
I'm sorry I was vague. I assume: <ul> You have a non-ILE application. The top is a CL menu program. Menu option 1 calls OPM RPG to build an OVRPRTF string. You want menu option 2 to run under menu option 1's override. You insist you don't want OVRSCOPE(*JOB) nor OVRSCOPE(*ACTGRPDFN). And you don't want the good benefits of named activation groups. [/list]Menu option 1 can call Check Command Syntax (QCMDCHK) API to prompt the user for a command and then store the command for later processing. For example in CL, <pre> DCL &CMD *CHAR 256 VALUE('? OVRPRTF ?-OVRSCOPE(*CALLLVL)') CALL QCMDCHK (&CMD 256) /* prompt user */ </pre>Variable &CMD resolves into a valid OVRPRTF command string. Then you can relay it into the CL caller using the LDA, or a parameter, or a program message, then execute it using QCMDEXC.
11-03-2000, 06:38 AM
Gene, I guess I was a bit vague in my question also. We are using RPGIV, but for the most part are running applications in the default activation group. I am somewhat familiar with activation groups, but not really sure enough to be able to do a mass change to ILE. I can see where using OVRSCOPE(*ACTGRPDFN) would do what I'm wanting, but I guess I was hoping for a way to do that outside of a large conversion to ILE. Your suggestion of passing the command back to the CL would work, but I was hoping to accomplish all of this within the RPG. The reason why is that the RPG that I am speaking about is actually a CPP for a command I have created. Having to run QCMDEXC after my command wouldn't be quite as clean of a method of which I was hoping for. I'll look into the activation group method though.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.