*PROCESS MARGINS(2,132); testD3: PROCEDURE options(main); Define alias HANDLE pointer; DECLARE (p1,p2,p3,p4) pointer, (f1,f2,f3,r) fixed bin(31), (c1,c2) char(64), (null,addr,trim,datetime,system,availablearea,allocsize) builtin; Dcl (myDcm1,myDcm2,myDcm3,myRcm) pointer; put skip edit("TestD1 starting at ",datetime())(2 a); if _initRcommon() = null then STOP; myDcm1 = _initDcommon("DBNAME1"); put skip edit("myDcm1 @",myDcm1)(2 a); if myDcm1^=null then do; r = _setDcommonC(myDcm1,"DB_DSNAME","FullyQualifiedDSNAME1"); put skip edit("setDcommon(",myDcm1,",DB_DSNAME,FullyQualifiedDSNAME1) rc=",r)(3 a,f(7)); c1 = _getDcommonC(myDcm1,"DB_NAME"); c2 = _getDcommonC(myDcm1,"DB_DSNAME"); put skip edit("DCOMMON(",trim(c1),") = ",trim(c2))(4 a); end; else put skip edit("Failed to create dcommon DBNAME1")(a); myDcm2 = _initDcommon("DBNAME2"); put skip edit("myDcm1 @",myDcm2)(2 a); if myDcm2^=null then do; r = _setDcommonC(myDcm2,"DB_DSNAME","FullyQualifiedDSNAME2"); put skip edit("setDcommon(",myDcm2,",DB_DSNAME2,FullyQualifiedDSNAME2) rc=",r)(3 a,f(7)); c1 = _getDcommonC(myDcm2,"DB_NAME"); c2 = _getDcommonC(myDcm2,"DB_DSNAME"); put skip edit("DCOMMON(",trim(c1),") = ",trim(c2))(4 a); end; else put skip edit("Failed to create dcommon DBNAME2")(a); myDcm3 = _initDcommon("DBNAME2"); put skip edit("myDcm1 @",myDcm3)(2 a); if myDcm3^=null then do; r = _setDcommonC(myDcm3,"DB_DSNAME","FullyQualifiedDSNAME2"); put skip edit("setDcommon(",myDcm2,",DB_DSNAME2,FullyQualifiedDSNAME2) rc=",r)(3 a,f(7)); c1 = _getDcommonC(myDcm3,"DB_NAME"); c2 = _getDcommonC(myDcm3,"DB_DSNAME"); put skip edit("DCOMMON(",trim(c1),") = ",trim(c2))(4 a); end; else put skip edit("Failed to create dcommon DBNAME2")(a); %include _dcommon, _Rcommon; end testD3;