Usage Note 7397: ERROR: 'Variable xxxx was referenced but not given a value' when using
ARRAY statement in PROC PHREG
When using arrays in PROC PHREG, you can not use an abbreviated variable list to define the array elements unless every variable implied by the list abbreviation exists in the data set. When referencing the array, if PROC PHREG encounters an implied variable that is not found in the DATA= data set, this error message is issued:
ERROR: The variable xxx was referenced but not given a value.
where 'xxx' represents the name of the variable.
To circumvent the problem, rewrite the ARRAY statement and any references to the array so that abbreviated variable lists refer only to variables which are actually present in the data set.
Example:
Suppose the DATA= data set contains X variables: X1, X2, X3, and X6. The statements:
array x{6} x1-x6; /* array definition */
do i=1 to 6;
y=x[i]; /* array reference */
end;
result in:
ERROR: The variable x4 was referenced but not given a value.
ERROR: The variable x5 was referenced but not given a value.
This ARRAY statement implies the existence of variables X1, X2, X3, X4, X5, and X6. The errors occur since variables X4 and X5 are not in the data set. To avoid the errors, rewrite the ARRAY statement as:
array x{4} x1-x3 x6; /* array definition */
do i=1 to 4;
y=x[i]; /* array reference */
end;
Operating System and Release Information
| SAS System | SAS/STAT | z/OS | | |
| z/OS 64-bit | | |
| OpenVMS VAX | | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
| Microsoft Windows XP 64-bit Edition | | |
| Microsoft® Windows® for x64 | | |
| OS/2 | | |
| Microsoft Windows 8 Enterprise 32-bit | | |
| Microsoft Windows 8 Enterprise x64 | | |
| Microsoft Windows 8 Pro 32-bit | | |
| Microsoft Windows 8 Pro x64 | | |
| Microsoft Windows 8.1 Enterprise 32-bit | | |
| Microsoft Windows 10 | | |
| Microsoft Windows 8.1 Enterprise x64 | | |
| Microsoft Windows 8.1 Pro 32-bit | | |
| Microsoft Windows 8.1 Pro x64 | | |
| Microsoft Windows 95/98 | | |
| Microsoft Windows 2000 Advanced Server | | |
| Microsoft Windows 2000 Datacenter Server | | |
| Microsoft Windows 2000 Server | | |
| Microsoft Windows 2000 Professional | | |
| Microsoft Windows NT Workstation | | |
| Microsoft Windows Server 2003 Datacenter Edition | | |
| Microsoft Windows Server 2003 Enterprise Edition | | |
| Microsoft Windows Server 2003 Standard Edition | | |
| Microsoft Windows Server 2003 for x64 | | |
| Microsoft Windows Server 2008 | | |
| Microsoft Windows Server 2008 R2 | | |
| Microsoft Windows Server 2008 for x64 | | |
| Microsoft Windows Server 2012 Datacenter | | |
| Microsoft Windows Server 2012 R2 Datacenter | | |
| Microsoft Windows Server 2012 R2 Std | | |
| Microsoft Windows Server 2012 Std | | |
| Microsoft Windows Server 2016 | | |
| Microsoft Windows Server 2019 | | |
| Microsoft Windows XP Professional | | |
| Windows 7 Enterprise 32 bit | | |
| Windows 7 Enterprise x64 | | |
| Windows 7 Home Premium 32 bit | | |
| Windows 7 Home Premium x64 | | |
| Windows 7 Professional 32 bit | | |
| Windows 7 Professional x64 | | |
| Windows 7 Ultimate 32 bit | | |
| Windows 7 Ultimate x64 | | |
| Windows Millennium Edition (Me) | | |
| Windows Vista | | |
| Windows Vista for x64 | | |
| 64-bit Enabled AIX | | |
| 64-bit Enabled HP-UX | | |
| 64-bit Enabled Solaris | | |
| ABI+ for Intel Architecture | | |
| AIX | | |
| HP-UX | | |
| HP-UX IPF | | |
| IRIX | | |
| Linux | | |
| Linux for x64 | | |
| Linux on Itanium | | |
| OpenVMS Alpha | | |
| OpenVMS on HP Integrity | | |
| Solaris | | |
| Solaris for x64 | | |
| Tru64 UNIX | | |
*
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: | Usage Note |
| Priority: | medium |
| Topic: | Analytics ==> Survival Analysis SAS Reference ==> Procedures ==> PHREG
|
| Date Modified: | 2019-05-21 09:42:52 |
| Date Created: | 2002-04-25 10:41:45 |