MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cobol Write for printer file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ravinan
Beginner


Joined: 30 Mar 2005
Posts: 4
Topics: 2

PostPosted: Wed Mar 30, 2005 9:10 am    Post subject: Cobol Write for printer file Reply with quote

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
View user's profile Send private message
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Wed Mar 30, 2005 3:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
ravinan
Beginner


Joined: 30 Mar 2005
Posts: 4
Topics: 2

PostPosted: Thu Mar 31, 2005 3:45 am    Post subject: Reply with quote

it is not working. can any one give any other alternative?
Back to top
View user's profile Send private message
kok328
Beginner


Joined: 05 Nov 2003
Posts: 19
Topics: 0
Location: MI, USA

PostPosted: Fri Apr 01, 2005 9:59 am    Post subject: Reply with quote

Try RECORDING MODE IS FBA
Back to top
View user's profile Send private message Send e-mail AIM Address
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Fri Apr 01, 2005 10:35 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Fri Apr 01, 2005 11:09 am    Post subject: Reply with quote

Quote:

Try RECORDING MODE IS FBA


hmm Kok328, do we even have such mode in cobol ? As far as I know the valid recording modes are:

Code:

Recording Mode F (Fixed)
Recording Mode V (variable)
Recording Mode U (Fixed or variable)
Recording Mode S (Spanned)


You can find the same here also.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/5.2.10?DT=20020920180651

Can you share the source for that statement ?

Thanks

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group