There is actually a forum for Enterprise Guide; it is SAS Enterprise Guide under SAS Programming and Reporting.
The reason for some of the confusion in responses to you is that SAS has a programming language, which is used in a SAS data step. However, you are using the Query Builder in Enterprise Guide, which uses SQL instead of the data step programming language.
The following might help:
1. In the query builder, build a new Computed Column, and within that use the Expression Builder.
2. As your expression, type or use the point-and-click features to create code that looks like:
CASE WHEN Line_Code = 1 THEN Provision_Detail ELSE . END
(or you can just copy and paste it from here). Note the . (dot) after the ELSE; that represents a SAS missing value, the equivalent of a SQL NULL.
On the way out of the expression builder, give the new variable a name, say Result1.
Now do the same to create Result2 and Result3, just changing the 1 after "WHEN Line_Code = 1" to 2 and 3.
When I preview the code of my query builder, it looks like this:
PROC SQL;
CREATE TABLE SASUSER.Query_for_TEST AS SELECT TEST.Line_Code,
TEST.Provision_Detail,
(CASE WHEN Line_Code = 1 THEN Provision_Detail ELSE . END) AS Result1,
(CASE WHEN Line_Code = 2 THEN Provision_Detail ELSE . END ) AS Result2,
(CASE WHEN Line_Code = 3 THEN Provision_Detail ELSE . END ) AS Result3
FROM WORK.TEST AS TEST;
QUIT;
And my test results look like this:
Line_Code
Provision_Detail
Result1
Result2
Result3
1
11
11
2
12
12
3
13
13
4
14
5
15
Of course, you can add as many result variables as you need.
Is this going in the direction you want?
Another option is to use the Data | Transpose task. It is designed to move data from a row orientation to a column orientation very easily, but it depends on whether it matches what you need.
Tom
Editor's note: This is the marked solution because it shows how to express a CASE statement in SAS Enterprise Guide. The original poster had deeper questions, but this should help most readers of this topic.
... View more