View previous topic :: View next topic |
Author |
Message |
sumithar Beginner
Joined: 22 Sep 2006 Posts: 84 Topics: 29
|
Posted: Mon Apr 09, 2012 1:00 pm Post subject: "F"ind in load modules |
|
|
Since I don't seem to get any bites to the question I posted on the DB forum, let me ask a somewhat related question without running the risk of multiposting.
Is it possible to programmatically find a string in a load module dataset member? With source code type datasets I can do this using an edit macro, right?
But edit macros won't work in load module dataset members.
Is there some other tack I could take?
Thanks! |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Apr 09, 2012 1:29 pm Post subject: |
|
|
You might try Superc. I am not sure if this utility will handle recfm=u datasets (which is how loadlibs are defined). _________________ All the best,
di |
|
Back to top |
|
|
sumithar Beginner
Joined: 22 Sep 2006 Posts: 84 Topics: 29
|
Posted: Mon Apr 09, 2012 3:37 pm Post subject: |
|
|
Hi,
I checked, ISRSUPC does work with Load module datasets. I haven't used it inside REXX. But looks a valid possibility, thanks for the pointer. |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Tue Apr 10, 2012 12:54 pm Post subject: |
|
|
Good luck - we'd be interested to hear the result
di |
|
Back to top |
|
|
sumithar Beginner
Joined: 22 Sep 2006 Posts: 84 Topics: 29
|
Posted: Tue Apr 10, 2012 2:01 pm Post subject: |
|
|
papadi wrote: | Good luck - we'd be interested to hear the result
di |
here is what I came up with, it also answers a question I posted on the database forum. I found how to use ISRSUPC in REXX on another forum...comments and critiques are welcome!
mem is the member for which i want to compare the timestamp and accepted as command line input
Code: | /* REXX */
arg mem
"alloc da('PROD.DBRMLIB("mem")') f(MYINDD),shr reuse"
"execio 1 diskr MYINDD (finis stem IREC." /*read 1st record into stem*/
"Free f(MYINDD)"
tmstp = c2x(substr(irec.1,25,4)) /*timestamp is the 25th byte*/
"ALLOC F(newdd) DA('PROD.LOADLIB("mem")') SHR REU"
"ALLOC F(outdd) NEW REU UNIT(VIO) SP(1,1) CYLINDERS"
"ALLOC F(sysin) NEW REU UNIT(VIO) RECFM(F B) LRECL(80)"
tmstp='X'||"'"||tmstp||"'" /*search as hex string*/
Queue "SRCHFOR "tmstp""
"EXECIO "Queued()" DISKW sysin (FINIS"
"CALL *(ISRSUPC) 'SRCHCMP,ANYC'"
"EXECIO * DISKR outdd (STEM supc. FINIS"
if pos('SRCHFOR',supc.10) > 0 then
/*I found that line 10 has the word SRCHFOR if no match is found!*/
say 'not found'
else
say 'founD'
exit 0 |
|
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Wed Apr 11, 2012 1:23 pm Post subject: |
|
|
Cool - thank you for posting your solution.
di |
|
Back to top |
|
|
|
|