how to use a printer file in a program cobol

185 pts.
Tags:
AS/400 printing
COBOL
Printer files
hi,

how to use a printer file in a program cobol.

i have the following:

(I wanna know if the write part is correct) 

MOVE M1DESC TO M1DESC-DSP.            MOVE M1DESC-DSP TO R1DESC-PRT.        MOVE PRINTER-LINE TO HIPR01R-RECORD.

 WRITE HIPR01R-RECORD FROM PRINTER-LINE.

Regards

Sylvana.



Software/Hardware used:
os/400

Answer Wiki

Thanks. We'll let you know when a new response is added.

you may want to add this after the WRITE instruction

AFTER ADVANCING 1 LINE

Discuss This Question: 2  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 depends on the printer file. Without seeing the printer file definition of the print line identified as HIPR01R-RECORD, there's no way to know. (AFTER ADVANCING 1 LINE would be the default behavior.) How many record formats are defined? Is the printer file externally described? Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    BTW, if you have this line:
    MOVE PRINTER-LINE TO HIPR01R-RECORD.
    ...then this line:
     WRITE HIPR01R-RECORD FROM PRINTER-LINE
    ...should only need to be:
    WRITE HIPR01R-RECORD
    You don't need the FROM if you've already done the MOVE. Also, if you do use the FROM, then you don't need the MOVE. Use one or the other rather than using both. Tom
    125,585 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