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
 

 

Query regarding COBOL

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

New User


Joined: 12 Sep 2005
Posts: 28

PostPosted: Fri Sep 16, 2005 6:09 pm    Post subject: Query regarding COBOL
Reply with quote

We code BLOCK CONTAINS 8000 (say) RECORDS in DATA DIVISION of a file section of a COBOL program.

As far as I know, these many records are read in one go from the memory. (not sure though!!)

But the program can read only one record at a time.

So is there any buffer kind of thing where these records are stored?

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

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Sep 17, 2005 5:23 am    Post subject:
Reply with quote

Hi Ajay,

The OS, at the request of the pgm, reads blks of recs into buffers (1 blk per buffer). Blk, rec, and buffer info is supplied by a combination of DSCB, Label, JCL DCB and/or pgm FD info.

When a COBOL pgm reads a rec, the 1st read fills all buffers w/data (blks). A pointer to the 1st rec of the 1st blk in the 1st buffer is presented to the pgm. On the next pgm read the pointer is then set to the next rec in the buffer, and so on until the last rec in the buffer is "read".

At that point the pointer is set to the 1st rec of the next buffer. The 1st buffer now is overlaid by a blk read from the external media. This is done in such a way as to "overlap" with the processing of the previous rec to make the whole process as efficient as possible.

And of course, this goes on until the entire file is read and processed.

So, the main point to remember is that when a pgm "reads" a rec it generally results in the buffer pointer being advanced to the next rec in the buffer. The data has previously been physically transferred to the pgm's memory long before the "read".
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 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
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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