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: 8784
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: 1329
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 How to place name of the file where t... danielgp89 SYNCSORT 18 Thu Oct 17, 2019 12:55 am
No new posts Running a REXX exec program using ZOSMF Sakthi344 CLIST & REXX 1 Tue Oct 15, 2019 3:13 pm
No new posts How to handle NULL in COBOL program bhaskar_kanteti COBOL Programming 8 Mon Oct 07, 2019 3:54 pm
This topic is locked: you cannot edit posts or make replies. COBOL/CICS with real time MQ Series u... BPranav CICS 2 Mon Sep 16, 2019 9:19 pm
No new posts REXX - CLIST program to be invoked af... pkmurali CLIST & REXX 5 Wed Sep 04, 2019 4:31 pm

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