***********************************************************************; * Version 3.1 July 20, 1994 *; ***********************************************************************; START _SCAN_( _BIG_, _LITTLE_ ) ; * This internal subroutine scans two vectors ( _BIG_ and _LITTLE_ ) and constructs a row vector (_INDEX_) which indexes the positions of each element of _BIG_ in _LITTLE_. If no match is found for an element of _LITTLE_, the corresponding element of _INDEX_ is set to missing. Inputs _BIG_ _LITTLE_ Output _INDEX_ (via RETURN) *___________________________________________________________________*; _INDEX_ = J( 1 , NCOL( _LITTLE_ ) , .); DO _L1_ = 1 TO NCOL( _LITTLE_ ); DO _B1_ = 1 TO NCOL( _BIG_ ) WHILE ( _INDEX_(| 1 , _L1_|) = . ); IF _LITTLE_(| 1 , _L1_|) = _BIG_(| 1 , _B1_|) THEN _INDEX_(| 1, _L1_ |) = _B1_ ; END; END; * Order elements of _LITTLE_ in ascending order ; *IF ALL( _LITTLE_ ^= "" ) THEN DO; * _LIT1_ = _LITTLE_; * _LITTLE_(| 1 , RANK( _LIT1_) |) = _LIT1_; * END; RETURN( _INDEX_ ); FINISH _SCAN_ ;