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

need REXX code to extract all the SQLs in COBOL pgm


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

New User


Joined: 21 Nov 2007
Posts: 28
Location: chennai

PostPosted: Sat Feb 09, 2008 3:32 pm
Reply with quote

Hi All,
My requirement is as follows

1) Process each member from the PDS given and extract all the SQL statements
into another PDS with the same member name. I need to skip the SQLs with FETCH
or CLOSE or OPEN statements.
2) All the i/p members contain only COBOL pgms.If no SQLs found in the member skip it.
3) All SQL statements are coded between EXEC and END-EXEC.

Can any one help me please with the source code ? I'm very new to REXX.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sat Feb 09, 2008 3:37 pm
Reply with quote

I can't help you "with the source code", but is is pretty simple mission:
1. Loop through all members using LMMLIST or DSLIST.
2. For each member, use the ISPF service VIEW with the MACRO option.
3. Write a macro that use the FIND command to find every EXEC SQL which is not commented.
4. Use EXECIO to create the new members.

O.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Sat Feb 09, 2008 3:54 pm
Reply with quote

Wouldn't it be easier to take a look through the DB2 tables, PACKSTMT or something like that, or the DBRM library to find the SQL code.

I believe that this is already extracted by DB2 at pre compile time.

Why extract what is already extracted ?
Back to top
View user's profile Send private message
suresh1624

New User


Joined: 21 Nov 2007
Posts: 28
Location: chennai

PostPosted: Sat Feb 09, 2008 4:11 pm
Reply with quote

What is PACKSTMT? The queries in the DBRM are written in a coded format.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sat Feb 09, 2008 4:17 pm
Reply with quote

But you can get the list of members that contains SQL from the DBRM library..... it will cost you some search time...

O.
Back to top
View user's profile Send private message
suresh1624

New User


Joined: 21 Nov 2007
Posts: 28
Location: chennai

PostPosted: Sat Feb 09, 2008 6:08 pm
Reply with quote

ofer61,
Thanks for your help, but i'm new to rexx and it take time to go through the manual and understand what you said; Step by step procedure ll be helpful if had a little knowledge in REXX;any way thanks for your time;
Back to top
View user's profile Send private message
suresh1624

New User


Joined: 21 Nov 2007
Posts: 28
Location: chennai

PostPosted: Mon Feb 11, 2008 10:12 am
Reply with quote

Can any one of u help me with the source code please. I think the logic is already given by ofer71 but to implement it takes time for me as i m new to rexx. Pls help me

Thanks,
Suresh.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Feb 11, 2008 11:41 am
Reply with quote

Well, I can do the work for you in about 6-8 hours. My rate is $100 per hour + tax. You will get a tested and working code.

O.
Back to top
View user's profile Send private message
suresh1624

New User


Joined: 21 Nov 2007
Posts: 28
Location: chennai

PostPosted: Mon Feb 11, 2008 12:17 pm
Reply with quote

ofer71,
its k; i understand that i shouldn't expect source code; icon_redface.gif
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Mon Feb 11, 2008 6:26 pm
Reply with quote

$100/hour is pretty cheap for freelance consulting. You should take him up on that
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Feb 11, 2008 6:42 pm
Reply with quote

suresh1624 wrote:
Can any one of u help me with the source code please. I think the logic is already given by ofer71 but to implement it takes time for me as i m new to rexx.


Then why not use something else you're more familiar with?
Back to top
View user's profile Send private message
suresh1624

New User


Joined: 21 Nov 2007
Posts: 28
Location: chennai

PostPosted: Thu Feb 21, 2008 3:59 pm
Reply with quote

Hi All,
Here is the code which i asked. I need not pay anyone now :lol:
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Fri Feb 29, 2008 6:44 am
Reply with quote

Good Job techies,

You have introduced one new rexx programmer to the mainframe world !!!

( Suresh i beleive you have written the code).

anyway thanks for sharing the code in forum.
Back to top
View user's profile Send private message
Arunraj Murugaiyan

New User


Joined: 27 Nov 2015
Posts: 5
Location: INDIA

PostPosted: Mon Nov 30, 2015 1:01 pm
Reply with quote

Thanks Suresh n team,

I am working on same kind of requirement and this code make easy my work.
Thank you all once again icon_smile.gif.

-Arun
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Mon Nov 30, 2015 9:13 pm
Reply with quote

Welcome!!
JACKPOT 777 for you icon_biggrin.gif
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top