NavigationUser login |
dfcn and what all goes on when compilingThe Asset Suite application runs with MicroFocus COBOL on non IBM machines. ProCOBOL (Oracle’s COBOL) is in use when a .csm or .ccp program is compiled. The dfcn script in the tools directory runs a custom Ventyx pre compiler that expands certain data type definitions, example: PIC I, and changes and EXEC SQL statements from DB2 style SQL to Oracle SQL (and maybe other stuff that I can’t remember) if Asset Suite is defined to be using the Oracle database. Then the Oracle Pro COBOL compiler will compile the Oracle style SQL and finally the MicroFocus COBOL compiler compiles everything else. If Asset Suite is using the Oracle database it is possible to write straight Oracle style SQL and use Oracle specific SQL capabilities. The EXEC SQL is marked (I forget exactly how) so that the Ventyx precompiler leaves it alone. Note that the Ventyx developers use vanilla DB2 style SQL that can be translated to Oracle style SQL. It's the reason why sometimes you'll wonder why the developer didn't use a fancier SQL statement to get the job done. By webmaster | MicroFocus COBOL compiling with listing | add new comment
Do not use Ventyx CURRENT TIMESTAMP precompiler changeFollowing is relevent for COBOL batch .csm programs used in PassPort / Asset Suite. Could impact any batch program that runs over midnight where the time portion of the time stamp value is being updated. This should be rare. K000-TIME-STAMP. EXEC SQL SET :TIME-STAMP-DB2 = CURRENT TIMESTAMP END-EXEC. ACCEPT CURRENT-TIME-HHMMSSTH FROM TIME. MOVE TIME-STAMP-DB-CC TO WS-CENTURY MOVE WS-CENTURY TO TODAYS-DATE-CC ADD +1 TO CURR-TIMESTAMP-MILLI. K000-EXIT. EXIT. *CUST Begin * EXEC SQL SET :TIME-STAMP-DB2 = CURRENT TIMESTAMP END-EXEC. * Use Oracle Current_Timestamp from dual. EXEC SQL *CUST end and so on... By webmaster | reply
Oracle SQL in source codeExample of adding an Oracle HINT to use a specific index. It appears the Ventyx precompiler skips over SQL that it does not recognize. EXEC SQL DECLARE TIVM10SC1 CURSOR FOR By Anonymous | reply
|
Cause Ventyx pre compiler to fail
It's possible to cause the Ventyx pre compiler (dfora8tran) to fail by using
EXEC CICS LINK PROGRAM (PGM-NAME)
COMMAREA(DATE-COMMAREA)
END-EXEC
Specific case occured with program containing
EXEC SQL SET :TIME-STAMP-DB2 = CURRENT TIMESTAMP END-EXEC.
Program was compiled in an environment using the Oracle database and the Ventyx pre compiler that changes DB2 SQL to Oracle SQL failed to properly replace the code. After a lengthly debugging process it was found that the EXEC CICS LINK PROGRAM was the culprit even though it was in a different COBOL paragraph.