Hash and Hash Iterator Object Language Elements |
Applies to: | Hash iterator object |
Syntax | |
Arguments | |
Details | |
See Also |
Syntax |
rc=object.LAST( ); |
specifies whether the method succeeded or failed.
A return code of zero indicates success; a non-zero value indicates failure. If you do not supply a return code variable for the method call and the method fails, then an appropriate error message is written to the log.
Details |
The LAST method returns the last data item in the hash object. If you use the ordered: 'yes' or ordered: 'ascending' argument tag in the DECLARE statement or _NEW_ operator when you instantiate the hash object, then the data item that is returned is the one with the 'highest' key (largest numeric value or last alphabetic character), because the data items are sorted in ascending key-value order in the hash object. Conversely, if you use the ordered: 'descending' argument tag in the DECLARE statement or _NEW_ operator when you instantiate the hash object, then the data item that is returned is the one with the 'least' key (smallest numeric value or first alphabetic character), because the data items are sorted in descending key-value order in the hash object.
Use the FIRST method to return the first data item in the hash object.
Note: The LAST method sets the data variable to the value of the data item so that it is available for use after the method call.
See Also |
| |||
Operators: | |||
| |||
Using the Hash Iterator Object in SAS Language Reference: Concepts |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.