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

How gdg are concatenated?

757


Explain in DD statement what is the use of DCB parameter?

747


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

771


Name the statement which can be used to send data to another mvs jes3 node?

697


Can we call instream to catalog and catalog to instream?

759






what is DSN parameter and DISP parameter is used for?

766


What statement marks the beginning of a job step; assigns a name to the step; identifies the program or catalogued or in-stream procedure to be executed in the step?

746


Explain about ISPF/TSO Commands

1439


List the different components of jcl statement?

784


I had Records in file Like this Company Code IBM 2 IBM 1 IBM 4 WIPRO 3 WIPRO 2 WIPRO 9 TCS 4 TCS 6 TCS 3 i want the record of every company with highest code How can i do that?

9048


what is use of disp parameter in dd statement?

741


How to submit jcl through a cobol program?

780


What is use of restart and how to use it?

880


what are JCLLIB and STEPLIB in JCL?

777


A chkpt is the parameter coded for multi-volume qsam datasets in a dd statement. When a chkpt is coded as chkpt=eov, a checkpoint is written to the dataset specified in the sysckeov statement at the end of each volume of the input/output multi-volume dataset. State whether true or false?

841