Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using OVRPRTF

Status
Not open for further replies.

RedMage1967

Programmer
Mar 13, 2003
200
US
Can I issued an OVRPRTF from within a RPG program that will use the printer file that I want to issue the override on?

I need to override the SPLFNAME. Can I do that within the program, before I open the file? (The file is set as USROPN).

Thanx.

RedMage1967
IBM Certifed - RPG IV Progammer
 
how about just embedding a CL command in the RPG to do the work

eg:

_____________________________________________________________________
onpnt2.gif

 
That's what I'm going to try. On other app's I call a CL program that issues the OVRPRTF and calls another RPG program that creates the SPLF. Trying to eliminate the CL program.

RedMage1967
IBM Certifed - RPG IV Progammer
 
Here is some code from one of my programs that overrides a printer file to the correct outq before opening the file for printing.

'F' Spec:
Oerr295p o e Printer Oflind(*In99) UsrOpn

'D' Specs:
* QcmdExec Procedure
* ------------------
D ExecCmd Pr ExtPgm('QCMDEXC')
D Cmd 2048a Const
D CmdLen 15 5 Const

D CmdString s 2048a
D CmdLength s 15 5

'C' Specs: (not aligned properly)
C Eval CmdString = 'OvrPrtf File(Oerr295p) Outq(' +
C %Trim(Parm_Outq) +
C ') PrtTxt(*Blank) FormType(' +
C %Trim(FormType) + ') UsrDta(' +
C 'Inv_' +
C %Editc(Udate:'X') +
C ') Drawer(' + Drawer + ')' +
C ' DEVTYPE(*AFPDS)'
C Eval CmdLength = %Len(%Trim(CmdString))
C CallP ExecCmd(CmdString:cmdLength)

* Open Printer File
C If Not %Open(Oerr295p)
C Open Oerr295p
C EndIf



T. Bishop
 
as400pro

I got it to work using code along the lines that you showed in your example. The only thing I need to do is to add a DLTOVR after the print procedure is called, because the splfname can change every time the print procedure is called. Thanx for the help ALL.

RedMage1967
IBM Certifed - RPG IV Progammer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top