SAS question: I have 50 fils a1,a2,...,a50. the primary key
is upc. then if i want to merge all 50 files, the code is
as follows,

data test;
merge a1 ... a50;
by upc;
run;

we know that writing all 50 files name is time consuming,
is there any standard format of this code?



SAS question: I have 50 fils a1,a2,...,a50. the primary key is upc. then if i want to merge all 50..

Answer / Mohd Asif

In SAS, you can use the `SAS autocall macro` to automate the process of merging multiple files. Instead of listing all the files in the `merge` statement, you can create a list of file names and then pass it to the `proc sort` procedure. Here's an example:
nndata filenames;n call symput("file", catx('a', 'a', $repeat(", a", 48)));
nrun;
nndata test;n set mersort(of test out=work upc) / drop=_merge_;n merge @(&filenames);n by upc;nrun;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

Tag for turning an image into a hyperlink is

1 Answers  


can any method return type may be constructor , or that method name allow

1 Answers   HCL,


kindly send interview materials

1 Answers   SoftSquare,


in IBM PC -AT.WAT AT REFERS TO?

1 Answers   IBM,


9.Difference between even and odd signals?explain with the diagram?

1 Answers  


how to convert infix expression to prefix expression?

1 Answers   nvidia,


what is the use of check point

1 Answers   HP,


swap two number wthout using third variable

4 Answers   eClerx,


To sorting array of 10 elements which sorting is best a)selection b)bubble c)tree sort

2 Answers   HP, Hughes,


a characteristic of a multiprogramming is? a.simultaneous exe of pgm instr 4m 2 appli b.concurrent processing of 2 r more prgms c.multiple cpu s d.all the abov

1 Answers   TCS,


what is dynamic polymorphism?

2 Answers   Satyam,


What is the difference between COM and CORBA?

1 Answers   Yahoo,


Categories