To
make it easier to interface with external C functions, many PROTO-compatible
procedures have been enhanced to support most of these C types.
The EXTERNC statement
is used to specify C variables in PROTO compatible procedures. The
syntax of the EXTERNC statement has the following form:
EXTERNC DOUBLE | INT | LONG | SHORT
| CHAR <[*][*]> var-1 <var-2
... var-n>;
The following table
shows how these variables are treated when they are positioned on
the left side of an expression. The table shows the automatic casting
that is performed for a short type on the right side of an assignment.
(Explicit type conversions can be forced in any expression, with a
unary operator called a cast.) The table lists all the allowed combinations
of short types that are associated with SAS variables.
Note: A table for int, long, and
double types can be created by substituting any of these types for
“short” in this table.
If any of the pointers
are null and require dereferencing, then the result is set to missing
if there is a missing value set for the result variable.
For more information,
see MAPMISS Statement.
Automatic Type Casting for the short Data Type in an Assignment
Statement
Type for Left Side of
Assignment
|
Type for Right Side
of Assignment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following table
shows how these variables are treated when they are passed as arguments
to an external C function.
Types That Are Allowed for External C Arguments
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double, double *, double
**
|
|
|
double, double *, double
**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: Automatic conversion between
two different C types is never performed.