The SAS Output Delivery System and reporting techniques

How to create in a single column values in to diff tables..?

Reply
N/A
Posts: 0

How to create in a single column values in to diff tables..?

i have data table like this with brand_cd field
Brand_cd
12
13
14

i want output like this(Different tables)

Brand_cd1(one table)
12
Brand_cd2(second table)
13
Brand_cd3(third table)
14
SAS Employee
Posts: 5

Re: How to create in a single column values in to diff tables..?

Example:

/* sample data set with 3 observations */
data a;
Brand_cd=12;output;
Brand_cd=13;output;
Brand_cd=14;output;
run;

/*macro to output line into new table*/
%macro test(currTable,index);
data &currTable;
set a(firstobs=&index obs=&index);
output;
run;
%mend test;


/* invoke the macro */
%test(Brand_cd1,1);
%test(Brand_cd2,2);
%test(Brand_cd3,3);
Ask a Question
Discussion stats
  • 1 reply
  • 113 views
  • 0 likes
  • 2 in conversation