I have a piece of code that lists the datasets starting with a particular high level qualifier:
FNAMES. = ""
cmdline. = ""
"EXECIO * DISKR CMDIN (STEM cmdline. FINIS"
parse var cmdline.1 var1 var2
indd = strip(var1)
x = outtrap("save.","*")
" LISTC NAME LEVEL('"||indd||"') "
count = save.0
i = 1
j = 1
do until (count = 0)
if POS('IN-CAT',save.i)== 0 then
FNAMES.j = substr(save.i,17)
j = j + 1
/*say 'member name ' i ' = ' save.i*/
i = i + 1
count = count - 1
if FNAMES.0 == 0 then
FNAMES.1 = 'no dataset exists'
FNAMES.J = ""
"EXECIO * DISKW MLISTD (STEM FNAMES. FINIS"
This code works fine and returns me the list of datasets without any trouble as long as i dont use wildcard characters.
For example: If I give DEVZS.ABS as input the code fetches all the datasets that have these 2 as high level qualifier.
But if I give DEVZS.AB* or DEVZS.AAB*.ABC then it doesnt work because of the presence of wildcard. Can any one help in changing the LISTC command or using any other command which would remove this limitation.