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

  • SEARCH
  • Home
  • 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 7405313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:23:07+00:00 2026-05-29T05:23:07+00:00

I run some sas queries on a monthly basis and they export data to

  • 0

I run some sas queries on a monthly basis and they export data to specific folders. Problem is I have to manually make these folders before I run the code so SAS wont error out.

Is there any way to automate this?

My folders have to be named in this fashion:

number of the Month – Name of the Month Year (12 – Dec 2011). I would also like to create a subfolder called Excel.

Also is there any way the month and number is populated automatically…so when I run this in January it changes to (1 – Jan 2012)?

  • 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-29T05:23:08+00:00Added an answer on May 29, 2026 at 5:23 am

    The X or SYSTASK commands can do this.

    However, if you are in the Enterprise Guide environment (I don’t believe) it is allowed by default in 9.2. I think 9.3 is going to allow it by default in the local environment (SAS DUMMY blog)

    Example:

    options noxwait;
    
    data _null_;
     month=strip(put(month(today()),2.));
     year=strip(put(year(today()),4.));
     monname=put(today(),monname3.);
     dir_name=month !! " - " !! monname !! " " !! year;
     call symputx('dir_name',dir_name);
    run;
    %put &dir_name;
    
    x "cd D:\Data";
    x "%str(mkdir %"&dir_name%")";
    

    Another option is the DCREATE function

    Example:

    data _null_;
     month=month(today());
     year=year(today());
    
     dir_name=put(month,2.) !! " - " !! put(today(),monname3.) !! " " !! put(year,4.);
     NewDirectory=dcreate(dir_name,'D:\Data\');
    run;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I run some SAS queries monthly and they all take a fairly long time
I have to run some student-made code that they made as homework, I'm running
I'm trying to run some queries to get rid of XSS in our database
is it possible to run some of my PLINQ AsParallel() - Queries with a
I have a SAS program that loops through certain sets of data and generates
I have written some SAS code that calls R via the x command (I
I'm trying to run some commands in paralel, in background, using bash. Here's what
I am trying to run some unit tests in a C# Windows Forms application
I'm trying to run some python code under Apache 2.2 / mod_python 3.2.8. Eventually
I'd like to run some small private/home applications on a local machine, but I

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.