Chapter Contents

Previous

Next
SAS/C Software: Changes and Enhancements, Release 6.50


New MVS Search Capability

  


addsrch

  Indicate a location from which modules may be loaded

SYNOPSIS
 #include <dynam.h> 

SEARCH_P addsrch(int type, 
                 const char *loc,
                 const char *prefix);

DESCRIPTION
addsrch adds a location to the list of locations from which modules can be loaded. This list controls the search order for modules loaded from a call to  loadm.  addsrch does not verify the existence of the location. 

The first argument, type, must be a module type defined in  <dynam.h>. The module type defines what type of module is loaded and can vary from operating system to operating system. The character string specified by the second argument,  loc, names the location. All location strings may have leading and trailing blanks, and all characters are converted to an uppercase format. The format of this string depends on the module type.  

The search order can be described additionally by the third argument, prefix. The  prefix argument is a character string of no more than eight characters.  prefix may be null (""), but if it not, then it specifies that the location indicated is searched only if the load module name (as specified by the  type argument to  loadm) begins with the same character or characters specified in  prefix. 

Under MVS, the module type, type, controls the format of the second argument,  loc, which names the location to be searched by  loadm. The module type may be either  MVS_DD or  MVS_DSN: 

 

Under CMS, the defined module types for the first argument, type, are the following: 

 

The module type also controls the format of the second argument, loc. The  loc argument identifies the location to be searched by  loadm. For the following the module types, the  loc argument is: 

CMS_NUCX
 The location parameter must be null ("").

CMS_LDLB
 The location parameter is the filename and filemode of the LOADLIB file in the form filename filemode, for example, DYNAMC A1 specifies the file, DYNAMC LOADLIB A1. The filemode may be an asterisk (*).

 CMS_DCSS
 The location parameter is a 1-8 character string that names the segment. An asterisk (*) as the first character in the name is used to specify that the segment name is for a non-shared segment.

At the C program's initialization, a default location is in effect. The default location is defined by the following call:

 sp = addsrch(CMS_LDLB, "DYNAMC *","")

RETURN VALUE
addsrch returns a value that can be passed to  delsrch to delete the input source. This is a value of the defined type  SEARCH_P, which can be passed to  delsrch to remove the location from the search order. If an error occurs, a value of 0 is returned.

 USAGE NOTES
addsrch does not verify that a location exists or that load modules may be loaded from that location. The  loadm function searches in the location only if the load module cannot be loaded from a location higher in the search order.  addsrch fails only if its parameters are ill-formed.

 EXAMPLE
 #include <dynam.h>

SEARCH_P mylib;
      .
      .
      .
/* Search for modules in a CMS LOADLIB. */
mylib=addsrch(CMS_LDLB, "PRIVATE *", "");

/* Search for modules in a MVS dataset. */
mylib=addsrch(MVS_DSN, "SYS1.LINKLIB", "");


Chapter Contents

Previous

Next

Top of Page

Copyright © Mon Mar 9 09:11:22 EST 1998 by SAS Institute Inc., Cary, NC, USA. All rights reserved.