View previous topic :: View next topic
|
Author |
Message |
sks_tvpm
New User
Joined: 21 Nov 2005 Posts: 5
|
|
|
|
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
New User
Joined: 10 Jan 2006 Posts: 76 Location: Germany
|
|
|
|
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
New User
Joined: 21 Nov 2005 Posts: 5
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
|