Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6074679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:24:33+00:00 2026-05-23T10:24:33+00:00

I need to pick the latest week file from a folder, but I don’t

  • 0

I need to pick the latest week file from a folder, but I don’t want to enter the week every time. It’s a weekly report which I want to make as easy as pressing F3 and having it run.

eg. sales_data_201123
    sales_data_201124

and so on. In the above example, sales_data_201124 should be selected since it’s the latest one.

Please advise!
Rajans

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:24:34+00:00Added an answer on May 23, 2026 at 10:24 am

    There are a few ways you could approach this. One would be to look for a specific file — for example, use the today() function combined with intnx() to calculate what is the name of the file you’re looking for and then open that file.

    I think an easier approach, however, would be to read all the file names in the directory into a data set:

    filename fnames pipe 'dir c:\temp\* /b';
    
    data fnames;
      infile fnames pad missover;
      input @1 filename $255.;
      dt=scan(filename,3,'_');
    run;
    

    Then just sort fnames and choose the last one, or better yet, use proc sql to put the filename into a macro variable:

    proc sql noprint;
      select filename into :fname
      from fnames
      having dt=max(dt);
    quit;
    

    The file you want to open can now be called with &fname.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to pick up list items from an list, and then perform operations
I need to pick a random element from a list, that fulfills certain condition.
I need to pick up some numbers from lines with irregular length, like this:
In essence I want to pick the best match of a prefix from the
I need to validate this simple pick list: <select name=<%= key %>> <option value=ETC
I need to check that a file contains some amounts that match a specific
I need to split (but not preg_split() ) my title on / , :
I need to develop a file indexing application in python and wanted to know
i have a input tag which is non editable, but some times i need
Working on some import process where i need to first upload the file at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.