BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
praveenkotte
Fluorite | Level 6

 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

1 ACCEPTED SOLUTION

Accepted Solutions
praveenkotte
Fluorite | Level 6

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

4 REPLIES 4
rayIII
SAS Employee

 

 

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; 

praveenkotte
Fluorite | Level 6

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

sastab.JPG


sastab.JPG
ballardw
Super User

 


@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.

praveenkotte
Fluorite | Level 6

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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