Problem Note 35149: Executing a method from within a DATEPART or PUT function might result in syntax errors
When you execute a method within a DATEPART or PUT function, you might see syntax errors such as the following:
ERROR 22-322: Syntax error, expecting one of the following: _NEO_, _NEW_.
ERROR 76-322: Syntax error, statement will be ignored.
ERROR 180-322: Statement is not valid or it is used out of proper order.
The syntax errors are not related to the execution of the _NEW_ or _NEW_ routines, or to the lack of these routines in the SCL application. Instead, the errors occur because the particular function does not currently support the dot notation syntax.
As a workaround, you can retrieve the value from the method into a variable, and then pass the variable to the function. Here is an example:
dcl object someinst = _new_ someclass()
var = someinst.somemethod()),
varout = put(datepart(var),date9.);
|
Operating System and Release Information
SAS System | SAS/AF | Solaris for x64 | 9.21 | | 9.2 TS2M0 | |
OpenVMS on HP Integrity | 9.21 | | 9.2 TS2M0 | |
Linux for x64 | 9.21 | | 9.2 TS2M0 | |
Linux | 9.21 | | 9.2 TS2M0 | |
HP-UX IPF | 9.21 | | 9.2 TS2M0 | |
64-bit Enabled Solaris | 9.21 | | 9.2 TS2M0 | |
64-bit Enabled HP-UX | 9.21 | | 9.2 TS2M0 | |
Windows Vista | 9.21 | | 9.2 TS2M0 | |
64-bit Enabled AIX | 9.21 | | 9.2 TS2M0 | |
Microsoft Windows XP Professional | 9.21 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.21 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.21 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.21 | | 9.2 TS2M0 | |
Microsoft® Windows® for x64 | 9.21 | | 9.2 TS2M0 | |
Microsoft Windows XP 64-bit Edition | 9.21 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.21 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.21 | | 9.2 TS2M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.21 | | 9.2 TS2M0 | |
z/OS | 9.21 | | 9.2 TS2M0 | |
*
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.
Type: | Problem Note |
Priority: | high |
Topic: | SAS Reference ==> SCL (SAS Component Language)
|
Date Modified: | 2009-03-30 15:50:30 |
Date Created: | 2009-03-16 15:35:06 |