create macros---you have 365 number of data and you need to
merge it throw the macros,,,,,,
data file1;
input a @@;
cards;
1 2 3 4
;
run;
data file2;
input a @@;
cards;
5 6 7 8
;
run;
data file3;
input a @@;
cards;
9 10 11 12
;
run;data file4;
input a @@;
cards;
13 14 15 16
;
run;
Answers were Sorted based on User's Feedback
Answer / jugaadu
Sorry missed the data step here is the corrected Version;
%MACRO Data_Create;
%Do i = 1 %to 365;
DATA file&i;
INPUT a @@;
CARDS;
4*&i-3 4*&i-2 4*&i-1 4*&i
;
RUN;
%MEND;
%Data_Create;
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / venkat
%macro merging(f,x);
%do i=1 %to %eval(&x-1);
data &f&n;
merge &f&n &f%eval(&i+1);
by a;
run;
%end;
%mend merging;
%merging(file,4);
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / ashutosh
%macro mydata(my,n);
data XXX;
merge
%do i=1 %to &n;
&my&i
%end;
;
by a;
run;
%mend;
%mydata(file,4);
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / singh.naveen409
%macros mydata(my,n);
data www;
set
%do i=1 %to &n;
&my&i
end;
;
run;
%mend;
%mydata(file,4);
Is This Answer Correct ? | 3 Yes | 4 No |
Answer / vijay
%MACRO mer;
DATA file_all_365;
MERGE
%DO i=1 %TO 365;
file&i
%END;;
RUN;
%MEND;
%MER;
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / jugaadu
%MACRO Data_Create;
%Do i = 1 %to 365;
INPUT a @@;
CARDS;
4*&i-3 4*&i-2 4*&i-1 4*&i
;
RUN;
%MEND;
%Data_Create;
Is This Answer Correct ? | 0 Yes | 4 No |
i have a macro variable var1,var2. i want titles for the each macro variable separately? how it is possible?
what are the different ways of merging two datasets.name atleast 4.
what is SAS OPTIMIZATION?
How to get part of string form the source string without using sub string function in SAS?
Tell e how how dealt with..
How to create list output for cross-tabulations in proc freq?
Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.
what is incremental update ? is this possible in SAS OLAP CUBE STUDIO.
What is your favorite all time computer book? Why?
what can you learn from the sas log when debugging? : Sas programming
sas implimented companies in hyderabad
is data integration and etl programming is same? : Sas-di