IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

automate searching loadlib data

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> CLIST & REXX
View previous topic :: View next topic  
Author Message
sks_tvpm



Joined: 21 Nov 2005
Posts: 5

Posted: Thu Apr 27, 2006 1:25 pm    Post subject: automate searching loadlib data  

Hi,

I have a requirement to search a string the loadlib of a cobol program.

I tried to open and read the loadlib member using EXECIO. This returned error since the loadlib pds is an unformatted one.

I able to open and view the member using the code given below.
OPEN_MEMBER:
ADDRESS ISPEXEC " VIEW DATASET ("TEMPNAME")"
ADDRESS TSO " FREE "
RETURN

But I actually want to automate the search rather than mannually opening and searching.
I tried to use OUTTRAP before ADDRESS ISPEXEC " VIEW DATASET ("TEMPNAME")" , but that also didn't work.

I would appreciate if anyone can help me to solve this problem.

thanks n regards
sks_tvpm
Back to top  
antonrino.b



Joined: 10 Jan 2006
Posts: 74
Location: Germany

Posted: Sun May 28, 2006 4:21 pm    Post subject: Re: automate searching loadlib data  

Hi,

Try reading the loadlib using the lmget service of ISPF. Find below a sample REXX routine to get the records from loadlib.

Code: /*rexx*/                                                 
dsn1=anton.sample.load
"ispexec lminit   dataid(lmd1) dataset('"dsn1"')"         
"ispexec lmopen dataid("lmd1")"                           
"ispexec lmmfind dataid("lmd1") member(mymember)"         
"ispexec lmget dataid("lmd1") mode(invar) dataloc(inrec),
    datalen(inlen) maxlen(20000)"                         
    say inlen                                             
    say inrec                                             
"ispexec lmfree   dataid("lmd1")"     


lmget should be preceded by lmmfind.

Replace the following in the above code as per your requirement.

dsn1 - your load library
mymember - the member name which you want to read
maxlen - maximum length of the record in your load library

the record will be read into variable inrec. and the length of the record read will be stored into inlen.


Hope this would help.

Thanks and Regards,
Antu
Back to top  
sks_tvpm



Joined: 21 Nov 2005
Posts: 5

Posted: Thu Nov 22, 2007 4:16 pm    Post subject: Thank you  

:)
Back to top  
enrico-sorichetti



Joined: 14 Mar 2007
Posts: 3273
Location: italy

Posted: Thu Nov 22, 2007 4:19 pm    Post subject: Reply to: automate searching loadlib data  

Quote: I have a requirement to search a string the loadlib of a cobol program.

The ISPF searchfor utility will happily scan LOAD libraries...

the return code will tell if the string was found,
customizing the output You will simply get a member list with the indication whether the string was found or not
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> CLIST & REXX
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM