Large array

Reply
Occasional Contributor
Posts: 5

Large array


Hello everybody,

I need help with my code, could you please take a look, it takes too long to run and I get errors when I try to define a large array.

Any other suggestions with my code, I would greatly appreciate your input?

Thank you.

Attachment
Respected Advisor
Posts: 3,890

Re: Large array

Like for variables Array definitions get defined during data step execution time. At this time variables n and m have not been populated. You therefore can't use SAS variables as part of an array element definition like done in code

array V{n,m};

You will need 2 data steps for this. In the first one you set the values for n and m and then load it into a SAS macro variable call symputx(). You then use in the second data step these macro variables within your array definition.

You are creating a lot of variables with your array. If you don't need all these variables then I would either drop them or - looking at your code - you could also use keyword _temporary_ as part of your array definition.

Ask a Question
Discussion stats
  • 1 reply
  • 136 views
  • 0 likes
  • 2 in conversation