IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Extract All SQL statements from a COBOL Db2 program


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sivakumar somala

New User


Joined: 26 Sep 2007
Posts: 10
Location: Mumbai

PostPosted: Mon Oct 06, 2014 1:20 pm
Reply with quote

Hi All,


Could you please suggest if it is possible to extract all the SQL statements from a COBOL DB2 program without compiling it.

Many thanks in advance.

Regards,
Siva
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8795
Location: Welsh Wales

PostPosted: Mon Oct 06, 2014 2:10 pm
Reply with quote

Is this specifically REXX related, or that you couldn't be asked to put this in the DB2 forum ?
Back to top
View user's profile Send private message
sivakumar somala

New User


Joined: 26 Sep 2007
Posts: 10
Location: Mumbai

PostPosted: Mon Oct 06, 2014 2:46 pm
Reply with quote

Hi,

Firstly, thanks for your response.

Either of it will do. Wanted to check if there is any rexx snipet or any other way, where we can extract all the SQL/Cursor declarations statements between EXEC SQL and END-EXEC statements in a given COBOL DB2 program.

Thanks in anticipation.

Regards,
Siva
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1348
Location: Israel

PostPosted: Mon Oct 06, 2014 4:55 pm
Reply with quote

Will you EXEC this tool or will it run as an EDIT MACRO ?

In the first case, you have to scan the cobol program line by line from top to bottom, discard comment lines and look for 'EXEC SQL' and 'END-EXEC' strings.

In the second case, you can use the FIND command to jump to the 'EXEC SQL' lines.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Mon Oct 06, 2014 7:52 pm
Reply with quote

all the sql statements can be extracted from the db2 tables.
too lazy to look myself, but there is a db2 table, that contains rows for each program, the program name is part of the key.
Back to top
View user's profile Send private message
kkielak

New User


Joined: 28 Dec 2013
Posts: 1
Location: Poland

PostPosted: Thu Oct 09, 2014 2:32 pm
Reply with quote

Do you still need this? I can create small REXX script for that ...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts COBOL/CICS Emulators CICS 4
This topic is locked: you cannot edit posts or make replies. how to extract a portion (e.g. fields... SYNCSORT 8
No new posts linking an ALC program to a Relationa... PL/I & Assembler 1
This topic is locked: you cannot edit posts or make replies. Passing a field name to COBOL program COBOL Programming 10
No new posts COBOL Performance Tuning COBOL Programming 6
Search our Forums:

Back to Top