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: 1224
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 Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
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


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