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
 

 

Is this the problem with READ Statement in Cobol.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Mohan Makana

New User


Joined: 07 Feb 2006
Posts: 18

PostPosted: Tue Feb 27, 2007 6:49 pm    Post subject: Is this the problem with READ Statement in Cobol.
Reply with quote

Hi,

My input file's record length(LRECL) is 760 bytes. but the first record of the input file contained only 350 bytes of data. While READing input file in my program ...it is filling all 760 bytes with the current record data along with the immediate next record data. How do I have to stop this from happening...is this the problem with the input file or with the READ statement.

Thanks,
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Feb 27, 2007 6:53 pm    Post subject:
Reply with quote

What is the COBOL blocksize?
What is the file blocksize?
What is the COBOL recfm?
What is the file recfm?
What is the COBOL lrecl?
What is the file lrecl?
Back to top
View user's profile Send private message
Mohan Makana

New User


Joined: 07 Feb 2006
Posts: 18

PostPosted: Tue Feb 27, 2007 7:01 pm    Post subject:
Reply with quote

Cobol :

BLOCK CONTAINS 0 CHARACTERS
RECORDING MODE IS V
LABEL RECORDS ARE STANDARD
----
Max. Record Length is 760 as it is using different layouts.
--------------------------------------------------------------------
JCL :
DCB=(RECFM=VB,LRECL=760,BLKSIZE=0,DSORG=PS)
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Feb 27, 2007 7:07 pm    Post subject: Re: Is this the problem with READ Statement in Cobol.
Reply with quote

Mohan Makana wrote:
My input file's record length(LRECL) is 760 bytes. but the first record of the input file contained only 350 bytes of data. While READing input file in my program ...it is filling all 760 bytes with the current record data along with the immediate next record data. How do I have to stop this from happening...is this the problem with the input file or with the READ statement.
I can't think of how you can get a read statement to do that.
This sounds like the llbb at the front of the first record says that it is 760 bytes.
Take a hex dump of the block and look to confirm.
Back to top
View user's profile Send private message
Mohan Makana

New User


Joined: 07 Feb 2006
Posts: 18

PostPosted: Tue Feb 27, 2007 8:34 pm    Post subject:
Reply with quote

Cobol :

BLOCK CONTAINS 0 CHARACTERS
RECORDING MODE IS V
LABEL RECORDS ARE STANDARD
----
Max. Record Length is 760 as it is using different layouts.
--------------------------------------------------------------------
JCL :
DCB=(RECFM=VB,LRECL=760,BLKSIZE=0,DSORG=PS)




Hi William,

Does it make any difference if we didn't specify
BLOCK CONTAINS 0 CHARACTERS in the above FD section.

Thanks
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Feb 27, 2007 8:53 pm    Post subject:
Reply with quote

Bill is talking about the preamble (first 4 bytes) in the record where you may find the recordlength of VB files. You can also investigate using TSO.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Feb 27, 2007 11:37 pm    Post subject:
Reply with quote

Mohan Makana wrote:
Does it make any difference if we didn't specify
BLOCK CONTAINS 0 CHARACTERS in the above FD section.
Not on an input file.
Again, you need to get a hex dump of at least the first 8 bytes of the first block (you did say it was the first record read, right?) so that you can verify the actual record length of the first record.
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: Wed Feb 28, 2007 12:15 am    Post subject:
Reply with quote

Hello,

It would be interesting to see the code and the jcl that created this file. . .
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Wed Feb 28, 2007 5:21 pm    Post subject: Re: Is this the problem with READ Statement in Cobol.
Reply with quote

Hi,

Could you please post the assign-to clause of your input file.

May be that is creating problem.

Actually I encountered the same problem but not on mainframes .
when I was using PC cobol for practice sessions got same problem.

Thanks,
-kapil.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Feb 28, 2007 8:12 pm    Post subject:
Reply with quote

Check to DSN characteristics; just might say RECFM=FB
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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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