Hello
I am new into rexx and have been asked to write few codes. So i wrote a code where we can open a copybook directly from cobol code by placing the cursor on the copybook name. I dont have the code with me right now but i can attach it tomorrow. Basically whats happening is first it will search the copybook name in the endevor stage libraries and open the copybook if available. The stage library names i am giving as input through PULL command. Suppose if i enter library A and the the element is not present it will throw a message. Then again i enter library B to check if it is present or not. Can this be made simpler? What i was thinking like if i could do a SRCHFOR for the copybook name in the libraries and somehow i could capture the status code for example FOUND in this library(just like normal srchfor when it displays found next to the pds or ps) and accordingly open that dataset directly. That way i would not have to manually check evry dataset. Is that possible? Kindly help as i have started two weeks ago learning rexx and i dont know how to call srchfor.
/* using datasets in a list */
dsl='SYS1.MACLIB SYS1.MODGEN'
member = 'IHASDWA'
fds=''
do n=1 to words(dsl) until fds<>''
ds = word(dsl,n)
if sysdsn("'"ds"("member")'")='OK' then fds=ds
end
if fds='' then do
say member 'not found in any library'
exit 12
end
say member 'is in' fds