Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8792
Location: Welsh Wales

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: 1344
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: 6970
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 COBOL batch program using large size ... Akriti Mishra COBOL Programming 3 Thu Mar 26, 2020 11:37 pm
No new posts Trying to submit COBOL PGM - JCL ERRO... sandeep prajapati JCL & VSAM 5 Tue Mar 24, 2020 11:21 pm
No new posts How to create UUID using COBOL PORYES COBOL Programming 0 Tue Mar 17, 2020 4:43 pm
No new posts Navigation program in CICS Ziko13 CICS 11 Fri Mar 06, 2020 2:30 pm
This topic is locked: you cannot edit posts or make replies. Cobol db2 program going in loop sivasaras COBOL Programming 4 Sat Feb 29, 2020 7:44 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us