3. Embedded QUEL for COBOL : Precompiling, Compiling, and Linking an EQUEL Program : Coding Requirements for Writing EQUEL Programs : COBOL Strings and EQUEL Strings
 
Share this page                  
COBOL Strings and EQUEL Strings
UNIX: COBOL stores string and character data in a machine-dependent data item. The EQUEL runtime routines are written in another language (C) that verifies lengths of strings by the location of a null (LOW-VALUE) byte. Consequently, COBOL strings must be converted to EQUEL runtime strings before the call to the runtime routine is made.
In some languages, EQUEL generates a nested function call that accepts as its argument the character data item and returns the address of the EQUEL null-terminated string. COBOL does not have nested function calls, and simulating this would require two expensive COBOL statements. EQUEL/COBOL knows the context of the statement and, in most cases, will MOVE the COBOL string constant or data item in a known area that has already been null-terminated. This extra statement is cheaper than the nested function call of other languages, as it generates a single machine instruction. Even though your COBOL-generated code may look wordier and longer than other EQUEL-generated code, it is actually as efficient.  
VMS: VAX/VMS COBOL stores string and character data in a machine-dependent descriptor. The EQUEL runtime routines are written in another language (C) that verifies lengths of strings by the location of a null (LOW-VALUE) byte. Consequently, COBOL strings must be converted to EQUEL runtime strings before the call to the runtime routine is made.
In some languages, EQUEL generates a nested function call that accepts as its argument the VAX string descriptor and returns the address of the EQUEL null-terminated string. COBOL does not have nested function calls, and simulating this would require two expensive COBOL statements. EQUEL/COBOL knows the context of the statement, and in most cases will MOVE the COBOL string constant or data item in a known area that is already null terminated. This extra statement is cheaper than the nested function call of other languages, as it generates a single machine instruction. Even though your COBOL-generated code can look wordier and longer than other EQUEL-generated code, it is actually as efficient.