Buscar tabela mais recente por sufixo

Ao armazenar tabelas no formato TABELA_ANOMES (TABELA_202001, TABELA_202002 ...) tem-se a necessidade de buscar a tabela do mês mais recente.

1
2
3
4
5
6
proc sql noprint;
    select max(scan(memname,4,'_')) into :date
    from dictionary.tables
    where 
        libname = upcase("MEU_LOCAL") and memname like 'TABELA_%';
quit;