View previous topic :: View next topic |
Author |
Message |
ravinan Beginner
Joined: 30 Mar 2005 Posts: 4 Topics: 2
|
Posted: Wed Mar 30, 2005 9:10 am Post subject: Cobol Write for printer file |
|
|
Hi,
I am working DOS/VS COBOL TO COBOL/VSE migration. There is a problem while using printer file in new compier(cobol/vse).I'm calling a module which contains the following code.
.......................
SELECT PRINT-FILE ASSIGN TO SYS007-UR-1403-S-PRINTER
.................
FD PRINT-FILE
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE OMITTED.
01 PRINT-LINE-OUT PIC X(133)
.....................
ADD 1 TO PAGE-NUMBER.
MOVE PAGE-NUMBER TO HDG1-PAGE.
MOVE HEADING-LINE-1 TO PRINT-LINE-OUT.
WRITE PRINT-LINE-OUT.
MOVE HEADING-LINE-2 TO PRINT-LINE-OUT.
WRITE PRINT-LINE-OUT.
MOVE SPACE TO PRINT-LINE-OUT.
WRITE PRINT-LINE-OUT.
MOVE 4 TO PAGE-COUNT.
...........................
Here problem is the first WRITE is doing nothing, second WRITE is writing
the the first record i.e( text of the HEADING-LINE-1 ) and third WRITE is writing the second record ( test of the HEADING-LINE-2).
I displayed the PRINT-LINE-OUT it showing the right value only, but when I'm writing that it is previous record is coming( as I said first write is doing nothing).
How it can be solved. Is there compiler options will do?
Thanks in advance. |
|
Back to top |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Wed Mar 30, 2005 3:59 pm Post subject: |
|
|
We went thru this a couple of years age. Here is what I use old/new:
-OLD--* SELECT PRINTER ASSIGN TO SYS202-UR-3203-S.
+NEW++ SELECT PRINTER ASSIGN TO SYS202.
FD PRINTER
RECORDING MODE IS F
LABEL RECORDS ARE OMITTED.
01 PRINTER-REC.
05 CC PIC X.
05 PRINT-LINE PIC X(132).
You can write 'FROM' or move WS to FD area. Your choice.
WRITE PRINTER-REC AFTER 1. _________________ Thanks,
NASCAR9 |
|
Back to top |
|
|
ravinan Beginner
Joined: 30 Mar 2005 Posts: 4 Topics: 2
|
Posted: Thu Mar 31, 2005 3:45 am Post subject: |
|
|
it is not working. can any one give any other alternative? |
|
Back to top |
|
|
kok328 Beginner
Joined: 05 Nov 2003 Posts: 19 Topics: 0 Location: MI, USA
|
Posted: Fri Apr 01, 2005 9:59 am Post subject: |
|
|
Try RECORDING MODE IS FBA |
|
Back to top |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Fri Apr 01, 2005 10:35 am Post subject: |
|
|
Here is another example:
SELECT REPORT1 ASSIGN SYS200.
FD REPORT1.
01 REPORT1-PRTLINE.
05 REPORT1-LINE PIC X(133).
INITIALIZE REPORT1-PRTLINE.
WRITE REPORT1-PRTLINE FROM DETAIL-LINE-ONE
AFTER ADVANCING 2 LINES. _________________ Thanks,
NASCAR9 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
|
|