View previous topic :: View next topic
|
Author |
Message |
suresh1624
New User
Joined: 21 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
suresh1624
New User
Joined: 21 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
What is PACKSTMT? The queries in the DBRM are written in a coded format. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
suresh1624
New User
Joined: 21 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
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 |
|
|
suresh1624
New User
Joined: 21 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
suresh1624
New User
Joined: 21 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
ofer71,
its k; i understand that i shouldn't expect source code; |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 631 Location: Wisconsin
|
|
|
|
$100/hour is pretty cheap for freelance consulting. You should take him up on that |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
suresh1624
New User
Joined: 21 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
Hi All,
Here is the code which i asked. I need not pay anyone now :lol: |
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
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 |
|
|
Arunraj Murugaiyan
New User
Joined: 27 Nov 2015 Posts: 5 Location: INDIA
|
|
|
|
Thanks Suresh n team,
I am working on same kind of requirement and this code make easy my work.
Thank you all once again .
-Arun |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Welcome!!
JACKPOT 777 for you |
|
Back to top |
|
|
|