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
 

 

need REXX code to extract all the SQLs in COBOL pgm

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: need REXX code to extract all the SQLs in COBOL pgm
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: 2360
Location: Israel

PostPosted: Sat Feb 09, 2008 3:37 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Sat Feb 09, 2008 3:54 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Sat Feb 09, 2008 4:17 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Mon Feb 11, 2008 11:41 am    Post subject:
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    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Feb 11, 2008 6:42 pm    Post subject:
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    Post subject: Reply to: need REXX code to extract all the SQLs in COBOL pg
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    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Mon Nov 30, 2015 9:13 pm    Post subject:
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    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 PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 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


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