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
 

 

Extract All SQL statements from a COBOL Db2 program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Extract All SQL statements from a COBOL Db2 program
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: 8593
Location: Back in jolly old England

PostPosted: Mon Oct 06, 2014 2:10 pm    Post subject:
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    Post subject: Reply to: Extract All SQL statements from a COBOL Db2 progra
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: 1219
Location: Israel

PostPosted: Mon Oct 06, 2014 4:55 pm    Post subject: Reply to: Extract All SQL statements from a COBOL Db2 progra
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: 6966
Location: porcelain throne

PostPosted: Mon Oct 06, 2014 7:52 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am


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