• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

OVRPRTF - Override Print File

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

  • OVRPRTF - Override Print File

    I have a button program that prints labels using a call to TL Ashford software. I need to override the TLA printer file to output to the appropriate printer. I have that working, but I thought (incorrectly) that the override would "end" when the button program ends.

    Within the button program i have a procedure ovrprtf();

    Code:
        
      dcl-proc ovrPrtf;
    
      dcl-s  cmd       varchar(512) inz;
      dcl-s  zebOutq   char(10) inz;
      dcl-s  laserOutq char(10) inz;
      ?
       ... code here populates outq variables
        cmd='OVRPRTF FILE(ASN003PF) OUTQ(' + %trim(laserOutq) + ') USRDTA(MSTR_BOL) COPIES(2)';
        vvUtility_qCmd(cmd);
        cmd='OVRPRTF FILE(BCLABELS) CPI(15) OUTQ(' +  %trim(zebOutq) + ') ' +
            'USRDTA(SKIDLAB) OVRSCOPE(*JOB)';
        vvUtility_qCmd(cmd);
    
      end-proc;
    ??
    The override in question is on BCLABELS. I had to use OVRSCOPE(*JOB) at the request of TLA support. This was the only way I could get the labels printing correctly.

    For now, I have created dltovr() procedure that runs "on-exit" of my procedure that prints both documents. It deletes all prtf overrides.

    Code:
      dcl-proc dltOvr;
    
      dcl-s  cmd       varchar(512) inz;
    
        cmd='DLTOVR FILE(*PRTF) LVL(*JOB)';
        monitor;
          vvUtility_qCmd(cmd);
        on-error;
        endmon;
    
      end-proc;
    ?
    Just wondering if there's a better way?

  • #2
    Concluding with the DLTOVR is definitely the appropriate thing to do. Every CGI job services multiple sessions, such that when the CGI job is done servicing a call from one user, it becomes available for any other user request that Apache directs to it next. So you should never leave any straggling overrides that could adversely affect another user session.

    You could omit the monitor/on-error/endmon lines by adjusting your command to this:
    Code:
    vvUtility_qCmd(cmd:*on:*off);
    The *on parameter tell it to ignore any error encountered when executing the command, while *off tells it to not log any encountered error to the Errors app.

    Comment


    • #3
      Thanks Rob!

      Comment

      Working...
      X