CALL RZMAKE (LUN,CHDIR,NWKEY,CHFORM,CHTAG,NREC,CHOPT)
Subroutine RZMAKE creates a new RZ file on the specified logical unit. Should the file already exist, the routine RZFILE should be used. On return from RZMAKE, IQUEST(1)
will be set to 0 if the routine was successful. A non-zero value for IQUEST(1) indicates an error.
The following example opens and creates a new RZ file, whose top directory contains three words per key, the first one being an integer (the year) and the two others being Hollerith (the month and the day). A total of 5000 records of length 4096 bytes are requested.
Example of using the routine RZMAKE
CHARACTER*16 CHDIR CHARACTER CHTAG(3)*8 DATA CHTAG/'Year','Month','Day'/ LRECL = 1024 CALL RZOPEN(LUN,CHDIR,'RZTEST.DAT','N',LRECL,ISTAT) IF(ISTAT.NE.0) GOTO 999 CALL RZMAKE(LUN,'Top_Dir',3,'IHH',CHTAG,5000,' ') 999 PRINT *,'Return code from RZOPEN = ',ISTAT
Option 'F' is particularly important for RZ files on
VM/CMS systems, when shared access is required. Further details are given in Appendix A.
N.B. when using option C, the call to RZMAKE must immediately follow a call to RZOPEN. This permits the record length of the file to be passed from RZOPEN to RZMAKE, where it is stored in an RZ control bank for future use.
Option 'M' creates an RZ file in memory. The variable LUN contains the record length. The address of this variable is used as the starting address for the memory file, as shown in the following example.
Example of creating a memory file
COMMON/MEMRZ/IBUFF(163840) * * Set record length of memory file to 1024 words * Starting address is LOCF(IBUF(1)) * Number of 'records' is 160 (length of IBUFF/lrecl) * IBUF(1) = 1024 CALL RZMAKE(IBUF(1),'MEMRZ',3,'IHH',CHTAG,160,'M')