I have a data set with a number of columns. I am wanting to create a data set from this using a selection of the columns: In iml Instead of use = old_use[1:100, 1:75]; I want to have use = old_use[1:100, 1:50] + old_use[1:100, 53:57] + old_use[1:100, 59:75]; But it is not returning the correct number of columns....
... View more
Thanks Sorry I'm REALLY new to SAS! - Think we are using a macro so that it can be called later in the long process flow. In the above solution are you taking year, text and value as the column titles in the data set?
... View more
Hi, It is written as a macro within the code %macro new_spend; data original_data_&year; set new_data; where year = &year; keep t_1; run; proc iml; with sample data: 1998 variable 1 4 1998 variable 1 2 1998 variable 1 3 1998 variable 1 2 1998 variable 2 0 1998 variable 2 2 1998 variable 2 3 1998 variable 2 0 when I really want 1998 variable 1 11 1998 variable 2 5
... View more
I have been running someone elses code previously which brought in an annual data set [111 rows, 1 column] The input data file has now been changed to have quarterly data [444 rows, 1 column]. Not sure how I can write a bit of code that sums every 4 rows to create the original [111, 1] format? data original_data_&year; set new_data; where year=&year; keep t_1 ; run; Thanks!
... View more