How could i automate the code in the scenario:Every month
one new data set will be created for that perticular month
transaction list.Now i would like to update the data in the
source table by appending every month data automatically.
jan---set jan;
feb---set jan feb;
mar---set jan mar;

Answers were Sorted based on User's Feedback



How could i automate the code in the scenario:Every month one new data set will be created for tha..

Answer / naresh

%macro update_table(demo1)
%let X = "JAN,FEB,MAR,APR";

%do i = 1 %to 4
%let y = scan(&x,i,',');

data &Master_table;
update &Master_table &y;
by acc_id;
run
%let i = %eval(&i+1);
%end;
%mend update_table;

Is This Answer Correct ?    1 Yes 1 No

How could i automate the code in the scenario:Every month one new data set will be created for tha..

Answer / satheesh

%macro sam (&mon);
data &mon1.;
set &mon.;
run;

proc append base = sav.appendData data = &mon.;
run;
%mend;
%sam(Jan);
%sam(Feb);
%sam(Mar);

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More SAS Interview Questions

I use NOCUM/NOPERCENT option in the tables statement like this Proc freq data = deepak; tables x y /nocum nopercent; run; Here I get nopercent and nocum in the output only for variables x and y. How do i do it for all variables? Deepak

1 Answers  


do you prefer proc report or proc tabulate? Why? : Sas programming

0 Answers  


what is the difference between compiler and interpreter? give any one example (software product) that act as a interpreter?

36 Answers   Accenture, College School Exams Tests, CTS, IBM, IHRD, Infosys, Sylhet Engineering College, TCS, Wipro,


What is difference between rename and lable in sas?

10 Answers   Satyam,


What is the registered Key word is sas????

2 Answers   TCS,






What are common programming errors committed in sas

0 Answers  


How would you determine how far down on a page you have printed in order to print out footnotes?

3 Answers  


What are the data types does SAS contain?

0 Answers  


In this question, I rename the numeric variable phone to numphone and then try use phone=put(numphone,comma16.) to store the numeric value numphone as a string value in phone. But I get a warning tha numphone already exists and in the data sat phone doesnt exist and numphone is set to missing. Why? data names_and_more; input Name $20. Phone : comma16. Height & $10. Mixed & $8.; Name = tranwrd(Name,' ',' '); rename phone = numphone; phone = put(numphone,comma16.); datalines; Roger Cody 9,087,821,234 5ft. 10in. 50 1/8 Thomas Jefferson 3,158,488,484 6ft. 1in. 23 1/2 Marco Polo 8,001,234,567 5Ft. 6in. 40 Brian Watson 5,183,551,766 5ft. 10in 89 3/4 Michael DeMarco 4,452,322,233 6ft. 76 1/3 ;

1 Answers  


What are exact SAS Base contents..?N what r SAS Tools..?

1 Answers  


Explain what is data step?

0 Answers  


What is the maximum length of the macro variable?

0 Answers  


Categories