Thursday, December 8, 2011

JCL: How buffer processing works for sequential files


In the normal course of events, a program will:

  1. Issue a GET request. 

  2. Go into a wait until the first I/O completes. This I/O will bring in to storage a number of blocks equivalent to the BUFNO specified for that data set. If no BUFNO is specified, a default of five blocks will be retrieved on this first I/O.

  3. Be returned the first record of the first buffer.

  4. Process that record.

  5. Issue a GET for the next record. This record will be returned from the in-storage buffer with no I/O required.

  6. Continue issuing GETs until the last record of the last buffer is returned.

  7. Issue a GET for the next record. At this point, another I/O must be issued to retrieve the next BUFNO number of blocks. Again, the program is put into a wait until the I/O completes.

  8. Carry on in this manner until the program completes.As with BSAM, there is a limit of 240 KB per I/O. If more than 240 KB worth of buffers are specified, QSAM will do double buffering. That is, QSAM will schedule a second I/O while the program is processing the results of the previous I/O. This is transparent to the application program, which simply continues to be returned records for every GET request.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.