IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Not to write LCP's


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rakeshnaredlla

New User


Joined: 04 Aug 2008
Posts: 26
Location: Hyderabad

PostPosted: Thu Mar 26, 2009 2:11 pm
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 26, 2009 5:15 pm
Reply with quote

Go through your program and remove every AFTER ADVANCING clause on every WRITE statement.
Back to top
View user's profile Send private message
rakeshnaredlla

New User


Joined: 04 Aug 2008
Posts: 26
Location: Hyderabad

PostPosted: Sun Apr 05, 2009 2:33 pm
Reply with quote

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

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Apr 05, 2009 9:29 pm
Reply with quote

Hi Rakesh,

Can you show us the DD stmt for the report and its FD from the COBOL pgm?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 06, 2009 3:28 am
Reply with quote

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. . . icon_confused.gif

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

New User


Joined: 04 Aug 2008
Posts: 26
Location: Hyderabad

PostPosted: Thu Apr 09, 2009 6:44 pm
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 09, 2009 6:57 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 09, 2009 7:26 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
No new posts Compare two files with a key and writ... SYNCSORT 3
No new posts JCL to write the log on to a PDS file JCL & VSAM 10
Search our Forums:

Back to Top