I might have a solution for the problem in the above link. i couldn't post a reply there and hence i am here.
//LAN01040 EXEC PGM=FTP,PARM='IP address'
//OUTPUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//INPUT DD *
Username
password
CD the-directory-in-which-the-files-are-available
lcd 'Your-high-level-qualifier'
ls *.TXT (disk------- This will list all the files available with *.TXT extension
QUIT
/*
//OUTPUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//INPUT DD *
Username
password
CD the-directory-in-which-the-files-are-available
lcd 'Your-high-level-qualifier'
ls *.TXT (disk------- This will list all the files available with *.TXT extension
QUIT
/*
The logic behind this is that the FTP determines our user ID as the local directory and creates the listing in the flat file with extension ".FTP.LSOUTPUT". So I tried to change the local directory to another name (Your-high-level-qualifier) and executed the job. I got the listing in the PDS "Your-high-level-qualifier.FTP.LSOUTPUT". This should satisfy our requirement.