There are two forms of concatenated data sets: partitioned and sequential. You can open concatenated data sets only by ddname, and only for read or update. Specifying any of the write, or append modes fails. As with PDS members, you cannot extend a concatenated data set.
//MYDD DD userid.PDS1,DISP=SHR
// DD userid.PDS2,DISP=SHR
fp = fopen("DD:MYDD(C)","r");
fp2 = fopen("DD:MYDD(D)","r");
the first call to fopen() finds member C from PDS1, even though there is also a member C in PDS2. The second call finds member D from PDS2, because PDS2 is the first PDS in the concatenation that contains this member. The member C in PDS2 is inaccessible.
Table 1 describes the rules for compatible concatenations.
RECFM of first data set | RECFM of subsequent data sets | LRECL of subsequent data sets |
---|---|---|
RECFM=F | RECFM=F | Same as that of first one |
RECFM=FB | RECFM=F or RECFM=FB | Same as that of first one |
RECFM=V | RECFM=V | Less than or equal to that of first one |
RECFM=VS | RECFM=V or RECFM=VS | Less than or equal to that of first one |
RECFM=VB | RECFM=V or RECFM=VB | Less than or equal to that of first one |
RECFM=VBS | RECFM=V, RECFM=VB, RECFM=VS, or RECFM=VBS | Less than or equal to that of first one |
RECFM=U | RECFM=U or RECFM=F (see note) | |
Note: You can use a data set in V-format, but
when you read it, you will see all of the BDWs and RDWs or SDWs with
the data.
|
If the first data set is in ASA format, all subsequent data sets must be ASA as well. The preceding rules apply to ASA files if you add an A to the RECFMs specified.
If you do not follow these rules, undefined behavior occurs. For example, trying to read a fixed-format member as RECFM=V could cause an exception or abend.
Repositioning is supported as it is for regular PDSs and PDSEs. If you try to read the directory, you will be able to read only the first one.
//MYDD DD userid.PDS1(A),DISP=SHR
// DD userid.PDS2(E),DISP=SHR
// DD userid.DATA,DISP=SHR
creates a concatenation that contains two members and a regular sequential data set. You can read or update all of these in order. In partitioned concatenations, you can read only one member at a time.
z/OS® XL C/C++ does not support concatenating data sets that do not have compatible DCB attributes. The rules for compatibility are the same as those for partitioned concatenations.
If all the data sets in the concatenation support repositioning, you can reposition within a concatenation by using the functions fseek(), ftell(), fgetpos(), fsetpos(), and rewind(). If the first one does not, all of the repositioning functions except rewind() fail for the entire concatenation. If the first data set supports repositioning but a subsequent one does not, you must specify the noseek parameter on the fopen() or freopen() call. If you do not, fopen() or freopen() opens the file successfully; however, an error occurs when the read position gets to the data set that does not support repositioning.