BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10
How to delete last nth dataset
In a library
9 REPLIES 9
Reeza
Super User
PROC DATASETS - more details are required to identify the nth/last data set. Is that the last created data set or with largest N or a date stamp?
RichardDeVen
Barite | Level 11
  • Do your data set names have a numeric suffix, say IMPORT1 to IMPORT100 and if N=25 you want to delete either IMPORT1-25 or IMPORT76-100 ?
  • Do you want the delete the N newest data sets by modification date ?
  • Do you want the delete the N oldest data sets ?
BrahmanandaRao
Lapis Lazuli | Level 10
Which procedure or dictionary tables have to use
BrahmanandaRao
Lapis Lazuli | Level 10
Give solution
Tom
Super User Tom
Super User

@BrahmanandaRao wrote:
Give solution

To get a solution you need to define the problem in more detail.  Example would help. What is the criteria for ordering? Alphabetical by name?  Numeric by something else?  If so what?  So part of the filename?  Creation timestamp?

 

Show an example with 3 or 4 files and tell which one is the Nth and why.

Reeza
Super User

@BrahmanandaRao wrote:
Give solution

You shouldn't expect an answer or response longer than your question.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 1915 views
  • 4 likes
  • 6 in conversation