The following functions are built-in to DDS and can be used for the mapping, read or write Definitions:

Function           Usage        Description
------------------ ------------ ----------------------------------
x+y                             Addition
x-y                             Subtration
x*y                             Mulitplication
x/y                             Division
x%y                             Modulo (Remainder of x/y)

x&&y                            Logical AND
x||y                            Logical OR
!x                              Logical Negation

x<<y                            Bit-wise Left shift
x>>y                            Bit-wise Right Shift
x&y                             Bit-wise AND
x|y                             Bit-wise OR
~x                              Bit-wise Compliment

x ? y : z                       Conditional returns y if <x> != 0,
                                else returns z.

x[y]                            Subscript x with y

sqrt(x)                         Returns double value of sqrt of 
                                "x" cast to a double value.

abs(x)                          Returns double value of absolute
                                of "x" cast to a double value.

sign(x)                         Returns 1 if x>0; -1 if x<0; else 0
                                ("x" cast to a double value)

ceil(x)                         Returns double value of smallest
                                integer not less than "x".

floor(x)                        Returns double value of largest 
                                integer not greater than "x".

sin(x)                          Returns double value of sine of "x" 
                                in radians cast to a double value.

cos(x)                          Returns double value of cosine of "x"
                                in radians cast to a double value.

tan(x)                          Returns double value of tangent of "x" 
                                in radians cast to a double value.

asin(x)                         Returns double value in radians of
                                arcsine of "x" cast to a double value.

acos(x)                         Returns double value in radians of 
                                arccosine of "x" cast to a double value in.

atan(x)                         Returns double value in radians of
                                arctangent of "x" cast to a double value.

atan2(x,y)                       Returns double value in radians of
                                arctangent of "x/y" cast to a double value.

log(x)                          Returns double value of natural log 
                                of "x" cast to a double value.

log10(x)                        Returns double value of base-10 log
                                of "x" cast to a double value.

exp(x)                          Returns double value of e**x (ex) 
                                cast to a double value.

pow(x,y)                        Returns double value of x**y (xy)
                                cast to a double value.

field(a,b)         map:         Specify expression "a" if exists
                                otherwise the value from "b" which
                                could be "nop" which does nothing.

ident(a)           map:         Used to specify a field name which
                                may contain special characters 
                                that could be interpreted by DDS
                                (eg. "-" in "SHT-X")

linetrc()          read:/write: Provide sequential I/O numbers 
                                for each trace starting with 1.
                   

reeltrc()          read:/write: Provide sequential I/O numbers 
                                for each trace starting with 1. 
                                This is reset after remounting
                                a new tape real or disk file.

datestruct(SGRDat) map:         Takes a Julian date stored as an
                                integer (as done with usp header
                                SGRDat) & converts it to the Date
                                structure used in segy Date.

dateint(Date)      map:         Takes the segy Date structure &
                                converts it to the usp Julian 
                                date integer.

defn_value(dict,name)           Pull a value out of Dictionary
                                eg. defn_value("hist:","delta.x")

ordinal(n)         read:/write: Provide sequential ordinal values starting
                                with 0 for axis number "n". (use 
                                edit:out=force.a to force the ordinal 
                                values; this must be done for all lower 
                                axes as well)
    

An example of the use of the "field()" function would be in the case:

map:segy:asp.UphlTm= UPHOLE

This mapping would require the member, "UPHOLE", to exist, otherwise an error would result. If there is any doubt, the function, "field()", can be used to guarantee that if a member doesn't exist, then an alternate value would be used. The following example will assign the value in "UPHOLE" to "UphlTm" if "UPHOLE" exists, otherwise nothing is assigned to "UphlTm".

map:segy:asp.UphlTm= field(UPHOLE, nop)