Here is the snipet that worked.
OPN = 'JUSTIN'
X = OUTTRAP("OPT.")
ADDRESS TSO "LISTDS "PDS" M"
X = OUTTRAP("OFF")
PDS = STRIP(PDS,"B","'")
DO I = 7 TO OPT.0
OPT.I = STRIP(OPT.I)
ADDRESS ISPEXEC "VIEW DATASET ('"PDS"("OPT.I")') MACRO ("OPN")"
However this opens the pds members in View mode and applies the Marco named OPN. But I'm facing some issues like I need to press F3 everytime to move on to the next member. Even after coding
"ISREDIT END" as the last edit statement I'm still facin issues. Any suggestions would be helpful.