* CODE: Load Tab Delimited File V5 - Separate Reject Data * AUTHOR: Blink 7 (http://www.blink7.com) * DATE: January 20, 2008 * REQUIREMENTS: * DESCRIPTION: Loader for Tab-Delimited File * Change from V4: Move records with questionable age data * to a different record * NOTES: You will probably need to change the location on * the INFILE statement to the location where you unpacked * namelist.txt ; DATA tab_v5 tab_v5_reject; /*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; /*if age data is odd, write to reject data set. else write to regular set*/ IF 18 <= age <= 120 THEN OUTPUT tab_v5; ELSE OUTPUT tab_v5_reject; RUN;