Page 1 of 1

How to read the member again Filtered via OUTTRAP

PostPosted: Thu Apr 03, 2014 2:52 pm
by samurai
Could someone help me out to continue the below coding to read all the member and find if it contains the field XXX in it.


THEPDS = "'MX9C.SAMPLE1.JCL'"
X = OUTTRAP('ML.')
"LISTDS "THEPDS" MEMBERS"
X = OUTTRAP('OFF')
DO N = 7 TO ML.0
SAY ML.N

O/p is
SAM1
SAM2
SAM3

Re: How to read the member again Filtered via OUTTRAP

PostPosted: Thu Apr 03, 2014 4:04 pm
by samurai
i have added the below code to read all the member of a PDS, while using sysdsn command its throwing error as below, Can someone help !!

ML.N = STRIP(ML.N)
PDS_NAME = STRIP(THEPDS)"("ML.N")"
IF SYSDSN("'"PDS_NAME"'") = "OK" THEN
SAY PDS_NAME



error:

IKJ56709I INVALID DATA SET NAME, ''MX9C.SAMPLE1.JCL'(SAM1)'
IKJ56709I INVALID DATA SET NAME, ''MX9C.SAMPLE1.JCL'(SAM2)'
IKJ56709I INVALID DATA SET NAME, ''MX9C.SAMPLE1.JCL'(SAM3)'

Re: How to read the member again Filtered via OUTTRAP

PostPosted: Thu Apr 03, 2014 9:33 pm
by Pedro
IKJ56709I INVALID DATA SET NAME, ''MX9C.SAMPLE1.JCL'(SAM1)'
THEPDS seems to contain single quotes. You need to strip out the quotes so that only one appears at the beginning and one at the end.