Version 4.2.6 for Mainframes
 —  Operations  —

Linking Natural Objects to the Natural Nucleus

The Natural nucleus is a collection of service programs such as memory administration, string handling, operating system interfaces, the compiler and the runtime environment which comprise the kernel of Natural. It is independent of the operating-system and the TP system.

This document describes the advantages of linking Natural objects to the Natural nucleus and provides information on how to proceed.

The following topics are covered:


Benefits

Linking Natural objects to the Natural nucleus provides the following benefits:

Top of page

ULDOBJ Utility

You can use the ULDOBJ utility to link Natural cataloged objects to the Natural nucleus. With the ULDOBJ utility, you generate an object module from a Natural cataloged object and write it to a Natural work file. The generated object module is then processed by the linkage editor and linked to the Natural nucleus.

Under z/OS and z/VSE: When a Natural shared nucleus is used, the generated object module has to be linked to the environment-independent part of the nucleus.

Top of page

Using ULDOBJ to Generate an Object Module

Start of instruction setTo invoke the ULDOBJ utility

  1. Log on to the library SYSMISC and issue the command ULDOBJ.

      10:12:19            ***** NATURAL OBJECT MAINTENANCE *****           2005-01-05  
      User: XYZ                 - NATURAL ULDOBJ UTILITY -          Library: SYSMISC
                                                                    Opsys .. z/OS
                                                                                    
                                                                                    
                          Specify parameters below ....                        
                                                                                    
                                    Object ...... ________    (Enter '.' to exit)
                                    Library ..... SYSMISC_
                                    OP System ... ________                          
       
     
     
     
     
     
      
    
  2. Specify and confirm the following parameters:

    Object The name of the cataloged object to be processed. The object can be a program, subprogram, subroutine, helproutine or map.
    Library The name of the library containing the cataloged object.
    OP System

    The name of the operating system for which the object module is to be generated. (Different operating systems have different rules to which the object module must conform.) The name of the operating system must be one of the following:

    z/OS z/OS systems
    z/VSE z/VSE systems
    BS2000 BS2000/OSD systems
    CMS VM/CMS systems

    For each object processed, the ULDOBJ utility displays a report containing the following information:

    ULDOBJ prompts for another object and library after the data from the initial input have been processed. The operating system is not requested, because it does not make sense to generate object modules for more than one operating system for the same Natural work file.

Start of instruction setTo terminate the ULDOBJ utility

Top of page

Additional Considerations for Linking Subroutines

Once a cataloged object has been unloaded by the ULDOBJ utility and linked to the Natural nucleus, the cataloged object can be deleted from the Natural system file.

However, this is not true for an object of type "subroutine". A subroutine has two names:

Natural internally associates these two names, but this is possible only if the cataloged object still exists on the Natural system file. If the cataloged object were deleted, this association would be lost and the subroutine linked to the nucleus would not be executable.

Top of page

Operating System Dependency of Object Module Generation

The object module is generated in different ways, according to the operating system. These differences are listed below.

Platform: Requirement:
z/OS

A NAME control statement is generated as the last card of the object module. It specifies the replace function. For example:

         
NAME TEST (R)

TEST is the name of the cataloged object.

z/VSE

The object module(s) will be in LIBR format. A CATALOG control statement is generated as the first card and a "/*" as the last card of the object module. For example:

         
CATALOG TEST.OBJ REPLACE-YES
... ... object module ...
/+

TEST.OBJ is the name of the cataloged object.

When the LIBR utility is executed, assign SYSIPT to the work file written by the ULDOBJ utility (ASSIGN SYSIPT=work-file-1).

BS2000/OSD

The object module(s) will be in LMS format. An ADD control statement is generated as the first card and an END statement as the last card of the object module. For example:

         
ADDR >TEST
... ... object module ...
END

When the LMS utility is executed, assign SYSDTA to the work file written by the ULDOBJ utility (SYSFILE SYSDTA=work-file-1). The file name generated is Nvr.MOD, where vr stands for the current Natural version and release number.

If multiple cataloged objects are unloaded during execution of the utility, the object decks are appended to each other.

Top of page

Example of Linking a Natural Object to the Natural Nucleus

If, for example, the objects LOGPROG and EDITPROG in the library SYSLIB are to be linked to the Natural nucleus, the following steps could be taken:

  1. Identify the cataloged objects to be linked.

    Object         Library
    -------------- --------------  
    LOGPROG        SYSLIB 
    EDITPROG       SYSLIB  
  2. Set up the batch Natural job stream. Assuming a z/OS environment, include the following cards:

    //CMWKF01  DD DSN=ULD.NAT.PGMS,UNIT=SYSDA,DISP=(,KEEP),  
    //            SPACE=(CYL,(3,1),,RLSE),VOL=SER=VVVVVV,
    //            DCB=(RECFM=FB,BLKSIZE=800,LRECL=80)
    //CMSYNIN DD *
    LOGON SYSMISC
    ULDOBJ LOGPROG,SYSLIB,OS
    EDITPROG,SYSLIB
    .
    FIN
    /* 
  3. Set up the linkage editor job stream.

    //JOBCARD JOB (ACCTING),CLASS=A,MSGCLASS=X
    //*
    //* GENERATE OS LOAD MODULE FROM ULDOBJ UTILITY
    //*
    //LINK1    EXEC PGM=IEWL,PARM='LIST,LET,XREF,NCAL,RENT,REUS'
    //SYSLMOD  DD DSN=NATURAL.USER.LOAD,DISP=SHR
    //SYSUT1   DD UNIT=SYSDA,SPACE=(1024,(200,20))
    //SYSPRINT DD SYSOUT=X
    //SYSLIN   DD DSN=NAT.ULD.PGMS,DISP=OLD,UNIT=SYSDA,VOL=SER=VVVVVV  
    /*

    This step places the load modules LOGPROG and EDITPROG in the NATURAL.USER.LOAD dataset.

    With an additional link-edit job, these modules can be linked together as a single load module before being linked to the nucleus in Step 5.

    //JOBCARD JOB (ACCTING),CLASS=A,MSGCLASS=X
    //*
    //* OPTIONAL JOB TO LINK CATALOGED OBJECTS TOGETHER
    //*
    //LINK2    EXEC PGM=IEWL,PARM='LIST,LET,XREF,NCAL,RENT,REUS'  
    //SYSLMOD  DD DSN=NATURAL.USER.LOAD,DISP=SHR
    //SYSUT1   DD UNIT=SYSDA,SPACE=(1024,(200,20))
    //SYSPRINT DD SYSOUT=X
    //SYSLIN   DD *
    INCLUDE SYSLMOD(LOGPROG)  LOGON NATURAL PGM
    INCLUDE SYSLMOD(EDITPROG) EDITOR NATURAL PGM
    NAME XXXXXX(R)
    /*
  4. Define the statically linked Natural programs in source module NATCONFG in the NSTATIC table for linked Natural programs:

    NTSTAT INPL,TYPE=W
    NTSTAT INPLLIB,TYPE=W
    NTSTAT AERROR,TYPE=W
    NTSTAT LOGPROG          <==== your entries  
    NTSTAT EDITPROG         <====

    TYPE=W means that a "weak" external reference to the specified program is generated rather than a normal one.

  5. Review the linkage editor job stream for the Natural nucleus and include the following:

    //*
    //* INCLUDE DDNAME AND DSN OF DATASET WHERE OBJECTS RESIDE  
    //*
    //SYSLMOD DD DSN=NATURAL.USER.LOAD,DISP=SHR
    //NATLIB DD DSN=NATURAL.V2.USER.LOAD,DISP=SHR//*
    //SYSLIN DD*
    ...
    ...                         INCLUDE MODULES FOR NUCLEUS
    ...
    INCLUDE NATLIB(NATPARM)     NATPARM MODULE
    INCLUDE SYSLMOD(LOGPROG)    LOGON NATURAL PGM
    INCLUDE SYSLMOD(EDITPROG)   EDITOR NATURAL PGM
    ...
    ...                         INCLUDE ENTRY AND NAME CARDS
    ...
    /*

    If the cataloged objects were linked together (as done optionally in Step 3), include this load module instead of the individual load modules in the link of the nucleus.

Top of page