Problem Note 38893: Syntax error in PROC PHREG if WHERE statement begins with a parenthesis
In the experimental procedure PROC TPHREG in SAS9.1 and in PROC PHREG in SAS9.2, if you specify a WHERE statement with a leading parenthesis a syntax error will result.
For example, the following WHERE statement will produce a syntax error in PROC PHREG in SAS9.2:
where (age=1 or age=2) and x='A';
To avoid the problem, rewrite the condition so that it does not begin with a parenthesis or use a WHERE clause instead. Several alternatives to the above WHERE statement are shown below:
- Reorder the WHERE statement:
where x='A' and (age=1 or age=2);
- Rewrite the WHERE statement so it begins with a condition that is always true:
where 1 and (age=1 or age=2) and x='A';
- Specify the condition in a WHERE clause as a data set option on the PROC PHREG statement:
proc phreg data=a(where=((age=1 or age=2) and x='A'));
- Apply the WHERE statement in a prior DATA step.
Operating System and Release Information
SAS System | SAS/STAT | z/OS | 9.1 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Professional | 9.1 TS1M0 | |
Microsoft Windows NT Workstation | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | |
Microsoft Windows XP Professional | 9.1 TS1M0 | |
64-bit Enabled AIX | 9.1 TS1M0 | |
64-bit Enabled HP-UX | 9.1 TS1M0 | |
64-bit Enabled Solaris | 9.1 TS1M0 | |
HP-UX IPF | 9.1 TS1M0 | |
Linux | 9.1 TS1M0 | |
OpenVMS Alpha | 9.1 TS1M0 | |
Tru64 UNIX | 9.1 TS1M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
With the advent of the CLASS statement, a leading parenthesis in a WHERE statement produces a syntax error and is not allowed.
Type: | Problem Note |
Priority: | medium |
Topic: | Analytics ==> Survival Analysis SAS Reference ==> Procedures ==> PHREG SAS Reference ==> Procedures ==> TPHREG
|
Date Modified: | 2010-03-02 13:04:21 |
Date Created: | 2010-03-01 18:07:44 |