BASIC Terminology

InfoSphere® DataStage® BASIC programmers should understand the meanings of the following terms:

BASIC Program

A BASIC program is a set of statements directing the computer to perform a series of tasks in a specified order. A BASIC statement is made up of keywords and variables.

Source Code

Source code is the original form of the program written by the programmer.

Object Code

Object code is compiler output, which can be executed by the InfoSphere DataStage RUN command or called as a subroutine.

Variable

A variable is a symbolic name assigned to one or more data values stored in memory. A variable's value can be numeric or character string data, the null value, or it can be defined by the programmer, or it can be the result of operations performed by the program. Variable names can be as long as the physical line, but only the first 64 characters are significant. Variable names begin with an alphabetic character and can include alphanumeric characters, periods ( . ), dollar signs ( $ ), and percent signs ( % ). Upper- and lowercase letters are interpreted as different; that is, REC and Rec are different variables.

Function

A BASIC intrinsic function performs mathematical or string manipulations on its arguments. It is referenced by its keyword name and is followed by the required arguments enclosed in parentheses. Functions can be used in expressions; in addition, function arguments can be expressions that include functions. InfoSphere DataStage BASIC contains both numeric and string functions.

  • Numeric functions. BASIC can perform certain arithmetic or algebraic calculations, such as calculating the sine (SIN), cosine (COS), or tangent (TAN) of an angle passed as an argument.
  • String functions. A string function operates on ASCII character strings. For example, the TRIM function deletes extra blank spaces and tabs from a character string, and the STR function generates a particular character string a specified number of times.

Keyword

A BASIC keyword is a word that has special significance in a BASIC program statement. The case of a keyword is ignored; for example, READU and readu are the same keyword. For a list of reserved words see Appendix A.