BookmarkSubscribeRSS Feed
R_Win
Calcite | Level 5

Hi every day in this path i will be getting the data "/sas/ saslev1/data/10/may10/may06" this is the path for one day tomoroow the data will be in new folfer as may07 like this for every month the month folder will chage and every day the data folder will be changed

ex: "/sas/ saslev1/data/10/may10/may06"  for may month and may06 date

      "/sas/ saslev1/data/10/may10/may07"  for may month and may07 date

.

. like this the data is placed in the respective floders daily how can i automat and run for each day i having data for 3 years and the data is in excel which is havinf data_may06 ending has the date and data is common how can i do this....

2 REPLIES 2
art297
Opal | Level 21

You can accomplish it like I did, below, or wrap everything into a single %let statement with a bunch of %sysfunc calls:

%let date_wanted=6may2010;

data _null_;

  year=year("&date_wanted."d);

  month=month("&date_wanted."d);

  day=day("&date_wanted."d);

  wmonth=put("&date_wanted"d,worddate3.);

  date_need=catt("sas/saslev1/data/",

  substr(strip(year),3,2),

  "/",

  wmonth,

  substr(strip(year),3,2),

  "/",

  wmonth,

  put(day,z2.) );

  call symput("path",put(date_need,$32.));

run;

%put &path.;

Ksharp
Super User

If you can use filename 's pipe function ,then you can search all the xls under some one directory .

Check the OS command about it , dir for win and ls for Unix, they are all has this ability.

Ksharp

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 930 views
  • 0 likes
  • 3 in conversation