/* REXX */
"ISPEXEC LMDINIT LISTID(LISTID) LEVEL(DYD.PERM)"
"ISPEXEC LMDLIST LISTID(&listid) OPTION(LIST) DATASET(dsn)"
If rc = 0 Then
"ISPEXEC LMERASE DATASET('"dsn"')"
Please use the code tags to present code and data - your indentation is then retained.
Please search the forum before posting. This question has been asked before. Note that you will need the answer that caters for the use of ISPEXEC commands.