dc. DO VREAD nc. Reads variable record length unlabled tapes. xc. C. ,C. This program reads a variable record tape and puts a "copy" of C. the data on the requested disk file. The user must first, before C. starting the program, set up the tape via: XC. C. $ ALLOCATE MT: TAPE C. $ MOUNT MT:/FOREIGN C. C. Then he RUNs the program VREAD. This program requests a file LC. spec for each file that he wishes to copy on to the disk. If C. the user enters a carriage return, (ret), then no copy is C. made of the program, but the records, and their length are shown. xC. It should be noted that the user can redirect this output, as C. with the DREAD program to a file or the printer via: @C. C. $ ASSIGN/USER xxxx FOR006 C. lC. WHERE xxx is the resulting output device or file. C. If the output is not redirected, it is suggested that the user 4C. may want to un-set the smooth scroll bit on a VT100, to have the C. output proceed rapidly. C. The resulting disk format is: ` C. The number of data bytes in a block I*2 C. followed by the data bytes. The file is terminated ( C. by a zero byte count. 2 c. < c.-end.of.info- c. IMPLICIT INTEGER*4 (A-Z) T PARAMETER BUFSIZ = 4098 C.  EXTERNAL IO$_REWIND, IO$_SKIPFILE, IO$_READLBLK, 1 SS$_ENDOFFILE, SS$_ENDOFTAPE C. H INTEGER*2 IOSB(4), NBYTES CHARACTER FILNAM*30, MSG*120  CHARACTER*4 CMD(2) t DATA CMD/ 'Read', 'Skip' /  BYTE BUF(BUFSIZ) ! INPUT BUFFER <C. C. ......... 10 FORMAT( A ) h20 FORMAT( 5I10 ) C. ......... 0C. C... ASSIGN THE TAPE C. \100 CONTINUE  IOK = SYS$ASSIGN( 'TAPE', ICHAN , , ) $ IF( IOK ) GOTO 150 C.  TYPE 10 , ' Assign and mount MT:/FOREIGN as TAPE' P TYPE 10 , ' Enter (ret, when mounted'  READ ( 5,10 ) FILNAM  GOTO 100 |C. ......... C. DC... REWIND THE TAPE C. 150 CONTINUE p IOK = SYS$QIOW( , %VAL(ICHAN), IO$_REWIND,,,,,,,,,)  IF( .NOT. IOK ) GOTO 8000 8 IXFILE = 1 C. C. dC... SETUP INITAL PARAMS C. ,200 CONTINUE  TYPE 10 , ' Enter: (ret) to SKIP, or a File-spec' C. X250 CONTINUE  TYPE 260 , IXFILE 260 FORMAT( '$File',i5,' =? ' )  READ ( 5,10, ERR=9000 ) FILNAM C. L IF( FILNAM.NE.' ' ) GOTO 400 C. C. xC... SKIP A FILE C. @300 CONTINUE  ICMD = 2  GOTO 425 l C. ......... C. 4!C... READ A FILE !C. !400 CONTINUE `"C. " ICMD = 1 (# OPEN( UNIT=99,NAME=FILNAM,TYPE='NEW', # 1 FORM='UNFORMATTED',CARRIAGECONTROL='NONE', # 2 ERR=200 ) T$C. $425 CONTINUE % IXRECD = 0 % IXBYTE = 0 % IXFILE = IXFILE+1 H&C. &450 CONTINUE ' IOK = SYS$QIOW( , %VAL(ICHAN), IO$_READLBLK, IOSB,,, t' 1 BUF, %VAL( BUFSIZ ) ,,,, ) 'C. <( IF( .NOT. IOK ) GOTO 8000 ( IF( IOSB(1).EQ. %LOC( SS$_ENDOFFILE ) ) GOTO 600 )C. h) NBYTES = IOSB(2) ) IXRECD = IXRECD+1 0* WRITE( 6, 20 ) IXRECD, NBYTES * IF( NBYTES.EQ.0 ) GOTO 600 * IF( ICMD.NE.1 ) GOTO 450 \+C. + WRITE( 99 ) NBYTES, (BUF(I), I=1,NBYTES) $,460 FORMAT( A ) , GOTO 450 ,C. ......... P-C. -C... END OF ONE READ CYCLE .C. |.600 CONTINUE .C. D/ NBYTES = 0 / IF( ICMD.EQ. 1 ) THEN 0 WRITE( 99 ) NBYTES p0 CLOSE( UNIT=99 ) 0 ENDIF 81 GOTO 250 1C. 2C... PRINT OUT AN ERROR d2C. 28000 CONTINUE ,3 CALL SYS$GETMSG( %VAL(IOK), ILEN, MSG, %VAL(-1), ) 3 WRITE( 6, 8010 ) IOK, MSG(1:ILEN) 38010 FORMAT( Z10, ' = ', A ) X4C. 49000 CONTINUE 5 END