DATA Step, Macro, Functions and more

syntax to give multiple datasets in a library that have different prefix or suffix

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 112
Accepted Solution

syntax to give multiple datasets in a library that have different prefix or suffix

Could anyone give an idea how to give a single condition for a library which has same dataset names suffix or prefixes. Like library (dsn) with names like dataone_05apr2015 , dataone_16jun2014 , dataone_09nov2017 

  or like 251_datatwo , 158_datatwo , 986_datathree . 

 

How can we give in dictionary.tables or dictionary.columns etc?

 

thanks,

 


Accepted Solutions
Solution
‎01-31-2018 10:10 PM
PROC Star
Posts: 2,226

Re: syntax to give multiple datasets in a library that have different prefix or suffix

It all depends on how you want your filter to work.

You can use any string function like FIND() or PRXPARSE() to create your match.

You can also use SQL operators such as LIKE (MEMNAME like 'DATAONE%' in your example)

Note the data set names starting with digits are not valid.

View solution in original post


All Replies
Solution
‎01-31-2018 10:10 PM
PROC Star
Posts: 2,226

Re: syntax to give multiple datasets in a library that have different prefix or suffix

It all depends on how you want your filter to work.

You can use any string function like FIND() or PRXPARSE() to create your match.

You can also use SQL operators such as LIKE (MEMNAME like 'DATAONE%' in your example)

Note the data set names starting with digits are not valid.

Frequent Contributor
Posts: 112

Re: syntax to give multiple datasets in a library that have different prefix or suffix

Thanks ChrisNZ. You are correct names are not valid with numbers, I wasn't thinking straight. My intention was if anything different as suffix .

I appreciate your help. 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 80 views
  • 0 likes
  • 2 in conversation