Hello, I'm new to programming so I need help, please. I have a table (TOTAL) that I need to split into small tables with a maximum of 400 rows. After that I need to create new columns in the small tables that were created and finally I need to stack the tables that were created. Since this table TOTAL can have 200 to 3000 rows, I am using the code bellow to know the numer of lines. PROC SQL; CREATE TABLE COUNT AS SELECT COUNT (*) AS TOTAL_LINES FROM TOTAL; QUIT; I am thinking of dividing this number by 400 and see the result, which can range from 7.5 to 0. So according to this result, generate a specific number of small tables. Like IF TOTAL_LINES >7 THEN create 8 small tables; Table_1 from TOTAL(firstobs=1 OBS=400); Table_2 from TOTAL (firstobs=401 OBS=800); Table_3 from TOTAL (firstobs=801 OBS=1200); ... IF TOTAL_LINES >6 THEN create 7 small tables; ... IF TOTAL_LINES <= 1 THEN just crate 1 table : small_table = TOTAL But how can I create a table based on the result of an IF CLAUSE ? (I am using SAS 9.4 Enterprise Guide 7.13) Thank you in advance!! At the end of all, I need to create a table like this: Like this: (imagine that it is a tabe) TYPE DATE CIA XXXX VALUE 1 29/07/2019 BR350 RESULT 500,00 2 RESULT - 650,78 2 RESULT 400,50 2 RESULT 700,50 2 (-RESULT) - 500,00 2 (-RESULT) 650,78 2 (-RESULT) - 400,50 2 (-RESULT) - 700,50 1 29/07/2019 BR700 RESULT 650,00 2 RESULT 700,00 2 RESULT 3.555,00 2 RESULT 90,00 2 (-RESULT) - 650,00 2 (-RESULT) - 700,00 2 (-RESULT) - 3.555,00 2 (-RESULT) - 90,00 I know how to do it but not if my TOTAL (=RESULT) is longer than 400 lines.
... View more