Determines the month name associated with a specified date value.
Syntax
$monthname(date)
Parameters
date | a data, or an expression that evaluates to a date, in the form YYYYMMDD |
Return Value
Character string.
Comments
This function extracts month information from standard date values. Date is often the system variable $Date.
The values returned by the $monthname function can be changed with the Language Customizer utility, ZIMLANG.
Example
$monthname(19981225)
Evaluates to “December”.
$monthname($date+7)
Evaluates to “January” when $Date is 19981225.
See Also
$Date
$day
$dayname
$month
$weekday
$year
About Data Types
About Functional Expressions
Tests if a character string is a valid date.
Syntax
$isdate(string)
Parameters
string | a character string or an expression that evaluates to a character string |
Return Value
1-character binary string. Evaluates to 1 ($True) if string meets the validation test; otherwise, evaluates to 0 ($False).
Comments
This function tests if a particular character string is a valid date.
Example
$isdate("19980606")
Evaluates to $True.
$isdate("19980229")
Evaluates to $False.
$isdate($date)
Evaluates to $True.
$isdate($date+30)
Evaluates to $True.
See Also
$isalphabetic
$isalphanumeric
$isdigit
$islower
$isnumber
$isupper
$iszimname
Character Literals
Functional Expressions
Calculates the sine of a number.
Syntax
$sin(number)
Parameters
number | a number, or an expression that evaluates to a number |
Return Value
Number, with the same number of decimal places as number.
Comments
The value returned by this function has the same number of decimal places as number. Ensure that you specify enough decimal places in your equation to ensure a sufficiently granular result. Unusual results such as
-0 are an indication that the number of decimal places needs to be increased. For example, if you enter
$sin(4)
without any decimal points, you receive the result
-1
However, if you enter
$sin(4.0000)
you receive the result
-0.7568
Example
let var1 = $sin(0)
Evaluates to 0.
See Also
$asin
$cos
$sinh
$tan
About Functional Expressions
Right-justifies a character string.
Syntax
$rightjustify(string)
Parameters
string | a character string, or an expression that evaluates to a character string |
Return Value
Character string, consisting of string right-justified in a space $length(string) characters long. Trailing blanks in string are ignored.
Example
$rightjustify("abcde ")
Evaluates to ” abcde”.
$rightjustify(var1)
Evaluates to ” 3″ if var1 is a LONGINT variable whose value is 3 (occupies 12 character spaces).
See Also
$center
$leftjustify
About Character Literals
About Functional Expressions
Conversion Between Data Types
Sums a set of values, excluding those in which the expression is $Null.
Syntax
$total(expression)
Parameters
Return Value
Number.
Comments
Expression is often a WHERE expression that includes only selected values in the totalling operation. If the WHERE expression (expr1 WHERE expr2) is true, the expr1 value is included in the operation; otherwise, expression is considered $Null and is not included.
Example
compute Employees where DeptName="Sales"
evaluate(let TotSal = $total(Salary))
(let TotSalF = $total(Salary where Sex = "F"))
Finds the total of all employees’ salaries, and the total of the salaries of all female employees, in the Sales department.
See Also
$average
$count
$max
$min
About Functional Expressions
Number Literals
Calculates the hyperbolic cosine of a number.
Syntax
$cosh(number)
Parameters
number | a number, or an expression that evaluates to a number, representing an angle (in radians) |
Return Value
Number, with the same number of decimal places as number. Ensure that you specify enough decimal places in your equation to ensure a sufficiently granular result. Unusual results such as -0 are an indication that the number of decimal places needs to be increased. For example, if you enter
$cosh(5)
without any decimal points, you receive the result
74
However, if you enter
$cosh(5.0000)
you receive the result
74.2099
Comments
This function calculates the hyperbolic cosine of a number.
Example
let vAngle = $cosh(3.000)
Variable vAngle is set to 10.068.
See Also
$acos
$cos
$sinh
$tanh
Calculates the tangent of a number.
Syntax
$tan(number)
Parameters
number | a number or an expression that evaluates to a number |
Return Value
Number, with the same number of decimal places as number. Ensure that you specify enough decimal places in your equation to ensure a sufficiently granular result. Unusual results such as -0 are an indication that the number of decimal places needs to be increased. For example, if you enter
$tan(3)
without any decimal points, you receive the result
-0
However, if you enter
$tan(3.0000)
you receive the result
-0.1425
Comments
The value returned by this function has the same number of decimal places as number.
Example
let var1 = $tan(0)
let var1 = 3.14
let var2 = $tan(0.50*var1)
See Also
$atan
$cos
$sin
$tanh
About Functional Expressions
Calculates the cosine of a number.
Syntax
$cos(number)
Parameters
number | a number, or an expression that evaluates to a number |
Return Value
Number, with the same number of decimal places as number.
Comments
The value returned by this function has the same number of decimal places as number. Ensure that you specify enough decimal places in your equation to ensure a sufficiently granular result. Unusual results such as
-0 are an indication that the number of decimal places needs to be increased. For example, if you enter
$cos(2)
without any decimal points, you receive the result
-0
However, if you enter
$cos(2.0000)
you receive the result
-0.4161
Example
$cos(0)
Evaluates to 1.
let var1 = 3.14
let var2 = $cos(0.50*var1)
Var2 evaluates to 0.00.
See Also
$acos
$cosh
$sin
$tan
About Functional Expressions
Calculates the arctangent (in radians) of the quotient of two numbers.
Syntax
$atan2(number1,number2)
Parameters
number1 | a number, or an expression that evaluates to a number |
number2 | a number, or an expression that evaluates to a number |
Return Value
Number, with the same number of decimal places as number1.
Comments
Number1 is divided by number2 before the arctangent is calculated.
The value returned by $atan2 has the same number of decimal places as number1.
Example
$atan2(1.000,2)
The above command is equivalent to $atan(0.500) and returns the value 0.464.
See Also
$acos
$asin
$atan
$tan
$tanh
About Functional Expressions
Builds a single character string out of separate character strings.
Syntax
$concat(string[«,string»])
Parameters
string | A character string or an expression that evaluates to a character string. Each string must be separated from the next by a comma (,). |
Return Value
Character string.
Comments
The function builds a single character string out of separate strings.
Example
$concat($ttrim(FirstName)," ",LastName)
Can evaluate to “John Smith “. Combines three strings.
$concat($ttrim(LastName),", ",$ttrim(FirstName)," ",Initials)
Can evaluate to “Smith, John T.”. Combines five strings.
let Today = $concat($trim($dayname($date)),", ",
$day($date),", ",$monthname($date))
Can evaluate to “Monday, 30, October”. Combines five strings.
See Also
$delete
$insert
$left
$position
$replace
$right
$squeeze
$substring
$translate