* CODE: Load Tab Delimited File V4 - Remove Bad Data * AUTHOR: Blink 7 (http://www.blink7.com) * DATE: January 20, 2008 * REQUIREMENTS: * DESCRIPTION: Loader for Tab-Delimited File * Change from V3: Remove any entry that does not have a * first and last name * NOTES: You will probably need to change the location on * the INFILE statement to the location where you unpacked * namelist.txt ; DATA tab_v4_nobaddata; /*specify location of text file and set loading properies*/ INFILE 'r:\namelist.txt' DLM='09'x DSD; /*define how input fields in text file should be loaded*/ INPUT firstname : $16. lastname : $16. city : $16. province : $16. age : 3. party : $32.; /*Create a sub-setting if state to write out record*/ /*REMINDER: Nothing after this line executed unless condition is true*/ IF _N_ > 1; /*Delete record if first or last name blank*/ IF LENGTHN(firstname) = 0 OR LENGTHN(lastname) = 0 THEN DELETE; RUN;