Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts COBOL MVS options BiswajitDG COBOL Programming 8 Fri Apr 06, 2018 12:35 am
No new posts batch cobol/db2 paragraph fall thru a... alois eisshofer COBOL Programming 5 Wed Mar 14, 2018 12:21 am
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us