02.07.2013 Views

Type III C lass A Program

Type III C lass A Program

Type III C lass A Program

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RDBUF Macro<br />

Purpose:<br />

RDBUF reads a record from a disk file.<br />

Format:<br />

label<br />

fcb<br />

alabel<br />

elabel<br />

Usage:<br />

I I RDBUF I fcb I<br />

is an optional statement label<br />

is the lahel of the FCB naming the file to be read<br />

is the label of an input buffer. If omitted, the<br />

area specified in the FeB is used<br />

is the entry of<br />

omitted, errors,<br />

ignored.<br />

an error-handling routine.<br />

including end of file,<br />

If<br />

are<br />

RDBUF returns one item each time it is executed. The item<br />

returned is specified by the item number field of the File<br />

Control Block at FCB+26. This number is incremented each<br />

time RDBUF is executed. It may be set to any value,<br />

allowing direct access to files.<br />

The file read may have fixed or variable length records i • but<br />

the buffer named AREA= must be large enough for the longest<br />

record in the file. The buffer named with RDBUF overrides<br />

that specified in FCB if it is different.<br />

Each time RDBUF is executed, it links via a CMS SVC<br />

instruction to a routine that returns control when the<br />

record requested bas been read in. If no error occurs,<br />

register 15 is set to zero on return. If an error or end of<br />

file occurs, register 15 contains a code indicating the type<br />

of error,. See Figure 21 for a list of RDBUF error returns.<br />

If ERROR1 is supplied, control goes to that point on an<br />

error. If no label is supplied, control returns immediately<br />

following RDBUF. regardless of error.. Note that end of file<br />

is always consid'ered an error. An error handling routine<br />

should start with the CREOF macro, to detect end of file ..<br />

284 RDBUF Macro

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!