Workbook for SLD Offline Users - Writing Code: Prepmort

To start learning Prepmort, take a look at a simple example of a Prepmort file. We will use the file that you called from IDA when you were learning about the EXTERNAL function. Use your editor to view the file

PRODSLD:UCHKTAG.PREPMORT

The Basic Structure of PREPMORT

The Prepmort file has three basic sections: the header section, the declarations section and the executable section. We'll discuss each of these three sections. First, a few general points:

The Header Section

The header section of the UCHKTAG file is everything up to but not including:
   "&COMMON/JAZELL/"
Many lines in the header section are enclosed in Prepmort comment characters. However, some of these comment lines are actually used by the Prepmort compiler and the DUCS code distribution software. So do not assume that these lines can be left out.

Many of these comment lines are read by DUCS when the file is installed for use by the rest of the SLD collaboration. The lines contain information that DUCS turns into a help file. Thus every routine that contains a properly written header will automatically generate a help file when it is installed into DUCS.

When the file is installed into DUCS, a help file is generated. The help can be read by issuing the help command from DCL with the appropriate library specified. Separate help libraries are maintained for each DUCS section.

Since the file UCHKTAG.PREPMORT lives in section SLD, you can view it with the command:

   HELP/LIBRARY=DUCSSLD:SLD
As another example, you could view the help library for section MFIT:
   HELP/LIBRARY=DUCSMFIT:MFIT

The Declarations Section

The declarations section of the UCHKTAG file is everything from
   "&COMMON/JAZELL/"
through
   LOGICAL FIRST / .TRUE. /;
This part of the file declares what external code is to be included, what variables are to be used and what initial values these variables are to have.

The Executable Section

The rest of the file is called the executable section. This is the part of the code that is executed when the routine is called.

Other Basic Prepmort Not in the Example

You have just seen one Prepmort routine in detail. Here are some other common Prepmort constructions that did not happen to be in the routine we used as our example.

Back to Writing Code

Joseph Perl
27 February 1995