Consider using SAS PROC FORMAT to build a look-up data table, and you would use the SAS PUT function in your DATA step to determine if the input-file data contents is contained in your selection criteria (from your SAS file, after it has been converted to the SAS format). A SAS file can be used as input to the PROC FORMAT procedure, using the CNTLIN= keyword, when the SAS file is populated with specific-named SAS variables (FMTNAME, HLO, START, LABEL, at a minimum).
You can use the SAS support website
http://support.sas.com/ to find SAS-hosted product documentation and also SAS user community technical papers on this topic.
Scott Barry
SBBWorks, Inc.
Creating a Format from Raw Data or a SAS® Dataset
http://www2.sas.com/proceedings/forum2007/068-2007.pdf
SAS FORMAT PROCEDURE
http://support.sas.com/documentation/cdl/en/proc/59565/HTML/default/a000063536.htm