Hello,
imagine that in my /folder1/subfolder1 , I have dataset named as below
test_d20210601
test_d20210602
...
test_d20210630
What I would like to do is to take the first dataset (test_d20210601) and rename it global. Thereafter to append all the other datasets into the global.
Here's my code:
libname src2 spde '/folder1/subfolder1';
data _null_;
length fname $ 20;
format date yymmddn8.;
do date='01JUN2021'd to '30JUN2021'd;
IF put(date,yymmddn8.) eq 20210601 then
do;
fname=strip(cats('test_d',put(date,yymmddn8.)));
put fname;
/*
Data global;
set src2.fname;
run;
*/
end;
else
do;
fname=strip(cats('test_dd',put(date,yymmddn8.)));
put fname;
/*
fname=strip(cats('test_d',put(date,yymmddn8.)));
proc append base=global data=src2.fname;
run;
*/
end;
END;
run;
This code works perferctly if I want to get the fname into the log file.
However, if I want to comment the put fname and comment out the piece of code that was comment in, it is not working.
What's wrong in my code.
Is it possible to create a dataset then append the other the way I would like to do it?
if not what's the best way?
Yes you are right.
Yes you are right.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.