How do you code footers in DDS Print File?

80 pts.
Tags:
AS400 RPGLE
DDS Printer files
I need to print a footer on every page of a report. Thought it would be simple like headers. If anyone has the answer let me know. Thx.

Software/Hardware used:
RPGLE AS400 iSeries Printer Files

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    It's done pretty much exactly like a header. Create a record format named, e.g., FOOTER that lays out what you need. When overflow arrives, write your FOOTER, then write your HEADER format. The FOOTER format should skip-before to the line you want your footer to start printing on. (The HEADER does almost the opposite, skip-before to a line at the top instead of near the bottom.) Naturally, you avoid writing FOOTER before the 1st-page HEADER, and avoid writing your HEADER after your last-page FOOTER. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    You may want to use the File Information Data Structure to determine the line count so you can decide when to print the footer.
    FMYFILE    O    F  132        PRINTER INFDS(PRTFBK)
    DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++Comments++++++++++
    DPRTFBK           DS
    D CUR_LINE              367    368I 0                                      * Current line num
    
    49,600 pointsBadges:
    report
  • TomLiotta
    By setting page size and OVRFLW() for the printer file, it shouldn't be necessary to keep track of the line count. With OVRFLW() kept external to the program, it could be changed with CHGPRTF or OVRPRTF if circumstances changed. Depending on exactly how programming is coded, any skip-before for the FOOTER format might become space-before or -after. I would first use the builtin overflow support. If that couldn't be made to work (for whatever the footer might be showing), then I'd go to the File Information Data Structure to control it myself in code. Whenever I can, I like to rely on external file descriptions to guide what the program does. Tom
    125,585 pointsBadges:
    report
  • Kdbwheels1
    Thanks everyone for great answers! I move on *in33 if overflow is on. But the footer never gets written! Can the problem be that I have a line # in the DDS for the footer? My code is simple: if *in33 = *ON; write footer; writer header; endif; DDS also simple: Header Detail Footer (where footer is designated to be written on line # 62)
    80 pointsBadges:
    report
  • Jfranz
    if footer not printing, display spooled file (wrksplf cmd, opt 5) and see if line 62 appears but is blank?. We dont see the dds code, so is the footer print conditional? Assume that form length > 62?
    55 pointsBadges:
    report
  • Kdbwheels1
    Thank you! Thank you! JFranz, TomLiotta, Philip1jb. I was given the task and realized that I had never written a footer!! I got such a brain freeze. Big Answer was the SKIPB code. I misled you - the report wasn't simple. It had 12 places where overflow could occur. And I had not placed the "write footer" at every instance of the overflow if code. Again thank you - you guys are the BEST!!!
    80 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following