Can we find specific member without knowing the name of PDS
or can we search a member to which PDS it belongs to? if so how?

Answer Posted / shekar

If the member is in one of the allocated datasets, then the
following REXX would help you:

/* REXX COMMAND TO search the member in the allocated
dataset */
arg
mem

mem = strip
(mem)

say ' '

if (mem = '' | mem = ' ')
then

do

say 'please give the member to be searched as
argument'

exit


end



/*trace
I*/

call on
error

ADDRESS ISPEXEC "CONTROL ERRORS
RETURN"
call
outtrap "LINE."

ADDRESS
TSO "LISTALC"

call
outtrap "OFF"

say mem
N = line.0
a = 0

ADDRESS TSOEXEC
do I = 1 to N
dataset = line.i
fullds = "'"dataset"("MEM")'"
foundmem = SYSDSN(fullds)
if foundmem = 'OK' then
do
a = a + 1
say '"'MEM'" is found in "'dataset'"'
end
end
if a = 0
then
say '"'MEM'" is not found in list of allocated
datasets'
exit



error:

zerrsm = "Return code"
rc
zerrlm = "Return code from command is"
rc
zerralrm
= "YES"
zerrhm
= "*"
address ispexec "SETMSG MSG
(ISRZ002)"
return

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to left uncode disp?

724


write a jcl to execute a job by 7:00 am on jan 20,1986?

708


how can you check if a file is empty using jcl?

825


What are the 2 types of parameters in dd statement?

664


How do you submit a job for execution?

647






how you can access an uncataloged dataset in a JCL?

665


how do you access an uncataloged dataset in a jcl?

877


How to do automated restart when a job abend?

799


What is the significance of addrspc parameter in the exec statement?

628


what are the statements that are not valid to be included in an include statement?

785


what is use of disp parameter in dd statement?

671


How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?

676


I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?

721


Where & How Do You Code Identifier In Jcl?

710


What is the significance of addrspc parameter in exec statement?

739