Section 14.29: SCHEMA v DATABASE Up Chapter 14: Extensions Section 14.31: Application Partitioning  

14.30 SESSIONS

Use the SESSION statements to access different databases within the same program.
(One limitation is that you cannot link across databases in a single query.)
Example:
MAIN
  DEFINE lv_a CHAR(10)
  OPEN SESSION s_id1 TO DATABASE test1
  OPEN SESSION s_id2 TO DATABASE test2
  USE SESSION s_id1 FOR SELECT USER INTO lv_a 
    FROM systables WHERE tabid=1
  DISPLAY lv_a
  USE SESSION s_id2 FOR SELECT USER INTO lv_a 
    FROM systables WHERE tabid=1
  DISPLAY lv_a
  SET SESSION s_id1
  ...
END MAIN
 Section 14.29: SCHEMA v DATABASE Up Chapter 14: Extensions Section 14.31: Application Partitioning