ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

OVRDBF issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OVRDBF issue

    I have an old CLP that calls two reports over and over again (passing a different parameter). It has overrides for both PRTF and an "output" DB file. I moved the calls logic into an ILE program, leaving the overrides in the original CLP. They OVRPRTF works just fine. The OVRDBF does not. I've tried OVRSCOPE *CALLLVL and *JOB to no avail.

    The two programs being called (RPT100 and RPT105) should update PF called PROJORDS... the file PROJWRK is defined in each RPT program.

    Here is the CLP and SQLRPGLE. I know this has to do with the override and activation groups. I just can't seem to see what's wrong. Any help would be appreciated.

    Code:
                 PGM
                 DCL        VAR(&USRDTA) TYPE(*CHAR) LEN(10)
    
                 CHGVAR     VAR(&USRDTA) VALUE('AMREPORTS')
    
    /* BUILD PROJECTION WORKFILE */
    
                 OVRDBF     FILE(PROJWRK) TOFILE(PROJORDS) OVRSCOPE(*CALLLVL)
                 OVRPRTF    FILE(RPT100PF) USRDTA(&USRDTA) OVRSCOPE(*CALLLVL)
                 OVRPRTF    FILE(RPT105PF) USRDTA(&USRDTA) OVRSCOPE(*CALLLVL)
                 OVRPRTF    FILE(RPT105APF) USRDTA(&USRDTA) OVRSCOPE(*CALLLVL)
                 CALL       PGM(AMREPORTS)
    
                 DLTSPLF    FILE(*SELECT) SELECT(*CURRENT *ALL *ALL +
                              &USRDTA *ALL)
    
                 DLTOVR     FILE(*ALL)
    This is the new program

    Code:
           ctl-opt
           datfmt(*iso)
           option(*srcstmt: *nodebugio)
           dftactgrp(*no) actgrp(*new)
           bnddir('ASTBIND':'TBFBIND');
    
          //------------------------------------------------------------------------
    ..... code here
    
             if AMReports(comx(x)) < 0;
               RptErr();
             endif;
    
    
    
          //===================================================================
          // Run AM Reports for a Company
          //===================================================================
           dcl-proc  AMReports;
    
             dcl-pi  AMReports        int(10);
               inCom                  char(3) const;
             end-pi;
    
             dcl-c  SP           const(' ');
    
    
           // Projections
             cmdstring = 'call pgm(RPT105) ' +
                         'parm(' + q + %trim(inCom) + q + SP + q + endOfMonth + q +')';
             monitor;
               qcmdexc(cmdstring:%len(cmdstring));
             on-error;
               return -1;
             endmon;
    
           // MTD-YTD Report
             cmdstring = 'call pgm(RPT100) ' +
                         'parm(' + q + %trim(inCom) + q + SP + q + year + q + SP +
                          q + month + q +')';
             monitor;
               qcmdexc(cmdstring:%len(cmdstring));
             on-error;
               return -1;
             endmon;
    
             return 0;
    
           end-proc;

  • #2
    I'd start by recompiling the CLP as CLLE.

    Comment


    • #3
      You can make the OVRSCOPE(*JOB) or the ACTGRP(*CALLER) to make them sync up. You'll have to figure out which. *NEW is an expensive operation if not needed.

      Ringer

      Comment


      • #4
        Originally posted by CRinger400 View Post
        You can make the OVRSCOPE(*JOB) or the ACTGRP(*CALLER) to make them sync up. You'll have to figure out which. *NEW is an expensive operation if not needed.

        Ringer
        My problem is that I don't understand the Activation groups totally - I'm not comfortable with them. There are numerous other CLP that call these same RPG reports - they are so old that neither indicates activation groups in the control specs. Since they are both RPGLE members, I'm assuming the are *NEW.

        So I've changed the CL driver for this process to CLLE and compiled. I can recompile the RPG programs (RPTxxx) however I like as long as it doesn't adversely affect the other calls. Should I use a named activation group, or is *CALLER the best bet?

        Comment


        • #5
          Thanks!

          My final/real problem was passing a CHAR(8) date in "backwards"
          Last edited by gwilburn; February 15, 2019, 09:02 AM.

          Comment

          Working...
          X