Help using Base SAS procedures

Reg:Data import and change the file

Reply
Regular Contributor
Posts: 229

Reg:Data import and change the file

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....

PROC Star
Posts: 7,492

Reg:Data import and change the file

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.;

Super User
Posts: 10,045

Reg:Data import and change the file

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

Ask a Question
Discussion stats
  • 2 replies
  • 106 views
  • 0 likes
  • 3 in conversation