Chapter Contents

Previous

Next
Linking C Programs

Using AR370 Archives

An AR370 archive is a collection of object modules that can be used by COOL to resolve external references, including external references to extended names. AR370 archives are created and maintained by the AR370 archive utility.

CAUTION:
Use ar370 to access AR370 archives. Do not attempt to create or modify an AR370 archive using any tools other than AR370 and UPDTE2AR. AR370 archives are stored in a binary format and will be rendered unusable if modified by a program unfamiliar with this structure, such as a text editor.  [cautionend]

COOL enables you to use AR370 archives as follows:


Using the ARLIBRARY Control Statement

The ARLIBRARY control statement is used to add an archive to the list of AR370 archives to be used as autocall input. For example, the following statement adds ALPHA to the list of archives:

ARLIBRARY ALPHA

ALPHA could be either an OS/390 DDname or a CMS filename. Refer to The ARLIBRARY Statement for additional information.


Specifying Archives from the Command Line

Under CMS, you can specify AR370 archives from the COOL command line. The COOL EXEC invokes the COOL object code preprocessor and can optionally invoke the CMS LOAD, START, GENMOD, or LKED command. The format is as follows:

COOL  [filename1  [filename2 ...]] [(options[)]]

where filename1, filename2, and so on are the names of the files that are to be the primary input to COOL. Each file should have a filetype of TEXT and contain either object code or COOL/linkage editor control statements.

A filename argument can also be the name of an AR370 archive with a filetype of A. For example, the following command specifies two AR370 archives named LIB1 and LIB2:

COOL [filename1 [filename2 ...]] LIB1 LIB2 [(options[)]]

COOL adds the specified AR370 archives to the list of AR370 archives to be used as autocall input.

When a filename appears on the command line, COOL checks to see if the filename identifies an AR370 archive before checking for a TEXT file. Thus, in this example, if both LIB1 A and LIB2 TEXT are found, LIB1 A will be processed and LIB2 TEXT ignored.

Similarly, under the USS shell, you can specify the names of AR370 archives to be processed by COOL on the sascc370 command line. For example, the following command requests prelinking and linking of the object module main.o , resolving references from the archive named subs.a :

sascc370 -o shgame main.o subs.a


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.