I got your point. In this case I shall not use macro language, though it is possible but mutch more compicated. Instead I shall show here a method that I have used a lot of times. Let say your file contains next variables: - LIB stands for Library - DSN stand for dataset Name - var1 contains attribute 1 (TYPE) - var2 contains attribute 2 (LABEL) - and so on, as mutch as you need Let's call your file ARGS (arguments); By the method, I write program A and run it to generate program B, using the fact that each program is a text file. I can look at the generated program B, make changes to program A if needed and rerun it until satisfaction. Then I run program B to do the wanted job. Here is a schematic prgram A: proc sort data=ARGS; by LIB DSN; run; /* needed for proc datasets */ filename generated '... any path and name ...'; data _NULL_; set ARGS end=eof; by LIB DSN; file generated; length pgm_line $80; /* generated program line. you may change length according to need */ if first.LIB then do; pgm_line = 'Proc Datasets lib=' || LIB || ' nolist; '; put pgm_line; end; if first.DSN then do; pgm_line = 'Modify ' || DSN || ';' ; put pgm_line; end; pgm_line = 'TYPE=' || var1 || ';' ; put pgm_line; pgm_line = 'LABEL=' || var2 || ';' ; put pgm_line; *** continue as much as you need ***; if last.LIB or eof then do; pgm_line = 'Quit; Run;' ; put pgm_line; end; RUN; /* end od program A */ Now run this program and look at the generated output. Addapt it to your needs and rerun. When satisfied, do %INCLUDE generated; and run it. I hope I realy got your point; Shmuel
... View more