RPGIV @ Work

A unique site for RPG and System i Lovers


Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Override printer file in RPG IV Print E-mail
User Rating: / 3
Written by Chamara Withanachchi   


Technique 1
  H BndDir('QC2LE') DftActGrp(*NO)
  FPRINTFILE O    E             Printer UsrOpn
   * prototyped call to execute a system command
  D System          PR            10i 0 ExtProc('system')  
  D   Cmd                           *   Value Options(*string)
  D ErrorFlag       S             10i 0
  C                   If        NOT %open(PRINTFILE)
  C                   Eval      ErrorFlag = System('OVRPRTF FILE(PRINTFILE) +
  C                                    PAGESIZE(' + %char(LENGSR) + ' 80)+
  C                                    OVRFLW(' + %char(OVFLNZ) + ') LPI(6) +
  C                                    CPI(10) FORMTYPE(whatever)')
  C                   Open      PRINTFILE
  C                   EndIF

Technique 2  I do similar QCMDEXC PR calls.
  d Qcmdexc         pr                  Extpgm('QCMDEXC')   
  d  Cmd                                Like(Qcmd) Options(*Varsize) Const
  d  CmdLen                       15p 5 Const                            
  d  CmdOpt                        3    Options(*NoPass) Const
  d Qcmd            s           3000
  d OvrPrtf         c                   'OVRPRTF FILE(QSYSPRT) PAGESIZE(*N 1-
  d                                     98) CPI(15) MAXRCDS(*NOMAX) OVRSCOPE-
  d                                     (*JOB) SHARE(*YES)'           

  c                   Eval      Qcmd = OvrPrtf        
  c                   CallP     Qcmdexc(Qcmd : %Len(%Trim(Qcmd)))
  c                   If        Not %Open(Qsysprt)
  c                   Open      Qsysprt           
  c                   EndIf                     
  c                   Close     Qsysprt
  c                   Eval      Qcmd = 'DLTOVR FILE(QSYSPRT) LVL(*JOB)'
  c                   CallP     Qcmdexc(Qcmd : %Len(%Trim(Qcmd)))


User Comments

Please login or register to add comments

<Previous   Next>