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
 

 

Search 34000 cobol programs for a list of copybooks.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Search 34000 cobol programs for a list of copybooks.
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: 7931
Location: Bellevue, IA

PostPosted: Tue Nov 18, 2008 7:01 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Nov 18, 2008 9:38 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Nov 18, 2008 11:03 am    Post subject:
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: 456
Location: Belgium

PostPosted: Tue Nov 18, 2008 11:39 am    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Tue Nov 18, 2008 12:55 pm    Post subject: Reply to: Search 34000 cobol programs for a list of copybook
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    Post subject:
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

Site Director


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

PostPosted: Mon Nov 24, 2008 2:53 pm    Post subject: Reply to: Search 34000 cobol programs for a list of copybook
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    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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
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