View previous topic :: View next topic
|
Author |
Message |
taciturn
New User
Joined: 27 Aug 2007 Posts: 3 Location: Philippines
|
|
|
|
Hi!
Does anyone know if a COBOL Report Writer program can contain a select db2 statement?
I'm planning to edit a pgm but they said it has a report writer code . I'm not sure actually if it has a difference with the 'normal' cobol code.
Thanks! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
I am not aware of anything that prohibits the use of sql and report-writer in the same module.
Suggest it would be an easy experiment to add a simple count(*) to the program and run the compile/test |
|
Back to top |
|
|
taciturn
New User
Joined: 27 Aug 2007 Posts: 3 Location: Philippines
|
|
|
|
Thanks Dick!
I tried what you suggested and i got this:
IGYPS0225-S An "EXEC SQL" statement was found, but the "SQL" compiler option was not
1PP 5655-G53 IBM Enterprise COBOL for z/OS 3.4.1
in effect. The statement was discarded.
... it looks like it doesn't support SQL. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Well, if the compiler found an EXEC SQL then the DB2 pre-processer hasn't been run on the program first. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Or the sql option wasn't enabled to use the DB2 precompiler in the Enterprise Compiler. This has nothing to do with the report writer which isn't supported in the Enterprise Compiler. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
This has nothing to do with the report writer which isn't supported in the Enterprise Compiler. |
I recall the Report Writer being removed form the compiler, but thought it was now an add-on product that would still work with Enterprise cobol.
Is the add-on still available? Will it work with Enterprise cobol?
Quote: |
it looks like it doesn't support SQL. |
Suggest you speak with someone in your group that compiles db2 programs and have them show you the standard cobol/db2 compile proces you should use now that the program includes sql. As was mentioned, the db2 pre-compiler must be used. Once the current error is resolved, the report writer may or may not work.
Keep us posted |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
Back to top |
|
|
taciturn
New User
Joined: 27 Aug 2007 Posts: 3 Location: Philippines
|
|
|
|
Hello!
Here's what happened:
I compiled the pgm using db2 precompile and the error for the sql compiler was resolved. but I got a new error:
PP 5655-G53 IBM Enterprise COBOL for z/OS 3.4.1
1350 IGYPS2121-S "SQLCA" was not defined as a data-name. The statement was discarded
Originally, the COMPILE PARMS of the pgm is:
COMPILE PARMS ===> EX(INX(RW),PRTX(RW)),DYNAM
I removed the PARMS and recompiled. The SQLCA error was gone but I received another error:
364 IGYDS0148-S "REPORT" is a reserved word related to language not supported
Now, I'm not sure what to place on the compile parms that will work for report writer and db2...
If all else fails, I'll just create a separate new pgm for db2.
Thanks All! |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
For DB2 you also need to do the following:
EXEC SQL INCLUDE SQLCA END-EXEC |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
1350 IGYPS2121-S "SQLCA" was not defined as a data-name. |
Does the code include:
Code: |
EXEC SQL
INCLUDE SQLCA
END-EXEC.
|
I'm not sure why the removed parms would have an affect on the sqlca definition.
Suggest you check with the system support people who maintain the compile jcl to make sure you are using the proper steps/parameters. |
|
Back to top |
|
|
|