When the assembler encounters a reference to an undefined macro or to a copy member, the library search path is searched for the member. The full library search path is the concatenation of the values of the SYSLIB assembler option and the X390LIB environment variable. That is, the paths specified in SYSLIB are searched before the paths in X390LIB.
The SYSLIB and X390LIB values are lists of path patterns. Each pattern is separated by either a semi-colon (Windows) or a colon (UNIX). Each pattern must contain an asterisk, &m or &M which indicates the position of the member name in the pattern. Thus, the pattern *.MAC would cause the assembler to append the .MAC extension to members when it looked in the current working directory.
You can also use the &D, &F, &E, and &X option variables in the path patterns, although it probably makes most sense to use &D. The &D, &F and &E variables are replaced with the directory, file name, and extension of the first source file specified on the command line. The &X variable is replaced with the name of the directory containing the assembler program. For Windows, the *, &m or & member name markers all have the same effect. For UNIX, you can use the * or &M to indicate that the member name should be inserted into the pattern in upper case or you can use &m to indicate that the member name should be inserted into the pattern in lower case. If neither SYSLIB nor X390LIB are set, the library search path will be set to &D&m.mac.
The SYSLIB option value can also contain the &S option variable. The &S variable is replaced by the previos SYSLIB value (if any). This allows you to specify a long library search path using multiple SYSLIB options. It also allows you to easily append a new path pattern to an existing specification. For example, setting the following:
SYSLIB(MACLIB1\&M.MAC) SYSLIB(&S;MACLIB2\&M.MAC)results in a library search path of MACLIB1\&M.MAC;MACLIB2\&M.MAC and setting:
SYSLIB(&M.MAC) SYSLIB(&M.CPY;&S)results in a library search path of &M.CPY;&M.MAC.
For the assembler to read macros and copy files from ZIP files, TAR files or CMS MACLIBs, the ZIP files, TAR files and MACLIBs must be listed in the library search path. The path patterns must designate the ZIP file, TAR file or CMS MACLIB file name and the pattern for the file members to be searched for. For instance, if the search path is set to C:\MACLIB.ZIP(&M.MAC) and a macro reference to MYMACRO is encountered, the assembler will attempt to retrieve the file MYMACRO.MAC from the ZIP file named C:\MACLIB.ZIP. The format for a TAR file is similar to that for a ZIP file. For a CMS MACLIB, the SYSLIB option could be set to C:\CMSMAC.LIB(&M). Once the assembler opens a ZIP file, TAR file or MACLIB, the directory is read into memory and the file is left open until the assembly is complete. This allows the assember to quickly locate and retrieve other members from the same file.
The library search path can be a mixture of ZIP file patterns, CMS MACLIB patterns and file path patterns. Further, if the same ZIP file or TAR file appears more than once in the search path, the assembler will only open it once. As another example, if the search path is set to &M.MAC;&DMACLIB.ZIP(MACLIB1/&M.MAC);&DMACLIB.ZIP(MACLIB2/&M.MAC), a reference to MYMACRO would cause the assembler to look for MYMACRO.MAC in the current directory, then if it was not found the assembler would open MACLIB.ZIP in the source file directory and look for MACLIB1/MYMACRO.MAC and then MACLIB2/MYMACRO.MAC within it.
SYSLIB and X390LIB can be used together to create a library search path that is dependent upon the project you are working on. SYSLIB could be used to define the library search path for the current project and X390LIB could be used to define the library search path for macros common to all projects. For example, if SYSLIB is set to .\&M.MAC;C:\PROJECT\&M.MAC and X390LIB is set to &D&M.MAC;F:\COMPANY\&m.cpy;F:\OPERSYS\*, and a macro reference to MYMACRO is encountered, the assembler will look for MYMACRO.MAC in the current directory, in C:\PROJECT and in the directory containing the source file, then look for F:\COMPANY\mymacro.cpy, and finally for F:\OPERSYS\MYMACRO.