IBM OS/390 User Manual

Page of 673
OPEN
(DAMFILE,(OUTPUT))
.
.
WRITE
DECBADD,DI,DAMFILE,DATA,
S
′ ,
KEY,BLOCKADDRESS
CHECK
DECBADD
.
.
DAMFILE
DCB
..MACRF=(WICS),DSORG=DA,OPTCD=R...
.
.
Figure 45. Adding to a D A M File u n d e r MVS
Loading a DAM File (Fixed-Length Records with keys)
Figure 46 and Figure 47 on page 320 illustrate an example of sequentially
loading a DAM file consisting of fixed-length records with keys. A direct
addressing technique is used, which provides unique correspondence between
each key and its relative or actual position on the disk (VSE) or within the data
set (MVS), similar to a sequential data set. The input file resides on tape and is a
set of records sorted into ascending order by keys. Each record consists of 50
bytes (a three-byte key field followed by 47 bytes of data).
OPEN
DAMFILE,TAPE
WRITER0
WRITE DAMFILE,RZERO
WAITF DAFMFILE
.
GET
GET
TAPE
.
WRITE DAMFILE,AFTER
WAITF DAMFILE
.
EOF
WRITE DAMFILE,AFTER,EOF
WAITF DAMFILE
CLOSE DAMFILE,TAPE
.
DAMFILE
DTFDA BLKSIZE=58,ERRBYTE=ERROR,
C
IOAREA1=OUTPUT,SEEKADDR=ADDR,
C
TYPEFLE=OUTPUT,AFTER=YES,
C
DSKXTNT=3,KEYLEN=3,RELTYPE=HEX,
C
VERIFY=YES,DEVICE=3340
DAMOD AFTER=YES,ERREXT=YES,RELTRK=YES
.
TAPE
DTFMT .....
MTMOD
Figure 46. Loading a Sequential D A M File u n d e r VSE
The VSE program writes the capacity record (R0) and uses WRITE AFTER to
sequentially write each record, so that the capacity record is checked for
available space on that track before each record is written. In VSE, the total
amount of space allocated to the file is indicated by the extents allocated to it,
but it can be extended in a later run.
Chapter 13. A s s e m b l e r
319