Chapter Contents |
Previous |
Next |
rxresult |
Developing C Function Packages |
The following notes should be considered when developing function packages:
argv
array used by
cmsrxfn
is not a normal C
argv
array. It can be inspected but not
modified.
cmsrxfn
expects functions to return normally via a
RETURN
statement. Therefore,
exit
and
longjmp
should not be used. Calls to these functions are trapped and cause an ABEND.
Similarly, the REXXMAIN entry point also expects the main function to return
by a
RETURN
statement.
To comply with this condition, do not use
exit
to terminate a REXX function package.
RENT
compiler option. If the function package
is not compiled with
RENT
,
a diagnostic message is issued when the package is called, and it is not loaded.
cmsrxfn
,
rxresult
,
rxeval
) should be used only in
the main load module. Using one of these functions in a dynamically loaded
module will result in problems when the module is linked.
Linking REXX Function Packages |
LOAD RXLOCFN (RLDSAVE RESET REXXMAIN GENMOD RXLOCFN (FROM first_CSECT
Inspect the LOAD map produced by the LOAD command to determine the name of the first CSECT. The RLDSAVE option in the LOAD command causes the resulting MODULE to be relocatable. The RESET REXXMAIN option causes REXXMAIN to be the entry point for the MODULE. The FROM option forces the GENMOD command to save the MODULE, beginning with the first CSECT. Always use the name of the first CSECT in the object code as the FROM parameter. (The LOAD MAP file lists the names of the CSECTs in your program.)
COOL RXLOCP1 RXLOCP2 ... LOAD COOL (RLDSAVE RESET REXXMAIN GENMOD RXLOCFN (FROM @EXTERN#
Using the SAS/C Debugger and the IC Command |
Because you cannot specify the
=debug
run-time option via the command line,
set the
_DEBUG
flag in
the
_options
variable to
start the debugger (see the previous example). When the function package
is called the first time, the debugger initializes normally and prompts for
a command. Use the debugger as you would in any other C program. When you
finish debugging, recompile the function package without the
_DEBUG
flag set. (For more information about
the
_options
variable,
refer to the "Library Options" section of Chapter 9, "Run-Time Argument Processing,"
in SAS/C Compiler and Library User's Guide).
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.