Ok I made a few modifications and now it is working
/* rexx */
say 'Enter the PDS name'
say 'Enter the Starting character of the Member name'
address tso "LISTDS "dsnname" MEMBERS"
do j = 7 to out.0
/*if memstarted= 'N' then do */
if substr(out.j,3,l) = member then do
n = n+1
say 'The PDS' dsnname 'has ' n 'members starting with ' member
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