View previous topic :: View next topic
|
Author |
Message |
rakeshnaredlla
New User
Joined: 04 Aug 2008 Posts: 26 Location: Hyderabad
|
|
|
|
Hi,
I have converted a cobol 1 code to cobol 390 using CCCA tool. The problem which I am facing in this cobol 390 code is, it is writing first byte of record with LCP's data i.e '-' or '1' or etc. I just don't want this LCP's field to be written. I connot figure it out from where it is writing this LCP's.
Note: In my write statement I am not using this LCP's but even though it wrote.
Please let me is there any way to stop writing this LCP field.Also let me know how these LCP work in cobol 390. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Go through your program and remove every AFTER ADVANCING clause on every WRITE statement. |
|
Back to top |
|
|
rakeshnaredlla
New User
Joined: 04 Aug 2008 Posts: 26 Location: Hyderabad
|
|
|
|
Thank you Robert
I have made the code changes as per your suggestion and I am getting spaces in LCP's. How can I make this LCP not to write into my file i.e I want to skip this writing to my file Please let me know is there any way to do so. Actually my cobol code is already having a carriage control defined in the file layout and after converting the code to LCP is getting added, because of this extra byte is getting added into the record.So, I want this LCP's not to be written. Also please let me know can I populate a blank in this LCP' field.
Thank You,
Rakesh |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Rakesh,
Can you show us the DD stmt for the report and its FD from the COBOL pgm? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Rakesh,
Please review you most recent reply. . .
Quote: |
I have made the code changes as per your suggestion and I am getting spaces in LCP's. How can I make this LCP not to write into my file i.e |
Quote: |
I want this LCP's not to be written. Also please let me know can I populate a blank in this LCP' field. |
I'm confused. . .
It should be no trouble to have the lcp, not have the lcp, have a first position blank or have a first position for data.
As Jack mentions, it will help if you post the requested info and one WRITE that is producing undesirable results. |
|
Back to top |
|
|
rakeshnaredlla
New User
Joined: 04 Aug 2008 Posts: 26 Location: Hyderabad
|
|
|
|
Hi,
Please find the layout which has been used in my program and JCL
Code: |
SELECT FILE1NF ASSIGN TO DA-S-OUTPUT1.
FD FILE1NF
BLOCK CONTAINS 0.
01 PRINT-LINE.
05 CARR-CONTROL PIC X.
05 PRNT-LINE PIC X(99). |
This above code is the converted code
Jcl declaration
Code: |
OUTPUT1 DD DSN=TEST.SAMPLE.FILE,
DISP=(NEW,CATLG,DELETE),
UNIT=PROD,
SPACE=(TRK,(40,5)),
DCB=(RECFM=FB,LRECL=100,BLKSIZE=23400,BUFNO=2) |
After the conversion it is taking up 1 byte LCP record and it is abending because of mismatch of file length declaration in program and JCL. So for this reason I don't want an LCP field comming into my file.
Please also let me know will there be any difference while Printing the file in which we remove the LCP' from that of one which have LCP's.
Reg-2: How to write a blank in LCP field.
Thank you ,
Rakesh |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What are the options for your COBOL compile? From the COBOL Programming Guide:
Quote: |
2.4.4 ADV
ADV has meaning only if you use WRITE . . . ADVANCING in your source code. With ADV in effect, the compiler adds 1 byte to the record length to account for the printer control character. |
not to mention
Quote: |
2.4.6 AWO
If you specify AWO, an implicit APPLY WRITE-ONLY clause is activated for all files in the program that are eligible for this clause. To be eligible, a file must have physical sequential organization and blocked variable-length records. |
so the compile options have to be set correctly as well. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Something is not making it thru to the topic. . .
As an experiment, add a new SELECT for:
SELECT TEST-100 ASSIGN TO UT-S-TEST100.
Add an FD for TEST-100. Open that file as output.
Then:
Code: |
MOVE SPACES TO PRINT-LINE-100.
WRITE PRINT-LINE.
MOVE ALL '9' TO PRINT-LINE-100.
WRITE PRINT-LINE. |
Close the file.
Use the same JCL that has already been posted, changing the ddname.
What happens? |
|
Back to top |
|
|
|