We have just seen an example of how BRMS can keep information about media written using tape file output. Input processing is very similar, with the exception of the parameters on the SETMEDBRM command.
You can use the following program to read the records that were written by the first example:
FTAPFIL IF F 26 SEQ
FTAPRPT O F 26 PRINTER
F*******************************************************************
F* Program: TAPFIL2
F* Purpose: This program will read the letters of the alphabet
F* from a file on tape through a tape file. The program
F* will read the 100 records created with the other
F* example and dump them to the printer
F*******************************************************************
IALPHA DS 26
I*******************************************************************
C DO 100 Loop 100 times
C READ TAPFIL ALPHA 99Read alphabet
C EXCPTALFOUT Write alphabet
C END End of loop
C SETON LR End the program
O*******************************************************************
O* Exception output defining the alphabet to be printed
O*
O*******************************************************************
OTAPRPT E ALFOUT
O ALPHA 26
This example also requires a printer file object so that the records are printed. Use the CRTPRTF command to create a printer file object.
The same processing would occur, namely:
CALL BRMTAPF/TAPFIL2
Set Media Controls using BRM (SETMEDBRM) Type choices, press Enter. Input controls: File label . . . . . . . . . . TAPEFILXMP Select version . . . . . . . . *CURRENT 1-999, *SAME, *CURRENT Allow conversion . . . . . . . . *NO *SAME, *NO, *YES Media class . . . . . . . . . . *SAME *NONE, *SAME, QIC120... Move policy . . . . . . . . . . *SAME *NONE, *SAME, OFFSITE... Secure volume . . . . . . . . . *SAME *SAME, *NO, *YES Retention: Retention type . . . . . . . . *SAME *SAME, *DATE, *DAYS, *NONE... Retain media . . . . . . . . . *SAME *SAME, Date, Number File group . . . . . . . . . . . *NONE *SAME, *NONE, *SYSTEM, *BKU... File group type . . . . . . . . *NONE *SAME, *NONE, *BKU, *ARC Mark volumes for duplication . . *NO *SAME, *NO, *YES Mark history for duplication . . *NO *SAME, *NO, *YES Text . . . . . . . . . . . . . . *SAME Bottom F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
BRMS will look for an open of a tape file called TAPFIL, and will prompt the operator to insert the tape volume corresponding to the most recent version of this file. If this file were in ASCII format, we could specify that we do not want i5/OS to convert the record to EBCDIC automatically. Specify Allow conversion as Yes to do this.