Search code examples
db2cobolmainframezoscics

mainframe - what is the name of extension suffix on filenames that change?


I recall when doing an ftp get to copy files from mainframe to windows that there would always be some numeric suffix on the filenames that would change each day. ie abc.4328 then it would become abc.23595..etc what is the concept/terminology of the changing suffix in mainframe world?


Solution

  • Leaving aside mainframe files residing in the Unix file system (z/OS is a flavor of Unix and has been for some years now), mainframe files do not have an extension or suffix.

    Mainframe file names (called DataSet Names or DSNs) take the form HLQ[.Q1[.Q2[.Qn]]] where HLQ is the High Level Qualifier and Q1...Qn are subsequent qualifiers separated from the HLQ and each other by full-stops. The entire DSN must be no more than 44 characters. Each qualifier must be comprised of alphabetic, numeric, and what IBM calls "national" characters which (in the USA anyway) are @, # and $. Additionally, a qualifier may not begin with a numeric character. There are exceptions to this which, in my opinion, are best avoided.

    As Bruce Martin indicates in his comment, mainframes have the concept of Generation Data Groups (GDGs) which have a lowest level qualifier taking the form GnnnnVnn generated by the operating system where the four digits between the G and V are the "generation number" and the two digits following the V are the "version number." The generation number is incremented by the operating system each time a new instance of the file is created.

    So it is possible you are thinking of a GDG. Be advised that the GDG lowest level qualifier is not dependent on date or time, it merely indicates the order in which the instances of the dataset were created.

    GDGs are normally accessed not by absolute generation number but by relative generation number. If ABC.DEF is a GDG and there are four extant generations ABC.DEF.G0008V00, ABC.DEF.G0009V00, ABC.DEF.G0010V00, ABC.DEF.G0011V00 then a reference to ABC.DEF(0) would be shorthand for ABC.DEF.G0011V00. A reference to ABC.DEF(-1) would be shorthand for ABC.DEF.G0010V00. Referencing relative generation (0) is always a reference to the most recently created instance of the GDG.

    A mainframe dataset may also be a PDS (Partitioned DataSet). Partitioned datasets have "members" and are conceptually slightly similar to (though implemented very differently from) directories on PC or Unix file systems. A PDS may contain many related members, such as utility control statements, where there is a desire to manage them as a group.

    PDS names follow the same rules as normal DSNs, and member names follow the same rules as normal DSN qualifiers, but referring to a member requires specifying it in parentheses. If MY.DATA is a PDS and I wish to access a member whose name is XYZ I would specify MY.DATA(XYZ).

    Note that the format of a dataset is not necessarily indicated in its name. That a dataset is, e.g. a PDS containing fixed 100 byte records is recorded as metadata in the file system.