Chapter Contents

Previous

Next
loadd

loadd



Dynamically Load a Load Module Containing Data

Portability: SAS/C extension


SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
CAUTION
PORTABILITY
IMPLEMENTATION
EXAMPLE


SYNOPSIS

#include <dynam.h>

void loadd(const char *name, char **dp, MODULE *mp);


DESCRIPTION

loadd is similar to loadm (load executable module) except that it is intended for data modules. loadd loads the module named by the argument name and stores the address of the load module's entry point in the location pointed to by the second argument dp .

If the module has been loaded already, the pointer returned in the second argument points to the previously loaded copy. If the module name in the first argument string is prefixed with an asterisk, a private copy of the module is loaded.

The third argument addresses a location where a value is stored that can be used later to remove the module from memory via unloadd . loadd should be used only to load modules that contain data (for example, translation tables) rather than executable code.


RETURN VALUE

loadd indirectly returns a value that is stored in the location addressed by the third argument mp . This value can be used later to remove the module from memory via unloadd . If the module to be loaded cannot be found, 0 is returned.


ERRORS

Various user ABENDs, notably 1217 and 1218, may occur if overlays of library storage are detected while dynamic loading is in progress.


CAUTION

The first argument string may be no more than eight characters long, not counting a leading asterisk. Also note that a module coded with loadd must contain at least 16 bytes of data following the entry point, or library validation of the module may fail.


PORTABILITY

loadd is not portable. As with other dynamic-loading functions, be aware of system-specific requirements for the location of modules to be loaded.


IMPLEMENTATION

The implementation of loadd necessarily varies from operating system to operating system. Under OS/390, modules to be loaded must reside in STEPLIB or the system link list. Under CMS, modules to be loaded may reside in DYNAMC LOADLIB or in other locations defined by use of the addsrch routine.

Under CICS, modules to be loaded must reside in a library in the DFHRPL concatenation, and must be defined to CICS.


EXAMPLE

The following example illustrates a general case of using loadd :

#include <dynam.h>
#include <lcstring.h>

char *table; 
char *str; 
MODULE tabmod;    
   /* Load a translate table named LC3270AE.      */ 
loadd("LC3270AE",&  table,&  tabmod); 
str = strxlt(str, table); 
unloadd(tabmod);                      /* Unload module after use.*/


Chapter Contents

Previous

Next

Top of Page

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