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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IHEFILE--PL/I File Access Routine<br />

Purpose:<br />

IHEFILE converts<br />

corresponding CMS<br />

WRBUF.<br />

PL/I file access requests<br />

commands S-rATE. ERASE" FINIS,<br />

into the<br />

RDBUF" and<br />

The user should be familiar with the operations of the<br />

above-named CMS file system routines. and the error codes<br />

produced by them.<br />

Calling Sequence<br />

CALL IHEFILE ( FCB ) ;<br />

where FeB (File Control Block) is a PL/I structure in the<br />

form illustrated below.<br />

DECLARE 1 FCB,<br />

2 COMMAND CHAR ( 9 ) i, /*CMS command desired */<br />

2 FILENAME CHAR(S) /* CMS filename */<br />

2 FILETYPE CHARCS) /* CMS filetype */<br />

2 CARD NUMBER FIXED BIN (31,0).<br />

/* record number - RDBlJF/WRBUF only<br />

2 STATUS FIXED BIN(31.0),<br />

/* CMS r,.!turn code - o means OK */<br />

2 CARD BUFFER CHAR(80);<br />

/* 80 byte record to be read or written<br />

The SO-byte record need not necessarily be a single<br />

character string. The next 80 bytes of the structure (after<br />

STATUS) are used, whatever they may be. Therefore, binary<br />

integers, character strings, floating-point numbers. etc.<br />

can be used in the following ways:<br />

(1) adding them to structure in place of CARD_BUFFER,<br />

(2) defining another structure positioned on top of<br />

CARD_BUFFER/, or<br />

(3) converting all information into a concatenated<br />

character string and separating out on input by<br />

SOBSTR.<br />

CARD NUMBER must be set for RDBUF/wRBUFusage; it is ignored<br />

for STATE" ERASE, and FINIS. If sequential writing or<br />

reading is to be done, the PL/I program must increment the<br />

CARD NUMBER or set it to zero. During writing. if the card<br />

already exists, it is replaced by the new card. If the card<br />

does not exist (that is, the file is being expanded), the<br />

position of the end-of-file is moved and the new card added<br />

to the file.<br />

STATUS is the CMS return code for the last IHEFILE issued<br />

352 PL/I <strong>Program</strong>ming<br />

*/<br />

*/

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

Saved successfully!

Ooh no, something went wrong!