Using SET in IDMS/SQL

Document ID : KB000115978
Last Modified Date : 27/09/2018
Show Technical Document Details
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.
Background:
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.
Instructions:
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
 
File Attachments:
timediff.txt