Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 Select statement in COBOL Report Writer

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
taciturn

New User


Joined: 27 Aug 2007
Posts: 3
Location: Philippines

PostPosted: Thu Mar 12, 2009 2:58 am    Post subject: DB2 Select statement in COBOL Report Writer
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 12, 2009 4:32 am    Post subject:
Reply with quote

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
View user's profile Send private message
taciturn

New User


Joined: 27 Aug 2007
Posts: 3
Location: Philippines

PostPosted: Fri Mar 13, 2009 2:28 am    Post subject:
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Mar 13, 2009 2:34 am    Post subject:
Reply with quote

Well, if the compiler found an EXEC SQL then the DB2 pre-processer hasn't been run on the program first.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Mar 13, 2009 2:53 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 13, 2009 3:41 am    Post subject:
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1239
Location: Richfield, MN, USA

PostPosted: Fri Mar 13, 2009 9:54 am    Post subject:
Reply with quote

According to http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr30/APPENDIX1.7?ACTION=MATCHES&REQUEST=report+writer&TYPE=FUZZY&SHELF=&DT=20050714120224&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT it is.
Back to top
View user's profile Send private message
taciturn

New User


Joined: 27 Aug 2007
Posts: 3
Location: Philippines

PostPosted: Fri Mar 13, 2009 11:29 pm    Post subject:
Reply with quote

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. icon_smile.gif

Thanks All!
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Sat Mar 14, 2009 12:20 am    Post subject:
Reply with quote

For DB2 you also need to do the following:

EXEC SQL INCLUDE SQLCA END-EXEC
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Mar 14, 2009 12:26 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us