Go Back   System iNetwork Forums > Systems Management > Printing

Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2009, 04:29 AM
azmir.silverlake azmir.silverlake is offline
Member
 
Join Date: Oct 2009
Location: Malaysia
Posts: 25
Generate spool file from PF with OVERLAY or Page Definition and Form Definition

Hi All,

I have a problem with Overlay. I refer to old theard but still cannot solve my problem.


Here how i execute my program

Step 1) Copy spool file to pf

Code:
 CPYSPLF    FILE(&PRTF) TOFILE(&OUTF) SPLNBR(*LAST) +       
             TOMBR(&PRTF) CTLCHAR(*PRTCTL)
Step 2) Overwrite printer file

Code:
OVRPRTF    FILE(QSYSPRT) DEVTYPE(*LINE) +                            
                          PAGESIZE(&LPP &PPL) LPI(&LPI) CPI(&CPIN) +              
                          OVRFLW(&OVRFLW) PAGDFN(BOSSTM/CAPST) +                  
                          FORMDF(BOSSTM/CAPST) PRTTXT(&REPTXT) +                  
                          OUTQ(&DSTLIB/&DSTOUT) FORMTYPE(&REPFRM) +               
                          COPIES(&COPYN) HOLD(&HOLD) SAVE(&SAVE) +                
                          USRDTA(&REPDTA) SPLFNAME(&DSTPRT)

Step 3) Call the program to generate the spool file. Code below is how my program look alike.

Code:
FSPOOL     IF   E             DISK    USROPN                                      
FQSYSPRT   O    F  198        PRINTER OFLIND(*INOF)                               
F                                     USROPN                                      
F                                     PRTCTL(CTL:*compat)                         
D CTL             DS                                                              
D  SPACEB                 1      1                                                
D  SPACEA                 2      2                                                
D  SKIPB                  3      4                                                
D  SKIPA                  5      6                                                
D  CURLIN                 7      9  0                                             
D                 DS                                                                      
D  PLINE                  1    198                                                
D  DIST                   1     50                                                
C*                                                                                
C     *ENTRY        PLIST                                                         
C                   PARM                    DSTNAM           50                   
C                   PARM                    REPFRM           10                   
C* OPEN                                                                           
C                   OPEN      SPOOL                                               
C                   OPEN      QSYSPRT                                             
C                   READ      RSPOOL                                 33              
C*                                                                                   
C     *IN33         DOWEQ     '0'                                                    
C*                                                                                   
C                   MOVE      LSKIP         SKIPB                                    
C                   MOVE      LSPACE        SPACEB                                   
C*                                                                                   
C*                                                                                   
C                   EXCEPT    LINE                                                   
C*                                                                                   
C                   READ      RSPOOL                                 33              
C                   END                                                              
C* CLOSE                                                                             
C                   CLOSE     SPOOL                                                  
C                   CLOSE     QSYSPRT                                                
C*                                                                                   
C                   RETURN                                                           
C*                                                                                   
OQSYSPRT   E            LINE                                                         
O                       PLINE              198

After all these step, i go to WRKSPLF and i see my spool file "Total Pages" value is 12*. But from what i understand, spool file with overlay must have extra 1 page. It should be 13*.

Is it i have to do something before i close QSYSPRT ?


Hopefully anyone out there can help me. Thanks.

Last edited by azmir.silverlake; 10-21-2009 at 08:07 AM. Reason: Update source code
Reply With Quote
  #2  
Old 10-20-2009, 11:12 PM
Scott Klement's Avatar
Scott Klement Scott Klement is offline
 
Join Date: Jul 2005
Location: Milwaukee, WI, USA
Posts: 10,387
I don't see where you are specifying that you want to use an overlay?! You aren't specifying it on your OVRPRTF.

Furthermore -- you said something about an overlay making your report 1 page longer. I don't see why it would change the number of pages? An overlay is an image that overlays the text on the page. So it doesn't change the number of pages, it prints on the same pages with your existing text.

Try adding the following to your OVRPRTF
Code:
DEVTYPE(*AFPDS) FRONTOVL(mylib/myoverlay 0 0)
Lastly, I don't understand why you copy an existing spooled file to a PF, then run an RPG program that essentially copies it back to the spool. Why not just use CPYF to copy it back to the spool?
Reply With Quote
  #3  
Old 10-20-2009, 11:39 PM
azmir.silverlake azmir.silverlake is offline
Member
 
Join Date: Oct 2009
Location: Malaysia
Posts: 25
Thanks for reply Scott.

1) I didn't specify Overlay because i use Page Definition and Form Definition. I given to understand that Page Definition and Form Definition are same as Overlay. Am i wrong? Please let me know.

2) Even if i add in
Code:
DEVTYPE(*AFPDS) FRONTOVL(BOSSTM/CAPST)
result still the same.

3) IT Operator told me that i should have extra 1 page. Am i wrong again ?

4) This is for distribution function. That why i copy and reprint again to distribute the new spool file to specify *OUTQ. For example, spool file content report for multiple department. So what i do is regenerate spool file for each department.

Thanks for your time. I only have 2 years experience on RPG. Please guide me.
Reply With Quote
  #4  
Old 10-21-2009, 04:22 AM
azmir.silverlake azmir.silverlake is offline
Member
 
Join Date: Oct 2009
Location: Malaysia
Posts: 25
1) I found something weird .

i add in
Code:
DEVTYPE(*AFPDS) FRONTOVL(BOSSTM/CAPST)
to OVRPRTF.

i print at HP Laserjet 3050, yeah its working. i can see my overlay. But when i print at IBM IP300, my overlay not printed. Do i need to change anything on IP300 ?


2) Refer to my attachment

1st spool file i use
Code:
DEVTYPE(*AFPDS) FRONTOVL(BOSSTM/CAPST)
HP Laserjet 3050 : OK, i can see overlay.
IBM IP300 : Nope. i didn't see any overlay.


2nd spool file i use
Code:
DEVTYPE(*LINE) PAGDFN(BOSSTM/CAPST) +                  
                          FORMDF(BOSSTM/CAPST)

HP Laserjet 3050 : Cannot print at all.
IBM IP300 : Perfect. Everything look nice.


3rd spool file i use
Code:
EVTYPE(*AFPDS) PAGDFN(BOSSTM/CAPST) +                  
                          FORMDF(BOSSTM/CAPST) FRONTOVL(BOSSTM/CAPST)
HP Laserjet 3050 : OK, i can see overlay.
IBM IP300 : Nope. i didn't see any overlay.


4th spool file i use
Code:
DEVTYPE(*AFPDS) PAGDFN(BOSSTM/CAPST) +                  
                          FORMDF(BOSSTM/CAPST)
HP Laserjet 3050 : OK, i can see overlay.
IBM IP300 : Nope. i didn't see any overlay.



Anyone out there facing similar issue, please speak up. Hope you can enlighten me.

Thanks everyone.
Attached Images
 
Reply With Quote
  #5  
Old 10-21-2009, 07:05 AM
bryan641's Avatar
bryan641 bryan641 is offline
Super Member
 
Join Date: May 2006
Posts: 1,256
Quote:
3) IT Operator told me that i should have extra 1 page. Am i wrong again ?
The IT Operator is wrong. An overlay doesn't add any pages.

How are those two printers defined? If I remember correctly, host print transform TRANSFORM(*YES) doesn't handle overlays applied to a spool with the FRONTOVL() attribute. For that you need an IPDS printer. Others in this forum will correct me if I'm wrong.

At least for our printers, I can't use the FRONTOVL() attribute. Instead, I have to use the OVERLAY keyword in the AFP print file definition. You would have to have a generic AFP print file (instead of QSYSPRT) that you use to write the overlay anytime you have a page break, and write your 198-char field for each record read as you are already doing.

BTW, is there a reason you're trying to apply an overlay after-the-fact like this? Can you not change the program that creates the first spool to add the overlay at that time?

--Bryan
Reply With Quote
  #6  
Old 10-21-2009, 07:50 AM
azmir.silverlake azmir.silverlake is offline
Member
 
Join Date: Oct 2009
Location: Malaysia
Posts: 25
Quote:
The IT Operator is wrong. An overlay doesn't add any pages.
If that so , how about my 2nd spool file if you see my attachment ? That spool file contain extra 1 page. What happen ? I`m just curious.

Quote:
How are those two printers defined? If I remember correctly, host print transform TRANSFORM(*YES) doesn't handle overlays applied to a spool with the FRONTOVL() attribute. For that you need an IPDS printer. Others in this forum will correct me if I'm wrong.
HP Laserjet 3050 is attached on my pc. So i just create a printer session and didn't defined anything. For IBM IP300, i`m not sure. I will ask IT Operator how he define it later.

Quote:
At least for our printers, I can't use the FRONTOVL() attribute. Instead, I have to use the OVERLAY keyword in the AFP print file definition. You would have to have a generic AFP print file (instead of QSYSPRT) that you use to write the overlay anytime you have a page break, and write your 198-char field for each record read as you are already doing.
Are you saying that i cannot use QSYSPRT with overlay on IPDS printer ? I assume IBM IP300 is IPDS printer.

Quote:
BTW, is there a reason you're trying to apply an overlay after-the-fact like this? Can you not change the program that creates the first spool to add the overlay at that time?
I'm not clearly understand your question. The 1st time i generate the spool file, it must be *SCS. If otherwise i cannot copy to PF.

Code:
CPYSPLF    FILE(&PRTF) TOFILE(&OUTF) SPLNBR(*LAST) +       
             TOMBR(&PRTF) CTLCHAR(*PRTCTL)

Thanks for reply bryan. Hope i answer all your question.
Reply With Quote
  #7  
Old 10-23-2009, 07:25 AM
bryan641's Avatar
bryan641 bryan641 is offline
Super Member
 
Join Date: May 2006
Posts: 1,256
Quote:
Originally Posted by azmir.silverlake View Post
If that so , how about my 2nd spool file if you see my attachment ? That spool file contain extra 1 page. What happen ? I`m just curious.
I expect the extra page has to do with your PAGDEF and FORMDEF objects. I haven't used either, but they could easily be causing overflow at a different location. When you release the second report, what does the extra page look like? Or maybe PAGDFN & FORMDF create a "dummy" page in the spool that is printed along with each subsequent page? I don't know.

Quote:
Originally Posted by azmir.silverlake View Post
HP Laserjet 3050 is attached on my pc. So i just create a printer session and didn't defined anything. For IBM IP300, i`m not sure. I will ask IT Operator how he define it later.
On the printer session, Select "Configure" from the "Communication" menu. Then click the "Setup..." button next to the printer radio button. This will tell you whether Host Print Transform is enabled and what printer type & model the server is generating printer code for.

Quote:
Originally Posted by azmir.silverlake View Post
Are you saying that i cannot use QSYSPRT with overlay on IPDS printer ? I assume IBM IP300 is IPDS printer.
What I meant to say is that you NEED an IPDS printer to use the overlay attribute on a QSYSPRT print file.

Quote:
Originally Posted by azmir.silverlake View Post
I'm not clearly understand your question. The 1st time i generate the spool file, it must be *SCS. If otherwise i cannot copy to PF.
My question is why you can't just change the first time you generate the spool file to apply the overlay. Why are you copying the spool file to a database file to re-create it with an overlay? While I've never added an overlay that way, it doesn't mean you don't have a good reason. But why don't you just add
Code:
OVRPRTF QSYSPRT FRONTOVL(youroverlay) /* other parms, etc */
when you first create the spool?

Also, if you need the overlay to work on a NON-IPDS printer, using TRANSFORM(*YES), I believe you'll NEED to create a specific *AFP spool file with the OVERLAY keyword in the DDS, rather than using FRONTOVL() on an *SCS print file.

--Bryan
Reply With Quote
Reply

Tags
form definition, overlay, page definition, printing

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:24 AM.