Post the full code you're trying to use, include the macro declarations. We don't know how you're defining them or what they look like
Hi Reeza,
Sure...
* flat file data path;
%global fpath;
%let fpath = /data/DEVELOPMENT/LANDING/IN_FILES;
* archive file data path;
%global apath;
%let apath = /data/DEVELOPMENT/LANDING/ARCHIVED_IN;
Moving Flat Files:
This is working:
x "mv /data/DEVELOPMENT/LANDING/IN_FILES/ET002A.D170605.EDLY.TXT /data/DEVELOPMENT/LANDING/ARCHIVED_IN";
What i need is :
x "mv &fpath/ET002A.D&tdate..EDLY.TXT &apath";
tdate is not defined anywhere.
@SAS_INFO wrote:
Hi Reeza,
Sure...
* flat file data path;
%global fpath;
%let fpath = /data/DEVELOPMENT/LANDING/IN_FILES;
* archive file data path;
%global apath;
%let apath = /data/DEVELOPMENT/LANDING/ARCHIVED_IN;
Moving Flat Files:
This is working:
x "mv /data/DEVELOPMENT/LANDING/IN_FILES/ET002A.D170605.EDLY.TXT /data/DEVELOPMENT/LANDING/ARCHIVED_IN";
What i need is :
x "mv &fpath/ET002A.D&tdate..EDLY.TXT &apath";
/*hi @SAS_INFO
the macro variables are resolved within the _NUll_ data step, so try this */
* flat file data path;
%global fpath;
%let fpath = /data/DEVELOPMENT/LANDING/IN_FILES;
* archive file data path;
%global apath;
%let apath = /data/DEVELOPMENT/LANDING/ARCHIVED_IN;
%let tdate = %sysfunc(today(), yymmdd6.);
%put &tdate;
data _NULL_;
infile "move &fpath./ET002A.D&tdate..EDLY.TXT &apath." pipe;
input;
put _infile_;
run;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: