cobol after precompilation

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

cobol after precompilation

Postby daemian » Wed Feb 15, 2012 6:04 pm

After compiling the embedded sql cobol program i saw some call address insted of the sql code.could anyone please tell me what they ment.

Posts: 4
Joined: Wed Feb 01, 2012 6:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: cobol after precompilation


Re: cobol after precompilation

Postby Robert Sample » Wed Feb 15, 2012 6:29 pm

The whole point of a precompile is to change non-COBOL statements (such as EXEC CICS or SQL) into something that can be compiled using the COBOL compiler. Typically, the statements are commented out and CALL statements inserted to invoke the external subsystem and perform the requested operation. The specific called programs depend upon what you are doing in the program, and have absolutely no bearing on anything you, the application programmer, care about. IBM's DB2 developers, for example, would care about the difference between DSNHADDR and DSNHADD2 -- but the application programmer should NEVER have to worry about them.

In other words, if you really feel you have to know -- open a problem report with IBM. But don't expect to get a lot of data back since IBM may well tell you it's none of your business what DSNHADDR, DSNHADD2, and DSNHLI are or do.
Robert Sample
Global moderator
Posts: 3100
Joined: Sat Dec 19, 2009 8:32 pm
Location: Bellevue, Iowa
Has thanked: 1 time
Been thanked: 176 times

Re: cobol after precompilation

Postby BillyBoyo » Wed Feb 15, 2012 7:31 pm

You could just google, you'll probably satisfy yourself that way.
Global moderator
Posts: 3734
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 254 times

Re: cobol after precompilation

Postby Anuj Dhawan » Fri Feb 17, 2012 3:57 pm

DSNADDR is called in the INIT-SQL section (or perhaps it is called SQL-INIT, have not verified). Its purpose is to establish addressability to each of the host variables that your program uses. DSNHLI (High Level Interface) is called to execute an SQL statement.

As Robert has mentioned too, SQL syntax such as EXEC SQL ... END-EXEC is not understood by the COBOL compiler. The DB2 pre-processor converts DB2 syntax into COBOL statements such as CALL and in that routines like DSNADDR and DSNHLI are called.
Anuj Dhawan
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Return to IBM Cobol


  • Related topics
    Last post