Using SET in IDMS/SQL
search cancel

Using SET in IDMS/SQL

book

Article ID: 115978

calendar_today

Updated On:

Products

IDMS IDMS - Database IDMS - ADS

Issue/Introduction

This article shows how to use SET in the CA-IDMS SQL Option to be able to use SQL scalar functions for coding unrelated to SQL database access.
It also uses this to show how to calculate the number of microseconds between two timestamp variables.

The CA IDMS SQL Option has a statement called SET which simply allows application program host variables to be assigned to an expression.
It does not involve any database access.
This means that the program or dialog uses SQL and will require an access module but the usefulness of this feature is that it means the power of the SQL scalar functions becomes available to regular ADS or DC-COBOL coding.
The example given here also shows how to determine the number of microseconds between two timestamp values, which is normally not an easy calculation due to the segmented manner in which such datatypes are stored.

Environment

CA IDMS, all supported releases.

Resolution

See the attached file timediff.txt for sample coding of how to use this feature.

Additional Information

Set host-variable Assignment
Representation of Date/Time Values
 

Attachments

1558536856364timediff.txt get_app