Ok I made a few modifications and now it is working
/* rexx */
say 'Enter the PDS name'
pull dsnname
say 'Enter the Starting character of the Member name'
pull member
dsnname=strip(dsnname)
member=strip(member)
dsnname ="'"dsnname"'"
n=0
l=length(member)
x=outtrap(out.)
address tso "LISTDS "dsnname" MEMBERS"
x=outtrap(off)
do j = 7 to out.0
/*if memstarted= 'N' then do */
SAY SUBSTR(out.j,3,8)
if substr(out.j,3,l) = member then do
n = n+1
Say substr(out.j,3,8)
/*memstarted='y'*/
end
end
say 'The PDS' dsnname 'has ' n 'members starting with ' member
exit
So I took out the memstarted Variable , and changed J to 7 because line 1 to 7 are where the members are stored , now it it working
For the other question , no I don't think we have fileaid , I have to ask IBM if it is installed but I don't think so
but thx again
already it is working in Rexx