@vegan_renegade wrote: There is no need for an unhelpful and condescending response.
Perhaps not, but there a details on how Proc Report uses things. For example from http://support.sas.com/resources/papers/proceedings15/SAS1642-2015.pdf which is referenced in my version of the online help for Proc Report under the Concepts tab in the Using Compute Blocks.
LESSON 1: THE COMPUTE STATEMENT PROC REPORT processes a data set by reading the variables in the order in which they appear from left to right in the COLUMN statement. The procedure builds the report one column and one row at a time, and COMPUTE statements are executed as the report is built.
I emphasized the left to right because that is the order things work. A compute block cannot use a column to the right of its position. If you want Test_date to use Test_result directly it has to be to the right of Test_result. Since you have not provided a COLUMNS statement, then the order is the default from the data set and Test_date is LEFT of test_result. So doesn't "see" the Test_result values.
By creating the Alias for Test_date on a Columns statement that is to the right of Test_result you get around that limitation.
While not required a Columns statement is a good idea just so you keep in mind the relative positions of the output. Also at some time you have someone provide a similar data but the variables in different order. It might take way more time than it should to realize your output is different because of the missing columns statement.
Similarly, the Define statement to reinforce if a variable is display, group/order, analysis makes a difference and worth including.
... View more