User`s guide

90 DC 900-1406E
BSCTRAN Programmer’s Guide
/* Use common rdblock for BSCWRIT and BSCREAD */
TRANBUF rdblock; /* rdblock for ICP responses */
.
struct dsc$descriptor_s wr_recbuf; /* Write record buffer */
.
/********************************************************************/
/* Call BSCASL to assign I/O channel. */
/* Open the SEND file and get one record at a time. */
/* Build the write record buffer: You can call BSCWRIT for each record*/
/* (with record separator appended), or concatenate several records */
/* (separated by record separators). */
/********************************************************************/
.
do /* Loop to handle unexpected responses */
{
/* Write the current record buffer to the ICP */
retcode = BSCWRIT (&rdblock, &wr_recbuf, &action, &dtime, FALSE);
if (retcode == RCUNR)
{
/* Handle the unexpected response contained in the rdblock: for */
/* example, you could ignore reports, abort on fatal errors, */
/* and write */
/* unexpected data to a file by calling BSCREAD (see */
/* BSCREAD example). */
}
else if (retcode != RCOK)
{
/* Abort program on fatal errors other than RCUNR */
/* (such as timeout of ‘dtime’ (RCTO error). */
}
} while (retcode == RCUNR);
.
/* After the last record has been sent, close the file. */