DATA Step, Macro, Functions and more

i want to create mathematical tabels from 1 to 10 ?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

i want to create mathematical tabels from 1 to 10 ?

[ Edited ]

 i want to create  mathematical tabels from 1 to 10 ?

the ouput should be like this

 

one_table   two_table   three_table  ---------- ten_table

1                  2                   3                                10

2                  4                    6                                20

3                  6                   9                                 30

4                   8                  12                               40

5                   10                15                                50

6                  12                 18                               60

7                  14                 21                               70

8                  16                 24                             80

9                   18                27                              90

10                 20                 30                             100


Accepted Solutions
Solution
‎07-19-2016 03:28 AM
Occasional Contributor
Posts: 13

Re: i want to create mathematical tabels from 1 to 10 ?

[ Edited ]

hey thanks.  Now i gor correct output.

 

data tables (drop = i j);

array table{10} table1-table10;
do i = 1 to 10;
do j = 1 to 10;
table{j} = i * j;
end;
output;
end;
run;


Capture1.JPG

View solution in original post


All Replies
SAS Employee
Posts: 106

Re: i want to create mathematical tabels from 1 to 10 ?

Posted in reply to praveenkotte

 

 

data tables (drop = i j);

array table{10} table1-table10; 

	do i = 1 to 10; 

		do j = 1 to 10;
			table{j} = i * j;
		end; 

	output; 

	end; 


run; 

Occasional Contributor
Posts: 13

Re: i want to create mathematical tabels from 1 to 10 ?

thanq for ur reply.BUT ur code is not giving required result;

sastab.JPG


sastab.JPG
Super User
Posts: 11,343

Re: i want to create mathematical tabels from 1 to 10 ?

Posted in reply to praveenkotte

 


praveenkotte wrote:

thanq for ur reply.BUT ur code is not giving required result;

 


Please show the log of the code you ran. The posted data is most likely the result of the OUTPUT statement in the wrong position.

Solution
‎07-19-2016 03:28 AM
Occasional Contributor
Posts: 13

Re: i want to create mathematical tabels from 1 to 10 ?

[ Edited ]

hey thanks.  Now i gor correct output.

 

data tables (drop = i j);

array table{10} table1-table10;
do i = 1 to 10;
do j = 1 to 10;
table{j} = i * j;
end;
output;
end;
run;


Capture1.JPG
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 267 views
  • 1 like
  • 3 in conversation