Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Not to write LCP's

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Not to write LCP's
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: 7992
Location: Bellevue, IA

PostPosted: Thu Mar 26, 2009 5:15 pm    Post subject:
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    Post subject: Reply to: Not to write LCP's
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    Post subject:
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

Site Director


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

PostPosted: Mon Apr 06, 2009 3:28 am    Post subject:
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    Post subject: Reply to: Not to write LCP's
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: 7992
Location: Bellevue, IA

PostPosted: Thu Apr 09, 2009 6:57 pm    Post subject:
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

Site Director


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

PostPosted: Thu Apr 09, 2009 7:26 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts Can you write 2 recs on SORTOUT when ... Sysaron DFSORT/ICETOOL 6 Thu Feb 23, 2017 12:07 am
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts Compare 2 files & write Indicator... nagendrapgupta SYNCSORT 5 Sun May 15, 2016 10:42 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us