Midrange News for the IBM i Community


Posted by: renojim
Identical overrides give different results
has no ratings.
Published: 13 Sep 2011
Revised: 23 Jan 2013 - 1587 days ago
Last viewed on: 28 May 2017 (4184 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Identical overrides give different results Published by: renojim on 13 Sep 2011 view comments(14)

I have two OVRPRTF's in a CL, overriding two printer files that are identical but with different names to two different outq's. Originally they included overlays, but I've removed the overlays from the equation and still have the same problem.

OVRPRTF FILE(PRTF1) DEVTYPE(*AFPDS) +

    OUTQ(OUTQ1) HOLD(*YES) SHARE(*YES)

 

OVRPRTF FILE(PRTF2) DEVTYPE(*AFPDS) +

    OUTQ(OUTQ2) HOLD(*YES) SHARE(*YES)

 

I define them simply in my program:

FFILE1    O    E               PRINTER

FFILE2    O    E               PRINTER

 

and later write to them:

WRITE FILE1R;

WRITE FILE2R;

Now when I print the two spool files, I find that the printing on the second one starts about 4 or 5 lines lower than the other. This is a problem, because I want to use the same overlay for both.  The field names, line and end position numbers, in fact every aspect of the printer files are identical, except their names. I've tried making them USROPN, open the first, write to it, close it, open the second, write to it, close it, makes no difference. Can't find anything that makes any difference. Don't get it. Any ideas?

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: renojim
Premium member *
Comment on: Identical overrides give different results
Posted: 5 years 8 months 15 days 17 hours 31 minutes ago

I should add, the difference is there if I print or look at them in ops nav viewer, but If I compare line by line in a green screen, the line numbers are the same.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Identical overrides give different results
Posted: 5 years 8 months 15 days 17 hours 14 minutes ago

Another thing you could eliminate...

Override both to the same outq.  Do all your checks again - opsnavigator, physical print, etc.

Seems the spooled output is identical internally, it's all the external viewers and writers that are a problem.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Identical overrides give different results
Posted: 5 years 8 months 15 days 17 hours 12 minutes ago

Another thing - you say both spooled files are identical?  You mean if I ran compare source they would match, and if I print them and hold them over each other up to the light they would also match??

What I used to do in this case was create 1 spooled file and in the CL send a copy to each outq.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Identical overrides give different results
Posted: 5 years 8 months 15 days 17 hours 11 minutes ago

You have PRTF1 and PRTF2 in the OVRPRTF command but FILE1 and FILE2 in the RPG source. Can we assume that was just a typo?

Posted by: renojim
Premium member *
Comment on: Identical overrides give different results
Posted: 5 years 8 months 15 days 17 hours 2 minutes ago

Tried overriding to same outq - still the same problem, nothing changed. Yes, If you printed the source of both printer files and held them up to the light, they would match, except for the names. And yes, the file name's a typo, cause I have to change everything when I post. I was not able to paste here, Firefox had some kind of problem with it that I didn't have time to pursue, so I had to type everything out.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Identical overrides give different results
Posted: 5 years 8 months 15 days 16 hours 55 minutes ago

I'm getting really inclined to create the spool file once, and send it to both outq's.

Posted by: renojim
Premium member *
Comment on: Identical overrides give different results
Posted: 5 years 8 months 15 days 16 hours 34 minutes ago

Ok, I'll give that a try, Thanks.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Identical overrides give different results
Posted: 5 years 8 months 15 days 16 hours 30 minutes ago

The PASTE icon/buttons on the Toolbar do give you an issue in FireFox.

If you press the Cut/Copy/Paste keyboard shortcuts, Ctrl+X, Ctrl+C, Ctrl+V it does work (on my PC anyway).

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Identical overrides give different results
Posted: 5 years 8 months 15 days 3 minutes ago

What paste buttons? Firefox has a toolbar? (I must have turned it off to save space.)

As far as the printer file, what happens if you send the files to the opposite printer? In other words, could it be a problem with the printer definition? Could it be a problem at the printer itself (some sort of top margin setting)? What if you send it to a completely different printer?

If you add a SAVE(*YES), you could release to one queue, change the queue, then release the same file to the other queue, and see what happens.

Posted by: renojim
Premium member *
Comment on: Identical overrides give different results
Posted: 5 years 8 months 14 days 22 hours 51 minutes ago

Toolbars are evil. I have more trouble with them and BHO's than anything else. I've banned them.

 

What I found eventually is that for some unknown reason, my printer files were operating at different LPI/CPI's. I didn't specify those values originally, just going with defaults. Don't get that either, but when I specified those values the same in all the overrides, the problem vaporized.

 

But thanks all for the help. Great place, this forum. I'm gonna' have to start paying for it.Cool

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Identical overrides give different results
Posted: 5 years 8 months 14 days 21 hours 57 minutes ago
Edited: Wed, 14 Sep, 2011 at 10:23:58 (2084 days ago)

Are you saying you do NOT see the toolbars at the top of the Comment Edit/Input box?

The Cut/Copy/Paste toolbar buttons are what do NOT work in Firefox, but using the short-cut keyboard keys DOES work (for me anyway). The toolbars are located and identified in the following image:

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Identical overrides give different results
Posted: 5 years 8 months 14 days 21 hours 51 minutes ago

You wouldn't have one of those legacy page separators on the 2nd print file (the one spacing down 4 lines) would you?

What if you used on the first file:

OVRPRTF P1 TOFILE(WORKINGPRINTFILE)

OVRPRTF P2 TOFILE(WORKINGPRINTFILE)

 

And then in your code, do (again) what you said you tried--print one file, close it, then open the 2nd and print to it.

Posted by: renojim
Premium member *
Comment on: Identical overrides give different results
Posted: 5 years 8 months 14 days 21 hours 33 minutes ago

I see the buttons in your editor, which works great except for the paste, which gives me this:

Cntrl-v works fine, however.

 

On the printing problem I'll get back to trying that shortly.

 

Thanks again.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Identical overrides give different results
Posted: 5 years 8 months 14 days 20 hours 24 minutes ago

Sorry - I also misunderstood which toolbars were under discussion. Yes, I see the toolbars on the edit box itself, but I never tried to use those particular buttons. (Keyboard shortcuts are almost always faster than using the mouse.)