Skip to main content

This is our first attempt to use the RAW print mode. We are reading in a file containing the PCL code necessary to print insurance forms. We can't seem to find a good combination of record lengths for the input file and/or the print file - we seem to be getting truncated PCL code at the printer and improperly formatted insurance forms. Any experience out there with doing this so you can point us in the right direction? Thanks.

The code currently looks like this:

       FILE-CONTROL.
           SELECT IN-FILE ASSIGN TO RANDOM, IN-FILE-NAME;
               ORGANIZATION IS BINARY SEQUENTIAL
               FILE STATUS IS A-STAT.
           SELECT RPT-FILE
             ASSIGN TO PRINT, PTR-NAME;
             FILE STATUS IS D-STAT. 
       DATA DIVISION.
       FILE SECTION.
       FD  IN-FILE
           LABEL RECORDS ARE STANDARD.
       01  IN-RECORD           PIC X(132). 
       FD  RPT-FILE
           LABEL RECORD OMITTED.
       01  PRINT-REC.
           05  PRINT-LINE       PIC X(132).

           OPEN OUTPUT RPT-FILE.
           MOVE RAWPRINT-FILE-NAME TO IN-FILE-NAME.
           OPEN INPUT  IN-FILE.
           MOVE 1 TO CTL-RETURN.
           MOVE SPACES TO IN-RECORD.
           READ IN-FILE AT END MOVE 9 TO CTL-RETURN.
           PERFORM UNTIL CTL-RETURN NOT = 1
              MOVE IN-RECORD TO PRINT-REC
              WRITE PRINT-REC
              MOVE SPACE TO IN-RECORD
              READ IN-FILE AT END MOVE 9 TO CTL-RETURN END-READ
           END-PERFORM.
           CLOSE RPT-FILE.


#rmcobolrawprint

This is our first attempt to use the RAW print mode. We are reading in a file containing the PCL code necessary to print insurance forms. We can't seem to find a good combination of record lengths for the input file and/or the print file - we seem to be getting truncated PCL code at the printer and improperly formatted insurance forms. Any experience out there with doing this so you can point us in the right direction? Thanks.

The code currently looks like this:

       FILE-CONTROL.
           SELECT IN-FILE ASSIGN TO RANDOM, IN-FILE-NAME;
               ORGANIZATION IS BINARY SEQUENTIAL
               FILE STATUS IS A-STAT.
           SELECT RPT-FILE
             ASSIGN TO PRINT, PTR-NAME;
             FILE STATUS IS D-STAT. 
       DATA DIVISION.
       FILE SECTION.
       FD  IN-FILE
           LABEL RECORDS ARE STANDARD.
       01  IN-RECORD           PIC X(132). 
       FD  RPT-FILE
           LABEL RECORD OMITTED.
       01  PRINT-REC.
           05  PRINT-LINE       PIC X(132).

           OPEN OUTPUT RPT-FILE.
           MOVE RAWPRINT-FILE-NAME TO IN-FILE-NAME.
           OPEN INPUT  IN-FILE.
           MOVE 1 TO CTL-RETURN.
           MOVE SPACES TO IN-RECORD.
           READ IN-FILE AT END MOVE 9 TO CTL-RETURN.
           PERFORM UNTIL CTL-RETURN NOT = 1
              MOVE IN-RECORD TO PRINT-REC
              WRITE PRINT-REC
              MOVE SPACE TO IN-RECORD
              READ IN-FILE AT END MOVE 9 TO CTL-RETURN END-READ
           END-PERFORM.
           CLOSE RPT-FILE.


#rmcobolrawprint

Have you tried reading the file and writing to the printer one byte at the time (using X(1) as the file record?


This is our first attempt to use the RAW print mode. We are reading in a file containing the PCL code necessary to print insurance forms. We can't seem to find a good combination of record lengths for the input file and/or the print file - we seem to be getting truncated PCL code at the printer and improperly formatted insurance forms. Any experience out there with doing this so you can point us in the right direction? Thanks.

The code currently looks like this:

       FILE-CONTROL.
           SELECT IN-FILE ASSIGN TO RANDOM, IN-FILE-NAME;
               ORGANIZATION IS BINARY SEQUENTIAL
               FILE STATUS IS A-STAT.
           SELECT RPT-FILE
             ASSIGN TO PRINT, PTR-NAME;
             FILE STATUS IS D-STAT. 
       DATA DIVISION.
       FILE SECTION.
       FD  IN-FILE
           LABEL RECORDS ARE STANDARD.
       01  IN-RECORD           PIC X(132). 
       FD  RPT-FILE
           LABEL RECORD OMITTED.
       01  PRINT-REC.
           05  PRINT-LINE       PIC X(132).

           OPEN OUTPUT RPT-FILE.
           MOVE RAWPRINT-FILE-NAME TO IN-FILE-NAME.
           OPEN INPUT  IN-FILE.
           MOVE 1 TO CTL-RETURN.
           MOVE SPACES TO IN-RECORD.
           READ IN-FILE AT END MOVE 9 TO CTL-RETURN.
           PERFORM UNTIL CTL-RETURN NOT = 1
              MOVE IN-RECORD TO PRINT-REC
              WRITE PRINT-REC
              MOVE SPACE TO IN-RECORD
              READ IN-FILE AT END MOVE 9 TO CTL-RETURN END-READ
           END-PERFORM.
           CLOSE RPT-FILE.


#rmcobolrawprint

Have you tried reading the file and writing to the printer one byte at the time (using X(1) as the file record?


This is our first attempt to use the RAW print mode. We are reading in a file containing the PCL code necessary to print insurance forms. We can't seem to find a good combination of record lengths for the input file and/or the print file - we seem to be getting truncated PCL code at the printer and improperly formatted insurance forms. Any experience out there with doing this so you can point us in the right direction? Thanks.

The code currently looks like this:

       FILE-CONTROL.
           SELECT IN-FILE ASSIGN TO RANDOM, IN-FILE-NAME;
               ORGANIZATION IS BINARY SEQUENTIAL
               FILE STATUS IS A-STAT.
           SELECT RPT-FILE
             ASSIGN TO PRINT, PTR-NAME;
             FILE STATUS IS D-STAT. 
       DATA DIVISION.
       FILE SECTION.
       FD  IN-FILE
           LABEL RECORDS ARE STANDARD.
       01  IN-RECORD           PIC X(132). 
       FD  RPT-FILE
           LABEL RECORD OMITTED.
       01  PRINT-REC.
           05  PRINT-LINE       PIC X(132).

           OPEN OUTPUT RPT-FILE.
           MOVE RAWPRINT-FILE-NAME TO IN-FILE-NAME.
           OPEN INPUT  IN-FILE.
           MOVE 1 TO CTL-RETURN.
           MOVE SPACES TO IN-RECORD.
           READ IN-FILE AT END MOVE 9 TO CTL-RETURN.
           PERFORM UNTIL CTL-RETURN NOT = 1
              MOVE IN-RECORD TO PRINT-REC
              WRITE PRINT-REC
              MOVE SPACE TO IN-RECORD
              READ IN-FILE AT END MOVE 9 TO CTL-RETURN END-READ
           END-PERFORM.
           CLOSE RPT-FILE.


#rmcobolrawprint

I tried that. It results in 1 character per line in the print out.