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

Search 34000 cobol programs for a list of copybooks.


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

New User


Joined: 22 Aug 2006
Posts: 95
Location: india

PostPosted: Tue Nov 18, 2008 6:21 am
Reply with quote

Hi all,

1) Under a PDS I have around 34000 cobol programs. eg. my.pds.cobol.
2) I have a list of copybooks (around 1300) in a PS.

I want to search all the cobol codes for the list of copybooks to check whether any of the cobol programs uses enlisted copybooks. For this I have written a small REXX code, which will read one record from the copybook file and searches each member in the Cobol program PDS one by one for that copybook.


Code:

DO CNT = 1 TO SRH.0                                   
   L.1=SRH.CNT                                       
   L.0=1                                             
   "EXECIO" L.0 "DISKW CALLCOB (STEM L."             
   DO CURMEM = 1 TO SRC.0                             
      PARSE VALUE SRC.CURMEM WITH MEMNM               
      MEMNM=STRIP(MEMNM)                             
      "ALLOC F(SOU) DS('"FULLNAME"("MEMNM")') SHR"   
      "EXECIO * DISKR SOU(STEM SLINE. FINIS)"         
      "FREE F(SOU)"                                   
      DO CLINE=1 TO SLINE.0                           
         IF POS(SRH.CNT,SLINE.CLINE) > 0 THEN         
            DO                                       
              L.1="          "MEMNM                   
              L.0=1                                   
              "EXECIO" L.0 "DISKW CALLCOB (STEM L."   
            END                                       
      END                                             
  END                                                 



Issue :

The above code is taking a hell lot of time for generating the list.

Can anyone provide me a more efficient approach for this issue.

Thanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Nov 18, 2008 7:01 am
Reply with quote

Grab an ISPF 3.14 search batch JCL and write a quick program to generate the 1300 search members in the JCL I'm not sure what the limit on ISRUPC is for search, so you may have to break it into more than one job, but it's almost certainly faster than what you're doing.
Back to top
View user's profile Send private message
abhishekmdwivedi

New User


Joined: 22 Aug 2006
Posts: 95
Location: india

PostPosted: Tue Nov 18, 2008 8:41 am
Reply with quote

Thanks Robert,

But this will won't help me in sub grouping the cobol programs list on the basis of copybooks.
eg :
Copybook1
COBOL1
COBOL2
COBOL3
Copybook2
COBOL2
COBOL5

Current REXX code helps me in organizing this in a better way.

Pleased to see your solution but can the above be achieved using a approach. ISRUPC is not helping me in setting up this.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 18, 2008 9:38 am
Reply with quote

Hello,

With just a little bit of work you should be able to take the output from the job Robert suggested and product the output you want.

If you're determined to use the rexx code, at least run this on the weekend in batch.
Back to top
View user's profile Send private message
abhishekmdwivedi

New User


Joined: 22 Aug 2006
Posts: 95
Location: india

PostPosted: Tue Nov 18, 2008 10:36 am
Reply with quote

Hi Dick,

Thanks for the reply.

Can you please provide me a brief of what you are saying.
Some more input to your post will help me better understand the approach you are pointing to.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 18, 2008 11:03 am
Reply with quote

Hello,

Part 1
I believe Robert's process will run much faster than the rexx code. It you used Robert's suggestion, with a little bit of work you could take the output that is not as you want it and turn into output like what you want.

Part 2
If the rexx code posted is used it will take "a hell lot of time ", so i'd recommend running this over the weekend to cause the least system impact as well as get the best run-time possible. I would also run this in batch rather than online. There should be more memory and cpu time available in batch, so this may prevent impacts on the tso resources as well as prevent abends.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Tue Nov 18, 2008 11:39 am
Reply with quote

Just thoughs.

( if I see well ) Here you explore first your set of copybooks and for each of them you open and close all the members of PDS.
Rexx is not really the best choice to do that.

So if you have 10 copybooks and 34000 members : 340000 open's and close's

If you first read members one by one and loop in the set of copybooks you will reduce the numbers to only exactty the numbers od members here 34000.

Second, do you have the opportunity to use SAS instead of REXX?

My two eurocents

Cheers
Pierre
Back to top
View user's profile Send private message
abhishekmdwivedi

New User


Joined: 22 Aug 2006
Posts: 95
Location: india

PostPosted: Tue Nov 18, 2008 11:49 am
Reply with quote

Quote:

So if you have 10 copybooks and 34000 members : 340000 open's and close's

If you first read members one by one and loop in the set of copybooks you will reduce the numbers to only exactty the numbers od members here 34000.


Yes, I have implemented that change in my second try.... but still the results are taking lot of time.

Quote:

Second, do you have the opportunity to use SAS instead of REXX?


Yes, I have SAS. But a limited knowledge of it. Can you please de-brief a approach which I can take in SAS. Currently I am following what Dick has suggested but can try SAS.
A small help for start will help a lot.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Nov 18, 2008 12:55 pm
Reply with quote

why don't You use IRSLEMX and process the output ???
ISRLEMX is an utiity to cross reference copy books in many languages
its option 12 in foreground or background
all the collecting will be done by ispf, an You simply have to process the output
to format in any way You like...
simple and effective icon_cool.gif
Back to top
View user's profile Send private message
abhishekmdwivedi

New User


Joined: 22 Aug 2006
Posts: 95
Location: india

PostPosted: Mon Nov 24, 2008 1:45 pm
Reply with quote

Hi All,

I have executed the REXX in the Weekend Batch for the results. And have obtain the desired output.

Thank you all for your inputs to the issue.

Regards,
Abhi
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Nov 24, 2008 2:53 pm
Reply with quote

You're welcome - thanks for letting us know it ran icon_smile.gif

Just curious, now long did it take and how much cpu was required?

d
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top