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
How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.
Explain the purpose of the dd keylen parameter?
How to pass the parameter in parm using linkage section ? (syntax)?
how do you code a null statement?
Explain how can a stopped job be started again?
What is Cataloged Procedures?
In sms datasets, what is the function of the dd mgmtclas keyword?
Mention the types of job control statements?
How does jcl specify the job to the operating system?
How does jcl act on a cobol code?
Explain how can the attributes of one sms dataset be copied to another dataset?
I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?
what is the resolution for sb37 error
which parameter is use to declare the name of dataset in dd statement?
When output dataset space is required, what quantity categories are used?