SQL iQuery Script Built-in Function

Index

toUpper / toLower

Convert data to upper or lower case.

The TOUPPER() built-in function returns the upper case equivalent of the value specified for parameter 1.
The TOLOWER() built-in function returns the lower case equivalent of the value specified for parameter 1.

Syntax

The ISHEX() passes the first parameter to the cvthc MI instruction. That instruction "unfolds" the characters; creating 2 hexadecimal bytes for each single byte of parameter 1. For example, the string '38' is translated to 'F3F8'.

Parameters

  1. The name of an iQuery Session Variable to be converted to upper or lower case.
#default &Comp = 'IBM Corp.'
SELECT upper(corpname) INTO &CompName
FROM CUSTMAST
WHERE CUSTNO = 5250;

if (toUpper(&comp) = &compName);
#msg Company: &compname
else;
// continue normally
endif;

The file CUSTMAST is read and the CORPNAME column is stored in the &COMPNAME session variable. That column is converted to upper case using the SQL UPPER() function. Next the SQL iQuery Script IF statement is used to compare the value from the file to a known value. To make sure the comparison is performed correclty, the built-in function TOUPPER is used to compare the value to that which is returned from the table.